aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Nerode <neroden@gcc.gnu.org>2003-06-27 19:12:56 +0000
committerNathanael Nerode <neroden@gcc.gnu.org>2003-06-27 19:12:56 +0000
commit1920e6a5766ddbc566b38c513477ccdb18fed323 (patch)
tree9d6a58a98909c4ba88def6962e85fa255d8d4843
parent67588f43eaec8eaae4fea179224387d115eda15c (diff)
* configure.in: Handle stage1_languages properly.
* configure: Regenerate. Auto-detects ada for stage 1 now, and bootstraps! Merge from mainline. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/toplevel-bootstrap@68596 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog49
-rw-r--r--ChangeLog.branch6
-rw-r--r--MAINTAINERS2
-rw-r--r--Makefile.def71
-rw-r--r--Makefile.in79
-rw-r--r--Makefile.tpl71
-rwxr-xr-xconfigure180
-rw-r--r--configure.in112
-rw-r--r--contrib/ChangeLog6
-rwxr-xr-xcontrib/gcc_update3
-rw-r--r--contrib/reghunt/ChangeLog7
-rwxr-xr-xcontrib/reghunt/reg_periodic27
-rwxr-xr-xcontrib/reghunt/reg_search39
-rw-r--r--fastjar/ChangeLog9
-rw-r--r--fastjar/jartool.c36
-rw-r--r--gcc/ChangeLog2017
-rw-r--r--gcc/ChangeLog.12
-rw-r--r--gcc/ChangeLog.34
-rw-r--r--gcc/ChangeLog.62
-rw-r--r--gcc/Makefile.in169
-rw-r--r--gcc/aclocal.m458
-rw-r--r--gcc/ada/ChangeLog17
-rw-r--r--gcc/ada/bindgen.adb22
-rw-r--r--gcc/ada/misc.c9
-rw-r--r--gcc/ada/utils.c2
-rw-r--r--gcc/alias.c1
-rw-r--r--gcc/alloc-pool.c3
-rw-r--r--gcc/basic-block.h4
-rw-r--r--gcc/bitmap.c10
-rw-r--r--gcc/builtin-attrs.def28
-rw-r--r--gcc/builtins.c611
-rw-r--r--gcc/c-aux-info.c51
-rw-r--r--gcc/c-common.c870
-rw-r--r--gcc/c-common.h330
-rw-r--r--gcc/c-convert.c6
-rw-r--r--gcc/c-cppbuiltin.c82
-rw-r--r--gcc/c-decl.c374
-rw-r--r--gcc/c-dump.c12
-rw-r--r--gcc/c-format.c230
-rw-r--r--gcc/c-incpath.c56
-rw-r--r--gcc/c-incpath.h8
-rw-r--r--gcc/c-lang.c33
-rw-r--r--gcc/c-lex.c112
-rw-r--r--gcc/c-objc-common.c53
-rw-r--r--gcc/c-opts.c440
-rw-r--r--gcc/c-parse.in48
-rw-r--r--gcc/c-pch.c22
-rw-r--r--gcc/c-ppoutput.c96
-rw-r--r--gcc/c-pragma.c56
-rw-r--r--gcc/c-pragma.h12
-rw-r--r--gcc/c-pretty-print.c311
-rw-r--r--gcc/c-pretty-print.h30
-rw-r--r--gcc/c-semantics.c210
-rw-r--r--gcc/c-tree.h227
-rw-r--r--gcc/c-typeck.c380
-rw-r--r--gcc/c.opt12
-rw-r--r--gcc/caller-save.c91
-rw-r--r--gcc/calls.c299
-rw-r--r--gcc/cfg.c114
-rw-r--r--gcc/cfganal.c112
-rw-r--r--gcc/cfgbuild.c70
-rw-r--r--gcc/cfgcleanup.c119
-rw-r--r--gcc/cfghooks.c8
-rw-r--r--gcc/cfghooks.h18
-rw-r--r--gcc/cfglayout.c102
-rw-r--r--gcc/cfglayout.h14
-rw-r--r--gcc/cfgloop.c191
-rw-r--r--gcc/cfgloop.h105
-rw-r--r--gcc/cfgloopanal.c155
-rw-r--r--gcc/cfgloopmanip.c252
-rw-r--r--gcc/cfgrtl.c273
-rw-r--r--gcc/cgraph.c211
-rw-r--r--gcc/cgraph.h29
-rw-r--r--gcc/cgraphunit.c118
-rw-r--r--gcc/common.opt524
-rw-r--r--gcc/config.gcc11
-rw-r--r--gcc/config.in14
-rw-r--r--gcc/config/alpha/alpha-protos.h290
-rw-r--r--gcc/config/alpha/alpha.c1668
-rw-r--r--gcc/config/alpha/alpha.h29
-rw-r--r--gcc/config/alpha/alpha.md2
-rw-r--r--gcc/config/alpha/elf.h25
-rw-r--r--gcc/config/alpha/openbsd.h23
-rw-r--r--gcc/config/alpha/osf.h23
-rw-r--r--gcc/config/alpha/osf5.h5
-rw-r--r--gcc/config/alpha/unicosmk.h17
-rw-r--r--gcc/config/alpha/vms-cc.c61
-rw-r--r--gcc/config/alpha/vms-ld.c52
-rw-r--r--gcc/config/alpha/vms.h19
-rw-r--r--gcc/config/arc/arc-protos.h1
-rw-r--r--gcc/config/arc/arc.c11
-rw-r--r--gcc/config/arc/arc.h4
-rw-r--r--gcc/config/arm/aof.h246
-rw-r--r--gcc/config/arm/aout.h38
-rw-r--r--gcc/config/arm/arm-protos.h2
-rw-r--r--gcc/config/arm/arm.c1385
-rw-r--r--gcc/config/arm/arm.h336
-rw-r--r--gcc/config/arm/arm.md115
-rw-r--r--gcc/config/arm/coff.h16
-rw-r--r--gcc/config/arm/elf.h16
-rw-r--r--gcc/config/arm/freebsd.h3
-rw-r--r--gcc/config/arm/lib1funcs.asm3
-rw-r--r--gcc/config/arm/linux-gas.h4
-rw-r--r--gcc/config/arm/netbsd-elf.h4
-rw-r--r--gcc/config/arm/netbsd.h4
-rw-r--r--gcc/config/arm/pe.h12
-rw-r--r--gcc/config/arm/t-xscale-elf4
-rw-r--r--gcc/config/avr/avr-protos.h1
-rw-r--r--gcc/config/avr/avr.c34
-rw-r--r--gcc/config/avr/avr.h22
-rw-r--r--gcc/config/c4x/c4x.c26
-rw-r--r--gcc/config/c4x/c4x.h29
-rw-r--r--gcc/config/cris/cris.c23
-rw-r--r--gcc/config/cris/cris.h18
-rw-r--r--gcc/config/d30v/d30v.c4
-rw-r--r--gcc/config/darwin.h5
-rw-r--r--gcc/config/dbxcoff.h8
-rw-r--r--gcc/config/dbxelf.h8
-rw-r--r--gcc/config/dsp16xx/dsp16xx-protos.h3
-rw-r--r--gcc/config/dsp16xx/dsp16xx.c49
-rw-r--r--gcc/config/dsp16xx/dsp16xx.h3
-rw-r--r--gcc/config/elfos.h13
-rw-r--r--gcc/config/frv/frv.c8
-rw-r--r--gcc/config/frv/frv.h2
-rw-r--r--gcc/config/gofast.h8
-rw-r--r--gcc/config/h8300/elf.h6
-rw-r--r--gcc/config/h8300/h8300-protos.h130
-rw-r--r--gcc/config/h8300/h8300.c1036
-rw-r--r--gcc/config/h8300/h8300.h9
-rw-r--r--gcc/config/h8300/h8300.md193
-rw-r--r--gcc/config/i370/i370.c26
-rw-r--r--gcc/config/i370/i370.h6
-rw-r--r--gcc/config/i386/att.h9
-rw-r--r--gcc/config/i386/freebsd.h10
-rw-r--r--gcc/config/i386/gas.h10
-rw-r--r--gcc/config/i386/i386-interix.h12
-rw-r--r--gcc/config/i386/i386.c389
-rw-r--r--gcc/config/i386/i386.h45
-rw-r--r--gcc/config/i386/i386.md187
-rw-r--r--gcc/config/i386/linux.h10
-rw-r--r--gcc/config/i386/sco5.h9
-rw-r--r--gcc/config/i386/sysv4.h9
-rw-r--r--gcc/config/i960/i960-coff.h5
-rw-r--r--gcc/config/i960/i960.h6
-rw-r--r--gcc/config/ia64/ia64-protos.h2
-rw-r--r--gcc/config/ia64/ia64.c43
-rw-r--r--gcc/config/ia64/ia64.h7
-rw-r--r--gcc/config/ia64/ia64.md2
-rw-r--r--gcc/config/ia64/sysv4.h20
-rw-r--r--gcc/config/ia64/unwind-ia64.c19
-rw-r--r--gcc/config/interix.h8
-rw-r--r--gcc/config/interix3.h8
-rw-r--r--gcc/config/ip2k/crt0.S8
-rw-r--r--gcc/config/ip2k/ip2k-protos.h8
-rw-r--r--gcc/config/ip2k/ip2k.c8
-rw-r--r--gcc/config/ip2k/ip2k.h1473
-rw-r--r--gcc/config/ip2k/ip2k.md8
-rw-r--r--gcc/config/ip2k/libgcc.S8
-rw-r--r--gcc/config/kaos.h2
-rw-r--r--gcc/config/libgloss.h8
-rw-r--r--gcc/config/linux-aout.h10
-rw-r--r--gcc/config/linux.h8
-rw-r--r--gcc/config/lynx-ng.h8
-rw-r--r--gcc/config/lynx.h20
-rw-r--r--gcc/config/m32r/m32r-protos.h1
-rw-r--r--gcc/config/m32r/m32r.c17
-rw-r--r--gcc/config/m32r/m32r.h14
-rw-r--r--gcc/config/m32r/m32r.md2
-rw-r--r--gcc/config/m68hc11/m68hc11-protos.h2
-rw-r--r--gcc/config/m68hc11/m68hc11.c70
-rw-r--r--gcc/config/m68hc11/m68hc11.h11
-rw-r--r--gcc/config/m68k/coff.h4
-rw-r--r--gcc/config/m68k/hp320.h15
-rw-r--r--gcc/config/m68k/m68k.c14
-rw-r--r--gcc/config/m68k/m68k.h5
-rw-r--r--gcc/config/mcore/mcore-pe.h18
-rw-r--r--gcc/config/mips/iris6-o32.h4
-rw-r--r--gcc/config/mips/iris6.h2
-rw-r--r--gcc/config/mips/mips-protos.h6
-rw-r--r--gcc/config/mips/mips.c714
-rw-r--r--gcc/config/mips/mips.h27
-rw-r--r--gcc/config/mips/mips.md157
-rw-r--r--gcc/config/mmix/mmix-protos.h1
-rw-r--r--gcc/config/mmix/mmix.c19
-rw-r--r--gcc/config/mmix/mmix.h5
-rw-r--r--gcc/config/mn10300/mn10300-protos.h1
-rw-r--r--gcc/config/mn10300/mn10300.c20
-rw-r--r--gcc/config/mn10300/mn10300.h4
-rw-r--r--gcc/config/ns32k/NOTES4
-rw-r--r--gcc/config/ns32k/ns32k.c3
-rw-r--r--gcc/config/ns32k/ns32k.h4
-rw-r--r--gcc/config/pa/elf.h15
-rw-r--r--gcc/config/pa/pa-linux.h24
-rw-r--r--gcc/config/pa/pa.c110
-rw-r--r--gcc/config/pa/pa64-hpux.h45
-rw-r--r--gcc/config/pa/som.h51
-rw-r--r--gcc/config/pdp11/pdp11.h14
-rw-r--r--gcc/config/ptx4.h8
-rw-r--r--gcc/config/rs6000/aix.h4
-rw-r--r--gcc/config/rs6000/darwin.h1
-rw-r--r--gcc/config/rs6000/linux.h23
-rw-r--r--gcc/config/rs6000/linux64.h19
-rw-r--r--gcc/config/rs6000/lynx.h1
-rw-r--r--gcc/config/rs6000/power4.md5
-rw-r--r--gcc/config/rs6000/rs6000-protos.h3
-rw-r--r--gcc/config/rs6000/rs6000.c86
-rw-r--r--gcc/config/rs6000/rs6000.h19
-rw-r--r--gcc/config/rs6000/spe.md4
-rw-r--r--gcc/config/rs6000/sysv4.h41
-rw-r--r--gcc/config/rs6000/sysv4le.h11
-rw-r--r--gcc/config/rs6000/t-rs60003
-rw-r--r--gcc/config/rs6000/xcoff.h44
-rw-r--r--gcc/config/rtems.h8
-rw-r--r--gcc/config/s390/s390.c37
-rw-r--r--gcc/config/sh/coff.h6
-rw-r--r--gcc/config/sh/elf.h29
-rw-r--r--gcc/config/sh/embed-elf.h2
-rw-r--r--gcc/config/sh/lib1funcs.asm6
-rw-r--r--gcc/config/sh/sh-protos.h3
-rw-r--r--gcc/config/sh/sh.c402
-rw-r--r--gcc/config/sh/sh.h394
-rw-r--r--gcc/config/sh/sh.md355
-rw-r--r--gcc/config/sol2.h8
-rw-r--r--gcc/config/sparc/aout.h18
-rw-r--r--gcc/config/sparc/biarch64.h10
-rw-r--r--gcc/config/sparc/cypress.md8
-rw-r--r--gcc/config/sparc/elf.h10
-rw-r--r--gcc/config/sparc/freebsd.h8
-rw-r--r--gcc/config/sparc/hypersparc.md8
-rw-r--r--gcc/config/sparc/linux.h8
-rw-r--r--gcc/config/sparc/linux64.h8
-rw-r--r--gcc/config/sparc/lite.h10
-rw-r--r--gcc/config/sparc/litecoff.h10
-rw-r--r--gcc/config/sparc/liteelf.h10
-rw-r--r--gcc/config/sparc/netbsd-elf.h10
-rw-r--r--gcc/config/sparc/openbsd.h8
-rw-r--r--gcc/config/sparc/pbd.h8
-rw-r--r--gcc/config/sparc/rtemself.h8
-rw-r--r--gcc/config/sparc/sol2-64.h2
-rw-r--r--gcc/config/sparc/sol2-bi.h2
-rw-r--r--gcc/config/sparc/sol2-gas-bi.h2
-rw-r--r--gcc/config/sparc/sol2-gld-bi.h2
-rw-r--r--gcc/config/sparc/sol2-gld.h2
-rw-r--r--gcc/config/sparc/sol2.h10
-rw-r--r--gcc/config/sparc/sp64-aout.h10
-rw-r--r--gcc/config/sparc/sp64-elf.h10
-rw-r--r--gcc/config/sparc/sp86x-elf.h10
-rw-r--r--gcc/config/sparc/sparc-modes.def10
-rw-r--r--gcc/config/sparc/sparc-protos.h10
-rw-r--r--gcc/config/sparc/sparc.c16
-rw-r--r--gcc/config/sparc/sparc.h4
-rw-r--r--gcc/config/sparc/sparc.md10
-rw-r--r--gcc/config/sparc/sparclet.md8
-rw-r--r--gcc/config/sparc/supersparc.md8
-rw-r--r--gcc/config/sparc/sysv4-only.h2
-rw-r--r--gcc/config/sparc/sysv4.h13
-rw-r--r--gcc/config/sparc/ultra1_2.md8
-rw-r--r--gcc/config/sparc/ultra3.md8
-rw-r--r--gcc/config/svr3.h46
-rw-r--r--gcc/config/svr4.h8
-rw-r--r--gcc/config/usegas.h8
-rw-r--r--gcc/config/v850/v850-protos.h1
-rw-r--r--gcc/config/v850/v850.c12
-rw-r--r--gcc/config/v850/v850.h4
-rw-r--r--gcc/config/vax/vax.c18
-rw-r--r--gcc/config/vax/vax.h13
-rw-r--r--gcc/config/vax/vaxv.h4
-rw-r--r--gcc/config/vxworks.h10
-rwxr-xr-xgcc/configure827
-rw-r--r--gcc/configure.in86
-rw-r--r--gcc/convert.c2
-rw-r--r--gcc/coverage.c10
-rw-r--r--gcc/cp/ChangeLog291
-rw-r--r--gcc/cp/Make-lang.in4
-rw-r--r--gcc/cp/call.c120
-rw-r--r--gcc/cp/class.c9
-rw-r--r--gcc/cp/config-lang.in2
-rw-r--r--gcc/cp/cp-lang.c3
-rw-r--r--gcc/cp/cp-tree.def3
-rw-r--r--gcc/cp/cp-tree.h64
-rw-r--r--gcc/cp/cvt.c6
-rw-r--r--gcc/cp/decl.c114
-rw-r--r--gcc/cp/decl.h6
-rw-r--r--gcc/cp/decl2.c19
-rw-r--r--gcc/cp/except.c1
-rw-r--r--gcc/cp/friend.c39
-rw-r--r--gcc/cp/init.c8
-rw-r--r--gcc/cp/lex.c2
-rw-r--r--gcc/cp/mangle.c413
-rw-r--r--gcc/cp/method.c89
-rw-r--r--gcc/cp/optimize.c2
-rw-r--r--gcc/cp/parser.c18
-rw-r--r--gcc/cp/pt.c853
-rw-r--r--gcc/cp/rtti.c21
-rw-r--r--gcc/cp/search.c315
-rw-r--r--gcc/cp/semantics.c341
-rw-r--r--gcc/cp/tree.c560
-rw-r--r--gcc/cp/typeck.c801
-rw-r--r--gcc/cppcharset.c11
-rw-r--r--gcc/cpperror.c17
-rw-r--r--gcc/cppexp.c173
-rw-r--r--gcc/cppfiles.c182
-rw-r--r--gcc/cpphash.c31
-rw-r--r--gcc/cpphash.h174
-rw-r--r--gcc/cppinit.c62
-rw-r--r--gcc/cpplex.c216
-rw-r--r--gcc/cpplib.c406
-rw-r--r--gcc/cpplib.h180
-rw-r--r--gcc/cppmacro.c217
-rw-r--r--gcc/cpppch.c102
-rw-r--r--gcc/cppspec.c8
-rw-r--r--gcc/cpptrad.c115
-rw-r--r--gcc/dbxout.c162
-rw-r--r--gcc/debug.h6
-rw-r--r--gcc/defaults.h6
-rw-r--r--gcc/diagnostic.c29
-rw-r--r--gcc/diagnostic.h1
-rw-r--r--gcc/doc/contrib.texi95
-rw-r--r--gcc/doc/extend.texi186
-rw-r--r--gcc/doc/install.texi37
-rw-r--r--gcc/doc/invoke.texi105
-rw-r--r--gcc/doc/md.texi4
-rw-r--r--gcc/doc/rtl.texi2
-rw-r--r--gcc/doc/sourcebuild.texi6
-rw-r--r--gcc/doc/tm.texi2844
-rw-r--r--gcc/dwarf2out.c27
-rw-r--r--gcc/dwarfout.c4
-rw-r--r--gcc/emit-rtl.c76
-rw-r--r--gcc/except.c72
-rw-r--r--gcc/explow.c6
-rw-r--r--gcc/expmed.c2
-rw-r--r--gcc/expr.c53
-rw-r--r--gcc/expr.h8
-rw-r--r--gcc/f/ChangeLog27
-rw-r--r--gcc/f/Make-lang.in8
-rw-r--r--gcc/f/com.c4
-rw-r--r--gcc/f/lang.opt3
-rw-r--r--gcc/f/top.c25
-rw-r--r--gcc/final.c99
-rw-r--r--gcc/fixinc/gnu-regex.c4
-rw-r--r--gcc/flags.h81
-rw-r--r--gcc/flow.c33
-rw-r--r--gcc/fold-const.c55
-rw-r--r--gcc/function.c40
-rw-r--r--gcc/function.h5
-rw-r--r--gcc/gcc.c63
-rwxr-xr-xgcc/gccbug.in4
-rw-r--r--gcc/gcov-io.c4
-rw-r--r--gcc/gcov-io.h49
-rw-r--r--gcc/gcov.c12
-rw-r--r--gcc/gcse.c3
-rw-r--r--gcc/gencheck.c2
-rw-r--r--gcc/gengenrtl.c2
-rw-r--r--gcc/gengtype.c5
-rw-r--r--gcc/genopinit.c2
-rw-r--r--gcc/genoutput.c2
-rw-r--r--gcc/genrecog.c6
-rw-r--r--gcc/gensupport.c4
-rw-r--r--gcc/ggc-page.c21
-rw-r--r--gcc/ggc-simple.c4
-rw-r--r--gcc/global.c6
-rw-r--r--gcc/haifa-sched.c6
-rw-r--r--gcc/hashtable.c4
-rw-r--r--gcc/hooks.c15
-rw-r--r--gcc/hooks.h2
-rw-r--r--gcc/hwint.h27
-rw-r--r--gcc/ifcvt.c4
-rw-r--r--gcc/integrate.c42
-rw-r--r--gcc/integrate.h2
-rw-r--r--gcc/java/ChangeLog23
-rw-r--r--gcc/java/class.c12
-rw-r--r--gcc/java/decl.c2
-rw-r--r--gcc/java/lang.c18
-rw-r--r--gcc/java/lang.opt8
-rw-r--r--gcc/java/parse.y2
-rw-r--r--gcc/java/resource.c5
-rw-r--r--gcc/jump.c14
-rw-r--r--gcc/langhooks-def.h4
-rw-r--r--gcc/langhooks.c1
-rw-r--r--gcc/langhooks.h8
-rw-r--r--gcc/libgcov.c89
-rw-r--r--gcc/line-map.c31
-rw-r--r--gcc/line-map.h17
-rw-r--r--gcc/lists.c2
-rw-r--r--gcc/local-alloc.c12
-rw-r--r--gcc/loop.c6
-rw-r--r--gcc/loop.h2
-rw-r--r--gcc/machmode.def2
-rw-r--r--gcc/machmode.h2
-rw-r--r--gcc/mips-tdump.c12
-rw-r--r--gcc/mips-tfile.c40
-rw-r--r--gcc/mkconfig.sh11
-rw-r--r--gcc/mkdeps.c4
-rw-r--r--gcc/mkdeps.h2
-rw-r--r--gcc/objc/objc-act.c147
-rw-r--r--gcc/objc/objc-lang.c2
-rw-r--r--gcc/optabs.c7
-rw-r--r--gcc/optabs.h6
-rw-r--r--gcc/opts.c1165
-rw-r--r--gcc/opts.h9
-rw-r--r--gcc/opts.sh51
-rw-r--r--gcc/output.h1
-rw-r--r--gcc/print-rtl.c2
-rw-r--r--gcc/print-tree.c2
-rw-r--r--gcc/profile.c390
-rw-r--r--gcc/protoize.c18
-rw-r--r--gcc/ra-debug.c25
-rw-r--r--gcc/read-rtl.c10
-rw-r--r--gcc/real.c19
-rw-r--r--gcc/real.h3
-rw-r--r--gcc/recog.c55
-rw-r--r--gcc/recog.h3
-rw-r--r--gcc/reg-stack.c2
-rw-r--r--gcc/regclass.c4
-rw-r--r--gcc/regs.h6
-rw-r--r--gcc/reload.c60
-rw-r--r--gcc/reload.h5
-rw-r--r--gcc/reload1.c1487
-rw-r--r--gcc/rtl-error.c2
-rw-r--r--gcc/rtl.h48
-rw-r--r--gcc/rtlanal.c4
-rw-r--r--gcc/sbitmap.c10
-rw-r--r--gcc/scan.h34
-rw-r--r--gcc/sched-deps.c2
-rw-r--r--gcc/sdbout.c17
-rw-r--r--gcc/simplify-rtx.c8
-rw-r--r--gcc/sreal.c1
-rw-r--r--gcc/ssa-dce.c8
-rw-r--r--gcc/ssa.c5
-rw-r--r--gcc/ssa.h2
-rw-r--r--gcc/stmt.c39
-rw-r--r--gcc/stringpool.c4
-rw-r--r--gcc/system.h78
-rw-r--r--gcc/target-def.h21
-rw-r--r--gcc/target.h25
-rw-r--r--gcc/testsuite/ChangeLog212
-rw-r--r--gcc/testsuite/g++.dg/abi/conv1.C13
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle4.C2
-rw-r--r--gcc/testsuite/g++.dg/lookup/scoped1.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.benjamin/16077.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.bugs/900215_01.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/pretty2.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/conversion5.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/memoized1.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.martin/pmf1.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/memoize1.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/anon7.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/conv7.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overcnv2.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload14.C1
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20020604-1.c3
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/961203-1.c3
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/980506-1.c3
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/simd-5.c5
-rw-r--r--gcc/testsuite/gcc.dg/compat/compat-common.h2
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-by-value-1_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-by-value-2_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-by-value-3_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-by-value-4_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-return-1_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-return-2_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-return-3_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-return-4_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-10_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-11_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-12_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-13_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-14_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-15_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-2_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-3_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-4_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-5_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-6_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-7_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-8_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-by-value-9_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-return-10_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-return-2_x.c2
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-return-3_x.c2
-rw-r--r--gcc/testsuite/lib/g++.exp17
-rw-r--r--gcc/testsuite/lib/gcc-dg.exp7
-rw-r--r--gcc/testsuite/lib/target-supports.exp5
-rw-r--r--gcc/testsuite/objc.dg/const-str-2.m2
-rw-r--r--gcc/timevar.c13
-rw-r--r--gcc/timevar.h3
-rw-r--r--gcc/tlink.c6
-rw-r--r--gcc/toplev.c896
-rw-r--r--gcc/toplev.h26
-rw-r--r--gcc/tracer.c1
-rw-r--r--gcc/tree-dump.c12
-rw-r--r--gcc/tree-inline.c3
-rw-r--r--gcc/tree.c8
-rw-r--r--gcc/tree.def2
-rw-r--r--gcc/tree.h104
-rw-r--r--gcc/treelang/ChangeLog10
-rw-r--r--gcc/treelang/treetree.c6
-rw-r--r--gcc/unroll.c38
-rw-r--r--gcc/varasm.c55
-rw-r--r--gcc/varray.c2
-rw-r--r--gcc/version.c2
-rw-r--r--gcc/vmsdbgout.c6
-rw-r--r--gcc/xcoffout.c6
-rw-r--r--gcc/xcoffout.h4
-rw-r--r--include/ChangeLog29
-rw-r--r--include/ansidecl.h11
-rw-r--r--include/safe-ctype.h18
-rw-r--r--libffi/ChangeLog4
-rw-r--r--libffi/src/powerpc/ppc_closure.S1
-rw-r--r--libiberty/ChangeLog36
-rw-r--r--libiberty/Makefile.in3
-rw-r--r--libiberty/config.in3
-rwxr-xr-xlibiberty/configure31
-rw-r--r--libiberty/configure.in2
-rw-r--r--libiberty/functions.texi100
-rw-r--r--libiberty/hashtab.c4
-rw-r--r--libiberty/hex.c9
-rw-r--r--libiberty/safe-ctype.c119
-rw-r--r--libiberty/testsuite/demangle-expected262
-rw-r--r--libjava/ChangeLog703
-rw-r--r--libjava/Makefile.am10
-rw-r--r--libjava/Makefile.in29
-rwxr-xr-xlibjava/configure2
-rw-r--r--libjava/configure.in2
-rw-r--r--libjava/gnu/java/lang/ArrayHelper.java59
-rw-r--r--libjava/gnu/java/lang/ClassHelper.java344
-rw-r--r--libjava/gnu/java/nio/DatagramChannelImpl.java96
-rw-r--r--libjava/gnu/java/nio/FileChannelImpl.java15
-rw-r--r--libjava/gnu/java/nio/MappedByteFileBuffer.java449
-rw-r--r--libjava/gnu/java/nio/SelectorImpl.java6
-rw-r--r--libjava/gnu/java/nio/ServerSocketChannelImpl.java25
-rw-r--r--libjava/gnu/java/nio/SocketChannelImpl.java98
-rw-r--r--libjava/gnu/java/nio/natFileChannelImpl.cc9
-rw-r--r--libjava/gnu/java/nio/natMappedByteFileBuffer.cc148
-rw-r--r--libjava/gnu/java/nio/natSocketChannelImpl.cc172
-rw-r--r--libjava/gnu/java/security/x509/X509Certificate.java7
-rw-r--r--libjava/java/awt/Font.java25
-rw-r--r--libjava/java/awt/Window.java4
-rw-r--r--libjava/java/awt/color/ColorSpace.java2
-rw-r--r--libjava/java/awt/datatransfer/StringSelection.java6
-rw-r--r--libjava/java/awt/image/ColorModel.java47
-rw-r--r--libjava/java/awt/image/IndexColorModel.java88
-rw-r--r--libjava/java/io/File.java48
-rw-r--r--libjava/java/io/LineNumberReader.java37
-rw-r--r--libjava/java/io/ObjectInputStream.java84
-rw-r--r--libjava/java/io/ObjectOutputStream.java81
-rw-r--r--libjava/java/io/ObjectStreamField.java24
-rw-r--r--libjava/java/io/RandomAccessFile.java4
-rw-r--r--libjava/java/lang/natVMSecurityManager.cc4
-rw-r--r--libjava/java/net/HttpURLConnection.java12
-rw-r--r--libjava/java/net/Inet4Address.java9
-rw-r--r--libjava/java/net/Inet6Address.java11
-rw-r--r--libjava/java/net/InetAddress.java172
-rw-r--r--libjava/java/net/InetSocketAddress.java24
-rw-r--r--libjava/java/net/PlainDatagramSocketImpl.java135
-rw-r--r--libjava/java/net/PlainSocketImpl.java218
-rw-r--r--libjava/java/net/ServerSocket.java89
-rw-r--r--libjava/java/net/Socket.java17
-rw-r--r--libjava/java/net/SocketImpl.java19
-rw-r--r--libjava/java/net/URL.java84
-rw-r--r--libjava/java/net/URLClassLoader.java4
-rw-r--r--libjava/java/net/URLConnection.java54
-rw-r--r--libjava/java/net/URLStreamHandler.java20
-rw-r--r--libjava/java/nio/Buffer.java9
-rw-r--r--libjava/java/nio/ByteBufferImpl.java2
-rw-r--r--libjava/java/nio/CharBufferImpl.java2
-rw-r--r--libjava/java/nio/DirectByteBufferImpl.java9
-rw-r--r--libjava/java/nio/DoubleBufferImpl.java2
-rw-r--r--libjava/java/nio/FloatBufferImpl.java2
-rw-r--r--libjava/java/nio/IntBufferImpl.java2
-rw-r--r--libjava/java/nio/LongBufferImpl.java2
-rw-r--r--libjava/java/nio/ShortBufferImpl.java2
-rw-r--r--libjava/java/nio/channels/FileChannel.java2
-rw-r--r--libjava/java/nio/channels/ServerSocketChannel.java2
-rw-r--r--libjava/java/nio/natDirectByteBufferImpl.cc24
-rw-r--r--libjava/java/rmi/server/SkeletonNotFoundException.java3
-rw-r--r--libjava/java/rmi/server/UnicastRemoteObject.java5
-rw-r--r--libjava/java/security/Certificate.java8
-rw-r--r--libjava/java/security/cert/PolicyQualifierInfo.java2
-rw-r--r--libjava/java/text/CollationElementIterator.java5
-rw-r--r--libjava/java/text/DateFormat.java14
-rw-r--r--libjava/java/text/Format.java2
-rw-r--r--libjava/java/text/SimpleDateFormat.java15
-rw-r--r--libjava/java/util/Locale.java31
-rw-r--r--libjava/java/util/PropertyResourceBundle.java1
-rw-r--r--libjava/java/util/SimpleTimeZone.java9
-rw-r--r--libjava/java/util/prefs/AbstractPreferences.java4
-rw-r--r--libjava/java/util/prefs/Preferences.java12
-rw-r--r--libjava/java/util/prefs/PreferencesFactory.java3
-rw-r--r--libjava/java/util/zip/InflaterInputStream.java4
-rw-r--r--libjava/java/util/zip/ZipEntry.java3
-rw-r--r--libjava/java/util/zip/ZipFile.java2
-rw-r--r--libjava/java/util/zip/ZipInputStream.java3
-rw-r--r--libjava/java/util/zip/ZipOutputStream.java7
-rw-r--r--libjava/javax/naming/CompositeName.java2
-rw-r--r--libjava/javax/naming/CompoundName.java2
-rw-r--r--libjava/javax/naming/InitialContext.java10
-rw-r--r--libjava/javax/naming/LinkRef.java3
-rw-r--r--libjava/javax/naming/NamingException.java1
-rw-r--r--libjava/javax/naming/NamingSecurityException.java4
-rw-r--r--libjava/javax/naming/ReferralException.java2
-rw-r--r--libjava/javax/naming/StringRefAddr.java1
-rw-r--r--libjava/javax/naming/directory/BasicAttribute.java12
-rw-r--r--libjava/javax/naming/directory/BasicAttributes.java8
-rw-r--r--libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java4
-rw-r--r--libjava/javax/security/auth/x500/X500Principal.java1
-rw-r--r--libjava/javax/swing/JComponent.java87
-rw-r--r--libjava/javax/swing/JInternalFrame.java22
-rw-r--r--libjava/javax/swing/JWindow.java7
-rw-r--r--libjava/javax/swing/MenuSelectionManager.java38
-rw-r--r--libjava/javax/swing/SwingUtilities.java34
-rw-r--r--libjava/javax/swing/Timer.java38
-rw-r--r--libjava/javax/swing/ToggleButtonModel.java8
-rw-r--r--libjava/javax/swing/UIManager.java36
-rw-r--r--libjava/javax/swing/border/AbstractBorder.java20
-rw-r--r--libjava/javax/swing/border/BevelBorder.java518
-rw-r--r--libjava/javax/swing/border/Border.java64
-rw-r--r--libjava/javax/swing/border/CompoundBorder.java14
-rw-r--r--libjava/javax/swing/border/EmptyBorder.java187
-rw-r--r--libjava/javax/swing/border/EtchedBorder.java369
-rw-r--r--libjava/javax/swing/border/LineBorder.java294
-rw-r--r--libjava/javax/swing/border/MatteBorder.java364
-rw-r--r--libjava/javax/swing/border/TitledBorder.java1112
-rw-r--r--libjava/javax/swing/event/AncestorEvent.java144
-rw-r--r--libjava/javax/swing/event/HyperlinkEvent.java258
-rw-r--r--libjava/javax/swing/event/InternalFrameEvent.java136
-rw-r--r--libjava/javax/swing/event/ListDataEvent.java141
-rw-r--r--libjava/javax/swing/event/TableModelEvent.java269
-rw-r--r--libjava/javax/swing/event/TreeWillExpandListener.java33
-rw-r--r--libjava/javax/swing/plaf/ActionMapUIResource.java44
-rw-r--r--libjava/javax/swing/plaf/BorderUIResource.java956
-rw-r--r--libjava/javax/swing/plaf/ButtonUI.java13
-rw-r--r--libjava/javax/swing/plaf/ColorChooserUI.java37
-rw-r--r--libjava/javax/swing/plaf/ColorUIResource.java76
-rw-r--r--libjava/javax/swing/plaf/ComboBoxUI.java102
-rw-r--r--libjava/javax/swing/plaf/ComponentInputMapUIResource.java50
-rw-r--r--libjava/javax/swing/plaf/ComponentUI.java342
-rw-r--r--libjava/javax/swing/plaf/DesktopIconUI.java35
-rw-r--r--libjava/javax/swing/plaf/DesktopPaneUI.java36
-rw-r--r--libjava/javax/swing/plaf/DimensionUIResource.java30
-rw-r--r--libjava/javax/swing/plaf/FileChooserUI.java163
-rw-r--r--libjava/javax/swing/plaf/FontUIResource.java63
-rw-r--r--libjava/javax/swing/plaf/IconUIResource.java69
-rw-r--r--libjava/javax/swing/plaf/InputMapUIResource.java41
-rw-r--r--libjava/javax/swing/plaf/InsetsUIResource.java35
-rw-r--r--libjava/javax/swing/plaf/InternalFrameUI.java38
-rw-r--r--libjava/javax/swing/plaf/LabelUI.java21
-rw-r--r--libjava/javax/swing/plaf/ListUI.java74
-rw-r--r--libjava/javax/swing/plaf/MenuBarUI.java38
-rw-r--r--libjava/javax/swing/plaf/MenuItemUI.java38
-rw-r--r--libjava/javax/swing/plaf/OptionPaneUI.java39
-rw-r--r--libjava/javax/swing/plaf/PanelUI.java20
-rw-r--r--libjava/javax/swing/plaf/PopupMenuUI.java110
-rw-r--r--libjava/javax/swing/plaf/ProgressBarUI.java38
-rw-r--r--libjava/javax/swing/plaf/RootPaneUI.java37
-rw-r--r--libjava/javax/swing/plaf/ScrollBarUI.java37
-rw-r--r--libjava/javax/swing/plaf/ScrollPaneUI.java38
-rw-r--r--libjava/javax/swing/plaf/SeparatorUI.java37
-rw-r--r--libjava/javax/swing/plaf/SliderUI.java38
-rw-r--r--libjava/javax/swing/plaf/SplitPaneUI.java162
-rw-r--r--libjava/javax/swing/plaf/TabbedPaneUI.java86
-rw-r--r--libjava/javax/swing/plaf/TableHeaderUI.java38
-rw-r--r--libjava/javax/swing/plaf/TableUI.java38
-rw-r--r--libjava/javax/swing/plaf/TextUI.java262
-rw-r--r--libjava/javax/swing/plaf/ToolBarUI.java38
-rw-r--r--libjava/javax/swing/plaf/ToolTipUI.java38
-rw-r--r--libjava/javax/swing/plaf/TreeUI.java171
-rw-r--r--libjava/javax/swing/plaf/ViewportUI.java20
-rw-r--r--libjava/javax/swing/plaf/basic/BasicBorders.java1756
-rw-r--r--libjava/javax/swing/plaf/basic/BasicButtonUI.java13
-rw-r--r--libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java10
-rw-r--r--libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java645
-rw-r--r--libjava/javax/swing/plaf/basic/BasicLabelUI.java9
-rw-r--r--libjava/javax/swing/plaf/basic/BasicListUI.java19
-rw-r--r--libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java10
-rw-r--r--libjava/javax/swing/plaf/basic/BasicRadioButtonUI.java9
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTextUI.java15
-rw-r--r--libjava/javax/swing/plaf/basic/BasicToggleButtonUI.java9
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTreeUI.java197
-rw-r--r--libjava/javax/swing/text/JTextComponent.java7
-rw-r--r--libjava/jni.cc26
-rw-r--r--libstdc++-v3/ChangeLog578
-rw-r--r--libstdc++-v3/Makefile.am35
-rw-r--r--libstdc++-v3/Makefile.in45
-rw-r--r--libstdc++-v3/README13
-rw-r--r--libstdc++-v3/acinclude.m435
-rw-r--r--libstdc++-v3/aclocal.m435
-rwxr-xr-xlibstdc++-v3/config/abi/extract_symvers64
-rw-r--r--libstdc++-v3/config/abi/i386-freebsd4/baseline_symbols.txt35
-rw-r--r--libstdc++-v3/config/abi/i486-linux-gnu/baseline_symbols.txt27
-rw-r--r--libstdc++-v3/config/linker-map.gnu5
-rw-r--r--libstdc++-v3/config/locale/generic/numeric_members.cc62
-rw-r--r--libstdc++-v3/config/locale/gnu/numeric_members.cc90
-rw-r--r--libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h14
-rwxr-xr-xlibstdc++-v3/configure389
-rw-r--r--libstdc++-v3/configure.host43
-rw-r--r--libstdc++-v3/configure.in45
-rw-r--r--libstdc++-v3/docs/doxygen/mainpage.html2
-rw-r--r--libstdc++-v3/docs/html/17_intro/contribute.html39
-rw-r--r--libstdc++-v3/docs/html/17_intro/libstdc++-assign.txt129
-rw-r--r--libstdc++-v3/docs/html/documentation.html1
-rw-r--r--libstdc++-v3/docs/html/test.html30
-rw-r--r--libstdc++-v3/include/bits/basic_ios.tcc8
-rw-r--r--libstdc++-v3/include/bits/basic_string.h26
-rw-r--r--libstdc++-v3/include/bits/basic_string.tcc32
-rw-r--r--libstdc++-v3/include/bits/boost_concept_check.h16
-rw-r--r--libstdc++-v3/include/bits/c++config2
-rw-r--r--libstdc++-v3/include/bits/fstream.tcc205
-rw-r--r--libstdc++-v3/include/bits/ios_base.h54
-rw-r--r--libstdc++-v3/include/bits/locale_classes.h227
-rw-r--r--libstdc++-v3/include/bits/locale_facets.h190
-rw-r--r--libstdc++-v3/include/bits/locale_facets.tcc61
-rw-r--r--libstdc++-v3/include/bits/sstream.tcc102
-rw-r--r--libstdc++-v3/include/bits/streambuf.tcc84
-rw-r--r--libstdc++-v3/include/ext/mt_allocator.h16
-rw-r--r--libstdc++-v3/include/ext/stdio_filebuf.h8
-rw-r--r--libstdc++-v3/include/std/std_fstream.h76
-rw-r--r--libstdc++-v3/include/std/std_sstream.h69
-rw-r--r--libstdc++-v3/include/std/std_streambuf.h133
-rwxr-xr-xlibstdc++-v3/mkcheck.in452
-rw-r--r--libstdc++-v3/src/globals.cc15
-rw-r--r--libstdc++-v3/src/ios.cc4
-rw-r--r--libstdc++-v3/src/locale-inst.cc4
-rw-r--r--libstdc++-v3/src/locale.cc53
-rw-r--r--libstdc++-v3/src/localename.cc114
-rw-r--r--libstdc++-v3/testsuite/20_util/auto_ptr.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/assign/char/1.cc3
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/replace/char/4.cc2
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/4.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/narrow/char/1.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/narrow/char/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/1.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/2.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/widen/char/1.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/1.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/list_modifiers.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector_bool.cc3
-rw-r--r--libstdc++-v3/testsuite/24_iterators/rel_ops.cc3
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc10
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/3-io.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/3-io.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/1.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc8
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc9
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc17
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc9
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-io.cc8
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-out.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/9701-2.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/9701-1.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1.cc178
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/Makefile.am98
-rw-r--r--libstdc++-v3/testsuite/Makefile.in116
-rw-r--r--libstdc++-v3/testsuite/abi_check.cc66
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp2
-rw-r--r--libstdc++-v3/testsuite/performance/allocator.cc192
-rw-r--r--libstdc++-v3/testsuite/performance/complex_norm.cc34
-rw-r--r--libstdc++-v3/testsuite/performance/cout_insert_int.cc14
-rw-r--r--libstdc++-v3/testsuite/performance/fstream_seek_write.cc13
-rw-r--r--libstdc++-v3/testsuite/performance/ifstream_getline.cc27
-rw-r--r--libstdc++-v3/testsuite/performance/map_create_fill.cc26
-rw-r--r--libstdc++-v3/testsuite/performance/ofstream_insert_float.cc16
-rw-r--r--libstdc++-v3/testsuite/performance/ofstream_insert_int.cc16
-rw-r--r--libstdc++-v3/testsuite/performance/string_append.cc27
-rw-r--r--libstdc++-v3/testsuite/testsuite_performance.h2
-rwxr-xr-xlibstdc++-v3/testsuite_flags.in62
-rw-r--r--maintainer-scripts/ChangeLog33
-rwxr-xr-xmaintainer-scripts/gcc_release92
-rw-r--r--maintainer-scripts/snapshot-README4
-rw-r--r--maintainer-scripts/snapshot-index.html13
783 files changed, 34045 insertions, 25009 deletions
diff --git a/ChangeLog b/ChangeLog
index 61aeeef822e..a00b87b0fba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,52 @@
+2003-06-27 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * configure.in: Clean up config-lang.in handling. Delete
+ useless assignment to "subdirs".
+ * configure: Regenerate.
+
+2003-06-26 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * configure.in: Rename 'target_libs' to 'target_libraries'.
+ Remove useless reference to 'target_libs'.
+ * configure: Regenerate.
+
+2003-06-23 Keith Seitz <kseitz@sources.redhat.com>
+
+ * Makefile.tpl: Add maybe-configure-itcl to configure-gdb.
+ * Makefile.in: Regenerate.
+
+2003-06-23 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * Makefile.def: Introduce flags_to_pass.
+ * Makefile.tpl: Generate BASE_FLAGS_TO_PASS using it.
+ * Makefile.in: Regenerate.
+
+2003-06-23 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * configure.in (noconfigdirs) <cris-*-*>: Disable target-newlib
+ and target-libgloss.
+ <d30v-*-*, fr30-*-*, i960-*-*, m32r-*-*>: Disable gdb.
+ <h8300*-*-*>: Disable libf2c and ${libgcj}.
+ * configure: Regenerate.
+
+2003-06-17 Benjamin Kosnik <bkoz@redhat.com>
+
+ * configure.in: Update testsuite_flags to new location.
+ * configure. Regenerate.
+
+2003-06-18 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * Makefile.tpl: Remove BUILD_CC stuff.
+ * Makefile.in: Regenerate.
+
+2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * MAINTAINERS (Write After Approval): Remove Andrew Haley.
+
+2003-06-16 Graeme Peterson <gp@qnx.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
2003-06-14 H.J. Lu <hongjiu.lu@intel.com>
* config.guess: Update to 2003-06-12 version.
diff --git a/ChangeLog.branch b/ChangeLog.branch
index 77cecacf5d5..1e2201ebb38 100644
--- a/ChangeLog.branch
+++ b/ChangeLog.branch
@@ -1,5 +1,11 @@
2003-06-27 Nathanael Nerode <neroden@gcc.gnu.org>
+ * configure.in: Handle stage1_languages properly.
+ * configure: Regenerate.
+ Auto-detects ada for stage 1 now, and bootstraps!
+
+ Merge from mainline.
+
* Makefile.tpl: Create a Makefile variable for STAGE1_LANGUAGES.
* Makefile.in: Regenerate.
diff --git a/MAINTAINERS b/MAINTAINERS
index d84c4c2aeba..32bf175ad86 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -188,7 +188,6 @@ Matthew Gingell gingell@gnat.com
Anthony Green green@redhat.com
Laurent Guerby guerby@acm.org
Olivier Hainque hainque@act-europe.fr
-Andrew Haley aph@redhat.com
Stuart Hastings stuart@apple.com
Matthew Hiller hiller@redhat.com
Manfred Hollstein mhollstein@redhat.com
@@ -226,6 +225,7 @@ Jeffrey D. Oldham oldham@codesourcery.com
Rainer Orth ro@TechFak.Uni-Bielefeld.DE
Devang Patel dpatel@apple.com
Nicola Pero n.pero@mi.flashnet.it
+Graeme Peterson gp@qnx.com
Alexandre Petit-Bianco apbianco@redhat.com
Sebastian Pop s.pop@laposte.net
Clinton Popetz cpopetz@cpopetz.com
diff --git a/Makefile.def b/Makefile.def
index 8a84a684702..ea32deef4a7 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -144,3 +144,74 @@ recursive_targets = { make_target= mostlyclean; };
recursive_targets = { make_target= clean; };
recursive_targets = { make_target= distclean; };
recursive_targets = { make_target= maintainer-clean; };
+
+// Flags which need to be passed down.
+
+// Directories etc.
+flags_to_pass = { flag= DESTDIR ; };
+flags_to_pass = { flag= RPATH_ENVVAR ; };
+flags_to_pass = { flag= TARGET_SUBDIR ; };
+flags_to_pass = { flag= bindir ; };
+flags_to_pass = { flag= datadir ; };
+flags_to_pass = { flag= exec_prefix ; };
+flags_to_pass = { flag= includedir ; };
+flags_to_pass = { flag= infodir ; };
+flags_to_pass = { flag= libdir ; };
+flags_to_pass = { flag= libexecdir ; };
+flags_to_pass = { flag= lispdir ; };
+flags_to_pass = { flag= libstdcxx_incdir ; };
+flags_to_pass = { flag= libsubdir ; };
+flags_to_pass = { flag= localstatedir ; };
+flags_to_pass = { flag= mandir ; };
+flags_to_pass = { flag= oldincludedir ; };
+flags_to_pass = { flag= prefix ; };
+flags_to_pass = { flag= sbindir ; };
+flags_to_pass = { flag= sharedstatedir ; };
+flags_to_pass = { flag= sysconfdir ; };
+flags_to_pass = { flag= tooldir ; };
+flags_to_pass = { flag= build_tooldir ; };
+flags_to_pass = { flag= gxx_include_dir ; };
+flags_to_pass = { flag= gcc_version ; };
+flags_to_pass = { flag= gcc_version_trigger ; };
+flags_to_pass = { flag= target_alias ; };
+
+// Build tools
+flags_to_pass = { flag= BISON ; };
+flags_to_pass = { flag= CC_FOR_BUILD ; };
+flags_to_pass = { flag= CXX_FOR_BUILD ; };
+flags_to_pass = { flag= EXPECT ; };
+flags_to_pass = { flag= INSTALL ; };
+flags_to_pass = { flag= INSTALL_DATA ; };
+flags_to_pass = { flag= INSTALL_PROGRAM ; };
+flags_to_pass = { flag= INSTALL_SCRIPT ; };
+flags_to_pass = { flag= LEX ; };
+flags_to_pass = { flag= M4 ; };
+flags_to_pass = { flag= MAKE ; };
+flags_to_pass = { flag= RUNTEST ; };
+flags_to_pass = { flag= RUNTESTFLAGS ; };
+flags_to_pass = { flag= SHELL ; };
+flags_to_pass = { flag= YACC ; };
+
+// Host tools
+flags_to_pass = { flag= AR_FLAGS ; };
+flags_to_pass = { flag= CFLAGS ; };
+flags_to_pass = { flag= CXXFLAGS ; };
+flags_to_pass = { flag= LDFLAGS ; };
+flags_to_pass = { flag= LIBCFLAGS ; };
+flags_to_pass = { flag= LIBCXXFLAGS ; };
+
+// Target tools
+flags_to_pass = { flag= AR_FOR_TARGET ; };
+flags_to_pass = { flag= AS_FOR_TARGET ; };
+flags_to_pass = { flag= CC_FOR_TARGET ; };
+flags_to_pass = { flag= CFLAGS_FOR_TARGET ; };
+flags_to_pass = { flag= CXX_FOR_TARGET ; };
+flags_to_pass = { flag= CXXFLAGS_FOR_TARGET ; };
+flags_to_pass = { flag= DLLTOOL_FOR_TARGET ; };
+flags_to_pass = { flag= GCJ_FOR_TARGET ; };
+flags_to_pass = { flag= LD_FOR_TARGET ; };
+flags_to_pass = { flag= LIBCFLAGS_FOR_TARGET ; };
+flags_to_pass = { flag= LIBCXXFLAGS_FOR_TARGET ; };
+flags_to_pass = { flag= NM_FOR_TARGET ; };
+flags_to_pass = { flag= RANLIB_FOR_TARGET ; };
+flags_to_pass = { flag= WINDRES_FOR_TARGET ; };
diff --git a/Makefile.in b/Makefile.in
index 01eadf57cbf..9a34cdaaaee 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -150,7 +150,6 @@ CXX_FOR_BUILD = $(CXX)
# Special variables passed down in EXTRA_GCC_FLAGS. They are defined
# here so that they can be overridden by Makefile fragments.
-BUILD_CC = $(CC_FOR_BUILD)
BUILD_PREFIX = @BUILD_PREFIX@
BUILD_PREFIX_1 = @BUILD_PREFIX_1@
@@ -387,47 +386,10 @@ all: all.normal
###
# Flags to pass down to all sub-makes.
-# Please keep these in alphabetical order.
BASE_FLAGS_TO_PASS = \
- "AR_FLAGS=$(AR_FLAGS)" \
- "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
- "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
- "BISON=$(BISON)" \
- "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
- "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
- "CFLAGS=$(CFLAGS)" \
- "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
- "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \
- "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
- "CXXFLAGS=$(CXXFLAGS)" \
- "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
- "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
"DESTDIR=$(DESTDIR)" \
- "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
- "INSTALL=$(INSTALL)" \
- "INSTALL_DATA=$(INSTALL_DATA)" \
- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
- "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
- "LDFLAGS=$(LDFLAGS)" \
- "LEX=$(LEX)" \
- "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
- "LIBCFLAGS=$(LIBCFLAGS)" \
- "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
- "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
- "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
- "M4=$(M4)" \
- "MAKE=$(MAKE)" \
- "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
- "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
- "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
"RPATH_ENVVAR=$(RPATH_ENVVAR)" \
- "SHELL=$(SHELL)" \
- "EXPECT=$(EXPECT)" \
- "RUNTEST=$(RUNTEST)" \
- "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
"TARGET_SUBDIR=$(TARGET_SUBDIR)" \
- "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
- "YACC=$(YACC)" \
"bindir=$(bindir)" \
"datadir=$(datadir)" \
"exec_prefix=$(exec_prefix)" \
@@ -450,7 +412,43 @@ BASE_FLAGS_TO_PASS = \
"gxx_include_dir=$(gxx_include_dir)" \
"gcc_version=$(gcc_version)" \
"gcc_version_trigger=$(gcc_version_trigger)" \
- "target_alias=$(target_alias)"
+ "target_alias=$(target_alias)" \
+ "BISON=$(BISON)" \
+ "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
+ "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
+ "EXPECT=$(EXPECT)" \
+ "INSTALL=$(INSTALL)" \
+ "INSTALL_DATA=$(INSTALL_DATA)" \
+ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
+ "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
+ "LEX=$(LEX)" \
+ "M4=$(M4)" \
+ "MAKE=$(MAKE)" \
+ "RUNTEST=$(RUNTEST)" \
+ "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
+ "SHELL=$(SHELL)" \
+ "YACC=$(YACC)" \
+ "AR_FLAGS=$(AR_FLAGS)" \
+ "CFLAGS=$(CFLAGS)" \
+ "CXXFLAGS=$(CXXFLAGS)" \
+ "LDFLAGS=$(LDFLAGS)" \
+ "LIBCFLAGS=$(LIBCFLAGS)" \
+ "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
+ "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
+ "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
+ "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
+ "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
+ "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
+ "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
+ "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
+ "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \
+ "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
+ "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
+ "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
+ "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
+ "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
+ "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
+ "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)"
# For any flags above that may contain shell code that varies from one
# target library to another. When doing recursive invocations of the
@@ -520,7 +518,6 @@ EXTRA_GCC_FLAGS = \
'CC=$(CC)' \
'CXX=$(CXX)' \
'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
- 'BUILD_CC=$(CC_FOR_BUILD)' \
'BUILD_PREFIX=$(BUILD_PREFIX)' \
'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
'NM=$(NM)' \
@@ -23788,7 +23785,7 @@ all-bootstrap: maybe-all-build-libiberty maybe-all-libiberty maybe-all-texinfo m
# Host modules specific to gdb.
# GDB needs to know that the simulator is being built.
-configure-gdb: maybe-configure-tcl maybe-configure-tk maybe-configure-sim
+configure-gdb: maybe-configure-itcl maybe-configure-tcl maybe-configure-tk maybe-configure-sim
GDB_TK = @GDB_TK@
all-gdb: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-mmalloc maybe-all-readline maybe-all-bison maybe-all-byacc maybe-all-sim $(gdbnlmrequirements) $(GDB_TK)
install-gdb: maybe-install-tcl maybe-install-tk maybe-install-itcl maybe-install-tix maybe-install-libgui
diff --git a/Makefile.tpl b/Makefile.tpl
index ea8227f8e3b..2339e3bba8a 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -153,7 +153,6 @@ CXX_FOR_BUILD = $(CXX)
# Special variables passed down in EXTRA_GCC_FLAGS. They are defined
# here so that they can be overridden by Makefile fragments.
-BUILD_CC = $(CC_FOR_BUILD)
BUILD_PREFIX = @BUILD_PREFIX@
BUILD_PREFIX_1 = @BUILD_PREFIX_1@
@@ -390,70 +389,9 @@ all: all.normal
###
# Flags to pass down to all sub-makes.
-# Please keep these in alphabetical order.
-BASE_FLAGS_TO_PASS = \
- "AR_FLAGS=$(AR_FLAGS)" \
- "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
- "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
- "BISON=$(BISON)" \
- "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
- "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
- "CFLAGS=$(CFLAGS)" \
- "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
- "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \
- "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
- "CXXFLAGS=$(CXXFLAGS)" \
- "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
- "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
- "DESTDIR=$(DESTDIR)" \
- "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
- "INSTALL=$(INSTALL)" \
- "INSTALL_DATA=$(INSTALL_DATA)" \
- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
- "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
- "LDFLAGS=$(LDFLAGS)" \
- "LEX=$(LEX)" \
- "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
- "LIBCFLAGS=$(LIBCFLAGS)" \
- "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
- "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
- "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
- "M4=$(M4)" \
- "MAKE=$(MAKE)" \
- "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
- "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
- "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
- "RPATH_ENVVAR=$(RPATH_ENVVAR)" \
- "SHELL=$(SHELL)" \
- "EXPECT=$(EXPECT)" \
- "RUNTEST=$(RUNTEST)" \
- "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
- "TARGET_SUBDIR=$(TARGET_SUBDIR)" \
- "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
- "YACC=$(YACC)" \
- "bindir=$(bindir)" \
- "datadir=$(datadir)" \
- "exec_prefix=$(exec_prefix)" \
- "includedir=$(includedir)" \
- "infodir=$(infodir)" \
- "libdir=$(libdir)" \
- "libexecdir=$(libexecdir)" \
- "lispdir=$(lispdir)" \
- "libstdcxx_incdir=$(libstdcxx_incdir)" \
- "libsubdir=$(libsubdir)" \
- "localstatedir=$(localstatedir)" \
- "mandir=$(mandir)" \
- "oldincludedir=$(oldincludedir)" \
- "prefix=$(prefix)" \
- "sbindir=$(sbindir)" \
- "sharedstatedir=$(sharedstatedir)" \
- "sysconfdir=$(sysconfdir)" \
- "tooldir=$(tooldir)" \
- "build_tooldir=$(build_tooldir)" \
- "gxx_include_dir=$(gxx_include_dir)" \
- "gcc_version=$(gcc_version)" \
- "gcc_version_trigger=$(gcc_version_trigger)" \
- "target_alias=$(target_alias)"
+BASE_FLAGS_TO_PASS = [+ FOR flags_to_pass +]\
+ "[+flag+]=$([+flag+])" [+ ENDFOR flags_to_pass +]\
+ "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)"
# For any flags above that may contain shell code that varies from one
# target library to another. When doing recursive invocations of the
@@ -523,7 +461,6 @@ EXTRA_GCC_FLAGS = \
'CC=$(CC)' \
'CXX=$(CXX)' \
'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
- 'BUILD_CC=$(CC_FOR_BUILD)' \
'BUILD_PREFIX=$(BUILD_PREFIX)' \
'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
'NM=$(NM)' \
@@ -1393,7 +1330,7 @@ all-bootstrap: maybe-all-build-libiberty maybe-all-libiberty maybe-all-texinfo m
# Host modules specific to gdb.
# GDB needs to know that the simulator is being built.
-configure-gdb: maybe-configure-tcl maybe-configure-tk maybe-configure-sim
+configure-gdb: maybe-configure-itcl maybe-configure-tcl maybe-configure-tk maybe-configure-sim
GDB_TK = @GDB_TK@
all-gdb: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-mmalloc maybe-all-readline maybe-all-bison maybe-all-byacc maybe-all-sim $(gdbnlmrequirements) $(GDB_TK)
install-gdb: maybe-install-tcl maybe-install-tk maybe-install-itcl maybe-install-tix maybe-install-libgui
diff --git a/configure b/configure
index 8e277fa5496..fe81c218e2d 100755
--- a/configure
+++ b/configure
@@ -803,7 +803,7 @@ libgcj="target-libffi \
# these libraries are built for the target environment, and are built after
# the host libraries and the host tools (which may be a cross compiler)
#
-target_libs="target-libiberty \
+target_libraries="target-libiberty \
target-libgloss \
target-newlib \
target-libstdc++-v3 \
@@ -811,10 +811,10 @@ target_libs="target-libiberty \
${libgcj} \
target-libobjc"
-# these tools are built using the target libs, and are intended to run only
-# in the target environment
+# these tools are built using the target libraries, and are intended to
+# run only in the target environment
#
-# note: any program that *uses* libraries that are in the "target_libs"
+# note: any program that *uses* libraries that are in the "target_libraries"
# list belongs in this list. those programs are also very likely
# candidates for the "native_only" list which follows
#
@@ -829,7 +829,7 @@ target_tools="target-examples target-groff target-gperf target-rda"
## ${target_configdirs} is directories we build using the target tools.
#
configdirs=`echo ${host_libs} ${host_tools}`
-target_configdirs=`echo ${target_libs} ${target_tools}`
+target_configdirs=`echo ${target_libraries} ${target_tools}`
# Modules which run on the build machine.
build_modules="libiberty gcc"
@@ -1133,22 +1133,22 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib"
;;
cris-*-*)
- noconfigdirs="$noconfigdirs ${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
d10v-*-*)
noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
;;
d30v-*-*)
- noconfigdirs="$noconfigdirs ${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj} gdb"
;;
fr30-*-elf*)
- noconfigdirs="$noconfigdirs ${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj} gdb"
;;
frv-*-*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
h8300*-*-*)
- noconfigdirs="$noconfigdirs target-libgloss"
+ noconfigdirs="$noconfigdirs target-libgloss ${libgcj} target-libf2c"
;;
h8500-*-*)
noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} target-libf2c"
@@ -1172,6 +1172,9 @@ case "${target}" in
# build on HP-UX 10.20.
noconfigdirs="$noconfigdirs ld shellutils ${libgcj}"
;;
+ i960-*-*)
+ noconfigdirs="$noconfigdirs ${libgcj} gdb"
+ ;;
ia64*-*-elf*)
# No gdb support yet.
noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb"
@@ -1249,6 +1252,9 @@ case "${target}" in
i[3456789]86-*-beos*)
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
;;
+ m32r-*-*)
+ noconfigdirs="$noconfigdirs ${libgcj} gdb"
+ ;;
m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
;;
@@ -1428,24 +1434,24 @@ enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/
# First scan to see if an enabled language requires some other language.
# We assume that a given config-lang.in will list all the language
# front ends it requires, even if some are required indirectly.
-for lang in ${srcdir}/gcc/*/config-lang.in ..
-do
- case $lang in
+for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
+ case ${lang_frag} in
..) ;;
# The odd quoting in the next line works around
# an apparent bug in bash 1.12 on linux.
${srcdir}/gcc/[*]/config-lang.in) ;;
*)
- lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
- this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang`
- for other in $this_lang_requires
- do
+ # From the config-lang.in, get $language, $lang_requires
+ language=
+ lang_requires=
+ . ${lang_frag}
+ for other in ${lang_requires} ; do
case ,${enable_languages}, in
*,$other,*) ;;
*,all,*) ;;
- *,$lang_alias,*)
- echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2
- enable_languages="$enable_languages,$other"
+ *,$language,*)
+ echo " \`$other' language required by \`$language'; enabling" 1>&2
+ enable_languages="${enable_languages},${other}"
;;
esac
done
@@ -1453,35 +1459,57 @@ do
esac
done
-subdirs=
-for lang in ${srcdir}/gcc/*/config-lang.in ..
-do
- case $lang in
+# By default, only C is a stage 1 language.
+stage1_languages=c
+
+
+for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
+ case ${lang_frag} in
..) ;;
# The odd quoting in the next line works around
# an apparent bug in bash 1.12 on linux.
${srcdir}/gcc/[*]/config-lang.in) ;;
*)
- lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
- this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang`
- this_lang_dirs=`sed -n -e 's,^lang_dirs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_dirs=\([^ ]*\).*$,\1,p' $lang`
- build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang`
- if test "x$lang_alias" = x
- then
- echo "$lang doesn't set \$language." 1>&2
+ # From the config-lang.in, get $language, $target_libs,
+ # $lang_dirs, $boot_language, and $build_by_default
+ language=
+ target_libs=
+ lang_dirs=
+ boot_language=
+ build_by_default=
+ . ${lang_frag}
+ if test "x$language" = x ; then
+ echo "${lang_frag} doesn't set \$language." 1>&2
exit 1
fi
- case ${build_by_default},${enable_languages}, in
- *,$lang_alias,*) add_this_lang=yes ;;
- no,*) add_this_lang=no ;;
- *,all,*) add_this_lang=yes ;;
+ case ,${enable_languages}, in
+ *,${language},*)
+ # Language was explicitly selected; include it.
+ add_this_lang=yes
+ ;;
+ *,all,*)
+ # 'all' was selected; include 'default' languages.
+ case ${build_by_default} in
+ no) add_this_lang=no ;;
+ *) add_this_lang=yes ;;
+ esac
+ ;;
*) add_this_lang=no ;;
esac
- if test x"${add_this_lang}" = xyes; then
- eval target_libs='"$target_libs "'\"$this_lang_libs\"
- else
- eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\"
- fi
+ case ${add_this_lang} in
+ yes)
+ case ${boot_language} in
+ yes)
+ # Add to (space-separated) list of stage 1 languages.
+ stage1_languages="${stage1_languages} ${language}"
+ ;;
+ esac
+ ;;
+ no)
+ # Remove language-dependent dirs.
+ eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\"
+ ;;
+ esac
;;
esac
done
@@ -2588,7 +2616,7 @@ fi
GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)'
# Don't use libstdc++-v3's flags to configure/build itself.
-libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
+libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
raw_libstdcxx_flags=' -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
if test "x${CXX_FOR_TARGET+set}" = xset; then
@@ -2686,7 +2714,7 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias-
# Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args.
set dummy ${ncn_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2690: checking for $ac_word" >&5
+echo "configure:2718: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2719,7 +2747,7 @@ if test -z "$ac_cv_prog_AR" ; then
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2723: checking for $ac_word" >&5
+echo "configure:2751: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2758,7 +2786,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args.
set dummy ${ncn_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2762: checking for $ac_word" >&5
+echo "configure:2790: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2791,7 +2819,7 @@ if test -z "$ac_cv_prog_AS" ; then
# Extract the first word of "as", so it can be a program name with args.
set dummy as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2795: checking for $ac_word" >&5
+echo "configure:2823: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2830,7 +2858,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ncn_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2834: checking for $ac_word" >&5
+echo "configure:2862: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2863,7 +2891,7 @@ if test -z "$ac_cv_prog_DLLTOOL" ; then
# Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2867: checking for $ac_word" >&5
+echo "configure:2895: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2902,7 +2930,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args.
set dummy ${ncn_tool_prefix}ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2906: checking for $ac_word" >&5
+echo "configure:2934: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2935,7 +2963,7 @@ if test -z "$ac_cv_prog_LD" ; then
# Extract the first word of "ld", so it can be a program name with args.
set dummy ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2939: checking for $ac_word" >&5
+echo "configure:2967: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2974,7 +3002,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args.
set dummy ${ncn_tool_prefix}nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2978: checking for $ac_word" >&5
+echo "configure:3006: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3007,7 +3035,7 @@ if test -z "$ac_cv_prog_NM" ; then
# Extract the first word of "nm", so it can be a program name with args.
set dummy nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3011: checking for $ac_word" >&5
+echo "configure:3039: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3046,7 +3074,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ncn_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3050: checking for $ac_word" >&5
+echo "configure:3078: 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
@@ -3079,7 +3107,7 @@ if test -z "$ac_cv_prog_RANLIB" ; then
# 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:3083: checking for $ac_word" >&5
+echo "configure:3111: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3118,7 +3146,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args.
set dummy ${ncn_tool_prefix}windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3122: checking for $ac_word" >&5
+echo "configure:3150: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3151,7 +3179,7 @@ if test -z "$ac_cv_prog_WINDRES" ; then
# Extract the first word of "windres", so it can be a program name with args.
set dummy windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3155: checking for $ac_word" >&5
+echo "configure:3183: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3190,7 +3218,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args.
set dummy ${ncn_tool_prefix}objcopy; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3194: checking for $ac_word" >&5
+echo "configure:3222: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3223,7 +3251,7 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then
# Extract the first word of "objcopy", so it can be a program name with args.
set dummy objcopy; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3227: checking for $ac_word" >&5
+echo "configure:3255: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3262,7 +3290,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args.
set dummy ${ncn_tool_prefix}objdump; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3266: checking for $ac_word" >&5
+echo "configure:3294: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3295,7 +3323,7 @@ if test -z "$ac_cv_prog_OBJDUMP" ; then
# Extract the first word of "objdump", so it can be a program name with args.
set dummy objdump; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3299: checking for $ac_word" >&5
+echo "configure:3327: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3343,7 +3371,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3347: checking for $ac_word" >&5
+echo "configure:3375: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3376,7 +3404,7 @@ if test -z "$ac_cv_prog_AR_FOR_TARGET" ; then
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3380: checking for $ac_word" >&5
+echo "configure:3408: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3415,7 +3443,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3419: checking for $ac_word" >&5
+echo "configure:3447: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3448,7 +3476,7 @@ if test -z "$ac_cv_prog_AS_FOR_TARGET" ; then
# Extract the first word of "as", so it can be a program name with args.
set dummy as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3452: checking for $ac_word" >&5
+echo "configure:3480: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3487,7 +3515,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3491: checking for $ac_word" >&5
+echo "configure:3519: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3520,7 +3548,7 @@ if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" ; then
# Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3524: checking for $ac_word" >&5
+echo "configure:3552: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3559,7 +3587,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3563: checking for $ac_word" >&5
+echo "configure:3591: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3592,7 +3620,7 @@ if test -z "$ac_cv_prog_LD_FOR_TARGET" ; then
# Extract the first word of "ld", so it can be a program name with args.
set dummy ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3596: checking for $ac_word" >&5
+echo "configure:3624: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3631,7 +3659,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3635: checking for $ac_word" >&5
+echo "configure:3663: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3664,7 +3692,7 @@ if test -z "$ac_cv_prog_NM_FOR_TARGET" ; then
# Extract the first word of "nm", so it can be a program name with args.
set dummy nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3668: checking for $ac_word" >&5
+echo "configure:3696: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3703,7 +3731,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3707: checking for $ac_word" >&5
+echo "configure:3735: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3736,7 +3764,7 @@ if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" ; then
# 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:3740: checking for $ac_word" >&5
+echo "configure:3768: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3775,7 +3803,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3779: checking for $ac_word" >&5
+echo "configure:3807: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3808,7 +3836,7 @@ if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" ; then
# Extract the first word of "windres", so it can be a program name with args.
set dummy windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3812: checking for $ac_word" >&5
+echo "configure:3840: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3875,7 +3903,7 @@ RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:3879: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:3907: checking whether to enable maintainer-specific portions of Makefiles" >&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
@@ -3918,10 +3946,6 @@ case $build in
esac
-# FIXME: This needs to be done much better. Sadly, that's hairy.
-stage1_languages="c ada"
-
-
# Enable -Werror in bootstrap stage2 and later.
# Change the default to "no" on release branches.
# Check whether --enable-werror or --disable-werror was given.
@@ -4101,6 +4125,7 @@ s%@TOPLEVEL_CONFIGURE_ARGUMENTS@%$TOPLEVEL_CONFIGURE_ARGUMENTS%g
s%@build_subdir@%$build_subdir%g
s%@host_subdir@%$host_subdir%g
s%@target_subdir@%$target_subdir%g
+s%@stage1_languages@%$stage1_languages%g
/@maybe_dependencies@/r $maybe_dependencies
s%@maybe_dependencies@%%g
/@serialization_dependencies@/r $serialization_dependencies
@@ -4187,7 +4212,6 @@ s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
s%@MAINT@%$MAINT%g
s%@stage1_cflags@%$stage1_cflags%g
-s%@stage1_languages@%$stage1_languages%g
s%@WERROR@%$WERROR%g
CEOF
diff --git a/configure.in b/configure.in
index f981e019eae..36708fd23b0 100644
--- a/configure.in
+++ b/configure.in
@@ -136,7 +136,7 @@ libgcj="target-libffi \
# these libraries are built for the target environment, and are built after
# the host libraries and the host tools (which may be a cross compiler)
#
-target_libs="target-libiberty \
+target_libraries="target-libiberty \
target-libgloss \
target-newlib \
target-libstdc++-v3 \
@@ -144,10 +144,10 @@ target_libs="target-libiberty \
${libgcj} \
target-libobjc"
-# these tools are built using the target libs, and are intended to run only
-# in the target environment
+# these tools are built using the target libraries, and are intended to
+# run only in the target environment
#
-# note: any program that *uses* libraries that are in the "target_libs"
+# note: any program that *uses* libraries that are in the "target_libraries"
# list belongs in this list. those programs are also very likely
# candidates for the "native_only" list which follows
#
@@ -162,7 +162,7 @@ target_tools="target-examples target-groff target-gperf target-rda"
## ${target_configdirs} is directories we build using the target tools.
#
configdirs=`echo ${host_libs} ${host_tools}`
-target_configdirs=`echo ${target_libs} ${target_tools}`
+target_configdirs=`echo ${target_libraries} ${target_tools}`
# Modules which run on the build machine.
build_modules="libiberty gcc"
@@ -445,22 +445,22 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib"
;;
cris-*-*)
- noconfigdirs="$noconfigdirs ${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
d10v-*-*)
noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
;;
d30v-*-*)
- noconfigdirs="$noconfigdirs ${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj} gdb"
;;
fr30-*-elf*)
- noconfigdirs="$noconfigdirs ${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj} gdb"
;;
frv-*-*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
h8300*-*-*)
- noconfigdirs="$noconfigdirs target-libgloss"
+ noconfigdirs="$noconfigdirs target-libgloss ${libgcj} target-libf2c"
;;
h8500-*-*)
noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} target-libf2c"
@@ -484,6 +484,9 @@ case "${target}" in
# build on HP-UX 10.20.
noconfigdirs="$noconfigdirs ld shellutils ${libgcj}"
;;
+ i960-*-*)
+ noconfigdirs="$noconfigdirs ${libgcj} gdb"
+ ;;
ia64*-*-elf*)
# No gdb support yet.
noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb"
@@ -561,6 +564,9 @@ case "${target}" in
i[[3456789]]86-*-beos*)
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
;;
+ m32r-*-*)
+ noconfigdirs="$noconfigdirs ${libgcj} gdb"
+ ;;
m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
;;
@@ -740,24 +746,24 @@ enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e
# First scan to see if an enabled language requires some other language.
# We assume that a given config-lang.in will list all the language
# front ends it requires, even if some are required indirectly.
-for lang in ${srcdir}/gcc/*/config-lang.in ..
-do
- case $lang in
+for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
+ case ${lang_frag} in
..) ;;
# The odd quoting in the next line works around
# an apparent bug in bash 1.12 on linux.
${srcdir}/gcc/[[*]]/config-lang.in) ;;
*)
- lang_alias=`sed -n -e 's,^language=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^language=\([[^ ]]*\).*$,\1,p' $lang`
- this_lang_requires=`sed -n -e 's,^lang_requires=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^lang_requires=\([[^ ]]*\).*$,\1,p' $lang`
- for other in $this_lang_requires
- do
+ # From the config-lang.in, get $language, $lang_requires
+ language=
+ lang_requires=
+ . ${lang_frag}
+ for other in ${lang_requires} ; do
case ,${enable_languages}, in
*,$other,*) ;;
*,all,*) ;;
- *,$lang_alias,*)
- echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2
- enable_languages="$enable_languages,$other"
+ *,$language,*)
+ echo " \`$other' language required by \`$language'; enabling" 1>&2
+ enable_languages="${enable_languages},${other}"
;;
esac
done
@@ -765,35 +771,57 @@ do
esac
done
-subdirs=
-for lang in ${srcdir}/gcc/*/config-lang.in ..
-do
- case $lang in
+# By default, only C is a stage 1 language.
+stage1_languages=c
+AC_SUBST(stage1_languages)
+
+for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
+ case ${lang_frag} in
..) ;;
# The odd quoting in the next line works around
# an apparent bug in bash 1.12 on linux.
${srcdir}/gcc/[[*]]/config-lang.in) ;;
*)
- lang_alias=`sed -n -e 's,^language=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^language=\([[^ ]]*\).*$,\1,p' $lang`
- this_lang_libs=`sed -n -e 's,^target_libs=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^target_libs=\([[^ ]]*\).*$,\1,p' $lang`
- this_lang_dirs=`sed -n -e 's,^lang_dirs=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^lang_dirs=\([[^ ]]*\).*$,\1,p' $lang`
- build_by_default=`sed -n -e 's,^build_by_default=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^build_by_default=\([[^ ]]*\).*$,\1,p' $lang`
- if test "x$lang_alias" = x
- then
- echo "$lang doesn't set \$language." 1>&2
+ # From the config-lang.in, get $language, $target_libs,
+ # $lang_dirs, $boot_language, and $build_by_default
+ language=
+ target_libs=
+ lang_dirs=
+ boot_language=
+ build_by_default=
+ . ${lang_frag}
+ if test "x$language" = x ; then
+ echo "${lang_frag} doesn't set \$language." 1>&2
exit 1
fi
- case ${build_by_default},${enable_languages}, in
- *,$lang_alias,*) add_this_lang=yes ;;
- no,*) add_this_lang=no ;;
- *,all,*) add_this_lang=yes ;;
+ case ,${enable_languages}, in
+ *,${language},*)
+ # Language was explicitly selected; include it.
+ add_this_lang=yes
+ ;;
+ *,all,*)
+ # 'all' was selected; include 'default' languages.
+ case ${build_by_default} in
+ no) add_this_lang=no ;;
+ *) add_this_lang=yes ;;
+ esac
+ ;;
*) add_this_lang=no ;;
esac
- if test x"${add_this_lang}" = xyes; then
- eval target_libs='"$target_libs "'\"$this_lang_libs\"
- else
- eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\"
- fi
+ case ${add_this_lang} in
+ yes)
+ case ${boot_language} in
+ yes)
+ # Add to (space-separated) list of stage 1 languages.
+ stage1_languages="${stage1_languages} ${language}"
+ ;;
+ esac
+ ;;
+ no)
+ # Remove language-dependent dirs.
+ eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\"
+ ;;
+ esac
;;
esac
done
@@ -1899,7 +1927,7 @@ fi
GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)'
# Don't use libstdc++-v3's flags to configure/build itself.
-libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
+libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
raw_libstdcxx_flags=' -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
if test "x${CXX_FOR_TARGET+set}" = xset; then
@@ -2085,10 +2113,6 @@ case $build in
esac
AC_SUBST(stage1_cflags)
-# FIXME: This needs to be done much better. Sadly, that's hairy.
-stage1_languages="c ada"
-AC_SUBST(stage1_languages)
-
# Enable -Werror in bootstrap stage2 and later.
# Change the default to "no" on release branches.
AC_ARG_ENABLE(werror,
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 679071ba689..19e92ad4f12 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,9 @@
+2003-06-13 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * gcc_update (files_and_dependencies): Add
+ gcc/testsuite/gcc.dg/cpp/_Pragma3.c depends on
+ gcc/testsuite/gcc.dg/cpp/mi1c.h.
+
2003-05-23 Nathanael Nerode <neroden@gcc.gnu.org>
* paranoia.cc: Fix spelling error.
diff --git a/contrib/gcc_update b/contrib/gcc_update
index a11660e831e..968ed18d5e7 100755
--- a/contrib/gcc_update
+++ b/contrib/gcc_update
@@ -85,6 +85,9 @@ gcc/ada/gnat_ug_unx.texi: gcc/ada/gnat_ug.texi gcc/ada/xgnatug.adb gcc/ada/ug_wo
gcc/ada/gnat_ug_vms.texi: gcc/ada/gnat_ug.texi gcc/ada/xgnatug.adb gcc/ada/ug_words
gcc/ada/gnat_ug_vxw.texi: gcc/ada/gnat_ug.texi gcc/ada/xgnatug.adb gcc/ada/ug_words
gcc/ada/gnat_ug_w32.texi: gcc/ada/gnat_ug.texi gcc/ada/xgnatug.adb gcc/ada/ug_words
+# testsuite
+# Without this, _Pragma3.c can have a false negative.
+gcc/testsuite/gcc.dg/cpp/_Pragma3.c: gcc/testsuite/gcc.dg/cpp/mi1c.h
# And libraries, at last
libf2c/configure: libf2c/configure.in
libf2c/libF77/configure: libf2c/libF77/configure.in
diff --git a/contrib/reghunt/ChangeLog b/contrib/reghunt/ChangeLog
index 3b4b78f8b7f..33ba2c7a540 100644
--- a/contrib/reghunt/ChangeLog
+++ b/contrib/reghunt/ChangeLog
@@ -1,5 +1,10 @@
-2003-03-27 Janis Johnson <janis187@us.ibm.com>
+2003-06-24 Janis Johnson <janis187@us.ibm.com>
+ * reg_search: Replace existing uses of DATE with MADE_DATE and
+ use DATE for the date command.
+ * reg_periodic: Ditto.
+
+2003-03-27 Janis Johnson <janis187@us.ibm.com>
* README: New file.
* reg_search: New file.
* reg_periodic: New file.
diff --git a/contrib/reghunt/reg_periodic b/contrib/reghunt/reg_periodic
index 57b86d349ce..4d46cf78d38 100755
--- a/contrib/reghunt/reg_periodic
+++ b/contrib/reghunt/reg_periodic
@@ -55,7 +55,7 @@ msg() {
if [ "x${DATE_IN_MSG}" = "x" ]; then
echo "${2}"
else
- echo "`date` ${2}"
+ echo "`${DATE}` ${2}"
fi
}
@@ -70,7 +70,7 @@ error() {
# control tools and report to the user.
make_date() {
- MADE_DATE="`date -u +\"%Y-%m-%d %H:%M %Z\" --date \"1970-01-01 00:00:${1}\"`" \
+ MADE_DATE="`${DATE} -u +\"%Y-%m-%d %H:%M %Z\" --date \"1970-01-01 00:00:${1}\"`" \
|| error "make_date: date command failed"
}
@@ -79,25 +79,32 @@ make_date() {
# testing; the first one needs it, the others can ignore it if they want.
process_date() {
- DATE="${1}"
+ TEST_DATE="${1}"
- ${REG_UPDATE} "${DATE}"
+ ${REG_UPDATE} "${TEST_DATE}"
if [ $? -ne 0 ]; then
- msg 0 "source update failed for ${DATE}"
+ msg 0 "source update failed for ${TEST_DATE}"
return
fi
- ${REG_BUILD} "${DATE}"
+ ${REG_BUILD} "${TEST_DATE}"
if [ $? -ne 0 ]; then
- msg 0 "build failed for ${DATE}"
+ msg 0 "build failed for ${TEST_DATE}"
return
fi
- ${REG_TEST} "${DATE}"
+ ${REG_TEST} "${TEST_DATE}"
}
########################################################################
# Main program (so to speak)
########################################################################
+# If DATE isn't defined, use the default date command; the configuration
+# file can override this.
+
+if [ "x${DATE}" = "x" ]; then
+ DATE=date
+fi
+
# Process the configuration file.
if [ $# -ne 1 ]; then
@@ -135,9 +142,9 @@ msg 2 "VERBOSITY = ${VERBOSITY}"
# Change the dates into seconds since the epoch. This uses an extension
# in GNU date.
-LOW_DATE=`date +%s --date "${LOW_DATE}"` || \
+LOW_DATE=`${DATE} +%s --date "${LOW_DATE}"` || \
error "date command failed for \"${LOW_DATE}\""
-HIGH_DATE=`date +%s --date "${HIGH_DATE}"` || \
+HIGH_DATE=`${DATE} +%s --date "${HIGH_DATE}"` || \
error "date command failed for \"${LOW_DATE}\""
# Process each date in the range.
diff --git a/contrib/reghunt/reg_search b/contrib/reghunt/reg_search
index 1ca0a5d6517..9452dda8f5f 100755
--- a/contrib/reghunt/reg_search
+++ b/contrib/reghunt/reg_search
@@ -75,7 +75,7 @@ msg() {
if [ "x${DATE_IN_MSG}" = "x" ]; then
echo "${2}"
else
- echo "`date` ${2}"
+ echo "`${DATE}` ${2}"
fi
}
@@ -96,7 +96,7 @@ error() {
# control tools and report to the user.
make_date() {
- MADE_DATE="`date -u +\"%Y-%m-%d %H:%M %Z\" --date \"1970-01-01 00:00:${1}\"`" \
+ MADE_DATE="`${DATE} -u +\"%Y-%m-%d %H:%M %Z\" --date \"1970-01-01 00:00:${1}\"`" \
|| error "make_date: date command failed"
}
@@ -105,15 +105,15 @@ make_date() {
# testing; the first one needs it, the others can ignore it if they want.
process_date() {
- DATE="${1}"
+ TEST_DATE="${1}"
- ${REG_UPDATE} "${DATE}" || error "source update failed for ${DATE}"
+ ${REG_UPDATE} "${TEST_DATE}" || error "source update failed for ${TEST_DATE}"
# If we're already in a valid range, skip this date if there are no
# differences from either end of the range and adjust LATER.
if [ ${VALID_RANGE} = 1 ]; then
- ${HAS_CHANGES} "${DATE}" "${LATER_THAN}" "${EARLIER_THAN}"
+ ${HAS_CHANGES} "${TEST_DATE}" "${LATER_THAN}" "${EARLIER_THAN}"
RET=$?
case ${RET} in
0) ;;
@@ -123,8 +123,8 @@ process_date() {
esac
fi
- ${REG_BUILD} "${DATE}" || error "build failed for ${DATE}"
- ${REG_TEST} "${DATE}"
+ ${REG_BUILD} "${TEST_DATE}" || error "build failed for ${TEST_DATE}"
+ ${REG_TEST} "${TEST_DATE}"
LATER=$?
}
@@ -149,21 +149,21 @@ search_dates() {
while [ ${DIFF} -ge ${DELTA} ]; do
make_date ${MID}
- DATE="${MADE_DATE}"
+ TEST_DATE="${MADE_DATE}"
# Test it.
- process_date "${DATE}"
+ process_date "${TEST_DATE}"
# Narrow the search based on the outcome of testing DATE.
if [ ${LATER} -eq 1 ]; then
- msg 1 "search dates later than \"${DATE}\""
- LATER_THAN="${DATE}"
+ msg 1 "search dates later than \"${TEST_DATE}\""
+ LATER_THAN="${TEST_DATE}"
let LOW=MID
else
- msg 1 "search dates earlier than \"${DATE}\""
- EARLIER_THAN="${DATE}"
+ msg 1 "search dates earlier than \"${TEST_DATE}\""
+ EARLIER_THAN="${TEST_DATE}"
let HIGH=MID
fi
@@ -176,6 +176,13 @@ search_dates() {
# Main program (so to speak)
########################################################################
+# If DATE isn't defined, use the default date command; the configuration
+# file can override this.
+
+if [ "x${DATE}" = "x" ]; then
+ DATE=date
+fi
+
# The error function uses this.
VALID_RANGE=0
@@ -228,15 +235,15 @@ test ${DELTA} -lt 120 && \
# Change the dates into seconds since the epoch. This uses an extension
# in GNU date.
-LOW_DATE=`date +%s --date "${LOW_DATE}"` || \
+LOW_DATE=`${DATE} +%s --date "${LOW_DATE}"` || \
error "date command failed for \"${LOW_DATE}\""
-HIGH_DATE=`date +%s --date "${HIGH_DATE}"` || \
+HIGH_DATE=`${DATE} +%s --date "${HIGH_DATE}"` || \
error "date command failed for \"${LOW_DATE}\""
# If FIRST_MID was defined, convert it and make sure it's in the range.
if [ "x${FIRST_MID}" != "x" ]; then
- FIRST_MID=`date +%s --date "${FIRST_MID}"` || \
+ FIRST_MID=`${DATE} +%s --date "${FIRST_MID}"` || \
error "date command failed for \"${FIRST_MID}\""
test ${FIRST_MID} -le ${LOW_DATE} && \
error "FIRST_MID date is earlier than LOW_DATE"
diff --git a/fastjar/ChangeLog b/fastjar/ChangeLog
index 1217352e89a..4536ae73302 100644
--- a/fastjar/ChangeLog
+++ b/fastjar/ChangeLog
@@ -1,3 +1,12 @@
+2003-06-15 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ PR java/9532
+ * jartool.c (main) Give proper error messages with -C, and
+ check for missing arguments properly. Send error messages
+ to stderr.
+ * jartool.c (add_to_jar): Make getcwd() call portable,
+ and check for error return.
+
2003-03-30 Joseph S. Myers <jsm@polyomino.org.uk>
* fastjar.texi: Remove @ at start of file.
diff --git a/fastjar/jartool.c b/fastjar/jartool.c
index aacf765f21d..31323d114b7 100644
--- a/fastjar/jartool.c
+++ b/fastjar/jartool.c
@@ -507,15 +507,19 @@ int main(int argc, char **argv){
if(!strcmp(arg, "-C")){
const char *dir_to_change = get_next_arg ();
const char *file_to_add = get_next_arg ();
- if(!dir_to_change
- || !file_to_add
- || add_to_jar(jarfd, dir_to_change, file_to_add)){
- printf("Error adding %s to jar archive!\n", arg);
+ if (!dir_to_change || !file_to_add) {
+ fprintf(stderr, "Error: missing argument for -C.\n");
+ exit(1);
+ }
+ if (add_to_jar(jarfd, dir_to_change, file_to_add)) {
+ fprintf(stderr,
+ "Error adding %s (in directory %s) to jar archive!\n",
+ file_to_add, dir_to_change);
exit(1);
}
} else {
if(add_to_jar(jarfd, NULL, arg)){
- printf("Error adding %s to jar archive!\n", arg);
+ fprintf(stderr, "Error adding %s to jar archive!\n", arg);
exit(1);
}
}
@@ -817,8 +821,8 @@ int add_to_jar(int fd, const char *new_dir, const char *file){
struct dirent *de;
zipentry *ze;
int stat_return;
- char *old_dir = NULL;
-
+ char old_dir[MAXPATHLEN];
+
/* This is a quick compatibility fix -- Simon Weijgers <simon@weijgers.com>
* It fixes this:
* "normal" jar : org/apache/java/io/LogRecord.class
@@ -830,10 +834,12 @@ int add_to_jar(int fd, const char *new_dir, const char *file){
file+=2;
/* If new_dir isn't null, we need to change to that directory. However,
- we also need to return to the old directory when we're done */
+ we also need to return to the old directory when we're done. See below.*/
if(new_dir != NULL){
- old_dir = getcwd(NULL, 0);
-
+ if (getcwd(old_dir, MAXPATHLEN) == NULL) {
+ perror("getcwd");
+ return 1;
+ }
if(chdir(new_dir) == -1){
perror(new_dir);
return 1;
@@ -957,11 +963,13 @@ int add_to_jar(int fd, const char *new_dir, const char *file){
fprintf(stderr, "Illegal file specified: %s\n", file);
}
- if(old_dir != NULL){
- if(chdir(old_dir))
+ /* If (and only if!) new_dir != NULL, we switched directories, so
+ we have to switch back to the old directory. */
+ if (new_dir != NULL) {
+ if (chdir(old_dir) == -1) {
perror(old_dir);
-
- free(old_dir);
+ return 1;
+ }
}
return 0;
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3b0e24a66fc..9d71ea635e6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,2017 @@
+2003-06-27 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (function_arg): Don't pass small aggregates
+ in floating point registers. Validate that we don't receive complex
+ values here. Use #elif.
+ (return_in_memory, function_value): New.
+ (alpha_va_arg): Handle complex values as two arguments.
+ * config/alpha/alpha.h (RETURN_IN_MEMORY): Use return_in_memory.
+ (FUNCTION_VALUE, LIBCALL_VALUE): Use function_value.
+ (SPLIT_COMPLEX_ARGS): New.
+ * config/alpha/alpha-protos.h: Update.
+
+2003-06-27 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * ggc-page.c (inverse_table): Change type of mult to size_t.
+ (compute_inverse): Compute inverse using size_t, not unsigned int.
+ Compute inverse also for sizes larger than half a machine page.
+
+Fri Jun 27 18:36:12 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * toplev.c (rest_of_decl_compilation): Only varpoolize argument
+ when called before cgraph_optimize.
+
+2003-06-27 Zack Weinberg <zack@codesourcery.com>
+
+ * config/darwin.h, config/elfos.h, config/i960/i960-coff.h
+ * config/m68k/coff.h: ASM_FILE_START_FILE_DIRECTIVE should
+ be TARGET_ASM_FILE_START_FILE_DIRECTIVE.
+
+Fri Jun 27 17:41:16 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (cgraph_node, cgraph_varpool_node): Avoid re-initializing
+ of known_decls.
+
+2003-06-27 Hans-Peter Nilsson <hp@axis.com>
+
+ * defaults.h (REGISTER_MOVE_COST): Define default here.
+ * regclass.c: Don't define default REGISTER_MOVE_COST here.
+ * reload.c, reload1.c: Ditto.
+
+2003-06-27 Richard Earnshaw <rearnsha@arm.com>
+
+ * flags.h: Really install previous change.
+
+2003-06-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * rtl.h (emit_note): Remove FILE parameter.
+ * emit-rtl.c (emit_line_note): Adjust emit_note call.
+ (emit_note): Remove FILE parameter. Adjust.
+ * builtins.c (expand_builtin_expect): Adjust emit_note call.
+ * c-semantics.c (genrtl_scope_stmt): Likewise.
+ (expand_stmt): Likewise.
+ * cfglayout.c (reemit_insn_block_notes): Likewise.
+ (duplicate_insn_chain): Likewise.
+ * except.c (expand_eh_region_start, expand_eh_region_end,
+ sjlj_emit_function_enter): Likewise.
+ * explow.c (probe_stack_range): Likewise.
+ * expr.c (emit_block_move_via_loop): Likewise.
+ * function.c (init_function_start, expand_function_start,
+ expand_function_end, thread_prologue_and_epilogue_insns): Likewise.
+ * integrate.c (expand_inline_function, copy_insn_list): Likewise.
+ * reg-stack.c (compensate_edge): Likewise.
+ * reload1.c (reload): Likewise.
+ * rtlanal.c (hoist_insn_to_edge): Likewise.
+ * stmt.c (expand_fixup, expand_start_loop, expand_start_null_loop,
+ expand_loop_continue_here, expand_end_loop, expand_continue_loop,
+ expand_exit_loop_top_cond, expand_value_return,
+ expand_start_bindings_and_block, expand_end_bindings,
+ expand_decl_cleanup, expand_start_case): Likewise.
+ * unroll.c (copy_loop_body
+ * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Likewise.
+ * config/ia64/ia64.c (ia64_output_mi_thunk): Likewise.
+ * config/rs6000/rs6000.c (rs6000_emit_eh_toc_restore,
+ rs6000_emit_allocate_stack, rs6000_output_function_prologue,
+ rs6000_output_function_epilogue, rs6000_output_mi_thunk): Likewise.
+ * config/sh/sh.c (sh_output_mi_thunk): Likewise.
+ * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
+
+2003-06-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * c-tree.h (grokfield): Remove unused filename and line parameters.
+ * c-decl.c (grokfield): Remove unused filename and line parameters.
+ * c-parse.in (component_decl): Adjust field grokking rules, adjust
+ grokfield calls.
+ (component_declarator): Likewise.
+ (component_notype_declarator): Likewise.
+ * objc/objc-act.c (build_module_descriptor): Adjust grokfield
+ calls.
+ (build_protocol_template, build_method_prototype_list_template,
+ build_method_prototype_template, build_category_template,
+ build_selector_template, build_class_template,
+ build_super_template, build_ivar_template,
+ build_ivar_list_template, build_method_list_template,
+ build_method_template, add_instance_variable): Likewise.
+
+2003-06-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * stmt.c (do_jump_if_equal): Return 0 earlier if OP1 and
+ OP2 are known to be not equivalent.
+
+2003-06-26 Devang Patel <dpatel@apple.com>
+
+ * final.c (debug_flush_symbol_queue): New function.
+ (debug_queue_symbol): New function.
+ (debug_free_queue): New function.
+ (debug_nesting): New variable.
+ (symbol_queue): New variable.
+ (symbol_queue_index): Same.
+ (symbol_queue_size): Same.
+ * debug.h (debug_flush_symbol_queue): New.
+ (debug_queue_symbol): New.
+ (debug_free_queue): New.
+ (debug_nesting): New.
+ (symbol_queue_index): New.
+ * dbxout.c (DBXOUT_DECR_NESTING): New macro.
+ (DBXOUT_DECR_NESTING_AND_RETURN): New macro.
+ (dbxout_init): Delay symbol output.
+ (dbxout_global_decl): Save, set and reset TREE_USED bit around
+ dbxout_symbol() call.
+ (dbxout_begin_function): Same.
+ (dbxout_finish): Free symbol queue.
+ (dbxout_type): Put appropriate symbols in queue.
+ (dbxout_symbol): Put info for symbol's type in queue.
+ Decrement/Increment nesting counts flush symbol queue appropriately.
+ (dbxout_parms): Increment dbxout nesting.
+ (dbxout_reg_parms): Same.
+ * flags.h (flag_debug_only_used_symbols): New.
+ * toplev.c (flag_debug_only_used_symbols): New variable.
+ (lang_independent_options): Add entries for new option
+ -feliminate-unused-debug-symbols.
+ * common.opt: Add entry for -feliminate-unused-debug-symbols.
+ * opts.c (common_handle_options): Same.
+ * config/rs6000/darwin.h (CC1_SPEC): Interpret -gused as
+ -feliminate-unused-debug-symbols.
+ * doc/invoke.texi (Debugging Options): Document
+ -feliminate-unused-debug-symbols.
+
+2003-06-26 Roger Sayle <roger@eyesopen.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ * builtins.c (expand_builtin_sprintf): Use c_getstr and strlen to
+ obtain the format string instead of using TREE_STRING_POINTER and
+ TREE_STRING_LENGTH. Only optimize sprintf(dst,"%s",src) when the
+ return value is unused or the length of src is a known constant.
+
+2003-06-26 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.h (REGISTER_NAMES): R0 is really AP.
+
+2003-06-26 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.c (ia64_expand_call): Don't add ar.pfs for sibcalls.
+ (ia64_split_call): Only load descriptor for GP register inputs.
+ (ia64_expand_epilogue): Check current_frame_info.mask not
+ current_function_is_leaf to restore ar.pfs.
+
+2003-06-26 Richard Henderson <rth@redhat.com>
+
+ * emit-rtl.c (try_split): Append to new CALL_INSN_FUNCTION_USAGE
+ instead of replacing it.
+
+2003-06-26 Richard Henderson <rth@redhat.com>
+
+ * flow.c (propagate_one_insn): Kill function return value
+ registers across tail calls.
+
+ * flow.c (propagate_one_insn): Preserve live-at-end registers
+ across tail calls.
+
+2003-06-26 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * reload.c (can_reload_into): New function.
+ (push_reload): Use it.
+
+2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (compute_a_rotate_length): Fix the
+ references to the amount of a rotation.
+
+2003-06-26 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/sh/coff.h: Don't include dbxcoff.h.
+ * config.gcc: List it here.
+
+2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * postreload.c (reload_cse_simplify_set): Call cselib_lookup
+ earlier. Don't check if SRC is a constant.
+
+2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * Makefile.in (OBJS): Add postreload.o.
+ Remove cselib.h from the dependency list for reload1.o.
+ Add a dependency list for postreload.o.
+ * reload.h: Change the comment for the prototype of
+ reload_cse_regs.
+ * reload1.c: Don't include cselib.h.
+ (reload_cse_regs): Move to postreload.c
+ (reload_cse_regs_1): Likewise.
+ (reload_cse_noop_set_p): Likewise.
+ (reload_cse_simplify_set): Likewise.
+ (reload_cse_simplify_operands): Likewise.
+ (RELOAD_COMBINE_MAX_USES): Likewise.
+ (reload_combine_ruid): Likewise.
+ (LABEL_LIVE): Likewise.
+ (reload_combine): Likewise.
+ (reload_combine_note_use): Likewise.
+ (reload_combine_note_store): Likewise.
+ (reg_set_luid): Likewise.
+ (reg_offset): Likewise.
+ (reg_base_reg): Likewise.
+ (reg_mode): Likewise.
+ (move2add_luid): Likewise.
+ (move2add_last_label_luid): Likewise.
+ (MODES_OK_FOR_MOVE2ADD): Likewise.
+ (reload_cse_move2add): Likewise.
+ (move2add_note_store): Likewise.
+ (reload_cse_simplify): Likewise.
+ * postreload.c: New.
+
+2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/avr/avr.c (final_prescan_insn): Remove support for
+ -mrtl.
+ * config/avr/avr.h (MASK_RTL_DUMP): Remove.
+ (TARGET_RTL_DUMP): Likewise.
+ (TARGET_SWITCHES): Remove -mrtl.
+
+2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Change emit_a_rotate to
+ output_a_rotate. Add a prototype for compute_a_rotate_length.
+ * config/h8300/h8300.c (emit_a_rotate): Change to
+ output_a_rotate.
+ (compute_a_rotate_length): New.
+ (h8300_adjust_insn_length): Remove.
+ * config/h8300/h8300.h (ADJUST_INSN_LENGTH): Remove.
+ * config/h8300/h8300.md (adjust_length): Remove.
+ (*rotlqi3_1): Use output_a_rotate and compute_a_rotate_length.
+ (*rotlhi3_1): Likewise.
+ (*rotlsi3_1): Likewise.
+
+2003-06-26 Roger Sayle <roger@eyesopen.com>
+ Richard Henderson <rth@redhat.com>
+
+ * builtins.c (expand_builtin_mathfn): Always stabilize the argument
+ list against re-evaluation. If expand_unop fails, call expand_call
+ with the stabilized argument list rather than return NULL_RTX.
+ (expand_builtin_mathfn2): Likewise, always stabilize the argument
+ list, and call expand_call ourselves if expand_binop fails.
+
+2003-06-26 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/11210
+ * fold-const (decode_field_reference): Strip only NOPs that
+ don't affect the sign.
+
+2003-06-26 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
+
+ * gcc/config/sh/sh.md (push_fpscr): Enable for TARGET_SH2E.
+ (pop_fpscr, fpu_switch): Likewise.
+
+2003-06-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * value-prof.c: New.
+ * value-prof.h: New.
+ * Makefile.in (value-prof.o): New.
+ (LIBGCOV): Add _gcov_merge_single and _gcov_merge_delta
+ (profile.o): Add value-prof.h and tree.h dependency.
+ * flags.h (flag_profile_values): Declare.
+ * gcov-io.h (GCOV_COUNTERS, GCOV_COUNTER_NAMES, GCOV_MERGE_FUNCTIONS):
+ Add new counters.
+ (GCOV_COUNTER_V_INTERVAL, GCOV_COUNTER_V_POW2, GCOV_COUNTER_V_SINGLE,
+ GCOV_COUNTER_V_DELTA): New counter sections.
+ (__gcov_merge_single, __gcov_merge_delta): Declare.
+ * flow.c (mark_used_regs): Set subregs_of_mode only when the
+ structure is initialized.
+ * libgcov.c (__gcov_merge_single, __gcov_merge_delta): New functions.
+ * profile.c: Include value-prof.h and tree.h.
+ (gen_interval_profiler, gen_pow2_profiler, gen_one_value_profiler,
+ gen_const_delta_profiler, instrument_values): New static functions.
+ (get_exec_counts): Fix comment.
+ (branch_prob): Invoke instrument_values.
+ * toplev.c (flag_profile_values): New flag.
+ * doc/invoke.texi (-fprofile-values): Document.
+
+2003-06-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * Makefile.in (cfgrtl.o): Add expr.h dependency.
+ * cfgrtl.c: Include expr.h.
+ (mark_killed_regs, safe_insert_insn_on_edge): New
+ functions.
+ * config/i386/i386.h (AVOID_CCMODE_COPIES): Define.
+ * basic-block.h (safe_insert_insn_on_edge): Declare.
+
+2003-06-26 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-opts.c (missing_arg): Make non-static.
+ (c_common_handle_option): Don't check for missing arguments.
+ * opts.c (handle_option): Check for missing arguments.
+
+2003-06-26 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/power4.md (power4-veccomplex): Correct latency.
+
+2003-06-25 Loren James Rittle <ljrittle@acm.org>
+
+ * configure.in (ld_vers): Portability [sed].
+ * configure: Regenerate with autoconf213.
+
+2003-06-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ * doc/extend.texi: Document new builtin functions for Intel
+ Prescott New Intrunctions.
+
+ * doc/invoke.texi: Document new command-line options, -mpni and
+ -mno-pni, for Intel Prescott New Intrunctions.
+
+ * config.gcc (extra_headers): Add pmmintrin.h for i[34567]86-*-*.
+
+ * config/i386/i386.c (override_options): Turn on MASK_SSE2
+ for -mpni. Turn on MASK_SSE for -msse2.
+ (bdesc_2arg): Add PNI builtins with 2 args.
+ (bdesc_1arg): Add PNI builtins with 1 arg.
+ (ix86_init_mmx_sse_builtins): Handle PNI builtins.
+ (ix86_expand_builtin): Likewise.
+
+ * config/i386/i386.h (MASK_3DNOW, MASK_3DNOW_A,
+ MASK_128BIT_LONG_DOUBLE, MASK_64BIT, MASK_MS_BITFIELD_LAYOUT,
+ MASK_TLS_DIRECT_SEG_REFS): Renumbered.
+ (TARGET_PNI): New.
+ (TARGET_SWITCHES): Don't enable MASK_SSE for -msse2 here. Add
+ -mpni and -mno-pni.
+ (TARGET_CPU_CPP_BUILTINS): Defined __PNI__ for PNI.
+ (ix86_builtins): Add PNI builtins.
+ (config/i386/i386.md): Add PNI patterns.
+
+ * config/i386/pmmintrin.h: New file.
+
+2003-06-25 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (call): Fix the insn lengths.
+ (call_value): Likewise.
+
+Thu Jun 26 00:13:35 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * c-common.c (handle_used_attribute): Use mark_referenced.
+ * varasm.c (mark_referenced): Break out from ...
+ (assemble_name): ... here.
+ * tree.h (mark_referenced): Declare.
+
+2003-06-25 Wolfgang Bangerth <bangerth@dealii.org>
+
+ * gccbug.in: Add PCH to list of categories.
+
+2003-06-25 Martin Schaffner <schaffner@gmx.li>
+
+ * cppfiles.c: Clarify comments.
+ * cpphash.h: Likewise.
+ * cpplib.h: Likewise.
+ * cppmacro.c: Likewise.
+ * mkdeps.h: Likewise.
+
+2003-06-25 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-opts.c (complain_wrong_lang, write_langs): Remove.
+ (c_common_handle_option): Complaints about wrong language are
+ handled in opts.c now.
+ * opts.c (complain_wrong_lang, write_langs, handle_options): New.
+ (find_opt): Fix thinko.
+ (handle_option): Update prototype. Complain about switches for
+ a different front end.
+ * opts.h (lang_names, handle_options): New.
+ (handle_option): Remove.
+ * opts.sh: Write out language names array.
+ * toplev.c (parse_options_and_default_flags): Use handle_options.
+
+2003-06-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (MASK_SSE1): Removed.
+ (MASK_SSE164): Removed.
+ (MASK_SSE264): Removed.
+ (bdesc_2arg): Replace MASK_SSE1 with MASK_SSE. Replace
+ MASK_SSE164 with MASK_SSE | MASK_64BIT. Replace MASK_SSE264
+ with MASK_SSE2 | MASK_64BIT.
+ (bdesc_1arg): Likewise.
+ (ix86_init_mmx_sse_builtins): Likewise.
+
+ * config/i386/i386.h (TARGET_SSE): Remove MASK_SSE2.
+ (TARGET_SWITCHES): Enable both MASK_SSE and MASK_SSE2 for
+ -msse2.
+
+2003-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * hwint.h (HOST_WIDE_INT_PRINT, HOST_WIDE_INT_PRINT_C): New macros.
+ (HOST_WIDE_INT_PRINT_DEC_SPACE,
+ HOST_WIDE_INT_PRINT_UNSIGNED_SPACE,
+ HOST_WIDEST_INT_PRINT_DEC_SPACE,
+ HOST_WIDEST_INT_PRINT_UNSIGNED_SPACE): Delete.
+ (HOST_WIDE_INT_PRINT_DEC, HOST_WIDE_INT_PRINT_DEC_C,
+ HOST_WIDE_INT_PRINT_UNSIGNED, HOST_WIDE_INT_PRINT_HEX): Define in
+ terms of HOST_WIDE_INT_PRINT and possibly HOST_WIDE_INT_PRINT_C.
+
+ * final.c (asm_fprintf): Use HOST_WIDE_INT_PRINT.
+ * ra-debug.c (dump_static_insn_cost): Likewise.
+
+2003-06-26 Nick Clifton <nickc@redhat.com>
+
+ * config/arm/arm.h (BIGGEST_FIELD_ALIGNMENT): Define instead
+ of ADJUST_FIELD_ALIGN if IN_TARGET_LIBS.
+ Replace occurances of '???' with 'XXX' incase they are
+ mistaken for trigraphs.
+ (THUMB_PRINT_OPERAND_ADDRESS): abort if a compound address
+ does not have a register for the first operand.
+
+2003-06-25 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
+
+ * config/sh/sh.c (sh_register_move_cost):
+ Add case for moving between MAC_REGS.
+
+2003-06-25 Zack Weinberg <zack@codesourcery.com>
+
+ PR 10178
+ * langhooks.h (struct lang_hooks): Add no_body_blocks bool.
+ * langhooks-def.h (LANG_HOOKS_NO_BODY_BLOCKS): New; default false.
+ * c-lang.c, objc/objc-lang.c: Override LANG_HOOKS_NO_BODY_BLOCKS
+ to true.
+ * stmt.c (is_body_block): If lang_hooks.no_body_blocks, always
+ return 0.
+
+2003-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (bt-load.o): Depend on $(TM_P_H).
+ * bt-load.c: Include "tm_p.h".
+
+2003-06-25 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (compute_mov_length): Adjust for the
+ new optimization.
+ * config/h8300/h8300.md (*movsi_h8300): Optimize the load of
+ an SImode constant whose upper and lower are the same.
+
+Wed Jun 25 11:31:59 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * varasm.c (assemble_name): Mark needed variables even when
+ global info is ready.
+
+2003-06-24 Jerry Quinn <jlquinn@optonline.net>
+
+ PR other/11280
+ * gcc/doc/invoke.texi (Optimization Options): Remove -Os from
+ -freorder-functions description.
+
+2003-06-25 Josef Zlomek <zlomekj@suse.cz>
+
+ * dwarf2out.c (gen_field_die): Return if type of decl is error mark.
+
+2003-06-25 Neil Booth <neil@daikokuya.co.uk>
+
+ * opts.c (common_handle_option): Add missing break;s.
+
+2003-06-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Add a prototype for
+ compute_mov_length.
+ * config/h8300/h8300.c (compute_mov_length): New.
+ * config/h8300/h8300.md (*movqi_h8300): Use it.
+ (*movqi_h8300hs): Likewise.
+ (movstrictqi): Likewise.
+ (*movhi_h8300): Likewise.
+ (*movhi_h8300hs): Likewise.
+ (movstricthi): Likewise.
+ (*movsi_h8300): Likewise.
+ (*movsf_h8300): Likewise.
+ (*movsi_h8300hs): Likewise.
+ (*movsf_h8300hs): Likewise.
+
+2003-06-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * jump.c (next_nondeleted_insn): Remove.
+ * rtl.h: Remove the prototype for next_nondeleted_insn.
+
+2003-06-24 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/11311
+ * builtins.c (powi_cost): Fix typo. The number of multiplications
+ required is the number to reduce the argument, result, plus the
+ cost of calculating the residual, val [not n, the original value].
+
+2003-06-24 Roger Sayle <roger@eyesopen.com>
+
+ * config/alpha/osf5.h (TARGET_C99_FUNCTIONS): Define.
+
+2003-06-24 Richard Henderson <rth@redhat.com>
+ (blame to: Loren James Rittle <ljrittle@acm.org>)
+
+ * real.h (ieee_extended_intel_96_round_53_format): New.
+ * real.c (ieee_extended_intel_96_round_53_format): New.
+ * config/i386/freebsd.h (SUBTARGET_OVERRIDE_OPTIONS): Use it
+ for XFmode and TFmode.
+
+2003-06-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (4 anonymous patterns): Give internal
+ names.
+ (movsi_h8300): Change the name to *movsi_h8300.
+ (movsi_h8300hs): Change the name to *movsi_h8300hs.
+ (movsf_h8300): Change the name to *movsf_h8300.
+ (movsf_h8300hs): Change the name to *movsf_h8300hs.
+
+2003-06-24 Jakub Jelinek <jakub@redhat.com>
+
+ * builtins.c (expand_builtin_strcpy): Don't evaluate side-effects in
+ src twice.
+
+2003-06-24 J"orn Rennecke <joern.rennecke@superh.com>
+
+ Back out these patches:
+ 2003-06-02 J"orn Rennecke <joern.rennecke@superh.com>
+ * sh.h (OLD_ARG_MODE): New macro.
+ (FUNCTION_ARG_ADVANCE, FUNCTION_ARG_PASS_BY_REFERENCE): Use it.
+ (FUNCTION_ARG_1): Break out of:
+ (FUNCTION_ARG). Use OLD_ARG_MODE.
+ 2003-06-06 J"orn Rennecke <joern.rennecke@superh.com>
+ * sh.h (FUNCTION_ARG_1): Consistently use NEW_MODE for the mode
+ of the generated register.
+
+ * sh.h (FUNCTION_ARG_SCmode_WART): Define.
+ (FUNCTION_ARG): Unless FUNCTION_ARG_SCmode_WART is defined and
+ an even number of floating point regs are in use, use the same
+ sequence of argument passing registers for SCmode as would be
+ used for two SFmode values.
+ * sh.c (sh_va_arg): If FUNCTION_ARG_SCmode_WART is defined,
+ swap real / imaginary parts in incoming SCmode values passed
+ in registers.
+
+2003-06-24 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
+
+ PR target/11260
+ * config/alpha/alpha.md (sqrtdf2): Fix operand substitution.
+
+Tue Jun 24 18:49:33 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * Makefile.in (cgraph.o): Depend on output.h, not depend on
+ tree-inline.h
+ * cgraph.c: Do not include tree-inline.h; include output.h
+ (known_fns): Rename to ...
+ (known_decls): ... this one; update all uses.
+ (cgraph_varpool_hash): New static variable.
+ (cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): New global
+ variables.
+ (cgraph_varpool_hash_node, eq_cgraph_varpool_node, cgraph_varpool_node,
+ cgraph_varpool_node_for_identifier, cgraph_varpool_mark_needed_node,
+ cgraph_varpool_finalize_decl, cgraph_varpool_assemble_pending_decls):
+ New functions.
+ * cgraph.h (cgraph_varpool_node): New structure.
+ (cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): Declare.
+ (cgraph_varpool_node, cgraph_varpool_node_for_identifier,
+ cgraph_varpool_finalize_decl, cgraph_varpool_mark_needed_node,
+ cgraph_varpool_asemble_pending_decls): Declare.
+ * cgraphunit.c (record_call_1): Notice variable references.
+ (cgraph_finalize_compilation_unit): Assemble pending variables.
+ * toplev.c (wrapup_global_declarations): Use varpool.
+ (compile_file): Assemble pending declarations.
+ (rest_of_decl_compilation): Use varpool in unit-at-a-time mode.
+ * varasm.c (assemble_name): Notice varpool references.
+
+Tue Jun 24 13:52:11 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * langhooks-def.h (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): New macro.
+ * langhooks.h (lang_hooks_for_decls): Add prepare_assemble_variable.
+ * varasm.c (assemble_variable): Call prepare_assemble_variable.
+
+2003-06-23 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (expand_builtin): Use expand_builtin_pow to expand
+ calls for pow, powf, powl and their __builtin_ variants.
+ (expand_builtin_pow): If the second argument is a constant
+ integer and compiling with -ffast-math, use expand_powi to
+ generate RTL if powi_cost is less than POWI_MAX_MULTS.
+ (powi_cost): New function to return the number of multiplications
+ necessary to evaluate an Nth power, for integer constant N.
+ (expand_powi): New function to expand the RTL for evaluating
+ the Nth power of a floating point value, for integer constant N.
+
+ * doc/tm.texi (POWI_MAX_MULTS): Document new target macro.
+
+Mon Jun 23 23:07:35 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (cgraph_nodes_queue): Declare.
+ (eq_node): Take identifier as p2.
+ (cgraph_node): Update htab_find_slot_with_hash call.
+ (cgraph_node_for_identifier): New.
+ (cgraph_mark_needed_node): Move here from cgraphunit.c.
+ * cgraph.h (cgraph_nodes_queue): Declare.
+ (cgraph_node_for_identifier): Declare.
+ * cgraphunit.c (cgraph_finalize_function): Collect entry points here
+ instead of in cgraph_finalize_compilation_unit; constructors and
+ destructors are entry points.
+ (cgraph_finalize_compilation_unit): Reorganize debug outout;
+ examine nested functions after lowerng; call collect_functions hook.
+ (cgraph_mark_local_functions): DECL_COMDAT functions are not local.
+ (cgraph_finalize_compilation_unit): Do not collect entry points.
+ * varasm.c: Include cgraph.h
+ (assemble_name): Mark referenced identifier as needed.
+
+ * cgraphunit.c (record_call_1): Use get_callee_fndecl.
+
+2003-06-23 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/i386.c (x86_output_mi_thunk): Don't pass MEM to %P0,
+ just SYMBOL_REF.
+ * config/s390/s390.c (s390_output_mi_thunk): Avoid .plt in -m31
+ mode, as it requires pic register loaded.
+
+ * varasm.c (resolve_unique_section): Remove prototype. No longer
+ static.
+ * tree.h (resolve_unique_section): New prototype.
+
+2003-06-23 Andreas Schwab <schwab@suse.de>
+
+ PR debug/9905
+ * dwarf2out.c (loc_descriptor_from_tree): Handle MODIFY_EXPR by
+ recursing through first argument.
+
+2003-06-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * ChangeLog.1: Fix a typo.
+ * cfgrtl.c: Fix comment typos.
+ * dwarf2out.c: Likewise.
+ * expmed.c: Likewise.
+ * genrecog.c: Likewise.
+ * jump.c: Likewise.
+ * rtlanal.c: Likewise.
+ * ssa-dce.c: Likewise.
+ * toplev.c: Likewise.
+
+2003-06-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/extend.texi: Fix typos.
+ * doc/md.texi: Likewise.
+ * doc/tm.texi: Likewise.
+
+2003-06-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * basic-block.h: Fix comment formatting.
+ * bt-load.c: Likewise.
+ * builtins.c: Likewise.
+ * c-common.c: Likewise.
+ * c-common.h: Likewise.
+ * c-format.c: Likewise.
+ * coverage.c: Likewise.
+ * cpplib.h: Likewise.
+ * cpppch.c: Likewise.
+ * dbxout.c: Likewise.
+ * diagnostic.c: Likewise.
+ * dwarf2out.c: Likewise.
+ * expr.c: Likewise.
+ * fold-const.c: Likewise.
+ * function.c: Likewise.
+ * gcc.c: Likewise.
+ * gcov-io.c: Likewise.
+ * gcov-io.h: Likewise.
+ * gcov.c: Likewise.
+ * profile.c: Likewise.
+ * real.h: Likewise.
+ * sched-deps.c: Likewise.
+
+2003-06-23 Roger Sayle <roger@eyesopen.com>
+ Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/contrib.texi (Contributors): Add a note on testing and
+ remove duplicates from testers list.
+
+2003-06-23 Nick Clifton <nickc@redhat.com>
+
+ * read-rtl.c (read_braced_string): Check for EOF. If
+ encountered issue an error message.
+
+2003-06-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/invoke.texi: Document dump options, dT and dW.
+
+2003-06-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * genrecog.c (pred_table): Remove the entry for
+ mode_independent_operand.
+ * recog.c (next_insns_test_no_inequality): Remove.
+ (mode_independent_operand): Likewise.
+ * recog.h: Remove the prototype for mode_independent_operand.
+
+2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (output_simode_bld): Use rotxl.l to
+ store into bit 0.
+ * config/h8300/h8300.md (*extzv_1_r_h8300hs): Change cc of the
+ second alternative to set_znv.
+ (*extzv_1_r_inv_h8300hs): Likewise.
+
+2003-06-23 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * configure.in (in_tree_gas): Find out here whether GAS is ELF,
+ set in_tree_gas_is_elf accordingly.
+ (in_tree_ld): Find out whether LD emulation is ELF, set
+ in_tree_ld_is_elf accordingly.
+ (gcc_cv_as_subsections, gcc_cv_as_hidden, gcc_cv_as_leb128)
+ (gcc_cv_as_eh_frame, gcc_cv_as_shf_merge)
+ (gcc_cv_as_dwarf2_debug_line, gcc_cv_as_gdwarf2_flag)
+ (gcc_cv_as_gstabs_flag): Use $in_tree_gas_is_elf instead of
+ grepping gas/Makefile.
+ (gcc_cv_ld_ro_rw_mix, gcc_cv_ld_eh_frame_hdr, gcc_cv_ld_pie): Use
+ $in_tree_ld_is_elf instead of grepping ld/Makefile.
+ * configure: Regenerate.
+
+2003-06-22 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (expand_builtin_mathfn_2): Use tree_cons to build
+ up the stabilized argument list, not build_tree_list.
+ (expand_builtin_strcpy): Construct new argument list manually
+ instead of using chainon to modify the original argument list.
+ (expand_builtin_stpcpy): Construct new argument list manually
+ instead of using copy_list and chainon.
+ (expand_builtin_sprintf): New function. Optimize calls to
+ sprintf when the format is "%s" or doesn't contain a '%'.
+ (expand_builtin): Expand BUILT_IN_SPRINTF using the new function
+ expand_builtin_sprintf.
+
+2003-06-22 Andreas Schwab <schwab@suse.de>
+
+ * function.c (set_insn_locators): Mark as unused.
+
+2003-06-22 Neil Booth <neil@daikokuya.co.uk>
+
+ * common.opt: Add -finline-limit.
+ * opts.c (common_handle_options): Handle it.
+ * opts.sh: Temporary kludge for -finline-limit.
+ * toplev.c (decode_f_option, independent_decode_option): Die.
+ (parse_options_and_default_flags): No independent_decode_option.
+
+2003-06-22 Andreas Jaeger <aj@suse.de>
+
+ * calls.c (emit_call_1): Readd lost ATTRIBUTE_UNUSED.
+
+2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/invoke.texi: Document dumps, .btl, .cfg, and .bypass.
+
+2003-06-22 Andreas Schwab <schwab@suse.de>
+
+ * doc/invoke.texi: Remove leading `-' from options in index.
+
+2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * bt-load.c: Follow spelling conventions.
+
+2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * expr.c (emit_move_insn_1): Fix a comment typo.
+
+2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/invoke.texi: Alphabetize dump options.
+
+2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/invoke.texi: Remove a duplicate -dk.
+
+2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/invoke.texi: Update dump file names.
+
+2003-06-22 Zack Weinberg <zack@codesourcery.com>
+
+ * config/i370/i370.c, config/i370/i370.h: Use HOST_CHARSET_ASCII
+ and HOST_CHARSET_EBCDIC, not HC_ASCII and HC_EBCDIC.
+
+2003-06-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/rtl.texi: Fix the @findex for pre_modify.
+
+2003-06-22 Andreas Jaeger <aj@suse.de>
+
+ * caller-save.c: Convert to ISO C90.
+ * calls.c: Likewise.
+ * cfg.c: Likewise.
+ * cfganal.c: Likewise.
+ * cfgbuild.c: Likewise.
+ * cfgcleanup.c: Likewise.
+ * cfghooks.c: Likewise.
+ * cfglayout.c: Likewise.
+ * cfglayout.h: Likewise.
+ * cfgloop.c: Likewise.
+ * cfgloop.h: Likewise.
+ * cfgloopanal.c: Likewise.
+ * cfgloopmainip.c: Likewise.
+ * cfgrtl.c: Likewise.
+
+2003-06-22 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.h (BIGGEST_ALIGNMENT): Use TARGET_REALLY_IWMMXT for selecting
+ 64-bit alignment.
+
+2003-06-22 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.md (all call_value patterns): Remove register constraints on
+ value operand.
+
+2003-06-22 Neil Booth <neil@daikokuya.co.uk>
+
+ * common.opt: More -f switches.
+ * opts.c (common_handle_options): Handle them.
+ * toplev.c (time_report): Make extern.
+ (f_options): USe flag_dummy.
+ (decode_f_option): No need to use f_options now.
+ * toplev.h (flag_cprop_registers, flag_ssa, flag_ssa_ccp,
+ flag_ssa_dce, time_report, flag_new_regalloc): Make extern.
+
+2003-06-22 Andreas Jaeger <aj@suse.de>
+
+ * c-lex.c: Convert to ISO C90.
+ * c-objc-common.c: Likewise.
+ * c-opts.c: Likewise.
+ * c-pch.c: Likewise.
+ * c-ppoutput.c: Likewise.
+ * c-pragma.h: Likewise.
+ * c-pretty-print.c: Likewise.
+ * c-pretty-print.h: Likewise.
+ * c-semantics.c: Likewise.
+ * c-tree.h: Likewise.
+ * c-typeck.c: Likewise.
+
+ * c-lang.c: Convert to ISO C90.
+
+2003-06-22 Neil Booth <neil@daikokuya.co.uk>
+
+ * opts.c (find_opt): Fix to always guarantee a find of a
+ switch with joined parameter.
+ * opts.h (struct cl_option): New member back_chain.
+ * opts.sh: Update to calculate and add back_chain member.
+
+2003-06-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * diagnostic.h (output_host_wide_integer): Declare.
+ * diagnostic.c (output_long_long_decicaml): New function.
+ (output_host_wide_integer): Likewise.
+ (output_format): Use them. Handle "%ll" and "%w".
+
+2003-06-21 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config.gcc (*-*-netbsd*): Add t-libgcc-pic to tmake_file.
+
+2003-06-21 Zack Weinberg <zack@codesourcery.com>
+
+ * aclocal.m4 (gcc_AC_C_CHARSET): Delete.
+ * configure.in: Don't use gcc_AC_C_CHARSET.
+ * configure, config.in: Regenerate.
+ * config/i370/i370.c, config/i370/i370.h: Use
+ (HOST_CHARSET == HC_EBCDIC) or (HOST_CHARSET == HC_ASCII)
+ instead of HOST_EBCDIC or !HOST_EBCDIC. Clarify comments a tad.
+
+2003-06-21 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in: Update.
+ * common.opt: New switches.
+ * opts.c: Include diagnostic.h.
+ (common_handle_option): Handle new switches.
+ * toplev.c (flag_loop_optimize, flag_crossjumping, flag_if_conversion,
+ flag_if_conversion2, flag_delete_null_pointer_checks,
+ flag_rerun_cse_after_loop): Make extern.
+ (flag_dummy): New.
+ (f_options): Update to use flag_dummy for moved options.
+ (decode_f_option): Some switches moved to opts.c.
+ * toplev.h (flag_loop_optimize, flag_crossjumping, flag_if_conversion,
+ flag_if_conversion2, flag_delete_null_pointer_checks,
+ flag_rerun_cse_after_loop, flag_keep_static_consts, flag_peel_loops,
+ flag_tracer, flag_thread_jumps, flag_unroll_loops,
+ flag_unroll_all_loops, flag_unswitch_loops): New.
+
+Sat Jun 21 13:41:00 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_va_arg): Fix allocation of temporary slot.
+
+2003-06-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Add a prototype for
+ same_cmp_preceding_p.
+ * config/h8300/h8300.c (same_cmp_preceding): New.
+ * config/h8300/h8300.md: Extend peephole2's that transform
+ compare:SI into shorter sequences so that they can deal with
+ signed comparisons.
+
+2003-06-21 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/contrib.texi (Contributors): Use Windows instead of Win32.
+
+ Update Andreas Jaeger's entry.
+
+ Merge the two entries of Kaveh Ghazi, David Edelsohn, and
+ Loren J. Rittle.
+
+2003-06-21 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * mkconfig.sh: Add multiple inclusion guards to generated headers.
+
+2003-06-20 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-decl.c (store_parm_decls): Make saved_warn_shadow boolean.
+ * common.opt: Add remaining -W options and -g.
+ * diagnostic.c (warnings_are_errors): Remove.
+ * flags.h: Make most warning flags boolean.
+ * opts.c (common_handle_option): Handle remaining -W options, and -g.
+ Move many warning flags from toplev.c, making them boolean.
+ * toplev.c: Remove many warning flags.
+ (decode_W_option): Remove.
+ (decode_g_option): Make extern. Error on unknown switch.
+ (lang_independent_W_options): Use warn_dummy.
+ (independent_decode_option): Just handle -f switches now.
+ * toplev.h (decode_g_option): New.
+
+2003-06-20 Aldy Hernandez <aldyh@redhat.com>
+
+ PR/11092
+ * config/rs6000/rs6000.h (LEGITIMATE_CONSTANT_P): Adjust for
+ vectors.
+
+2003-06-20 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * opts.sh: Tweak awk script for portability.
+
+2003-06-20 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10888
+ * tree-inline.c (expand_call_inline): Do not warn about failing to
+ inline functions declared in system headers.
+ * doc/invoke.texi (-Winline): Expand on documentation.
+
+2003-06-20 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (alpha_file_start): Disable
+ file_start_file_directive for ELF and not MDEBUG.
+
+2003-06-20 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (ROUND_TYPE_ALIGN): Remove.
+
+2003-06-20 Richard Henderson <rth@redhat.com>
+
+ * hooks.c (hook_int_void_no_regs): Rename from
+ hook_reg_class_void_no_regs; change return type.
+ * hooks.h: Update.
+ * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Update.
+ * target.h (branch_target_register_class): Change return type to int.
+ Add documentation.
+ * config/sh/sh.c (sh_target_reg_class): Change return type.
+ * doc/tm.texi (TARGET_BRANCH_TARGET_REGISTER_CLASS): Likewise.
+
+2003-06-20 Andreas Tobler <toa@pop.agri.ch>
+
+ * c-format.c: Change _Bool to bool reverting part of the last
+ patch.
+
+2003-06-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * som.h (ASM_OUTPUT_SOURCE_LINE): Use targetm.strip_name_encoding to
+ strip name encoding.
+
+2003-06-20 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in (gcc_cv_as_gstabs_flag): Disable if assembler warns.
+ * configure: Regenerate.
+ Fixes PR driver/9362.
+
+2003-06-20 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * config/alpha/alpha.c (alpha_file_start): Fix typo.
+
+2003-06-20 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/mips/mips.h (PUT_SDB_FUNCTION_END): Pass 0 as third arg
+ to ASM_OUTPUT_SOURCE_LINE.
+
+2003-06-20 Daniel Egger <degger@fhm.edu>
+ Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Building): Correct and improve statement
+ about parallel builds.
+
+2003-06-20 Andreas Jaeger <aj@suse.de>
+
+ * c-common.c: Change _Bool to bool reverting part of the last
+ patch.
+
+2003-06-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ * tree.h (expand_function_end): Remove all parameters.
+ * function.c (expand_function_end): Remove all parameters.
+ Use input_location. Never expand_end_bindings.
+ * c-decl.c (c_expand_body_1): Adjust expand_function_end call.
+ * coverage.c (create_coverage): Likewise.
+
+2003-06-20 Nick Clifton <nickc@redhat.com>
+
+ * doc/extend.texi (ARM Built-in Functions): New node. Document
+ ARM builtin functions for iWMMXt support.
+
+2003-06-20 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * doc/install.texi (--with-gnu-as): Mention SPARC/Solaris and
+ SPARC64/Solaris as platforms where --with-gnu-as makes a difference.
+ (--with-as): Add @anchor.
+ (--with-gnu-ld): Fix typo.
+ (--with-ld): Add @uref to --with-as.
+
+2003-06-19 Zack Weinberg <zack@codesourcery.com>
+
+ * doc/tm.texi: Uniformly use @defmac for macros, rather than
+ @table items. Minor formatting and editorial corrections.
+
+2003-06-20 Neil Booth <neil@daikokuya.co.uk>
+
+ * line-map.c, line-map.h: Convert to ISO prototypes.
+
+2003-06-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * gcse.c (store_killed_in_insn): Fix.
+
+2003-06-19 Zack Weinberg <zack@codesourcery.com>
+
+ * target.h (asm_out.file_start, file_start_app_off,
+ file_start_file_directive): New hooks.
+ * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE,
+ TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START):
+ New hook-definition macros.
+ * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START.
+ * varasm.c (default_file_start): New.
+ * output.h: Prototype it.
+ * toplev.c (init_asm_output): Use targetm.asm_out.file_start.
+ * system.h: Poison ASM_FILE_START.
+
+ * config/alpha/alpha.c (alpha_write_verstamp): Delete.
+ (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK.
+ (unicosmk_asm_file_start): Rename unicosmk_file_start,
+ make static, take no arguments.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END,
+ TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate.
+ * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor
+ TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in
+ comment.
+ * config/arc/arc.c (arc_asm_file_start): Rename
+ arc_file_start, take no arguments, make static.
+ (TARGET_ASM_FILE_START): Set it.
+ * config/arm/arm.c (aof_file_start): New static function.
+ (TARGET_ASM_FILE_START): Set it, when appropriate.
+ * config/arm/coff.h, config/arm/elf.h:
+ Set TARGET_ASM_FILE_START_APP_OFF to true.
+ * config/avr/avr.c (asm_file_start): Rename avr_file_start,
+ take no arguments, make static.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE):
+ Set them.
+ * config/c4x/c4x.c (c4x_file_start): New static function.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE):
+ Set them.
+ * config/cris/cris.c (cris_file_start): New static function.
+ (TARGET_ASM_FILE_START): Set it.
+ * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename
+ dsp16xx_file_start, make static.
+ (luxworks_dsp16xx_file_start): Delete.
+ (TARGET_ASM_FILE_START): Set it.
+ * config/h8300/h8300.c (asm_file_start): Rename
+ h8300_file_start, make static, take no arguments.
+ (TARGET_ASM_FILE_START): Set it.
+ * config/i370/i370.c (i370_file_start): New static function.
+ (TARGET_ASM_FILE_START): Set it.
+ * config/i386/i386.c (x86_file_start): New static function.
+ (TARGET_ASM_FILE_START): Set it.
+ * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE,
+ X86_FILE_START_FLTUSED): New macros, default to false.
+ * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1.
+ * config/i386/sysv4.h, config/i386/sco5.h: Override
+ X86_FILE_START_VERSION_DIRECTIVE to true.
+ * config/ia64/ia64.c (ia64_file_start): New static function.
+ (TARGET_ASM_FILE_START): Set it.
+ (emit_safe_across_calls): Take no arguments.
+ * config/ia64/ia64.md: Update to match.
+ * config/m32r/m32r.c (m32r_asm_file_start): Rename
+ m32r_file_start, make static, take no arguments.
+ (TARGET_ASM_FILE_START): Set it.
+ * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename
+ m68hc11_file_start, make static, take no arguments.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
+ (print_options): Delete.
+ * config/m68k/m68k.c (m68k_hp320_file_start): New static function.
+ (TARGET_ASM_FILE_START_APP_OFF): Set.
+ * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to
+ m68k_hp320_file_start.
+ * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start):
+ Make static, take no arguments.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
+ * config/mmix/mmix.c (mmix_asm_file_start): Rename
+ mmix_file_start, make static, take no arguments.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
+ * config/mn10300/mn10300.c (asm_file_start): Rename
+ mn10300_file_start, make static, take no arguments.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
+ * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set.
+ * config/pa/pa.c (pa_file_start_level, pa_file_start_space,
+ pa_file_start_file, pa_file_start_mcount, pa_elf_file_start,
+ pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start,
+ pa_hpux64_hpas_file_start): New static functions.
+ * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start.
+ * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to
+ pa_linux_file_start.
+ * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to
+ pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as
+ appropriate.
+ * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start.
+ * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF.
+ (rs6000_file_start): Make static, take no arguments. Reset
+ default_cpu under certain conditions.
+ (rs6000_xcoff_file_start): New function.
+ * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set.
+ * config/rs6000/xcoff.h (TARGET_ASM_FILE_START,
+ TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override.
+ * config/sh/sh.c (output_file_start): Rename
+ sh_file_start, make static, take no arguments. Merge in old
+ code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
+ * config/sh/sh.c (TARGET_ELF): Define to 0.
+ * config/sh/elf.h (TARGET_ELF): Redefine to 1.
+ * config/v850/v850.c (asm_file_start): Delete.
+ (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set.
+ * config/vax/vax.c (vax_file_start): New static function.
+ (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set.
+
+ * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false.
+ * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h
+ * config/i386/att.h, config/i386/gas.h, config/i386/linux.h
+ * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h
+ * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h
+ * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true.
+
+ * config/darwin.h, config/elfos.h, config/alpha/elf.h
+ * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h
+ * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h
+ * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h
+ * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h
+ * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h
+ * config/i370/i370.h, config/i386/att.h, config/i386/gas.h
+ * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h
+ * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h
+ * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h
+ * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h
+ * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h
+ * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h
+ * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h
+ * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h
+ * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h
+ * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h
+ * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START.
+
+ * config/alpha/alpha-protos.h, config/arc/arc-protos.h
+ * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h
+ * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h
+ * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h
+ * config/mips/mips-protos.h, config/mmix/mmix-protos.h
+ * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h
+ * config/sh/sh-protos.h, config/v850/v850-protos.h: Update.
+
+ * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h:
+ Remove reference to ASM_FILE_START in comment.
+ * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h
+ * config/arm/linux-gas.h, config/arm/netbsd-elf.h
+ * config/arm/netbsd.h: Delete definition of ARM_OS_NAME.
+
+2003-06-19 Graeme Peterson <gp@qnx.com>
+
+ * gcc.c (target_sysroot_suffix, target_sysroot_hdrs_suffix,
+ SYSROOT_SUFFIX_SPEC, SYSROOT_HEADERS_SUFFIX_SPEC, sysroot_suffix_spec,
+ sysroot_hdrs_suffix_spec): New.
+ (static_specs): Initialize new variables.
+ (add_sysroot_suffix_prefix, do_spec_1, main): Use new variables.
+ * doc/tm.texi (SYSROOT_SUFFIX_SPEC, SYSROOT_HEADERS_SUFFIX_SPEC):
+ New macros.
+
+2003-06-19 Andreas Jaeger <aj@suse.de>
+
+ * c-aux-info.c: Convert to ISO C90.
+ * c-pragma.c: Likewise.
+ * c-common.c: Likewise.
+ * c-common.h: Likewise.
+ * c-convert.c: Likewise.
+ * c-cppbuiltin.c: Likewise.
+ * c-dump.c: Likewise.
+ * c-decl.c: Likewise
+ * c-format.c: Likewise.
+ * c-incpath.c: Likewise.
+ * c-incpath.h: Likewise.
+
+2003-06-19 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (expand_errno_check): Assume that flag_errno_math
+ and HONOR_NANS have been tested before calling here. Only try
+ to set errno ourselves if the decl can't throw an exception.
+ (expand_builtin_mathfn): Move the code to stabilize the arg
+ after the main switch, so that that its only done when needed.
+ BUILT_IN_SQRT{,F,L} doesn't set errno if its arg is nonnegative.
+ Don't modify the original expr when stabilizing the argument.
+ (expand_builtin_mathfn_2): Likewise, move the code to stabilize
+ the args after the main switch, and don't modify the orginal exp.
+
+2003-06-19 Aldy Hernandez <aldyh@redhat.com>
+
+ * expr.c (const_vector_from_tree): Initialize remaining elements
+ to 0.
+
+2003-06-19 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/rs6000/spe.md ("spe_evfscfsi"): Change operand types.
+ Change "fix" to "float".
+
+2003-06-19 Andreas Jaeger <aj@suse.de>
+
+ * c-tree.h: Remove declaration of poplevel.
+
+ * tree.h: Remove declaration of approx_sqrt.
+
+ * c-lex.c: Remove redundant declaration of asm_out_file.
+
+ * flags.h: Remove declaration of warn_unknown_pragma and
+ main_input_filename.
+
+ * rtl.h: Remove functions from fold-const.c since they're already
+ declared in tree.h.
+
+ * regs.h: Remove redundant declaration of reg_names.
+
+ * bt-load.c (migrate_btr_defs): Correct printf arguments.
+
+ * protoize.c: Fix breakage from last patch.
+
+2003-06-19 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * hooks.h (hook_reg_class_void_no_regs): Only declare if tm.h
+ has been included.
+
+2003-06-18 James A Morrison <ja2morri@student.math.uwaterloo.ca>
+
+ * config/sparc/sparc.c: Update copyright year.
+
+2003-06-19 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (init_cumulative_args): Limit CALL_LIBCALL
+ to ABI_V4.
+
+2003-06-18 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ PR bootstrap/4068
+ * config/i386/liunx.h: Don't include sys/ucontext.h for glibc 2.0.
+
+2003-06-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (TARGET_INITIALIZER and friends): Move
+ to the end of the file. Remove unnecessary prototypes.
+
+2003-06-19 Hans-Peter Nilsson <hp@axis.com>
+
+ * bt-load.c (migrate_btr_def) [INSN_SCHEDULING]: Conditionalize
+ calls to insn_default_latency and result_ready_cost. Initialize
+ def_latency to 1.
+
+2003-06-18 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/unwind-ia64.c (_Unwind_GetCFA): New.
+ (_Unwind_FindEnclosingFunction): Implement.
+
+2003-06-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * toplev.c (rest_of_handle_sched): Hide the entire function if
+ INSN_SCHEDULING is not defined.
+ (rest_of_compilation): Call rest_of_handle_sched() only when
+ INSN_SCHEDULING is defined.
+
+2003-06-18 Stephen Clarke <stephen.clarke@superh.com>
+ J"orn Rennecke <joern.rennecke@superh.com>
+
+ * bt-load.c: New file.
+ * Makefile.in (OBJS): Include bt-load.o
+ (bt-load.o): Add dependencies.
+ * flags.h (flag_branch_target_load_optimize): Declare.
+ (flag_branch_target_load_optimize2): Likewise.
+ * hooks.c (hook_reg_class_void_no_regs): New function.
+ (hook_bool_bool_false): Likewise.
+ * hooks.h (hook_reg_class_void_no_regs, hook_bool_bool_false): Declare.
+ * rtl.h (branch_target_load_optimize): Declare.
+ * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define.
+ (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise.
+ (TARGET_INITIALIZER): Include these.
+ * target.h (struct gcc_target): Add branch_target_register_class
+ and branch_target_register_callee_saved members.
+ * toplev.c (enum dump_file_index): Add DFI_branch_target_load
+ (dump_file) Add "tars" entry.
+ (flag_branch_target_load_optimize): New variable.
+ (flag_branch_target_load_optimize2): Likewise.
+ (lang_independent_options): Add entries for new options.
+ (rest_of_compilation): Call branch_target_load_optimize.
+ * doc/tm.texi (TARGET_BRANCH_TARGET_REGISTER_CLASS): Document.
+ (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise.
+ * doc/invoke.texi: Document -fbranch-target-load-optimize and
+ -fbranch-target-load-optimize2.
+ * rtl.h (epilogue_completed): Declare.
+ * recog.c (epilogue_completed): New variable.
+ * toplev.c (rest_of_compilation): Set it.
+ * flow.c (mark_regs_live_at_end): Use it.
+ * config/ia64/ia64.c (ia64_output_mi_thunk): Set it.
+ * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise.
+ * config/sh/sh.c (sh_output_mi_thunk): Likewise.
+ * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
+
+ * sh.c (shmedia_space_reserved_for_target_registers): New variable.
+ (sh_target_reg_class): New function.
+ (sh_optimize_target_register_callee_saved): Likwise.
+ (shmedia_target_regs_stack_space): Likewise.
+ (shmedia_reserve_space_for_target_registers_p): Likewise.
+ (shmedia_target_regs_stack_adjust): Likewise.
+ (TARGET_BRANCH_TARGET_REGISTER_CLASS): Override.
+ (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise.
+ (calc_live_regs): If flag_branch_target_load_optimize2 and
+ TARGET_SAVE_ALL_TARGET_REGS is enabled, and we have space reserved
+ for target registers, make sure that we save all target registers.
+ (sh_expand_prologue, sh_expand_epilogue): Take target register
+ optimizations into account. Collapse stack adjustments if that
+ is beneficial.
+ (initial_elimination_offset): Reserve space for target registers
+ if necessary.
+ * sh.h (SAVE_ALL_TR_BIT, TARGET_SAVE_ALL_TARGET_REGS): Define.
+ (OPTIMIZATION_OPTIONS): Enable flag_branch_target_load_optimize.
+
+2003-06-18 Nick Clifton <nickc@redhat.com>
+
+ * config.gcc: Add an extra_header for ARM targets.
+ Support configuring with --with-cpu=iwmmxt.
+ * doc/invoke.texi: Document new value for -mcpu= ARM switch.
+ * config/arm/aof.h (REGISTER_NAMES): Add iwmmxt register
+ names. Fix formatting.
+ * config/arm/aout.h (REGISTER_NAMES): Add iwmmxt register
+ names.
+ * config/arm/arm-protos.h (arm_emit_vector_const): New
+ prototype.
+ (arm_output_load_gr): New prototype.
+ * config/arm/arm.c (extra_reg_names1): Delete.
+ (TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN, FL_IWMMXT,
+ * arch_is_iwmmxt): Define.
+ (all_cores, all_architecture): Add entry for iwmmxt.
+ (arm_override_options): Add support for iwmmxt.
+ (use_return_insn, arm_function_arg, arm_legitimate_index_p,
+ arm_print_value, arm_rtx_costs_1, output_move_double,
+ arm_compute_save_reg_mask, arm_output_epilogue,
+ arm_get_frame_size, arm_expand_prologue, arm_print_operand,
+ arm_assemble_integer, arm_hard_regno_ok, arm_regno_class):
+ Likewise.
+ (arm_init_cumulative_args): Count iwmmxt registers.
+ (arm_function_ok_for_sibcall): Return false of sibcall_blocked
+ has been set.
+ (struct minipool_node): Add fix_size field.
+ (add_minipool_forward_ref): Add support for 8-byte aligning of
+ the pool.
+ (add_minipool_backward_ref, add_minipool_offsets,
+ dump_minipool, push_minipool_fix): Likewise.
+ (struct builtin_description): New struct.
+ (builtin_description): New array of iwmmxt builtin functions.
+ (arm_init_iwmmxt_builtins): New function.
+ (arm_init_builtins): New function.
+ (safe_vector_operand): New function.
+ (arm_expand_binop_builtin): New function.
+ (arm_expand_unop_builtin): New function.
+ (arm_expand_builtin): New function.
+ (arm_emit_vector_const): New function.
+ (arm_output_load_gr): New function.
+ * config/arm/arm.h (TARGET_CPU_iwmmxt, TARGET_IWMMXT,
+ TARGET_REALLY_IWMMXT, arm_arch_iwmmxt, IWMMXT_ALIGNMENT,
+ TYPE_NEEDS_IWMMXT_ALIGNMENT, ADJUST_FIELD_ALIGN,
+ DATA_ALIGNMENT, LOCAL_ALIGNMENT, VECTOR_MODE_SUPPORTED_P): Define.
+ (BIGGEST_ALIGNMENT): Set to 64 if ATPCS support is enabled.
+ (CPP_CPU_ARCH_SPEC): Add entries for iwmmxt.
+ (FIXED_REGISTERS, CALL_USED_REGISTERS, REG_ALLOC_ORDER,
+ reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS,
+ REG_CLASS_FOR_LETTER): Add iwmmxt registers.
+ (SUBTARGET_CONDITIONAL_REGISTER_USAGE): Disable iwmmxt
+ registers unless the iwmmxt target is selected.
+ (FIRST_IWMMXT_GR_REGNUM, LAST_IWMMXT_GR_REGNUM,
+ FIRST_IWMMXT_REGNUM, LAST_IWMMXT_REGNUM, IS_IWMMXT_REGNUM,
+ IS_IWMMXT_GR_REGNUM): Define.
+ (FIRST_PSEUDO_REGISTER): Bump to 63.
+ (struct machine_function): Add sibcall_blocked field.
+ (Struct CUMULATIVE_ARGS): Add iwmmxt_nregs, named_count and
+ nargs fields.
+ (enum arm_builtins): New enum list.
+ * config/arm/arm.md (UNSPEC_WSHUFH, UNSPEC_WACC,
+ UNSPEC_TMOVMSK, UNSPEC_WSAD, UNSPEC_WSADZ, UNSPEC_WMACS,
+ UNSPEC_WMACU, UNSPEC_WMACSZ, UNSPEC_WMACUZ, UNSPEC_CLRDI,
+ UNSPEC_WMADDS, UNSPEC_WMADDU): New unspecs.
+ (VUNSPEC_TMRC, VUNSPEC_TMCR, VUNSPEC_ALIGN8, VUNSPEC_WCMP_EQ,
+ VUNSPEC_WCMP_GTU, VUNSPEC_WCMP_GT): New vunspecs.
+ (movv2si, movv4hi, movv8qi): New expands for vector moves.
+ Include iwmmxt.md.
+ * config/arm/t-xscale-elf (MULTILIB_OPITONS): Add iwmmxt
+ multilib.
+ (MULTILIB_DIRNAMES, MULTILIB_REDUNDANT_DIRS): Likewise.
+ * config/arm/mmintrin.h: New ARM specific header file.
+ * config/arm/iwmmx.md: New iWMMXt specific machine patterns.
+
+2003-06-18 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * toplev.c (Remaining -d letters summary): Update.
+
+2003-06-18 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * config/rs6000/rs6000.c (init_cumulative_args): Add and handle LIBCALL
+ argument.
+ (function_arg): Handle CALL_LIBCALL flag.
+ * config/rs6000/rs6000-protos.h (init_cumulative_args): Update
+ prototype.
+ * config/rs6000/rs6000.h (CALL_LIBCALL): New macro.
+ (INIT_CUMULATIVE_LIBCALL_ARGS): New macro.
+ (INIT_CUMULATIVE_ARGS): Add LIBCALL argument.
+ (INIT_CUMULATIVE_INCOMING_ARGS): Likewise.
+
+2003-06-18 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makefile.in: Update.
+ * common.opt: New options.
+ * opts.c (maybe_warn_unused_parameter, set_Wextra, handle_param,
+ set_Wunused): New.
+ (common_handle_option): Handle new options.
+ * toplev.c (set_target_switch): Export.
+ (set_Wextra, set_Wunused, maybe_warn_unused_parameter): Move to opts.c.
+ (decode_W_option): -Wunused and -Wextra handled in opts.c now.
+ (independent_decode_option): More options handled in opts.c now.
+ Change prototype.
+ * toplev.h (set_target_switch): New.
+
+2003-06-17 Robert Abeles <rabeles@archaelogic.com>
+
+ PR debug/4252
+ * c-opts.c (c_common_handle_option): Pass -fdump argument suffix
+ to dump_switch_p().
+ * tree-dump.c (dump_switch_p): Remove redundant 'dump-' prefix
+ from static strings in dump_files.
+
+2003-06-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * system.h (ANSI_PROTOTYPES, PTR_CONST, LONG_DOUBLE, VPARAMS,
+ VA_OPEN, VA_FIXEDARG, VA_CLOSE, VA_START): undef and poison these
+ libiberty macros.
+
+2003-06-17 Jason Merrill <jason@redhat.com>
+
+ PR c++/10929
+ * tree-inline.c (expand_call_inline): Don't warn about failing to
+ inline a function which was made inline by -finline-functions.
+
+2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Update to ISO C.
+ * config/h8300/h8300.c: Likewise.
+ * config/h8300/h8300.h: Likewise.
+ * config/h8300/h8300.md: Likewise.
+
+2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * configure.in: Replace BUILD_CC references with CC_FOR_BUILD.
+ * configure: Regenerate.
+ * Makefile.in: Replace BUILD_CC references with CC_FOR_BUILD.
+
+2003-06-17 Ranjit Mathew <rmathew@hotmail.com>
+
+ * install.texi (Testing): Add information on how to run Java
+ runtime tests separately.
+
+2003-06-17 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/mips/mips.md (trap): Use break 0 when !TARGET_GAS.
+
+ * config/mips/iris6-o32.h (MIPS_ISA_DEFAULT): Remove.
+ (MIPS_CPU_STRING_DEFAULT): Redefine to mips2.
+
+2003-06-17 Christopher Faylor <cgf@redhat.com>
+
+ * doc/install.texi: Add msvc rebuild caveat.
+
+2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/sh/coff.h: Replace Hitachi with Renesas.
+ * config/sh/elf.h: Likewise.
+ * config/sh/embed-elf.h: Likewise.
+ * config/sh/lib1funcs.asm: Likewise.
+ * config/sh/sh-protos.h: Likewise.
+ * config/sh/sh.c: Likewise.
+ * config/sh/sh.h: Likewise.
+ * config/sh/sh.md: Likewise.
+
+2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * ChangeLog.3: Fix comment typos.
+ * ChangeLog.6: Likewise.
+ * config/d30v/d30v.c: Likewise.
+ * config/h8300/h8300.md: Likewise.
+ * config/m32r/m32r.md: Likewise.
+ * config/mips/mips.c: Likewise.
+ * config/mips/mips.md: Likewise.
+ * config/ns32k/NOTES: Likewise.
+
+2003-06-17 Ranjit Mathew <rmathew@hotmail.com>
+ Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/sourcebuild.texi (libgcj Tests): Simplify instructions on how
+ to run Java runtime tests separately.
+
+2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Update a comment.
+
+2003-06-17 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (ROUND_TYPE_ALIGN, LOCAL_ALIGNMENT): Complex modes
+ are aligned like integral modes.
+ (SH5_WOULD_BE_PARTIAL_NREGS): Also test for CDImode and DCmode.
+
+ * sh.h (EXTRA_CONSTRAINT_Csy): Allow PIC_DIRECT_ADDR_P.
+ (LEGITIMATE_PIC_OPERAND_P): Allow LABEL_REF.
+ * sh.md (*pt): Remove.
+
+ * sh.h (REG_ALLOC_ORDER): Avoid squandering call-saved registers.
+
+ * sh.md (return_media_rte): New pattern.
+ (return_media): Use it.
+
+2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/contrib.texi: Replace Hitachi with Renesas.
+ * doc/install.texi: Likewise.
+ * doc/invoke.texi: Likewise.
+
+2003-06-17 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (CONST_OK_FOR_J16): Fix HOST_BITS_PER_WIDE_INT >= 64
+ behaviour.
+
+2003-06-17 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * doc/tm.texi (MD_FALLBACK_FRAME_STATE_FOR): Mention MAKE_THROW_FRAME.
+
+ * config/rs6000/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Partly revert
+ 2003-01-23 patch. Corrected to handle kernels with changed ucontext.
+
+ * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Error on invalid
+ -msdata=eabi usages.
+
+ * gcc/config/rs6000/sysv4.h (USE_LIBC_1): Delete all uses.
+
+2003-06-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * alloc-pool.c: Don't check HAVE_LONG_DOUBLE.
+ * fixinc/gnu-regex.c: Don't define `volatile'.
+ * ggc-page.c: Don't check HAVE_LONG_DOUBLE.
+ * ggc-simple.c: Likewise.
+ * system.h: Don't define `volatile'.
+
+ * aclocal.m4 (gcc_AC_C_VOLATILE, gcc_AC_C_LONG_DOUBLE): Delete.
+ * configure.in (gcc_AC_C_VOLATILE, gcc_AC_C_LONG_DOUBLE): Don't
+ call these macros.
+ * config.in, configure: Regenerated.
+
+2003-06-17 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * config/ia64/ia64.c (ia64_expand_builtin, case IA64_BUILTIN_BSP):
+ Handle POINTERS_EXTEND_UNSIGNED.
+
+2003-06-17 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/mips/mips.c (TARGET_ASM_UNALIGNED_DI_OP) [TARGET_IRIX5 &&
+ !TARGET_IRIX6]: Define as NULL.
+
+2003-06-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * config/sparc/sparc.c (sparc_va_arg): Don't align 16-byte+ structures.
+
+2003-06-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * dbxout.c (dbxout_source_line_counter): New global variable.
+ Mark it with GTY(()).
+ (dbxout_source_line): Increment dbxout_source_line_counter
+ and pass it to ASM_OUTPUT_SOURCE_LINE.
+ * sdbout.c (sdbout_source_line_counter): New global variable.
+ Mark it with GTY(()).
+ (unnamed_struct_number): Mark it with GTY(()).
+ (sdbout_source_line): Increment sdbout_source_line_counter
+ and pass it to ASM_OUTPUT_SOURCE_LINE.
+ * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Add third parameter
+ (xcoffout_source_line): Pass 0 as third argument to
+ ASM_OUTPUT_SOURCE_LINE.
+ (xcoffout_begin_prologue): Likewise.
+ * config/dbxout.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ Use it instead of 'sym_lineno' but without incrementing it.
+ * config/dbxelf.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/lynx.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/ptx4.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/alpha/alpha.c (alpha_start_function): Pass 0 as third
+ argument to ASM_OUTPUT_SOURCE_LINE.
+ * config/alpha/alpha.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ * config/arm/aout.h: Remove useless comment.
+ * config/avr/avr.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ * config/i960/i960.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/m32r/m32r.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ Use it instead of 'sym_lineno' but without incrementing it.
+ * config/m68k/hp320.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ * config/mcore/mcore-pe.h (ASM_OUTPUT_SOURCE_LINE): Add third
+ parameter. Use it instead of 'sym_lineno' but without incrementing it.
+ * config/mips/mips.c (mips_output_function_prologue): Pass 0 as third
+ argument to ASM_OUTPUT_SOURCE_LINE.
+ * config/mips/mips.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ * config/mmix/mmix.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/pa/som.h (ASM_OUTPUT_SOURCE_LINE): Add third parameter.
+ Use it instead of 'sym_lineno' but without incrementing it.
+ * config/rs6000/linux64.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/sh/elf.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/sparc/aout.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * config/sparc/pbd.h (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ * doc/tm.texi (ASM_OUTPUT_SOURCE_LINE): Document third parameter.
+
+2003-06-17 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips-protos.h (mips_expand_block_move): Declare.
+ (expand_block_move, output_block_move): Remove.
+ * config/mips/mips.h (enum block_move_type): Remove.
+ * config/mips/mips.c (block_move_call, output_block_move): Remove.
+ (mips_block_move_straight, mips_adjust_block_mem): New function.
+ (mips_block_move_loop): Renamed and reworked from block_move_loop.
+ (mips_expand_block_move): Likewise expand_block_move. Return false
+ to fall back on the target-independent code.
+ * config/mips/mips.md (movstrsi): Use mips_expand_block_move.
+ (movstrsi_internal*): Remove.
+
+2003-06-16 Zack Weinberg <zack@codesourcery.com>
+
+ * cpplib.h, cpphash.h, cppcharset.c, cpperror.c, cppexp.c
+ * cppfiles.c, cpphash.c, cppinit.c, cpplex.c, cpplib.c
+ * cppmacro.c, cpppch.c, cpptrad.c, cppspec.c: Convert to
+ ISO C: new-style function declarations, no need for PARAMS,
+ no special punctuation on indirect function calls, use string
+ constant concatenation where convenient.
+
+2003-06-17 Andreas Jaeger <aj@suse.de>
+
+ * rtl.h: Remove declarations from coverage.h.
+ * toplev.c: Include coverage.h.
+ * Makefile.in (toplev.o): Depend on coverage.h.
+
+ * toplev.h: Remove extra declaration of print_time.
+
+ * gengtype.c (close_output_files): Remove duplicated declaration.
+
+2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/sparc/sysv4.h: Remove target-independent comment;
+ replace "GNU CC" with "GCC".
+ * config/vxworks.h: Replace "GNU compiler" with "GCC".
+ * config/sparc/aout.h, config/sparc/biarch64.h, config/sparc/elf.h,
+ config/sparc/freebsd.h, config/sparc/linux.h, config/sparc/linux64.h,
+ config/sparc/lite.h, config/sparc/litecoff.h, config/sparc/liteelf.h,
+ config/sparc/netbsd-elf.h, config/sparc/openbsd.h,
+ config/sparc/rtemself.h, config/sparc/sol2-64.h,
+ config/sparc/sol2-bi.h, config/sparc/sol2-gas-bi.h,
+ config/sparc/sol2-gld-bi.h, config/sparc/sol2-gld.h,
+ config/sparc/sol2.h, config/sparc/sp64-aout.h,
+ config/sparc/sp64-elf.h, config/sparc/sp86x-elf.h,
+ config/sparc/sparc-protos.h, config/sparc/sysv4-only.h: Replace
+ "GNU compiler", "GNU CC" with "GCC".
+ * config/sparc/cypress.md, config/sparc/hypersparc.md,
+ config/sparc/sparc-modes.def, config/sparc/sparc.c,
+ config/sparc/sparc.md, config/sparc/sparclet.md,
+ config/sparc/supersparc.md, config/sparc/ultra1_2.md,
+ config/sparc/ultra3.md: Replace "GNU CC", "GNU Compiler", and
+ "GNU C Compiler" with "GCC".
+ * config/ip2k/ip2k.h: Replace "GNU CC" and "GNU compiler" with "GCC".
+
+2003-06-16 Aldy Hernandez <aldyh@redhat.com>
+
+ * simplify-rtx.c (simplify_subreg): Do not over-extend vector
+ constants.
+
+ * testsuite/gcc.c-torture/execute/simd-4.c: New.
+
+2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/ip2k/ip2k.h: Remove target-independent comments.
+
+ * config.gcc: Explicitly mention elfos.h in ip2k entry.
+ * config/ip2k/ip2k.h: Don't #include it here.
+
+2003-06-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * bitmap.c, builtins.c, c-incpath.c, cgraph.c, config/frv/frv.c,
+ config/mips/mips.c, cppfiles.c, cpphash.c, cppinit.c, cpplib.c,
+ dwarf2out.c, dwarfout.c, except.c, expr.c, expr.h, fold-const.c,
+ function.c, gcc.c, genoutput.c, gensupport.c, global.c,
+ haifa-sched.c, hashtable.c, ifcvt.c, integrate.c, local-alloc.c,
+ loop.c, mips-tdump.c, mips-tfile.c, mkdeps.c, protoize.c,
+ read-rtl.c, recog.h, reload1.c, sbitmap.c, ssa-dce.c,
+ stringpool.c, tlink.c, tree.c, varasm.c, varray.c: Don't use
+ the PTR macro.
+
+ * gengtype.c: Don't use UNION_INIT_ZERO.
+ * system.h (UNION_INIT_ZERO): Delete.
+
+2003-06-16 Richard Henderson <rth@redhat.com>
+
+ * simplify-rtx.c (simplify_subreg): Use GET_MODE_SIZE instead of
+ GET_MODE_UNIT_SIZE when simplifying constant vectors.
+
+2003-06-16 Andreas Jaeger <aj@suse.de>
+
+ * timevar.c (get_run_time): Remove function provided also by
+ libiberty.
+ * timevar.h: Remove get_run_time declaration.
+
+2003-06-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): Remove
+ unreachable code.
+
+2003-06-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtin-attrs.def, builtin-attrs.def, builtins.c, cpplex.c,
+ cpplib.c, gencheck.c, gengenrtl.c, machmode.def, protoize.c: Don't
+ use macros from "symcat.h", instead rely on ISO C.
+
+ * system.h: Don't include "symcat.h".
+ * configure.in (AC_C_STRINGIZE): Delete.
+ * config.in, configure: Regenerate.
+
+2003-06-16 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * Makefile.in (install-mkheaders): Use INSTALL_SCRIPT for scripts.
+
+ * tree.h (STMT_CHECK): New macro.
+ Also upper-case argument names on all checking macros and
+ fix some whitespace problems; assume CODE argument does not
+ have side-effects.
+
+2003-06-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * scan.h: Convert to ISO C.
+ * system.h: Likewise.
+
+ * c-format.c (dynamic_format_types): New pointer for dynamic data.
+ (find_length_info_modifier_index, init_dynamic_asm_fprintf_info):
+ New functions split out of...
+ (handle_format_attribute): ...here.
+
+2003-06-16 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.h (REG_CLASS_FROM_LETTER): Change to:
+ (REG_CLASS_FROM_CONSTRAINT).
+ (CONST_OK_FOR_I): Rename to:
+ (CONST_OK_FOR_I08). Changed all users.
+ (CONST_OK_FOR_J): Rename to:
+ (CONST_OK_FOR_I16). Changed all users.
+ (CONST_OK_FOR_K): Rename to:
+ (CONST_OK_FOR_P27). Changed all users.
+ (CONST_OK_FOR_L): Rename to:
+ (CONST_OK_FOR_K08). Changed all users.
+ (CONST_OK_FOR_O): Rename to:
+ (CONST_OK_FOR_I06). Changed all users.
+ (CONST_OK_FOR_P): Rename to:
+ (CONST_OK_FOR_I10). Changed all users.
+ (CONSTRAINT_LEN, CONST_OK_FOR_I, CONST_OK_FOR_J16): Define.
+ (CONST_OK_FOR_J, CONST_OK_FOR_K, CONST_OK_FOR_P): Likewise.
+ (EXTRA_CONSTRAINT_A, EXTRA_CONSTRAINT_Bsc): Likewise.
+ (EXTRA_CONSTRAINT_B, PIC_OFFSET_P, PIC_DIRECT_ADDR_P): Likewise.
+ (EXTRA_CONSTRAINT_Cpg, EXTRA_CONSTRAINT_C): Likewise.
+ (EXTRA_MEMORY_CONSTRAINT,(EXTRA_CONSTRAINT_Sr0): Likewise.
+ (CONST_OK_FOR_LETTER_P): Replace with
+ (CONST_OK_FOR_CONSTRAINT_P).
+ (EXTRA_CONSTRAINT_S): Rename to:
+ (EXTRA_CONSTRAINT_C16). Changed all users.
+ (MOVI_SHORI_BASE_OPERAND_P): Don't allow direct addresses.
+ (EXTRA_CONSTRAINT_T): Rename to:
+ (EXTRA_CONSTRAINT_Csy). Changed all users.
+ (EXTRA_CONSTRAINT_Z): Remove.
+ (EXTRA_CONSTRAINT): Replace with:
+ (EXTRA_CONSTRAINT_STR).
+ (EXTRA_CONSTRAINT_U): Rename to:
+ (EXTRA_CONSTRAINT_Z). Changed all users.
+ * sh.c (and_operand): Use CONST_OK_FOR_J16.
+ * sh.md (cmpeqsi_t-1, cmpeqsi_t, adddi3_media): Use new constraints.
+ (addsi3_media, addsi3_compact, andsi3_compact, anddi3): Likewise.
+ (iorsi3, iordi3, xorsi3, xordi3, ashlsi3_std, ashlhi3_k): Likewise.
+ (lshrsi3_k, movsi_i, movsi_ie, movsi_i_lowpart, movsi_media): Likewise.
+ (movsi_media_nofpu, movqi_media, movhi_i, movhi_media): Likewise.
+ (*movdi_i, movdi_media, movdi_media_nofpu, shori_media): Likewise.
+ (movdf_media, movdf_media_nofpu, movv2sf_i, movv4sf_i): Likewise.
+ (movsf_media, movsf_media_nofpu, movsi_y, beq_media): Likewise.
+ (beq_media_i, bne_media, pt, ptb, movv8qi_i, movv2hi_i): Likewise.
+ (movv4hi_i, movv2si_i, negcmpeqv8qi, negcmpeqv2si): Likewise.
+ (negcmpeqv4hi, negcmpgtuv8qi, negcmpgtv2si, negcmpgtv4hi): Likewise.
+ (mcmv, mcnvs_lw, mcnvs_wb, mcnvs_wub, mextr_rl, mextr_lr): Likewise.
+ (mextr1, mextr2, mextr3, mextr4, mextr5, mextr6, mextr7): Likewise.
+ (mperm_w, mperm_w_little, mperm_w_big, msad_ubq_i): Likewise.
+ (mshards_q, mshfhi_b, mshflo_b, mshf4_b, mshf0_b, mshfhi_l): Likewise.
+ (mshflo_l, mshf4_l, mshf0_l, mshfhi_w, mshflo_w, mshf4_w): Likewise.
+ (mshf0_w, mshflo_w_x, mshfhi_l_di, mshfhi_l_di_rev): Likewise.
+ (mshflo_l_di_rev, mshflo_l_di_x, concat_v2sf): Likewise.
+ (mshflo_l_di_x_rev, subv2si3, subv4hi3, sssubv2si3): Likewise.
+ (sssubv4hi3): Likewise.
+ (movsf_i): Change I[08]/r to G/r.
+ (movsf_ie): Change f/{G,H}/c/X to f/{G,H}/c/Bsc.
+
+ * sh.c (sh_output_mi_thunk): Use CONST_OK_FOR_ADD.
+
+2003-06-16 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/i386/i386.c (ix86_memory_move_cost): Fix typo.
+
+2003-06-16 Andreas Jaeger <aj@suse.de>
+
+ * basic-block.h: Remove duplicate prototype of
+ note_prediction_to_br_prob.
+
+ * tree.h: Remove duplicate prototype of strip_float_extensions.
+
+2003-06-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * config/c4x/c4x.c: Don't include "c-tree.h".
+ * config/pa/pa.c: Likewise.
+ * langhooks.c: Likewise.
+ * tree.h (poplevel): Declare.
+
+2003-06-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (const_costs): Move this to ...
+ (h8300_rtx_costs): ... here.
+
+2003-06-16 Roger Sayle <roger@eyesopen.com>
+
+ * optabs.h (enum optab_index): Add new OTI_tan and OTI_atan.
+ (tan_optab, atan_optab): Define corresponding macros.
+ * optabs.c (init_optabs): Initialize tan_optab and atan_optab.
+ * genopinit.c (optabs): Implement tan_optab and atan_optab
+ using tan?f2 and atan?f2 patterns.
+ * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_TAN{,F,L}
+ using tan_optab, and BUILT_IN_ATAN{,F,L} using atan_optab.
+ Change the default value of errno_set to false.
+ (expand_builtin): Expand BUILT_IN_TAN{,F,L} and BUILT_IN_ATAN{,F,L}
+ using expand_builtin_mathfn.
+
+ * config/i386/i386.md (atansf2, atandf2, atanxf2, atantf2): New
+ expander patterns implemented using existing atan2?f3 patterns.
+
+2003-06-16 Roger Sayle <roger@eyesopen.com>
+
+ * expr.c (expand_expr <PLUS_EXPR>): If operand_equal_p considers
+ both operands of the addition equal, reuse the expanded RTL.
+ (expand_expr <MULT_EXPR>): Likewise for multiplication.
+
+2003-06-16 Roger Sayle <roger@eyesopen.com>
+ Jeff Law <law@redhat.com>
+
+ * fold-const.c (operand_equal_p): Consider two calls to "const"
+ functions with identical non-volatile arguments to be equal.
+ Consider the FUNCTION_DECL for the "__builtin_foo" form of a
+ built-in function to be equal to the "foo" form.
+
+2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/rs6000/sysv4le.h: Remove target-independent comment.
+ Replace "GNU compiler" with "GCC" in comment.
+
+2003-06-16 Andreas Jaeger <aj@suse.de>
+
+ * tracer.c: Remove duplicate declaration.
+
+ * toplev.c: Remove extra declaration of decode_d_option.
+
+ * ssa.c: Remove duplicate declaration.
+
+ * sreal.c: Remove extra declaration of dump_sreal.
+
+ * reload1.c: Remove duplicate declarations.
+
+ * integrate.c: Remove extra declaration of
+ set_decl_abstract_flags.
+
+ * flow.c: Remove extra declaration of dump_flow_info.
+
+ * alias.c: Remove extra declaration of get_addr.
+
+2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/rtems.h, config/sol2.h, config/svr4.h, config/usegas.h,
+ config/vxworks.h: GNU CC -> GCC.
+
+ * convert.c, dwarf2out.c, dwarfout.c, emit-rtl.c, function.c,
+ lists.c, print-rtl.c, print-tree.c, read-rtl.c, rtl-error.c,
+ stmt.c, toplev.c, integrate.h, loop.h, machmode.h, rtl.h,
+ ssa.h, tree.def: Replace overly specific references to "GNU C"
+ and "GNU C Compiler" with references to "GCC".
+
+2003-06-16 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.c (prepare_move_operand): Check if operand 0 is an invalid
+ memory reference. Fix test that checks if operand 1 is using r0.
+ * sh.md (movhi_i): Don't allow st.w r0,@(rX,rY) .
+
+ * defaults.h (REG_CLASS_FROM_CONSTRAINT): Only define if not already
+ defined.
+
+2003-06-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ * function.h (struct emit_status): Remove x_last_linenum,
+ x_last_filename. Add x_last_location.
+ * rtl.h: #include "input.h".
+ (NOTE_DATA): New.
+ * cfglayout.c (duplicate_insn_chain): Use emit_line_note for line
+ number notes.
+ * emit-rtl.c (last_linenum, last_filename): Remove.
+ (last_location): New.
+ (emit_line_note_after): LINE must always be >= 0.
+ (emit_line_note): Likewise. Check not duplicate here...
+ (emit_note): ... rather than here.
+ (emit_line_note_force, force_next_line_note, init_emit): Adjust.
+ * integrate.c (expand_inline_function): Use emit_line_note for
+ line number notes.
+ (copy_insn_list): Likewise.
+ * unroll.c (copy_loop_body): Likewise.
+ * Makefile.in (RTL_H): Add input.h.
+
+2003-06-16 Richard Sandiford <rsandifo@redhat.com>
+
+ * optabs.c (emit_libcall_block): Don't hoist insns past a label.
+
+2003-06-16 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha-protos.h, config/alpha/elf.h,
+ config/alpha/osf.h, config/alpha/unicosmk.h, config/alpha/vms.h,
+ config/alpha/vms-cc.c, config/alpha/vms-ld.c: Update to ISO C.
+ * config/alpha/alpha.c: Likewise. Move targetm init to end of file.
+ Remove unneeded static function decls.
+
+2003-06-16 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-opts.c (c_common_handle_option): s/on/value/.
+ (OPT_fabi_version_, OPT_ftabstop_, OPT_ftemplate_depth_): Use value
+ directly rather than converting the argument.
+ * c.opt: Update docs. Use UInteger where appropriate.
+ * common.opt: Use UInteger where appropriate.
+ * opts.c (integral_argument): New.
+ (handle_argument): Handle integral arguments, and optional
+ joined arguments.
+ (common_handle_option): Update.
+ * opts.h (CL_MISSING_OK, CL_UINTEGER): New.
+ * opts.sh: Handle JoinedOrMissing and UInteger flags.
+
+2003-06-16 Neil Booth <neil@daikokuya.co.uk>
+
+ * config/rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_LOCAL): Remove
+ unnecessary extern declaration.
+
+2003-06-15 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/gofast.h, config/interix.h, config/interix3.h,
+ config/libgloss.h, config/linux-aout.h, config/linux.h,
+ config/lynx-ng.h, config/lynx.h: GNU CC -> GCC.
+ * config/kaos.h: "GNU compiler" -> GCC.
+ * config/linux-aout.h, config/lynx.h: Clarify comment describing file.
+
+ * config/ip2k/crt0.S, config/ip2k/ip2k-protos.h,
+ config/ip2k/ip2k.c, config/ip2k/ip2k.md, config/ip2k/libgcc.S:
+ GNU CC -> GCC.
+
+ * config/svr3.h: Remove #if 0 code, misleading comments.
+ GNU CC -> GCC.
+
+2003-06-15 Zack Weinberg <zack@codesourcery.com>
+
+ * vmsdbgout.c (vmsdbgout_finish): Rename parameter to
+ main_input_filename to avoid conflict with input_filename macro.
+
+2003-06-15 Neil Booth <neil@daikokuya.co.uk>
+
+ * config/mips/mips.h (asm_file_name, g_switch_set,
+ g_switch_value): Remove.
+ * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Remove
+ unnecessary extern declarations.
+
+2003-06-15 Neil Booth <neil@daikokuya.co.uk>
+
+ * config/frv/frv.h: Remove declaration of g_switch_value.
+ * config/m32r/m32r.h: Remove declaration of g_switch_value.
+ * config/m68hc11/m68hc11.c: Remove declaration of asm_file_name.
+
+2003-06-15 Neil Booth <neil@daikokuya.co.uk>
+
+ * opts.sh: Quote '+' in regex.
+
+2003-06-15 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * config/rs6000/t-rs6000: Add dependence of cfglayout.h to rs6000.o.
+ * config/rs6000/rs6000.c: Include cfglayout.h.
+ * config/alpha/alpha.c: Likewise.
+ * config/ia64/ia64.c: Likewise.
+ * config/sparc/sparc.c: Likewise.
+ * config/sh/sh.c: Likewise.
+
2003-06-15 Neil Booth <neil@daikokuya.co.uk>
* opts.sh: Quote '+' in regex.
@@ -9,8 +2023,7 @@
* c.opt: Specify languages.
* opts.h: Remove languages.
* opts.sh: Recognise front-end defined languages.
-doc:
- * sourcebuild.texi: Update.
+ * doc/sourcebuild.texi: Update.
2003-06-15 Andreas Jaeger <aj@suse.de>
diff --git a/gcc/ChangeLog.1 b/gcc/ChangeLog.1
index 389b702dac6..b99a93754a3 100644
--- a/gcc/ChangeLog.1
+++ b/gcc/ChangeLog.1
@@ -3212,7 +3212,7 @@ Tue Mar 16 13:44:50 1999 Jim Wilson <wilson@cygnus.com>
unless it's necessary.
* cpplib.h (parse_marker): Removed.
- (struct cpp_buffer): Line_base is now a unsigned char *; add
+ (struct cpp_buffer): Line_base is now an unsigned char *; add
`mark' [long], remove `marks' [struct parse_marker *].
(parse_set_mark, parse_clear_mark, parse_goto_mark): Update
prototypes.
diff --git a/gcc/ChangeLog.3 b/gcc/ChangeLog.3
index 2d1fb5f7108..52df96025fb 100644
--- a/gcc/ChangeLog.3
+++ b/gcc/ChangeLog.3
@@ -14863,9 +14863,9 @@ Mon Jan 24 16:56:10 2000 Jim Wilson <wilson@cygnus.com>
2000-01-24 Richard Henderson <rth@cygnus.com>
- * rtl.def: Add unordered fp comparisions.
+ * rtl.def: Add unordered fp comparisons.
* tree.def: Likewise.
- * tree.h: Add ISO C 9x unordered fp comparision builtins.
+ * tree.h: Add ISO C 9x unordered fp comparison builtins.
* builtins.c (expand_tree_builtin): New function.
* c-typeck.c (build_function_call): Use it.
diff --git a/gcc/ChangeLog.6 b/gcc/ChangeLog.6
index 5618eaa29e2..a6f412aa3c8 100644
--- a/gcc/ChangeLog.6
+++ b/gcc/ChangeLog.6
@@ -10043,7 +10043,7 @@ Tue Sep 25 17:13:56 CEST 2001 Jan Hubicka <jh@suse.cz>
* config/i386/i386.c (ix86_init_builtins): Correct return type
building v4hi_ftype_v4hi_int_int tree node.
(ix86_expand_sse_comi): Fix typo swapping operands.
- Don't swap comparision condition, it is already swapped.
+ Don't swap comparison condition, it is already swapped.
(ix86_expand_sse_compare): Before swapping operands
move operand 1 into new rtx and not the target rtx.
Don't swap comparison condition, it is already swapped.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 53d0ab72736..773fd03a132 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -557,7 +557,7 @@ BUILD_PREFIX = @BUILD_PREFIX@
# out of the way of the other rules for compiling the same source files.
BUILD_PREFIX_1 = @BUILD_PREFIX_1@
# Native compiler for the build machine and its switches.
-BUILD_CC = @BUILD_CC@
+CC_FOR_BUILD = @CC_FOR_BUILD@
BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE
# Native linker and preprocessor flags. For x-fragment overrides.
@@ -631,7 +631,7 @@ LANGHOOKS_DEF_H = langhooks-def.h $(HOOKS_H)
TARGET_DEF_H = target-def.h $(HOOKS_H)
MACHMODE_H = machmode.h machmode.def @extra_modes_file@
RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H)
-RTL_H = $(RTL_BASE_H) genrtl.h
+RTL_H = $(RTL_BASE_H) genrtl.h input.h
PARAMS_H = params.h params.def
TREE_H = tree.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.def \
input.h
@@ -813,8 +813,8 @@ OBJS = alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o \
haifa-sched.o hashtable.o hooks.o ifcvt.o insn-attrtab.o insn-emit.o \
insn-extract.o insn-opinit.o insn-output.o insn-peep.o insn-recog.o \
integrate.o intl.o jump.o langhooks.o lcm.o lists.o local-alloc.o \
- loop.o mbchar.o optabs.o options.o opts.o params.o predict.o \
- print-rtl.o print-tree.o \
+ loop.o mbchar.o optabs.o options.o opts.o params.o postreload.o predict.o \
+ print-rtl.o print-tree.o value-prof.o \
profile.o ra.o ra-build.o ra-colorize.o ra-debug.o ra-rewrite.o \
real.o recog.o reg-stack.o regclass.o regmove.o regrename.o \
reload.o reload1.o reorg.o resource.o rtl.o rtlanal.o rtl-error.o \
@@ -822,7 +822,7 @@ OBJS = alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o \
sibcall.o simplify-rtx.o sreal.o ssa.o ssa-ccp.o ssa-dce.o stmt.o \
stor-layout.o stringpool.o timevar.o toplev.o tracer.o tree.o tree-dump.o \
tree-inline.o unroll.o varasm.o varray.o version.o vmsdbgout.o xcoffout.o \
- alloc-pool.o et-forest.o cgraph.o cgraphunit.o cfghooks.o \
+ alloc-pool.o et-forest.o cgraph.o cgraphunit.o cfghooks.o bt-load.o \
$(GGC) $(out_object_file) $(EXTRA_OBJS) $(host_hook_obj)
BACKEND = main.o libbackend.a
@@ -854,7 +854,7 @@ STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
LIB2FUNCS_ST = _eprintf __gcc_bcmp
# Defined in libgcov.c, included only in gcov library
-LIBGCOV = _gcov _gcov_merge_add
+LIBGCOV = _gcov _gcov_merge_add _gcov_merge_single _gcov_merge_delta
FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
_fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
@@ -1318,7 +1318,7 @@ c-pretty-print.o : c-pretty-print.c c-pretty-print.h pretty-print.h \
c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
c-pragma.h flags.h toplev.h langhooks.h tree-inline.h diagnostic.h \
- intl.h debug.h $(C_COMMON_H) opts.h options.h
+ intl.h debug.h $(C_COMMON_H) opts.h options.h params.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$< $(OUTPUT_OPTION) @TARGET_SYSTEM_ROOT_DEFINE@
@@ -1384,12 +1384,12 @@ s-check : gencheck$(build_exeext) $(srcdir)/move-if-change
$(STAMP) s-check
gencheck$(build_exeext) : gencheck.o $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
gencheck.o $(BUILD_LIBS)
gencheck.o : gencheck.c gencheck.h tree.def $(BCONFIG_H) $(SYSTEM_H) \
coretypes.h $(GTM_H) $(lang_tree_files)
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
$(srcdir)/gencheck.c $(OUTPUT_OPTION)
gencheck.h : s-gencheck ; @true
@@ -1482,7 +1482,8 @@ diagnostic.o : diagnostic.c diagnostic.h real.h diagnostic.def \
$(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(TM_P_H) flags.h $(GGC_H) \
input.h toplev.h intl.h langhooks.h $(LANGHOOKS_DEF_H)
opts.o : opts.c opts.h options.h toplev.h $(CONFIG_H) $(SYSTEM_H) \
- coretypes.h $(TREE_H) $(TM_H) $(LANGHOOKS_H)
+ coretypes.h $(TREE_H) $(TM_H) $(LANGHOOKS_H) $(GGC_H) $(RTL_H) \
+ output.h diagnostic.h
toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
function.h flags.h xcoffout.h input.h $(INSN_ATTR_H) output.h diagnostic.h \
debug.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h \
@@ -1490,7 +1491,7 @@ toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_
graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) $(lang_options_files) \
ssa.h $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \
langhooks.h insn-flags.h options_.h cfglayout.h real.h cfgloop.h \
- hosthooks.h $(LANGHOOKS_DEF_H) cgraph.h
+ hosthooks.h $(LANGHOOKS_DEF_H) cgraph.h $(COVERAGE_H)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DTARGET_NAME=\"$(target_alias)\" \
-c $(srcdir)/toplev.c $(OUTPUT_OPTION)
@@ -1595,7 +1596,7 @@ simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RT
$(REGS_H) hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
output.h function.h $(GGC_H) $(OBSTACK_H) $(TM_P_H) $(TREE_H) $(TARGET_H)
cgraph.o : cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- langhooks.h tree-inline.h toplev.h flags.h ggc.h $(TARGET_H) cgraph.h gt-cgraph.h
+ langhooks.h toplev.h flags.h ggc.h $(TARGET_H) cgraph.h gt-cgraph.h output.h
cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
langhooks.h tree-inline.h toplev.h flags.h ggc.h $(TARGET_H) cgraph.h
coverage.o : coverage.c gcov-io.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
@@ -1635,7 +1636,10 @@ conflict.o : conflict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(OBSTACK_H)
$(HASHTAB_H) $(RTL_H) hard-reg-set.h $(BASIC_BLOCK_H)
profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) flags.h output.h $(REGS_H) $(EXPR_H) function.h \
- toplev.h $(BASIC_BLOCK_H) $(COVERAGE_H)
+ toplev.h $(BASIC_BLOCK_H) $(COVERAGE_H) $(TREE_H) value-prof.h
+value-prof.o : value-prof.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
+ $(BASIC_BLOCK_H) hard-reg-set.h value-prof.h $(EXPR_H) output.h flags.h \
+ $(RECOG_H) insn-config.h $(OPTABS_H)
loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h $(LOOP_H) \
insn-config.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) \
real.h $(PREDICT_H) $(BASIC_BLOCK_H) function.h cfgloop.h \
@@ -1658,7 +1662,7 @@ cfghooks.o: cfghooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TR
$(BASIC_BLOCK_H) cfglayout.h
cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
- function.h except.h $(GGC_H) $(TM_P_H) insn-config.h
+ function.h except.h $(GGC_H) $(TM_P_H) insn-config.h $(EXPR_H)
cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(BASIC_BLOCK_H) hard-reg-set.h insn-config.h $(RECOG_H) $(GGC_H) $(TM_P_H)
cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
@@ -1721,11 +1725,18 @@ reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h
$(REGS_H) function.h real.h toplev.h $(TM_P_H)
reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) real.h flags.h \
$(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \
+ $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h $(TM_P_H) \
+ except.h $(TREE_H)
+postreload.o : postreload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) real.h flags.h \
+ $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \
$(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h cselib.h $(TM_P_H) \
except.h $(TREE_H)
caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
flags.h $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) function.h \
$(RECOG_H) reload.h $(EXPR_H) toplev.h $(TM_P_H)
+bt-load.o : bt-load.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(BASIC_BLOCK_H) $(RTL_H) hard-reg-set.h $(REGS_H) $(OBSTACK_H) $(TM_P_H) \
+ $(FIBHEAP_H) output.h $(TARGET_H) $(EXPR_H) flags.h $(INSN_ATTR_H)
reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) conditions.h \
hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(INSN_ATTR_H) except.h \
$(RECOG_H) function.h flags.h output.h $(EXPR_H) toplev.h $(PARAMS_H) $(TM_P_H)
@@ -1850,11 +1861,11 @@ insn-conditions.o : insn-conditions.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(GTM_H) $(RTL_H) $(TM_P_H) $(REGS_H) function.h $(RECOG_H) real.h output.h \
flags.h hard-reg-set.h resource.h toplev.h reload.h gensupport.h \
insn-constants.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) insn-conditions.c
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) insn-conditions.c
dummy-conditions.o : dummy-conditions.c $(BCONFIG_H) $(SYSTEM_H) \
coretypes.h $(GTM_H) gensupport.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
$(srcdir)/dummy-conditions.c $(OUTPUT_OPTION)
insn-flags.h: s-flags ; @true
@@ -2050,7 +2061,7 @@ s-gtype: gengtype$(build_exeext) $(GTFILES)
#
# Compile the programs that generate insn-* from the machine description.
-# They are compiled with $(BUILD_CC), and associated libraries,
+# They are compiled with $(CC_FOR_BUILD), and associated libraries,
# since they need to run on this machine
# even if GCC is being compiled to run on some other machine.
@@ -2061,171 +2072,171 @@ s-gtype: gengtype$(build_exeext) $(GTFILES)
read-rtl.o: read-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) \
$(OBSTACK_H) $(HASHTAB_H)
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/read-rtl.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/read-rtl.c $(OUTPUT_OPTION)
gensupport.o: gensupport.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) \
$(OBSTACK_H) errors.h $(HASHTAB_H) gensupport.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gensupport.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gensupport.c $(OUTPUT_OPTION)
genconfig$(build_exeext) : genconfig.o $(BUILD_RTL) $(BUILD_SUPPORT) \
$(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
genconfig.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
$(BUILD_ERRORS) $(BUILD_LIBS)
genconfig.o : genconfig.c $(RTL_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c $(OUTPUT_OPTION)
genflags$(build_exeext) : genflags.o $(BUILD_RTL) $(BUILD_SUPPORT) \
$(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
genflags.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
$(BUILD_ERRORS) $(BUILD_LIBS)
genflags.o : genflags.c $(RTL_H) $(OBSTACK_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c $(OUTPUT_OPTION)
gencodes$(build_exeext) : gencodes.o $(BUILD_RTL) $(BUILD_SUPPORT) \
$(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
gencodes.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
$(BUILD_ERRORS) $(BUILD_LIBS)
gencodes.o : gencodes.c $(RTL_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c $(OUTPUT_OPTION)
genconstants$(build_exeext) : genconstants.o $(BUILD_RTL) $(BUILD_EARLY_SUPPORT) \
$(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
genconstants.o $(BUILD_EARLY_SUPPORT) $(BUILD_RTL) \
$(BUILD_ERRORS) $(BUILD_LIBS)
genconstants.o : genconstants.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
errors.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genconstants.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genconstants.c $(OUTPUT_OPTION)
genemit$(build_exeext) : genemit.o $(BUILD_RTL) $(BUILD_SUPPORT) \
$(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
genemit.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
$(BUILD_ERRORS) $(BUILD_LIBS)
genemit.o : genemit.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
errors.h gensupport.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c $(OUTPUT_OPTION)
genopinit$(build_exeext) : genopinit.o $(BUILD_RTL) $(BUILD_SUPPORT) \
$(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
genopinit.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
$(BUILD_ERRORS) $(BUILD_LIBS)
genopinit.o : genopinit.c $(RTL_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c $(OUTPUT_OPTION)
genrecog$(build_exeext) : genrecog.o $(BUILD_RTL) $(BUILD_SUPPORT) \
$(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
genrecog.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
$(BUILD_ERRORS) $(BUILD_LIBS)
genrecog.o : genrecog.c $(RTL_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c $(OUTPUT_OPTION)
genextract$(build_exeext) : genextract.o $(BUILD_RTL) $(BUILD_SUPPORT) \
$(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
genextract.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
$(BUILD_ERRORS) $(BUILD_LIBS)
genextract.o : genextract.c $(RTL_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) insn-config.h errors.h gensupport.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c $(OUTPUT_OPTION)
genpeep$(build_exeext) : genpeep.o $(BUILD_RTL) $(BUILD_SUPPORT) \
$(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
genpeep.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
$(BUILD_ERRORS) $(BUILD_LIBS)
genpeep.o : genpeep.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
errors.h gensupport.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c $(OUTPUT_OPTION)
genattr$(build_exeext) : genattr.o $(BUILD_RTL) $(BUILD_SUPPORT) \
$(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
genattr.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
$(BUILD_ERRORS) $(BUILD_LIBS)
genattr.o : genattr.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h \
gensupport.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c $(OUTPUT_OPTION)
genattrtab$(build_exeext) : genattrtab.o genautomata.o \
$(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_VARRAY) \
$(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
genattrtab.o genautomata.o \
$(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) $(BUILD_ERRORS) \
$(BUILD_VARRAY) $(BUILD_LIBS) -lm
genattrtab.o : genattrtab.c $(RTL_H) $(OBSTACK_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(GGC_H) gensupport.h genattrtab.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c $(OUTPUT_OPTION)
genautomata.o : genautomata.c $(RTL_H) $(OBSTACK_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h varray.h genattrtab.h $(HASHTAB_H)
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genautomata.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genautomata.c $(OUTPUT_OPTION)
genoutput$(build_exeext) : genoutput.o $(BUILD_RTL) $(BUILD_SUPPORT) \
$(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
genoutput.o $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
$(BUILD_ERRORS) $(BUILD_LIBS)
genoutput.o : genoutput.c $(RTL_H) $(BCONFIG_H) \
$(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c $(OUTPUT_OPTION)
gengenrtl$(build_exeext) : gengenrtl.o $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
gengenrtl.o $(BUILD_LIBS)
gengenrtl.o : gengenrtl.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
$(GTM_H) real.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gengenrtl.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gengenrtl.c $(OUTPUT_OPTION)
genpreds$(build_exeext) : genpreds.o $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
genpreds.o $(BUILD_LIBS)
genpreds.o : genpreds.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H)
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genpreds.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/genpreds.c $(OUTPUT_OPTION)
gengtype$(build_exeext) : gengtype.o gengtype-lex.o gengtype-yacc.o \
$(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
gengtype.o gengtype-lex.o gengtype-yacc.o $(BUILD_LIBS)
gengtype.o : gengtype.c gengtype.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
real.h $(RTL_BASE_H) gtyp-gen.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
$(srcdir)/gengtype.c $(OUTPUT_OPTION)
gengtype-lex.o : $(parsedir)/gengtype-lex.c gengtype.h $(parsedir)/gengtype-yacc.c \
$(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H)
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
$(parsedir)/gengtype-lex.c $(OUTPUT_OPTION)
gengtype-yacc.o : $(parsedir)/gengtype-yacc.c gengtype.h $(BCONFIG_H) $(SYSTEM_H) \
coretypes.h $(GTM_H)
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
$(parsedir)/gengtype-yacc.c $(OUTPUT_OPTION)
# The sed command works around a bug in flex-2.5.4.
@@ -2250,13 +2261,13 @@ $(parsedir)/gengtype-yacc.c: $(srcdir)/gengtype-yacc.y
genconditions$(build_exeext) : genconditions.o $(BUILD_EARLY_SUPPORT) \
$(BUILD_RTL) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
genconditions.o $(BUILD_EARLY_SUPPORT) $(BUILD_RTL) \
$(BUILD_ERRORS) $(BUILD_LIBS)
genconditions.o : genconditions.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
$(GTM_H) errors.h
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
$(srcdir)/genconditions.c $(OUTPUT_OPTION)
#
@@ -2268,37 +2279,37 @@ $(BUILD_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYST
real.h $(GGC_H) errors.h
rm -f $(BUILD_PREFIX)rtl.c
sed -e 's/config[.]h/bconfig.h/' $(srcdir)/rtl.c > $(BUILD_PREFIX)rtl.c
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)rtl.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)rtl.c $(OUTPUT_OPTION)
print-rtl1.o: $(srcdir)/print-rtl.c $(BCONFIG_H) coretypes.h $(GTM_H) \
$(RTL_H) $(TREE_H) hard-reg-set.h $(BASIC_BLOCK_H)
rm -f print-rtl1.c
sed -e 's/config[.]h/bconfig.h/' $(srcdir)/print-rtl.c > print-rtl1.c
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) print-rtl1.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) print-rtl1.c $(OUTPUT_OPTION)
$(BUILD_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) \
$(RTL_H) flags.h $(BASIC_BLOCK_H) $(REGS_H) $(GGC_H)
rm -f $(BUILD_PREFIX)bitmap.c
sed -e 's/config[.]h/bconfig.h/' $(srcdir)/bitmap.c > $(BUILD_PREFIX)bitmap.c
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)bitmap.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)bitmap.c $(OUTPUT_OPTION)
$(BUILD_PREFIX_1)errors.o: errors.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) errors.h
rm -f $(BUILD_PREFIX)errors.c
sed -e 's/config[.]h/bconfig.h/' $(srcdir)/errors.c > $(BUILD_PREFIX)errors.c
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)errors.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)errors.c $(OUTPUT_OPTION)
$(BUILD_PREFIX_1)varray.o: varray.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) varray.h \
$(RTL_H) $(GGC_H) $(TREE_H) bitmap.h errors.h
rm -f $(BUILD_PREFIX)varray.c
sed -e 's/config[.]h/bconfig.h/' $(srcdir)/varray.c > \
$(BUILD_PREFIX)varray.c
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
$(BUILD_PREFIX)varray.c $(OUTPUT_OPTION)
$(BUILD_PREFIX_1)ggc-none.o: ggc-none.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) $(GGC_H)
rm -f $(BUILD_PREFIX)ggc-none.c
sed -e 's/config[.]h/bconfig.h/' $(srcdir)/ggc-none.c > $(BUILD_PREFIX)ggc-none.c
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)ggc-none.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)ggc-none.c $(OUTPUT_OPTION)
#
# Remake internationalization support.
@@ -2444,9 +2455,9 @@ test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
# gcov-iov.c is run on the build machine to generate gcov-iov.h from version.c
gcov-iov.o: gcov-iov.c version.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) coretypes.h $(TM_H)
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gcov-iov.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gcov-iov.c $(OUTPUT_OPTION)
gcov-iov$(build_exeext): gcov-iov.o
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) gcov-iov.o -o $@
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) gcov-iov.o -o $@
gcov-iov.h: s-iov
s-iov: gcov-iov$(build_exeext) $(srcdir)/move-if-change
./gcov-iov$(build_exeext) > tmp-gcov-iov.h
@@ -2516,7 +2527,7 @@ fixinc.sh: $(FIXINCSRCDIR)/mkfixinc.sh $(FIXINCSRCDIR)/fixincl.c \
$(FIXINCSRCDIR)/server.c $(FIXINCSRCDIR)/gnu-regex.h \
$(FIXINCSRCDIR)/server.h $(FIXINCSRCDIR)/inclhack.def specs.ready
(MAKE="$(MAKE)"; srcdir=`cd $(srcdir)/fixinc && ${PWD}` ; \
- CC="$(BUILD_CC)"; CFLAGS="$(BUILD_CFLAGS)"; LDFLAGS="$(BUILD_LDFLAGS)"; \
+ CC="$(CC_FOR_BUILD)"; CFLAGS="$(BUILD_CFLAGS)"; LDFLAGS="$(BUILD_LDFLAGS)"; \
WARN_CFLAGS="$(WARN_CFLAGS)"; LIBERTY=`pwd`/"$(BUILD_LIBIBERTY)"; \
export MAKE srcdir CC CFLAGS LDFLAGS WARN_CFLAGS LIBERTY; \
cd ./fixinc && \
@@ -2550,7 +2561,7 @@ stmp-fixinc: fixinc.sh gsyslimits.h
$(STAMP) stmp-fixinc
# Files related to the fixproto script.
-# gen-protos and fix-header are compiled with BUILD_CC, but they are only
+# gen-protos and fix-header are compiled with CC_FOR_BUILD, but they are only
# used in native and host-x-target builds, so it's safe to link them with
# libiberty.a.
@@ -2567,14 +2578,14 @@ deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs
GEN_PROTOS_OBJS = gen-protos.o scan.o
gen-protos$(build_exeext): $(GEN_PROTOS_OBJS)
- ${BUILD_CC} $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
+ ${CC_FOR_BUILD} $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
$(GEN_PROTOS_OBJS) $(BUILD_LIBS)
gen-protos.o: gen-protos.c scan.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H)
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gen-protos.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gen-protos.c $(OUTPUT_OPTION)
scan.o: scan.c scan.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H)
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/scan.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/scan.c $(OUTPUT_OPTION)
xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos$(build_exeext) Makefile
sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \
@@ -2590,15 +2601,15 @@ xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos$(build_
# so we can (indeed, must) use $(LIBDEPS) and $(LIBS).
fix-header$(build_exeext): fix-header.o scan-decls.o scan.o xsys-protos.h \
c-incpath.o cppdefault.o prefix.o $(LIBDEPS) libcpp.a
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ fix-header.o \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ fix-header.o \
c-incpath.o cppdefault.o scan-decls.o prefix.o scan.o libcpp.a $(LIBS)
fix-header.o: fix-header.c $(OBSTACK_H) scan.h \
xsys-protos.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(CPPLIB_H)
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/fix-header.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/fix-header.c $(OUTPUT_OPTION)
scan-decls.o: scan-decls.c scan.h $(CPPLIB_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H)
- $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/scan-decls.c $(OUTPUT_OPTION)
+ $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/scan-decls.c $(OUTPUT_OPTION)
# stmp-fixproto depends on this, not on fix-header directly.
# The idea is to make sure fix-header gets built,
@@ -3180,18 +3191,18 @@ install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir \
if [ x$(STMP_FIXINC) != x ] ; then \
$(INSTALL_DATA) $(srcdir)/README-fixinc \
$(DESTDIR)$(itoolsdir)/include/README ; \
- $(INSTALL_PROGRAM) fixinc.sh $(DESTDIR)$(itoolsdir)/fixinc.sh ; \
+ $(INSTALL_SCRIPT) fixinc.sh $(DESTDIR)$(itoolsdir)/fixinc.sh ; \
$(INSTALL_PROGRAM) fixinc/fixincl $(DESTDIR)$(itoolsdir)/fixincl ; \
$(INSTALL_DATA) $(srcdir)/gsyslimits.h $(DESTDIR)$(itoolsdir)/gsyslimits.h ; \
else :; fi
if [ x$(STMP_FIXPROTO) != x ] ; then \
- $(INSTALL_PROGRAM) $(srcdir)/mkinstalldirs \
+ $(INSTALL_SCRIPT) $(srcdir)/mkinstalldirs \
$(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
- $(INSTALL_PROGRAM) $(srcdir)/fixproto $(DESTDIR)$(itoolsdir)/fixproto ; \
+ $(INSTALL_SCRIPT) $(srcdir)/fixproto $(DESTDIR)$(itoolsdir)/fixproto ; \
$(INSTALL_PROGRAM) fix-header$(build_exeext) \
$(DESTDIR)$(itoolsdir)/fix-header$(build_exeext) ; \
else :; fi
- $(INSTALL_PROGRAM) mkheaders $(DESTDIR)$(itoolsdir)/mkheaders
+ $(INSTALL_SCRIPT) mkheaders $(DESTDIR)$(itoolsdir)/mkheaders
echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \
> $(DESTDIR)$(itoolsdir)/mkheaders.conf
echo 'OTHER_FIXINCLUDES_DIRS="$(OTHER_FIXINCLUDES_DIRS)"' \
@@ -3504,7 +3515,7 @@ stage1_copy: stage1_build
echo stage2_build > stage_last
stage2_build: stage1_copy
- $(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" BUILD_CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
+ $(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CC_FOR_BUILD="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
STAGE_PREFIX=stage1/ \
$(POSTSTAGE1_FLAGS_TO_PASS) \
$(STAGE2_FLAGS_TO_PASS)
@@ -3517,7 +3528,7 @@ stage2_copy: stage2_build
echo stage3_build > stage_last
stageprofile_build: stage1_copy
- $(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" BUILD_CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
+ $(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CC_FOR_BUILD="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
STAGE_PREFIX=stage1/ \
$(POSTSTAGE1_FLAGS_TO_PASS) \
$(STAGEPROFILE_FLAGS_TO_PASS)
@@ -3530,7 +3541,7 @@ stageprofile_copy: stageprofile_build
echo stagefeedback_build > stage_last
stage3_build: stage2_copy
- $(MAKE) CC="$(STAGE_CC_WRAPPER) stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" BUILD_CC="$(STAGE_CC_WRAPPER) stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" \
+ $(MAKE) CC="$(STAGE_CC_WRAPPER) stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CC_FOR_BUILD="$(STAGE_CC_WRAPPER) stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" \
STAGE_PREFIX=stage2/ \
$(POSTSTAGE1_FLAGS_TO_PASS) \
$(STAGE2_FLAGS_TO_PASS)
@@ -3538,7 +3549,7 @@ stage3_build: stage2_copy
echo stage3_build > stage_last
stagefeedback_build: stageprofile_copy stage1_copy
- $(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" BUILD_CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
+ $(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CC_FOR_BUILD="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
STAGE_PREFIX=stage1/ \
$(POSTSTAGE1_FLAGS_TO_PASS) \
$(STAGEFEEDBACK_FLAGS_TO_PASS)
@@ -3557,7 +3568,7 @@ stage3_copy: stage3_build
echo stage4_build > stage_last
stage4_build: stage3_copy
- $(MAKE) CC="$(STAGE_CC_WRAPPER) stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" BUILD_CC="$(STAGE_CC_WRAPPER) stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" \
+ $(MAKE) CC="$(STAGE_CC_WRAPPER) stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" CC_FOR_BUILD="$(STAGE_CC_WRAPPER) stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" \
STAGE_PREFIX=stage3/ \
$(POSTSTAGE1_FLAGS_TO_PASS) \
$(STAGE2_FLAGS_TO_PASS)
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4
index 4228504ee65..f0124c002b4 100644
--- a/gcc/aclocal.m4
+++ b/gcc/aclocal.m4
@@ -163,36 +163,6 @@ fi
AC_SUBST(LN)dnl
])
-dnl See whether the stage1 host compiler accepts the volatile keyword.
-AC_DEFUN(gcc_AC_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, 1, [Define if your compiler understands volatile.])
-fi
-])
-
-dnl Check whether long double is supported. This differs from the
-dnl built-in autoconf test in that it works for cross compiles.
-AC_DEFUN(gcc_AC_C_LONG_DOUBLE,
-[AC_CACHE_CHECK(for long double, gcc_cv_c_long_double,
-[if test "$GCC" = yes; then
- gcc_cv_c_long_double=yes
-else
-AC_TRY_COMPILE(,
-[/* The Stardent Vistra knows sizeof(long double), but does not support it. */
-long double foo = 0.0;
-/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
-switch (0) case 0: case (sizeof(long double) >= sizeof(double)):;],
-gcc_cv_c_long_double=yes, gcc_cv_c_long_double=no)
-fi])
-if test $gcc_cv_c_long_double = yes; then
- AC_DEFINE(HAVE_LONG_DOUBLE, 1,
- [Define if your compiler supports the \`long double' type.])
-fi
-])
-
dnl Check whether _Bool is built-in.
AC_DEFUN(gcc_AC_C__BOOL,
[AC_CACHE_CHECK(for built-in _Bool, gcc_cv_c__bool,
@@ -594,34 +564,6 @@ AC_CACHE_CHECK(for __int64, ac_cv_c___int64,
fi
])
-dnl Host character set probe.
-dnl The EBCDIC values match the table in config/i370/i370.c;
-dnl there are other versions of EBCDIC but GCC won't work with them.
-dnl
-AC_DEFUN([gcc_AC_C_CHARSET],
-[AC_CACHE_CHECK(execution character set, ac_cv_c_charset,
- [AC_EGREP_CPP(ASCII,
-[#if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \
- && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21
-ASCII
-#endif], ac_cv_c_charset=ASCII)
- if test x${ac_cv_c_charset+set} != xset; then
- AC_EGREP_CPP(EBCDIC,
-[#if '\n' == 0x15 && ' ' == 0x40 && '0' == 0xF0 \
- && 'A' == 0xC1 && 'a' == 0x81 && '!' == 0x5A
-EBCDIC
-#endif], ac_cv_c_charset=EBCDIC)
- fi
- if test x${ac_cv_c_charset+set} != xset; then
- ac_cv_c_charset=unknown
- fi])
-if test $ac_cv_c_charset = unknown; then
- AC_MSG_ERROR([*** Cannot determine host character set.])
-elif test $ac_cv_c_charset = EBCDIC; then
- AC_DEFINE(HOST_EBCDIC, 1,
- [Define if the host execution character set is EBCDIC.])
-fi])
-
#serial AM2
dnl From Bruno Haible.
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index aaadc708f72..8160333c66f 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,20 @@
+2003-06-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * misc.c (record_code_position): Adjust emit_note call.
+
+2003-06-26 Neil Booth <neil@daikokuya.co.uk>
+
+ * misc.c (gnat_handle_option): Don't check for missing arguments.
+
+2003-06-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ * utils.c (end_subprog_body): Adjust expand_function_end call.
+
+2003-06-16 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * bindgen.adb (Gen_Main_Ada, Gen_Main_C): Do not test
+ Bind_Main_Program.
+
2003-06-15 Neil Booth <neil@daikokuya.co.uk>
* lang.opt: Declare Ada.
diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb
index abfb0af9cff..08e4e7755f3 100644
--- a/gcc/ada/bindgen.adb
+++ b/gcc/ada/bindgen.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -1245,12 +1245,10 @@ package body Bindgen is
-- The reference stops Ada_Main_Program_Name from being optimized
-- away by smart linkers, such as the AiX linker.
- if Bind_Main_Program then
- WBI
- (" Ensure_Reference : System.Address := " &
- "Ada_Main_Program_Name'Address;");
- WBI ("");
- end if;
+ WBI
+ (" Ensure_Reference : System.Address := " &
+ "Ada_Main_Program_Name'Address;");
+ WBI ("");
WBI (" begin");
@@ -1366,12 +1364,10 @@ package body Bindgen is
-- place). The reference stops Ada_Main_Program_Name from being
-- optimized away by smart linkers, such as the AiX linker.
- if Bind_Main_Program then
- WBI
- (" char *ensure_reference __attribute__ ((__unused__)) = " &
- "__gnat_ada_main_program_name;");
- WBI ("");
- end if;
+ WBI
+ (" char *ensure_reference __attribute__ ((__unused__)) = " &
+ "__gnat_ada_main_program_name;");
+ WBI ("");
if ALIs.Table (ALIs.First).Main_Program = Func then
WBI (" int result;");
diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c
index 81bc3d94876..e0ee975215d 100644
--- a/gcc/ada/misc.c
+++ b/gcc/ada/misc.c
@@ -220,7 +220,6 @@ gnat_parse_file (set_yydebug)
static int
gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED)
{
- const struct cl_option *option = &cl_options[scode];
enum opt_code code = (enum opt_code) scode;
char *q;
int i;
@@ -229,12 +228,6 @@ gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED)
if (code == N_OPTS)
return 1;
- if (arg == NULL && (option->flags & (CL_JOINED | CL_SEPARATE)))
- {
- error ("missing argument to \"-%s\"", option->opt_text);
- return 1;
- }
-
switch (code)
{
default:
@@ -726,7 +719,7 @@ record_code_position (gnat_node)
addressable needs some fixups and also for above reason. */
save_gnu_tree (gnat_node,
build (RTL_EXPR, void_type_node, NULL_TREE,
- (tree) emit_note (0, NOTE_INSN_DELETED)),
+ (tree) emit_note (NOTE_INSN_DELETED)),
1);
}
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index 5eeca2b6828..186b0fdb175 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -1801,7 +1801,7 @@ end_subprog_body ()
/* Mark the RESULT_DECL as being in this subprogram. */
DECL_CONTEXT (DECL_RESULT (current_function_decl)) = current_function_decl;
- expand_function_end (input_filename, input_line, 0);
+ expand_function_end ();
/* If this is a nested function, push a new GC context. That will keep
local variables on the stack from being collected while we're doing
diff --git a/gcc/alias.c b/gcc/alias.c
index a7a51188d09..c68a0ad10b9 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -94,7 +94,6 @@ typedef struct alias_set_entry
static int rtx_equal_for_memref_p (rtx, rtx);
static rtx find_symbolic_term (rtx);
-rtx get_addr (rtx);
static int memrefs_conflict_p (int, rtx, int, rtx, HOST_WIDE_INT);
static void record_set (rtx, rtx, void *);
static int base_alias_check (rtx, rtx, enum machine_mode,
diff --git a/gcc/alloc-pool.c b/gcc/alloc-pool.c
index e247b141f76..1315b12f53d 100644
--- a/gcc/alloc-pool.c
+++ b/gcc/alloc-pool.c
@@ -54,11 +54,8 @@ typedef struct allocation_object_def
the following elements are here. They are never accessed so
the allocated object may be even smaller than this structure. */
char *align_p;
- double align_d;
HOST_WIDEST_INT align_i;
-#ifdef HAVE_LONG_DOUBLE
long double align_ld;
-#endif
} u;
} allocation_object;
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index 9e57f1941c4..b26b14399d1 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -157,7 +157,7 @@ typedef struct edge_def {
#define EDGE_COMPLEX (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL | EDGE_EH)
/* Counter summary from the last set of coverage counts read by
- profile.c. */
+ profile.c. */
extern const struct gcov_ctr_summary *profile_info;
/* Declared in cfgloop.h. */
@@ -340,6 +340,7 @@ extern void update_bb_for_insn PARAMS ((basic_block));
extern void free_basic_block_vars PARAMS ((int));
extern void insert_insn_on_edge PARAMS ((rtx, edge));
+bool safe_insert_insn_on_edge (rtx, edge);
extern void commit_edge_insertions PARAMS ((void));
extern void commit_edge_insertions_watch_calls PARAMS ((void));
@@ -535,7 +536,6 @@ extern rtx emit_block_insn_before PARAMS ((rtx, rtx, basic_block));
extern void estimate_probability PARAMS ((struct loops *));
extern void note_prediction_to_br_prob PARAMS ((void));
extern void expected_value_to_br_prob PARAMS ((void));
-extern void note_prediction_to_br_prob PARAMS ((void));
extern bool maybe_hot_bb_p PARAMS ((basic_block));
extern bool probably_cold_bb_p PARAMS ((basic_block));
extern bool probably_never_executed_bb_p PARAMS ((basic_block));
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index f03f3e27949..98229d59815 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -729,9 +729,9 @@ debug_bitmap_file (FILE *file, bitmap head)
bitmap_element *ptr;
fprintf (file, "\nfirst = ");
- fprintf (file, HOST_PTR_PRINTF, (PTR) head->first);
+ fprintf (file, HOST_PTR_PRINTF, (void *) head->first);
fprintf (file, " current = ");
- fprintf (file, HOST_PTR_PRINTF, (PTR) head->current);
+ fprintf (file, HOST_PTR_PRINTF, (void *) head->current);
fprintf (file, " indx = %u\n", head->indx);
for (ptr = head->first; ptr; ptr = ptr->next)
@@ -739,11 +739,11 @@ debug_bitmap_file (FILE *file, bitmap head)
unsigned int i, j, col = 26;
fprintf (file, "\t");
- fprintf (file, HOST_PTR_PRINTF, (PTR) ptr);
+ fprintf (file, HOST_PTR_PRINTF, (void *) ptr);
fprintf (file, " next = ");
- fprintf (file, HOST_PTR_PRINTF, (PTR) ptr->next);
+ fprintf (file, HOST_PTR_PRINTF, (void *) ptr->next);
fprintf (file, " prev = ");
- fprintf (file, HOST_PTR_PRINTF, (PTR) ptr->prev);
+ fprintf (file, HOST_PTR_PRINTF, (void *) ptr->prev);
fprintf (file, " indx = %u\n\t\tbits = {", ptr->indx);
for (i = 0; i < BITMAP_ELEMENT_WORDS; i++)
diff --git a/gcc/builtin-attrs.def b/gcc/builtin-attrs.def
index 8314b88cdca..df0bc08d86f 100644
--- a/gcc/builtin-attrs.def
+++ b/gcc/builtin-attrs.def
@@ -51,13 +51,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
DEF_ATTR_NULL_TREE (ATTR_NULL)
-/* Note that below we must avoid whitespace in arguments of CONCAT*. */
-
/* Construct a tree for a given integer and a list containing it. */
#define DEF_ATTR_FOR_INT(VALUE) \
- DEF_ATTR_INT (CONCAT2 (ATTR_,VALUE), VALUE) \
- DEF_ATTR_TREE_LIST (CONCAT2 (ATTR_LIST_,VALUE), ATTR_NULL, \
- CONCAT2 (ATTR_,VALUE), ATTR_NULL)
+ DEF_ATTR_INT (ATTR_##VALUE, VALUE) \
+ DEF_ATTR_TREE_LIST (ATTR_LIST_##VALUE, ATTR_NULL, \
+ ATTR_##VALUE, ATTR_NULL)
DEF_ATTR_FOR_INT (0)
DEF_ATTR_FOR_INT (1)
DEF_ATTR_FOR_INT (2)
@@ -67,8 +65,8 @@ DEF_ATTR_FOR_INT (4)
/* Construct a tree for a list of two integers. */
#define DEF_LIST_INT_INT(VALUE1, VALUE2) \
- DEF_ATTR_TREE_LIST (CONCAT4 (ATTR_LIST_,VALUE1,_,VALUE2), ATTR_NULL, \
- CONCAT2 (ATTR_,VALUE1), CONCAT2 (ATTR_LIST_,VALUE2))
+ DEF_ATTR_TREE_LIST (ATTR_LIST_##VALUE1##_##VALUE2, ATTR_NULL, \
+ ATTR_##VALUE1, ATTR_LIST_##VALUE2)
DEF_LIST_INT_INT (1,0)
DEF_LIST_INT_INT (1,2)
DEF_LIST_INT_INT (2,0)
@@ -130,10 +128,10 @@ DEF_ATTR_TREE_LIST (ATTR_MALLOC_NOTHROW_NONNULL_1, ATTR_MALLOC, ATTR_NULL, \
/* Construct a tree for a format attribute. */
#define DEF_FORMAT_ATTRIBUTE(TYPE, FA, VALUES) \
- DEF_ATTR_TREE_LIST (CONCAT4 (ATTR_,TYPE,_,VALUES), ATTR_NULL, \
- CONCAT2 (ATTR_,TYPE), CONCAT2 (ATTR_LIST_,VALUES)) \
- DEF_ATTR_TREE_LIST (CONCAT4 (ATTR_FORMAT_,TYPE,_,VALUES), ATTR_FORMAT, \
- CONCAT4 (ATTR_,TYPE,_,VALUES), CONCAT2 (ATTR_NOTHROW_NONNULL_,FA))
+ DEF_ATTR_TREE_LIST (ATTR_##TYPE##_##VALUES, ATTR_NULL, \
+ ATTR_##TYPE, ATTR_LIST_##VALUES) \
+ DEF_ATTR_TREE_LIST (ATTR_FORMAT_##TYPE##_##VALUES, ATTR_FORMAT, \
+ ATTR_##TYPE##_##VALUES, ATTR_NOTHROW_NONNULL_##FA)
DEF_FORMAT_ATTRIBUTE(PRINTF,1,1_0)
DEF_FORMAT_ATTRIBUTE(PRINTF,1,1_2)
DEF_FORMAT_ATTRIBUTE(PRINTF,2,2_0)
@@ -150,16 +148,16 @@ DEF_FORMAT_ATTRIBUTE(STRFMON,3,3_4)
/* Construct a tree for a format_arg attribute. */
#define DEF_FORMAT_ARG_ATTRIBUTE(FA) \
- DEF_ATTR_TREE_LIST (CONCAT2 (ATTR_FORMAT_ARG_,FA), ATTR_FORMAT_ARG, \
- CONCAT2 (ATTR_LIST_,FA), CONCAT2 (ATTR_NOTHROW_NONNULL_,FA))
+ DEF_ATTR_TREE_LIST (ATTR_FORMAT_ARG_##FA, ATTR_FORMAT_ARG, \
+ ATTR_LIST_##FA, ATTR_NOTHROW_NONNULL_##FA)
DEF_FORMAT_ARG_ATTRIBUTE(1)
DEF_FORMAT_ARG_ATTRIBUTE(2)
#undef DEF_FORMAT_ARG_ATTRIBUTE
/* Define an attribute for a function, along with the IDENTIFIER_NODE. */
#define DEF_FN_ATTR_IDENT(NAME, ATTRS, PREDICATE) \
- DEF_ATTR_IDENT (CONCAT2(ATTR_,NAME), STRINGX(NAME)) \
- DEF_FN_ATTR (CONCAT2(ATTR_,NAME), ATTRS, PREDICATE)
+ DEF_ATTR_IDENT (ATTR_##NAME, #NAME) \
+ DEF_FN_ATTR (ATTR_##NAME, ATTRS, PREDICATE)
/* The ISO C functions are always checked (whether <stdio.h> is
included or not), since it is common to call printf without
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 83797491c5d..20ccda3dfe6 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -64,7 +64,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
const char *const built_in_class_names[4]
= {"NOT_BUILT_IN", "BUILT_IN_FRONTEND", "BUILT_IN_MD", "BUILT_IN_NORMAL"};
-#define DEF_BUILTIN(X, N, C, T, LT, B, F, NA, AT, IM) STRINGX(X),
+#define DEF_BUILTIN(X, N, C, T, LT, B, F, NA, AT, IM) #X,
const char *const built_in_names[(int) END_BUILTINS] =
{
#include "builtins.def"
@@ -141,6 +141,7 @@ static rtx expand_builtin_alloca (tree, rtx);
static rtx expand_builtin_unop (enum machine_mode, tree, rtx, rtx, optab);
static rtx expand_builtin_frame_address (tree, tree);
static rtx expand_builtin_fputs (tree, int, int);
+static rtx expand_builtin_sprintf (tree, rtx, enum machine_mode);
static tree stabilize_va_list (tree, int);
static rtx expand_builtin_expect (tree, rtx);
static tree fold_builtin_constant_p (tree);
@@ -1653,38 +1654,35 @@ mathfn_built_in (tree type, enum built_in_function fn)
static void
expand_errno_check (tree exp, rtx target)
{
- rtx lab;
+ rtx lab = gen_label_rtx ();
- if (flag_errno_math && HONOR_NANS (GET_MODE (target)))
- {
- lab = gen_label_rtx ();
-
- /* Test the result; if it is NaN, set errno=EDOM because
- the argument was not in the domain. */
- emit_cmp_and_jump_insns (target, target, EQ, 0, GET_MODE (target),
- 0, lab);
+ /* Test the result; if it is NaN, set errno=EDOM because
+ the argument was not in the domain. */
+ emit_cmp_and_jump_insns (target, target, EQ, 0, GET_MODE (target),
+ 0, lab);
#ifdef TARGET_EDOM
- {
+ /* If this built-in doesn't throw an exception, set errno directly. */
+ if (TREE_NOTHROW (TREE_OPERAND (TREE_OPERAND (exp, 0), 0)))
+ {
#ifdef GEN_ERRNO_RTX
- rtx errno_rtx = GEN_ERRNO_RTX;
+ rtx errno_rtx = GEN_ERRNO_RTX;
#else
- rtx errno_rtx
+ rtx errno_rtx
= gen_rtx_MEM (word_mode, gen_rtx_SYMBOL_REF (Pmode, "errno"));
#endif
-
- emit_move_insn (errno_rtx, GEN_INT (TARGET_EDOM));
- }
-#else
- /* We can't set errno=EDOM directly; let the library call do it.
- Pop the arguments right away in case the call gets deleted. */
- NO_DEFER_POP;
- expand_call (exp, target, 0);
- OK_DEFER_POP;
-#endif
-
+ emit_move_insn (errno_rtx, GEN_INT (TARGET_EDOM));
emit_label (lab);
+ return;
}
+#endif
+
+ /* We can't set errno=EDOM directly; let the library call do it.
+ Pop the arguments right away in case the call gets deleted. */
+ NO_DEFER_POP;
+ expand_call (exp, target, 0);
+ OK_DEFER_POP;
+ emit_label (lab);
}
@@ -1701,35 +1699,14 @@ expand_builtin_mathfn (tree exp, rtx target, rtx subtarget)
rtx op0, insns;
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
tree arglist = TREE_OPERAND (exp, 1);
- enum machine_mode argmode;
- bool errno_set = true;
+ enum machine_mode mode;
+ bool errno_set = false;
+ tree arg, narg;
if (!validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
return 0;
- /* Stabilize and compute the argument. */
- if (TREE_CODE (TREE_VALUE (arglist)) != VAR_DECL
- && TREE_CODE (TREE_VALUE (arglist)) != PARM_DECL)
- {
- exp = copy_node (exp);
- TREE_OPERAND (exp, 1) = arglist;
- /* Wrap the computation of the argument in a SAVE_EXPR. That
- way, if we need to expand the argument again (as in the
- flag_errno_math case below where we cannot directly set
- errno), we will not perform side-effects more than once.
- Note that here we're mutating the original EXP as well as the
- copy; that's the right thing to do in case the original EXP
- is expanded later. */
- TREE_VALUE (arglist) = save_expr (TREE_VALUE (arglist));
- arglist = copy_node (arglist);
- }
- op0 = expand_expr (TREE_VALUE (arglist), subtarget, VOIDmode, 0);
-
- /* Make a suitable register to place result in. */
- target = gen_reg_rtx (TYPE_MODE (TREE_TYPE (exp)));
-
- emit_queue ();
- start_sequence ();
+ arg = TREE_VALUE (arglist);
switch (DECL_FUNCTION_CODE (fndecl))
{
@@ -1744,51 +1721,82 @@ expand_builtin_mathfn (tree exp, rtx target, rtx subtarget)
case BUILT_IN_SQRT:
case BUILT_IN_SQRTF:
case BUILT_IN_SQRTL:
- builtin_optab = sqrt_optab; break;
+ errno_set = ! tree_expr_nonnegative_p (arg);
+ builtin_optab = sqrt_optab;
+ break;
case BUILT_IN_EXP:
case BUILT_IN_EXPF:
case BUILT_IN_EXPL:
- builtin_optab = exp_optab; break;
+ errno_set = true; builtin_optab = exp_optab; break;
case BUILT_IN_LOG:
case BUILT_IN_LOGF:
case BUILT_IN_LOGL:
- builtin_optab = log_optab; break;
+ errno_set = true; builtin_optab = log_optab; break;
+ case BUILT_IN_TAN:
+ case BUILT_IN_TANF:
+ case BUILT_IN_TANL:
+ builtin_optab = tan_optab; break;
+ case BUILT_IN_ATAN:
+ case BUILT_IN_ATANF:
+ case BUILT_IN_ATANL:
+ builtin_optab = atan_optab; break;
case BUILT_IN_FLOOR:
case BUILT_IN_FLOORF:
case BUILT_IN_FLOORL:
- errno_set = false ; builtin_optab = floor_optab; break;
+ builtin_optab = floor_optab; break;
case BUILT_IN_CEIL:
case BUILT_IN_CEILF:
case BUILT_IN_CEILL:
- errno_set = false ; builtin_optab = ceil_optab; break;
+ builtin_optab = ceil_optab; break;
case BUILT_IN_TRUNC:
case BUILT_IN_TRUNCF:
case BUILT_IN_TRUNCL:
- errno_set = false ; builtin_optab = trunc_optab; break;
+ builtin_optab = trunc_optab; break;
case BUILT_IN_ROUND:
case BUILT_IN_ROUNDF:
case BUILT_IN_ROUNDL:
- errno_set = false ; builtin_optab = round_optab; break;
+ builtin_optab = round_optab; break;
case BUILT_IN_NEARBYINT:
case BUILT_IN_NEARBYINTF:
case BUILT_IN_NEARBYINTL:
- errno_set = false ; builtin_optab = nearbyint_optab; break;
+ builtin_optab = nearbyint_optab; break;
default:
abort ();
}
+ /* Make a suitable register to place result in. */
+ mode = TYPE_MODE (TREE_TYPE (exp));
+ target = gen_reg_rtx (mode);
+
+ if (! flag_errno_math || ! HONOR_NANS (mode))
+ errno_set = false;
+
+ /* Wrap the computation of the argument in a SAVE_EXPR, as we may
+ need to expand the argument again. This way, we will not perform
+ side-effects more the once. */
+ narg = save_expr (arg);
+ if (narg != arg)
+ {
+ arglist = build_tree_list (NULL_TREE, arg);
+ exp = build_function_call_expr (fndecl, arglist);
+ }
+
+ op0 = expand_expr (arg, subtarget, VOIDmode, 0);
+
+ emit_queue ();
+ start_sequence ();
+
/* Compute into TARGET.
Set TARGET to wherever the result comes back. */
- argmode = TYPE_MODE (TREE_TYPE (TREE_VALUE (arglist)));
- target = expand_unop (argmode, builtin_optab, op0, target, 0);
+ target = expand_unop (mode, builtin_optab, op0, target, 0);
- /* If we were unable to expand via the builtin, stop the
- sequence (without outputting the insns) and return 0, causing
- a call to the library function. */
+ /* If we were unable to expand via the builtin, stop the sequence
+ (without outputting the insns) and call to the library function
+ with the stabilized argument list. */
if (target == 0)
{
end_sequence ();
- return 0;
+ return expand_call (exp, target, target == const0_rtx);
}
if (errno_set)
@@ -1816,8 +1824,8 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget)
rtx op0, op1, insns;
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
tree arglist = TREE_OPERAND (exp, 1);
- tree arg0, arg1;
- enum machine_mode argmode;
+ tree arg0, arg1, temp, narg;
+ enum machine_mode mode;
bool errno_set = true;
bool stable = true;
@@ -1827,64 +1835,67 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget)
arg0 = TREE_VALUE (arglist);
arg1 = TREE_VALUE (TREE_CHAIN (arglist));
- /* Stabilize the arguments. */
- if (TREE_CODE (arg0) != VAR_DECL && TREE_CODE (arg0) != PARM_DECL)
+ switch (DECL_FUNCTION_CODE (fndecl))
{
- arg0 = save_expr (arg0);
- TREE_VALUE (arglist) = arg0;
- stable = false;
+ case BUILT_IN_POW:
+ case BUILT_IN_POWF:
+ case BUILT_IN_POWL:
+ builtin_optab = pow_optab; break;
+ case BUILT_IN_ATAN2:
+ case BUILT_IN_ATAN2F:
+ case BUILT_IN_ATAN2L:
+ builtin_optab = atan2_optab; break;
+ default:
+ abort ();
}
- if (TREE_CODE (arg1) != VAR_DECL && TREE_CODE (arg1) != PARM_DECL)
+
+ /* Make a suitable register to place result in. */
+ mode = TYPE_MODE (TREE_TYPE (exp));
+ target = gen_reg_rtx (mode);
+
+ if (! flag_errno_math || ! HONOR_NANS (mode))
+ errno_set = false;
+
+ /* Alway stabilize the argument list. */
+ narg = save_expr (arg1);
+ if (narg != arg1)
{
- arg1 = save_expr (arg1);
- TREE_VALUE (TREE_CHAIN (arglist)) = arg1;
+ temp = build_tree_list (NULL_TREE, narg);
stable = false;
}
+ else
+ temp = TREE_CHAIN (arglist);
- if (! stable)
+ narg = save_expr (arg0);
+ if (narg != arg0)
{
- exp = copy_node (exp);
- arglist = tree_cons (NULL_TREE, arg0,
- build_tree_list (NULL_TREE, arg1));
- TREE_OPERAND (exp, 1) = arglist;
+ arglist = tree_cons (NULL_TREE, narg, temp);
+ stable = false;
}
+ else if (! stable)
+ arglist = tree_cons (NULL_TREE, arg0, temp);
+
+ if (! stable)
+ exp = build_function_call_expr (fndecl, arglist);
op0 = expand_expr (arg0, subtarget, VOIDmode, 0);
op1 = expand_expr (arg1, 0, VOIDmode, 0);
- /* Make a suitable register to place result in. */
- target = gen_reg_rtx (TYPE_MODE (TREE_TYPE (exp)));
-
emit_queue ();
start_sequence ();
- switch (DECL_FUNCTION_CODE (fndecl))
- {
- case BUILT_IN_POW:
- case BUILT_IN_POWF:
- case BUILT_IN_POWL:
- builtin_optab = pow_optab; break;
- case BUILT_IN_ATAN2:
- case BUILT_IN_ATAN2F:
- case BUILT_IN_ATAN2L:
- builtin_optab = atan2_optab; break;
- default:
- abort ();
- }
-
/* Compute into TARGET.
Set TARGET to wherever the result comes back. */
- argmode = TYPE_MODE (TREE_TYPE (arg0));
- target = expand_binop (argmode, builtin_optab, op0, op1,
+ target = expand_binop (mode, builtin_optab, op0, op1,
target, 0, OPTAB_DIRECT);
- /* If we were unable to expand via the builtin, stop the
- sequence (without outputting the insns) and return 0, causing
- a call to the library function. */
+ /* If we were unable to expand via the builtin, stop the sequence
+ (without outputting the insns) and call to the library function
+ with the stabilized argument list. */
if (target == 0)
{
end_sequence ();
- return 0;
+ return expand_call (exp, target, target == const0_rtx);
}
if (errno_set)
@@ -1898,6 +1909,253 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget)
return target;
}
+/* To evaluate powi(x,n), the floating point value x raised to the
+ constant integer exponent n, we use a hybrid algorithm that
+ combines the "window method" with look-up tables. For an
+ introduction to exponentiation algorithms and "addition chains",
+ see section 4.6.3, "Evaluation of Powers" of Donald E. Knuth,
+ "Seminumerical Algorithms", Vol. 2, "The Art of Computer Programming",
+ 3rd Edition, 1998, and Daniel M. Gordon, "A Survey of Fast Exponentiation
+ Methods", Journal of Algorithms, Vol. 27, pp. 129-146, 1998. */
+
+/* Provide a default value for POWI_MAX_MULTS, the maximum number of
+ multiplications to inline before calling the system library's pow
+ function. powi(x,n) requires at worst 2*bits(n)-2 multiplications,
+ so this default never requires calling pow, powf or powl. */
+
+#ifndef POWI_MAX_MULTS
+#define POWI_MAX_MULTS (2*HOST_BITS_PER_WIDE_INT-2)
+#endif
+
+/* The size of the "optimal power tree" lookup table. All
+ exponents less than this value are simply looked up in the
+ powi_table below. This threshold is also used to size the
+ cache of pseudo registers that hold intermediate results. */
+#define POWI_TABLE_SIZE 256
+
+/* The size, in bits of the window, used in the "window method"
+ exponentiation algorithm. This is equivalent to a radix of
+ (1<<POWI_WINDOW_SIZE) in the corresponding "m-ary method". */
+#define POWI_WINDOW_SIZE 3
+
+/* The following table is an efficient representation of an
+ "optimal power tree". For each value, i, the corresponding
+ value, j, in the table states than an optimal evaluation
+ sequence for calculating pow(x,i) can be found by evaluating
+ pow(x,j)*pow(x,i-j). An optimal power tree for the first
+ 100 integers is given in Knuth's "Seminumerical algorithms". */
+
+static const unsigned char powi_table[POWI_TABLE_SIZE] =
+ {
+ 0, 1, 1, 2, 2, 3, 3, 4, /* 0 - 7 */
+ 4, 6, 5, 6, 6, 10, 7, 9, /* 8 - 15 */
+ 8, 16, 9, 16, 10, 12, 11, 13, /* 16 - 23 */
+ 12, 17, 13, 18, 14, 24, 15, 26, /* 24 - 31 */
+ 16, 17, 17, 19, 18, 33, 19, 26, /* 32 - 39 */
+ 20, 25, 21, 40, 22, 27, 23, 44, /* 40 - 47 */
+ 24, 32, 25, 34, 26, 29, 27, 44, /* 48 - 55 */
+ 28, 31, 29, 34, 30, 60, 31, 36, /* 56 - 63 */
+ 32, 64, 33, 34, 34, 46, 35, 37, /* 64 - 71 */
+ 36, 65, 37, 50, 38, 48, 39, 69, /* 72 - 79 */
+ 40, 49, 41, 43, 42, 51, 43, 58, /* 80 - 87 */
+ 44, 64, 45, 47, 46, 59, 47, 76, /* 88 - 95 */
+ 48, 65, 49, 66, 50, 67, 51, 66, /* 96 - 103 */
+ 52, 70, 53, 74, 54, 104, 55, 74, /* 104 - 111 */
+ 56, 64, 57, 69, 58, 78, 59, 68, /* 112 - 119 */
+ 60, 61, 61, 80, 62, 75, 63, 68, /* 120 - 127 */
+ 64, 65, 65, 128, 66, 129, 67, 90, /* 128 - 135 */
+ 68, 73, 69, 131, 70, 94, 71, 88, /* 136 - 143 */
+ 72, 128, 73, 98, 74, 132, 75, 121, /* 144 - 151 */
+ 76, 102, 77, 124, 78, 132, 79, 106, /* 152 - 159 */
+ 80, 97, 81, 160, 82, 99, 83, 134, /* 160 - 167 */
+ 84, 86, 85, 95, 86, 160, 87, 100, /* 168 - 175 */
+ 88, 113, 89, 98, 90, 107, 91, 122, /* 176 - 183 */
+ 92, 111, 93, 102, 94, 126, 95, 150, /* 184 - 191 */
+ 96, 128, 97, 130, 98, 133, 99, 195, /* 192 - 199 */
+ 100, 128, 101, 123, 102, 164, 103, 138, /* 200 - 207 */
+ 104, 145, 105, 146, 106, 109, 107, 149, /* 208 - 215 */
+ 108, 200, 109, 146, 110, 170, 111, 157, /* 216 - 223 */
+ 112, 128, 113, 130, 114, 182, 115, 132, /* 224 - 231 */
+ 116, 200, 117, 132, 118, 158, 119, 206, /* 232 - 239 */
+ 120, 240, 121, 162, 122, 147, 123, 152, /* 240 - 247 */
+ 124, 166, 125, 214, 126, 138, 127, 153, /* 248 - 255 */
+ };
+
+
+/* Return the number of multiplications required to calculate
+ powi(x,n) where n is less than POWI_TABLE_SIZE. This is a
+ subroutine of powi_cost. CACHE is an array indicating
+ which exponents have already been calculated. */
+
+static int
+powi_lookup_cost (unsigned HOST_WIDE_INT n, bool *cache)
+{
+ /* If we've already calculated this exponent, then this evaluation
+ doesn't require any additional multiplications. */
+ if (cache[n])
+ return 0;
+
+ cache[n] = true;
+ return powi_lookup_cost (n - powi_table[n], cache)
+ + powi_lookup_cost (powi_table[n], cache) + 1;
+}
+
+/* Return the number of multiplications required to calculate
+ powi(x,n) for an arbitrary x, given the exponent N. This
+ function needs to be kept in sync with expand_powi below. */
+
+static int
+powi_cost (HOST_WIDE_INT n)
+{
+ bool cache[POWI_TABLE_SIZE];
+ unsigned HOST_WIDE_INT digit;
+ unsigned HOST_WIDE_INT val;
+ int result;
+
+ if (n == 0)
+ return 0;
+
+ /* Ignore the reciprocal when calculating the cost. */
+ val = (n < 0) ? -n : n;
+
+ /* Initialize the exponent cache. */
+ memset (cache, 0, POWI_TABLE_SIZE * sizeof (bool));
+ cache[1] = true;
+
+ result = 0;
+
+ while (val >= POWI_TABLE_SIZE)
+ {
+ if (val & 1)
+ {
+ digit = val & ((1 << POWI_WINDOW_SIZE) - 1);
+ result += powi_lookup_cost (digit, cache)
+ + POWI_WINDOW_SIZE + 1;
+ val >>= POWI_WINDOW_SIZE;
+ }
+ else
+ {
+ val >>= 1;
+ result++;
+ }
+ }
+
+ return result + powi_lookup_cost (val, cache);
+}
+
+/* Recursive subroutine of expand_powi. This function takes the array,
+ CACHE, of already calculated exponents and an exponent N and returns
+ an RTX that corresponds to CACHE[1]**N, as calculated in mode MODE. */
+
+static rtx
+expand_powi_1 (enum machine_mode mode, unsigned HOST_WIDE_INT n, rtx *cache)
+{
+ unsigned HOST_WIDE_INT digit;
+ rtx target, result;
+ rtx op0, op1;
+
+ if (n < POWI_TABLE_SIZE)
+ {
+ if (cache[n])
+ return cache[n];
+
+ target = gen_reg_rtx (mode);
+ cache[n] = target;
+
+ op0 = expand_powi_1 (mode, n - powi_table[n], cache);
+ op1 = expand_powi_1 (mode, powi_table[n], cache);
+ }
+ else if (n & 1)
+ {
+ target = gen_reg_rtx (mode);
+ digit = n & ((1 << POWI_WINDOW_SIZE) - 1);
+ op0 = expand_powi_1 (mode, n - digit, cache);
+ op1 = expand_powi_1 (mode, digit, cache);
+ }
+ else
+ {
+ target = gen_reg_rtx (mode);
+ op0 = expand_powi_1 (mode, n >> 1, cache);
+ op1 = op0;
+ }
+
+ result = expand_mult (mode, op0, op1, target, 0);
+ if (result != target)
+ emit_move_insn (target, result);
+ return target;
+}
+
+/* Expand the RTL to evaluate powi(x,n) in mode MODE. X is the
+ floating point operand in mode MODE, and N is the exponent. This
+ function needs to be kept in sync with powi_cost above. */
+
+static rtx
+expand_powi (rtx x, enum machine_mode mode, HOST_WIDE_INT n)
+{
+ unsigned HOST_WIDE_INT val;
+ rtx cache[POWI_TABLE_SIZE];
+ rtx result;
+
+ if (n == 0)
+ return CONST1_RTX (mode);
+
+ val = (n < 0) ? -n : n;
+
+ memset (cache, 0, sizeof(cache));
+ cache[1] = x;
+
+ result = expand_powi_1 (mode, (n < 0) ? -n : n, cache);
+
+ /* If the original exponent was negative, reciprocate the result. */
+ if (n < 0)
+ result = expand_binop (mode, sdiv_optab, CONST1_RTX (mode),
+ result, NULL_RTX, 0, OPTAB_LIB_WIDEN);
+
+ return result;
+}
+
+/* Expand a call to the pow built-in mathematical function. Return 0 if
+ a normal call should be emitted rather than expanding the function
+ in-line. EXP is the expression that is a call to the builtin
+ function; if convenient, the result should be placed in TARGET. */
+
+static rtx
+expand_builtin_pow (tree exp, rtx target, rtx subtarget)
+{
+ tree arglist = TREE_OPERAND (exp, 1);
+ tree arg0, arg1;
+
+ if (! validate_arglist (arglist, REAL_TYPE, REAL_TYPE, VOID_TYPE))
+ return 0;
+
+ arg0 = TREE_VALUE (arglist);
+ arg1 = TREE_VALUE (TREE_CHAIN (arglist));
+
+ if (flag_unsafe_math_optimizations
+ && ! flag_errno_math
+ && ! optimize_size
+ && TREE_CODE (arg1) == REAL_CST
+ && ! TREE_CONSTANT_OVERFLOW (arg1))
+ {
+ REAL_VALUE_TYPE cint;
+ REAL_VALUE_TYPE c;
+ HOST_WIDE_INT n;
+
+ c = TREE_REAL_CST (arg1);
+ n = real_to_integer (&c);
+ real_from_integer (&cint, VOIDmode, n, n < 0 ? -1 : 0, 0);
+ if (real_identical (&c, &cint)
+ && powi_cost (n) <= POWI_MAX_MULTS)
+ {
+ enum machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
+ rtx op = expand_expr (arg0, subtarget, VOIDmode, 0);
+ op = force_reg (mode, op);
+ return expand_powi (op, mode, n);
+ }
+ }
+ return expand_builtin_mathfn_2 (exp, target, NULL_RTX);
+}
+
/* Expand expression EXP which is a call to the strlen builtin. Return 0
if we failed the caller should emit a normal call, otherwise
try to get the result in TARGET, if convenient. */
@@ -2269,11 +2527,11 @@ expand_builtin_memcpy (tree arglist, rtx target, enum machine_mode mode)
&& GET_CODE (len_rtx) == CONST_INT
&& (unsigned HOST_WIDE_INT) INTVAL (len_rtx) <= strlen (src_str) + 1
&& can_store_by_pieces (INTVAL (len_rtx), builtin_memcpy_read_str,
- (PTR) src_str, dest_align))
+ (void *) src_str, dest_align))
{
dest_mem = store_by_pieces (dest_mem, INTVAL (len_rtx),
builtin_memcpy_read_str,
- (PTR) src_str, dest_align, 0);
+ (void *) src_str, dest_align, 0);
dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX);
#ifdef POINTERS_EXTEND_UNSIGNED
if (GET_MODE (dest_mem) != ptr_mode)
@@ -2366,13 +2624,13 @@ expand_builtin_mempcpy (tree arglist, rtx target, enum machine_mode mode,
&& GET_CODE (len_rtx) == CONST_INT
&& (unsigned HOST_WIDE_INT) INTVAL (len_rtx) <= strlen (src_str) + 1
&& can_store_by_pieces (INTVAL (len_rtx), builtin_memcpy_read_str,
- (PTR) src_str, dest_align))
+ (void *) src_str, dest_align))
{
dest_mem = get_memory_rtx (dest);
set_mem_align (dest_mem, dest_align);
dest_mem = store_by_pieces (dest_mem, INTVAL (len_rtx),
builtin_memcpy_read_str,
- (PTR) src_str, dest_align, endp);
+ (void *) src_str, dest_align, endp);
dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX);
#ifdef POINTERS_EXTEND_UNSIGNED
if (GET_MODE (dest_mem) != ptr_mode)
@@ -2491,7 +2749,7 @@ expand_builtin_bcopy (tree arglist)
static rtx
expand_builtin_strcpy (tree arglist, rtx target, enum machine_mode mode)
{
- tree fn, len;
+ tree fn, len, src, dst;
if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
return 0;
@@ -2500,12 +2758,16 @@ expand_builtin_strcpy (tree arglist, rtx target, enum machine_mode mode)
if (!fn)
return 0;
- len = c_strlen (TREE_VALUE (TREE_CHAIN (arglist)));
- if (len == 0)
+ src = TREE_VALUE (TREE_CHAIN (arglist));
+ len = c_strlen (src);
+ if (len == 0 || TREE_SIDE_EFFECTS (len))
return 0;
+ dst = TREE_VALUE (arglist);
len = size_binop (PLUS_EXPR, len, ssize_int (1));
- chainon (arglist, build_tree_list (NULL_TREE, len));
+ arglist = build_tree_list (NULL_TREE, len);
+ arglist = tree_cons (NULL_TREE, src, arglist);
+ arglist = tree_cons (NULL_TREE, dst, arglist);
return expand_expr (build_function_call_expr (fn, arglist),
target, mode, EXPAND_NORMAL);
}
@@ -2522,8 +2784,7 @@ expand_builtin_stpcpy (tree arglist, rtx target, enum machine_mode mode)
return 0;
else
{
- tree newarglist;
- tree src, len;
+ tree dst, src, len;
/* If return value is ignored, transform stpcpy into strcpy. */
if (target == const0_rtx)
@@ -2544,10 +2805,12 @@ expand_builtin_stpcpy (tree arglist, rtx target, enum machine_mode mode)
if (! c_getstr (src) || ! (len = c_strlen (src)))
return 0;
+ dst = TREE_VALUE (arglist);
len = fold (size_binop (PLUS_EXPR, len, ssize_int (1)));
- newarglist = copy_list (arglist);
- chainon (newarglist, build_tree_list (NULL_TREE, len));
- return expand_builtin_mempcpy (newarglist, target, mode, /*endp=*/2);
+ arglist = build_tree_list (NULL_TREE, len);
+ arglist = tree_cons (NULL_TREE, src, arglist);
+ arglist = tree_cons (NULL_TREE, dst, arglist);
+ return expand_builtin_mempcpy (arglist, target, mode, /*endp=*/2);
}
}
@@ -2618,13 +2881,13 @@ expand_builtin_strncpy (tree arglist, rtx target, enum machine_mode mode)
if (!p || dest_align == 0 || !host_integerp (len, 1)
|| !can_store_by_pieces (tree_low_cst (len, 1),
builtin_strncpy_read_str,
- (PTR) p, dest_align))
+ (void *) p, dest_align))
return 0;
dest_mem = get_memory_rtx (dest);
store_by_pieces (dest_mem, tree_low_cst (len, 1),
builtin_strncpy_read_str,
- (PTR) p, dest_align, 0);
+ (void *) p, dest_align, 0);
dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX);
#ifdef POINTERS_EXTEND_UNSIGNED
if (GET_MODE (dest_mem) != ptr_mode)
@@ -2735,7 +2998,7 @@ expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode)
c = 1;
if (!can_store_by_pieces (tree_low_cst (len, 1),
builtin_memset_read_str,
- (PTR) &c, dest_align))
+ &c, dest_align))
return 0;
val = fold (build1 (CONVERT_EXPR, unsigned_char_type_node, val));
@@ -2745,7 +3008,7 @@ expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode)
dest_mem = get_memory_rtx (dest);
store_by_pieces (dest_mem, tree_low_cst (len, 1),
builtin_memset_gen_str,
- (PTR) val_rtx, dest_align, 0);
+ val_rtx, dest_align, 0);
dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX);
#ifdef POINTERS_EXTEND_UNSIGNED
if (GET_MODE (dest_mem) != ptr_mode)
@@ -2762,14 +3025,14 @@ expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode)
if (!host_integerp (len, 1))
return 0;
if (!can_store_by_pieces (tree_low_cst (len, 1),
- builtin_memset_read_str, (PTR) &c,
+ builtin_memset_read_str, &c,
dest_align))
return 0;
dest_mem = get_memory_rtx (dest);
store_by_pieces (dest_mem, tree_low_cst (len, 1),
builtin_memset_read_str,
- (PTR) &c, dest_align, 0);
+ &c, dest_align, 0);
dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX);
#ifdef POINTERS_EXTEND_UNSIGNED
if (GET_MODE (dest_mem) != ptr_mode)
@@ -3982,7 +4245,7 @@ expand_builtin_fputs (tree arglist, int ignore, int unlocked)
{
tree string_arg;
- /* If optimizing for size keep fputs. */
+ /* If optimizing for size keep fputs. */
if (optimize_size)
return 0;
string_arg = TREE_VALUE (arglist);
@@ -4038,7 +4301,7 @@ expand_builtin_expect (tree arglist, rtx target)
rtx_c = expand_expr (c, NULL_RTX, GET_MODE (target), EXPAND_NORMAL);
- note = emit_note (NULL, NOTE_INSN_EXPECTED_VALUE);
+ note = emit_note (NOTE_INSN_EXPECTED_VALUE);
NOTE_EXPECTED_VALUE (note) = gen_rtx_EQ (VOIDmode, target, rtx_c);
}
@@ -4221,6 +4484,90 @@ expand_builtin_cabs (tree arglist, rtx target)
return expand_complex_abs (mode, op0, target, 0);
}
+/* Expand a call to sprintf with argument list ARGLIST. Return 0 if
+ a normal call should be emitted rather than expanding the function
+ inline. If convenient, the result should be placed in TARGET with
+ mode MODE. */
+
+static rtx
+expand_builtin_sprintf (tree arglist, rtx target, enum machine_mode mode)
+{
+ tree orig_arglist, dest, fmt;
+ const char *fmt_str;
+
+ orig_arglist = arglist;
+
+ /* Verify the required arguments in the original call. */
+ if (! arglist)
+ return 0;
+ dest = TREE_VALUE (arglist);
+ if (TREE_CODE (TREE_TYPE (dest)) != POINTER_TYPE)
+ return 0;
+ arglist = TREE_CHAIN (arglist);
+ if (! arglist)
+ return 0;
+ fmt = TREE_VALUE (arglist);
+ if (TREE_CODE (TREE_TYPE (dest)) != POINTER_TYPE)
+ return 0;
+ arglist = TREE_CHAIN (arglist);
+
+ /* Check whether the format is a literal string constant. */
+ fmt_str = c_getstr (fmt);
+ if (fmt_str == NULL)
+ return 0;
+
+ /* If the format doesn't contain % args or %%, use strcpy. */
+ if (strchr (fmt_str, '%') == 0)
+ {
+ tree fn = implicit_built_in_decls[BUILT_IN_STRCPY];
+ tree exp;
+
+ if (arglist || ! fn)
+ return 0;
+ expand_expr (build_function_call_expr (fn, orig_arglist),
+ const0_rtx, VOIDmode, EXPAND_NORMAL);
+ if (target == const0_rtx)
+ return const0_rtx;
+ exp = build_int_2 (strlen (fmt_str), 0);
+ exp = fold (build1 (NOP_EXPR, integer_type_node, exp));
+ return expand_expr (exp, target, mode, EXPAND_NORMAL);
+ }
+ /* If the format is "%s", use strcpy if the result isn't used. */
+ else if (strcmp (fmt_str, "%s") == 0)
+ {
+ tree fn, arg, len;
+ fn = implicit_built_in_decls[BUILT_IN_STRCPY];
+
+ if (! fn)
+ return 0;
+
+ if (! arglist || TREE_CHAIN (arglist))
+ return 0;
+ arg = TREE_VALUE (arglist);
+ if (TREE_CODE (TREE_TYPE (arg)) != POINTER_TYPE)
+ return 0;
+
+ if (target != const0_rtx)
+ {
+ len = c_strlen (arg);
+ if (! len || TREE_CODE (len) != INTEGER_CST)
+ return 0;
+ }
+ else
+ len = NULL_TREE;
+
+ arglist = build_tree_list (NULL_TREE, arg);
+ arglist = tree_cons (NULL_TREE, dest, arglist);
+ expand_expr (build_function_call_expr (fn, arglist),
+ const0_rtx, VOIDmode, EXPAND_NORMAL);
+
+ if (target == const0_rtx)
+ return const0_rtx;
+ return expand_expr (len, target, mode, EXPAND_NORMAL);
+ }
+
+ return 0;
+}
/* Expand an expression EXP that calls a built-in function,
with result going to TARGET if that's convenient
@@ -4285,6 +4632,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_BCOPY:
case BUILT_IN_INDEX:
case BUILT_IN_RINDEX:
+ case BUILT_IN_SPRINTF:
case BUILT_IN_STPCPY:
case BUILT_IN_STRCHR:
case BUILT_IN_STRRCHR:
@@ -4416,6 +4764,12 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_LOG:
case BUILT_IN_LOGF:
case BUILT_IN_LOGL:
+ case BUILT_IN_TAN:
+ case BUILT_IN_TANF:
+ case BUILT_IN_TANL:
+ case BUILT_IN_ATAN:
+ case BUILT_IN_ATANF:
+ case BUILT_IN_ATANL:
/* Treat these like sqrt only if unsafe math optimizations are allowed,
because of possible accuracy problems. */
if (! flag_unsafe_math_optimizations)
@@ -4446,6 +4800,13 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_POW:
case BUILT_IN_POWF:
case BUILT_IN_POWL:
+ if (! flag_unsafe_math_optimizations)
+ break;
+ target = expand_builtin_pow (exp, target, subtarget);
+ if (target)
+ return target;
+ break;
+
case BUILT_IN_ATAN2:
case BUILT_IN_ATAN2F:
case BUILT_IN_ATAN2L:
@@ -4750,6 +5111,12 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
return target;
break;
+ case BUILT_IN_SPRINTF:
+ target = expand_builtin_sprintf (arglist, target, mode);
+ if (target)
+ return target;
+ break;
+
/* Various hooks for the DWARF 2 __throw routine. */
case BUILT_IN_UNWIND_INIT:
expand_builtin_unwind_init ();
diff --git a/gcc/c-aux-info.c b/gcc/c-aux-info.c
index 1297cc13377..b0a9ef040b7 100644
--- a/gcc/c-aux-info.c
+++ b/gcc/c-aux-info.c
@@ -2,7 +2,7 @@
on information stored in GCC's tree structure. This code implements the
-aux-info option.
Copyright (C) 1989, 1991, 1994, 1995, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2003 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@segfault.us.com).
This file is part of GCC.
@@ -41,12 +41,12 @@ typedef enum formals_style_enum formals_style;
static const char *data_type;
-static char *affix_data_type PARAMS ((const char *)) ATTRIBUTE_MALLOC;
-static const char *gen_formal_list_for_type PARAMS ((tree, formals_style));
-static int deserves_ellipsis PARAMS ((tree));
-static const char *gen_formal_list_for_func_def PARAMS ((tree, formals_style));
-static const char *gen_type PARAMS ((const char *, tree, formals_style));
-static const char *gen_decl PARAMS ((tree, int, formals_style));
+static char *affix_data_type (const char *) ATTRIBUTE_MALLOC;
+static const char *gen_formal_list_for_type (tree, formals_style);
+static int deserves_ellipsis (tree);
+static const char *gen_formal_list_for_func_def (tree, formals_style);
+static const char *gen_type (const char *, tree, formals_style);
+static const char *gen_decl (tree, int, formals_style);
/* Given a string representing an entire type or an entire declaration
which only lacks the actual "data-type" specifier (at its left end),
@@ -63,8 +63,7 @@ static const char *gen_decl PARAMS ((tree, int, formals_style));
that look as expected. */
static char *
-affix_data_type (param)
- const char *param;
+affix_data_type (const char *param)
{
char *const type_or_decl = ASTRDUP (param);
char *p = type_or_decl;
@@ -110,9 +109,7 @@ affix_data_type (param)
of empty parens here. */
static const char *
-gen_formal_list_for_type (fntype, style)
- tree fntype;
- formals_style style;
+gen_formal_list_for_type (tree fntype, formals_style style)
{
const char *formal_list = "";
tree formal_type;
@@ -194,8 +191,7 @@ gen_formal_list_for_type (fntype, style)
if the "function type" parameter list should end with an ellipsis. */
static int
-deserves_ellipsis (fntype)
- tree fntype;
+deserves_ellipsis (tree fntype)
{
tree formal_type;
@@ -230,9 +226,7 @@ deserves_ellipsis (fntype)
function formal parameter list. */
static const char *
-gen_formal_list_for_func_def (fndecl, style)
- tree fndecl;
- formals_style style;
+gen_formal_list_for_func_def (tree fndecl, formals_style style)
{
const char *formal_list = "";
tree formal_decl;
@@ -305,10 +299,7 @@ gen_formal_list_for_func_def (fndecl, style)
string onto the returned "seed". */
static const char *
-gen_type (ret_val, t, style)
- const char *ret_val;
- tree t;
- formals_style style;
+gen_type (const char *ret_val, tree t, formals_style style)
{
tree chain_p;
@@ -434,13 +425,13 @@ gen_type (ret_val, t, style)
case TYPE_DECL:
data_type = IDENTIFIER_POINTER (DECL_NAME (t));
break;
-
+
case INTEGER_TYPE:
data_type = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (t)));
/* Normally, `unsigned' is part of the deal. Not so if it comes
- with a type qualifier. */
+ with a type qualifier. */
if (TREE_UNSIGNED (t) && TYPE_QUALS (t))
- data_type = concat ("unsigned ", data_type, NULL);
+ data_type = concat ("unsigned ", data_type, NULL);
break;
case REAL_TYPE:
@@ -479,10 +470,7 @@ gen_type (ret_val, t, style)
an attached list of DECL nodes for function formal arguments is present. */
static const char *
-gen_decl (decl, is_func_definition, style)
- tree decl;
- int is_func_definition;
- formals_style style;
+gen_decl (tree decl, int is_func_definition, formals_style style)
{
const char *ret_val;
@@ -560,11 +548,8 @@ extern FILE *aux_info_file;
function definition (even the implicit ones). */
void
-gen_aux_info_record (fndecl, is_definition, is_implicit, is_prototyped)
- tree fndecl;
- int is_definition;
- int is_implicit;
- int is_prototyped;
+gen_aux_info_record (tree fndecl, int is_definition, int is_implicit,
+ int is_prototyped)
{
if (flag_gen_aux_info)
{
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 30a7db74efb..43f9586d415 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -180,7 +180,7 @@ enum c_language_kind c_language;
tree c99_function_name_decl_node;
Stack of nested function name VAR_DECLs.
-
+
tree saved_function_name_decls;
*/
@@ -328,9 +328,9 @@ int warn_char_subscripts;
int warn_conversion;
-/* Warn about #pragma directives that are not recognized. */
+/* Warn about #pragma directives that are not recognized. */
-int warn_unknown_pragmas; /* Tri state variable. */
+int warn_unknown_pragmas; /* Tri state variable. */
/* Warn about format/argument anomalies in calls to formatted I/O functions
(*printf, *scanf, strftime, strfmon, etc.). */
@@ -432,8 +432,8 @@ int warn_div_by_zero = 1;
int warn_implicit_int;
/* Warn about NULL being passed to argument slots marked as requiring
- non-NULL. */
-
+ non-NULL. */
+
int warn_nonnull;
@@ -476,7 +476,7 @@ int warn_selector;
int warn_undeclared_selector;
-/* Warn if methods required by a protocol are not implemented in the
+/* Warn if methods required by a protocol are not implemented in the
class adopting it. When turned off, methods inherited to that
class are also considered implemented. */
@@ -595,7 +595,7 @@ int flag_enforce_eh_specs = 1;
/* The version of the C++ ABI in use. The following values are
allowed:
- 0: The version of the ABI believed most conformant with the
+ 0: The version of the ABI believed most conformant with the
C++ ABI specification. This ABI may change as bugs are
discovered and fixed. Therefore, 0 will not necessarily
indicate the same ABI in different versions of G++.
@@ -612,8 +612,8 @@ int flag_abi_version = 1;
int warn_abi = 0;
-/* Nonzero means warn about invalid uses of offsetof. */
-
+/* Nonzero means warn about invalid uses of offsetof. */
+
int warn_invalid_offsetof = 1;
/* Nonzero means warn about implicit declarations. */
@@ -683,11 +683,11 @@ int max_tinst_depth = 500;
type names and storage classes. It is indexed by a RID_... value. */
tree *ridpointers;
-tree (*make_fname_decl) PARAMS ((tree, int));
+tree (*make_fname_decl) (tree, int);
/* If non-NULL, the address of a language-specific function that takes
any action required right before expand_function_end is called. */
-void (*lang_expand_function_end) PARAMS ((void));
+void (*lang_expand_function_end) (void);
/* Nonzero means the expression being parsed will never be evaluated.
This is a count, since unevaluated expressions can nest. */
@@ -714,7 +714,7 @@ const struct fname_var_t fname_vars[] =
{NULL, 0, 0},
};
-static int constant_fits_type_p PARAMS ((tree, tree));
+static int constant_fits_type_p (tree, tree);
/* Keep a stack of if statements. We record the number of compound
statements seen up to the if keyword, as well as the line number
@@ -737,78 +737,55 @@ static int if_stack_space = 0;
/* Stack pointer. */
static int if_stack_pointer = 0;
-static tree handle_packed_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_nocommon_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_common_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_noreturn_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_noinline_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_always_inline_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_used_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_unused_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_const_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_transparent_union_attribute PARAMS ((tree *, tree, tree,
- int, bool *));
-static tree handle_constructor_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_destructor_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_mode_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_section_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_aligned_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_weak_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_alias_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_visibility_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_tls_model_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_no_instrument_function_attribute PARAMS ((tree *, tree,
- tree, int,
- bool *));
-static tree handle_malloc_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_no_limit_stack_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_pure_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_deprecated_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_vector_size_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_nonnull_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_nothrow_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree handle_cleanup_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree vector_size_helper PARAMS ((tree, tree));
-
-static void check_function_nonnull PARAMS ((tree, tree));
-static void check_nonnull_arg PARAMS ((void *, tree,
- unsigned HOST_WIDE_INT));
-static bool nonnull_check_p PARAMS ((tree, unsigned HOST_WIDE_INT));
-static bool get_nonnull_operand PARAMS ((tree,
- unsigned HOST_WIDE_INT *));
+static tree handle_packed_attribute (tree *, tree, tree, int, bool *);
+static tree handle_nocommon_attribute (tree *, tree, tree, int, bool *);
+static tree handle_common_attribute (tree *, tree, tree, int, bool *);
+static tree handle_noreturn_attribute (tree *, tree, tree, int, bool *);
+static tree handle_noinline_attribute (tree *, tree, tree, int, bool *);
+static tree handle_always_inline_attribute (tree *, tree, tree, int,
+ bool *);
+static tree handle_used_attribute (tree *, tree, tree, int, bool *);
+static tree handle_unused_attribute (tree *, tree, tree, int, bool *);
+static tree handle_const_attribute (tree *, tree, tree, int, bool *);
+static tree handle_transparent_union_attribute (tree *, tree, tree,
+ int, bool *);
+static tree handle_constructor_attribute (tree *, tree, tree, int, bool *);
+static tree handle_destructor_attribute (tree *, tree, tree, int, bool *);
+static tree handle_mode_attribute (tree *, tree, tree, int, bool *);
+static tree handle_section_attribute (tree *, tree, tree, int, bool *);
+static tree handle_aligned_attribute (tree *, tree, tree, int, bool *);
+static tree handle_weak_attribute (tree *, tree, tree, int, bool *) ;
+static tree handle_alias_attribute (tree *, tree, tree, int, bool *);
+static tree handle_visibility_attribute (tree *, tree, tree, int,
+ bool *);
+static tree handle_tls_model_attribute (tree *, tree, tree, int,
+ bool *);
+static tree handle_no_instrument_function_attribute (tree *, tree,
+ tree, int, bool *);
+static tree handle_malloc_attribute (tree *, tree, tree, int, bool *);
+static tree handle_no_limit_stack_attribute (tree *, tree, tree, int,
+ bool *);
+static tree handle_pure_attribute (tree *, tree, tree, int, bool *);
+static tree handle_deprecated_attribute (tree *, tree, tree, int,
+ bool *);
+static tree handle_vector_size_attribute (tree *, tree, tree, int,
+ bool *);
+static tree handle_nonnull_attribute (tree *, tree, tree, int, bool *);
+static tree handle_nothrow_attribute (tree *, tree, tree, int, bool *);
+static tree handle_cleanup_attribute (tree *, tree, tree, int, bool *);
+static tree vector_size_helper (tree, tree);
+
+static void check_function_nonnull (tree, tree);
+static void check_nonnull_arg (void *, tree, unsigned HOST_WIDE_INT);
+static bool nonnull_check_p (tree, unsigned HOST_WIDE_INT);
+static bool get_nonnull_operand (tree, unsigned HOST_WIDE_INT *);
/* Table of machine-independent attributes common to all C-like languages. */
const struct attribute_spec c_common_attribute_table[] =
{
/* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
{ "packed", 0, 0, false, false, false,
- handle_packed_attribute },
+ handle_packed_attribute },
{ "nocommon", 0, 0, true, false, false,
handle_nocommon_attribute },
{ "common", 0, 0, true, false, false,
@@ -898,10 +875,7 @@ const struct attribute_spec c_common_format_attribute_table[] =
condition to keep line number information accurate. */
void
-c_expand_start_cond (cond, compstmt_count, if_stmt)
- tree cond;
- int compstmt_count;
- tree if_stmt;
+c_expand_start_cond (tree cond, int compstmt_count, tree if_stmt)
{
/* Make sure there is enough space on the stack. */
if (if_stack_space == 0)
@@ -929,7 +903,7 @@ c_expand_start_cond (cond, compstmt_count, if_stmt)
/* Called after the then-clause for an if-statement is processed. */
void
-c_finish_then ()
+c_finish_then (void)
{
tree if_stmt = if_stack[if_stack_pointer - 1].if_stmt;
RECHAIN_STMTS (if_stmt, THEN_CLAUSE (if_stmt));
@@ -939,7 +913,7 @@ c_finish_then ()
if statement had an ambiguous else clause. */
void
-c_expand_end_cond ()
+c_expand_end_cond (void)
{
if_stack_pointer--;
if (if_stack[if_stack_pointer].needs_warning)
@@ -952,7 +926,7 @@ c_expand_end_cond ()
of an if-then-else. */
void
-c_expand_start_else ()
+c_expand_start_else (void)
{
/* An ambiguous else warning must be generated for the enclosing if
statement, unless we see an else branch for that one, too. */
@@ -972,7 +946,7 @@ c_expand_start_else ()
/* Called after the else-clause for an if-statement is processed. */
void
-c_finish_else ()
+c_finish_else (void)
{
tree if_stmt = if_stack[if_stack_pointer - 1].if_stmt;
RECHAIN_STMTS (if_stmt, ELSE_CLAUSE (if_stmt));
@@ -987,7 +961,7 @@ c_finish_else ()
beyond what is strictly necessary for correctness. */
tree
-c_begin_if_stmt ()
+c_begin_if_stmt (void)
{
tree r;
r = build_stmt (IF_STMT, NULL_TREE, NULL_TREE, NULL_TREE);
@@ -1003,7 +977,7 @@ c_begin_if_stmt ()
beyond what is strictly necessary for correctness. */
tree
-c_begin_while_stmt ()
+c_begin_while_stmt (void)
{
tree r;
r = build_stmt (WHILE_STMT, NULL_TREE, NULL_TREE);
@@ -1011,9 +985,7 @@ c_begin_while_stmt ()
}
void
-c_finish_while_stmt_cond (cond, while_stmt)
- tree while_stmt;
- tree cond;
+c_finish_while_stmt_cond (tree cond, tree while_stmt)
{
WHILE_COND (while_stmt) = cond;
}
@@ -1021,11 +993,11 @@ c_finish_while_stmt_cond (cond, while_stmt)
/* Push current bindings for the function name VAR_DECLS. */
void
-start_fname_decls ()
+start_fname_decls (void)
{
unsigned ix;
tree saved = NULL_TREE;
-
+
for (ix = 0; fname_vars[ix].decl; ix++)
{
tree decl = *fname_vars[ix].decl;
@@ -1051,7 +1023,7 @@ start_fname_decls ()
involved. Pop the previous bindings. */
void
-finish_fname_decls ()
+finish_fname_decls (void)
{
unsigned ix;
tree body = NULL_TREE;
@@ -1059,7 +1031,7 @@ finish_fname_decls ()
for (; stack && TREE_VALUE (stack); stack = TREE_CHAIN (stack))
body = chainon (TREE_VALUE (stack), body);
-
+
if (body)
{
/* They were called into existence, so add to statement tree. Add
@@ -1075,10 +1047,10 @@ finish_fname_decls ()
body = chainon (body, *p);
*p = body;
}
-
+
for (ix = 0; fname_vars[ix].decl; ix++)
*fname_vars[ix].decl = NULL_TREE;
-
+
if (stack)
{
/* We had saved values, restore them. */
@@ -1088,7 +1060,7 @@ finish_fname_decls ()
{
tree decl = TREE_PURPOSE (saved);
unsigned ix = TREE_INT_CST_LOW (TREE_VALUE (saved));
-
+
*fname_vars[ix].decl = decl;
}
stack = TREE_CHAIN (stack);
@@ -1100,11 +1072,10 @@ finish_fname_decls ()
by PRETTY_P. */
const char *
-fname_as_string (pretty_p)
- int pretty_p;
+fname_as_string (int pretty_p)
{
const char *name = NULL;
-
+
if (pretty_p)
name = (current_function_decl
? (*lang_hooks.decl_printable_name) (current_function_decl, 2)
@@ -1120,11 +1091,10 @@ fname_as_string (pretty_p)
required by the supplied RID value. */
const char *
-fname_string (rid)
- unsigned rid;
+fname_string (unsigned int rid)
{
unsigned ix;
-
+
for (ix = 0; fname_vars[ix].decl; ix++)
if (fname_vars[ix].rid == rid)
break;
@@ -1139,9 +1109,7 @@ fname_string (rid)
this language independent code. */
tree
-fname_decl (rid, id)
- unsigned rid;
- tree id;
+fname_decl (unsigned int rid, tree id)
{
unsigned ix;
tree decl = NULL_TREE;
@@ -1161,7 +1129,7 @@ fname_decl (rid, id)
it from appearing in the RTL. */
int saved_lineno = input_line;
input_line = 0;
-
+
decl = (*make_fname_decl) (id, fname_vars[ix].pretty);
if (last_tree != saved_last_tree)
{
@@ -1187,8 +1155,7 @@ fname_decl (rid, id)
/* Given a STRING_CST, give it a suitable array-of-chars data type. */
tree
-fix_string_type (value)
- tree value;
+fix_string_type (tree value)
{
const int wchar_bytes = TYPE_PRECISION (wchar_type_node) / BITS_PER_UNIT;
const int wide_flag = TREE_TYPE (value) == wchar_array_type_node;
@@ -1231,8 +1198,7 @@ fix_string_type (value)
STRING_CST. */
tree
-combine_strings (strings)
- varray_type strings;
+combine_strings (varray_type strings)
{
const int wchar_bytes = TYPE_PRECISION (wchar_type_node) / BITS_PER_UNIT;
const int nstrings = VARRAY_ACTIVE_SIZE (strings);
@@ -1258,7 +1224,7 @@ combine_strings (strings)
{
length += (TREE_STRING_LENGTH (t) - 1);
if (C_ARTIFICIAL_STRING_P (t) && !in_system_header)
- warning ("concatenation of string literals with __FUNCTION__ is deprecated");
+ warning ("concatenation of string literals with __FUNCTION__ is deprecated");
}
}
@@ -1333,12 +1299,13 @@ combine_strings (strings)
return value;
}
-static int is_valid_printf_arglist PARAMS ((tree));
-static rtx c_expand_builtin PARAMS ((tree, rtx, enum machine_mode, enum expand_modifier));
-static rtx c_expand_builtin_printf PARAMS ((tree, rtx, enum machine_mode,
- enum expand_modifier, int, int));
-static rtx c_expand_builtin_fprintf PARAMS ((tree, rtx, enum machine_mode,
- enum expand_modifier, int, int));
+static int is_valid_printf_arglist (tree);
+static rtx c_expand_builtin (tree, rtx, enum machine_mode,
+ enum expand_modifier);
+static rtx c_expand_builtin_printf (tree, rtx, enum machine_mode,
+ enum expand_modifier, int, int);
+static rtx c_expand_builtin_fprintf (tree, rtx, enum machine_mode,
+ enum expand_modifier, int, int);
/* Print a warning if a constant expression had overflow in folding.
Invoke this function on every expression that the language
@@ -1347,8 +1314,7 @@ static rtx c_expand_builtin_fprintf PARAMS ((tree, rtx, enum machine_mode,
constant expression to overflow. */
void
-constant_expression_warning (value)
- tree value;
+constant_expression_warning (tree value)
{
if ((TREE_CODE (value) == INTEGER_CST || TREE_CODE (value) == REAL_CST
|| TREE_CODE (value) == VECTOR_CST
@@ -1365,8 +1331,7 @@ constant_expression_warning (value)
however, do not invoke this function on operands of explicit casts. */
void
-overflow_warning (value)
- tree value;
+overflow_warning (tree value)
{
if ((TREE_CODE (value) == INTEGER_CST
|| (TREE_CODE (value) == COMPLEX_CST
@@ -1400,8 +1365,7 @@ overflow_warning (value)
converted to an unsigned type. */
void
-unsigned_conversion_warning (result, operand)
- tree result, operand;
+unsigned_conversion_warning (tree result, tree operand)
{
tree type = TREE_TYPE (result);
@@ -1423,23 +1387,21 @@ unsigned_conversion_warning (result, operand)
for type TYPE (an INTEGER_TYPE). */
static int
-constant_fits_type_p (c, type)
- tree c, type;
+constant_fits_type_p (tree c, tree type)
{
if (TREE_CODE (c) == INTEGER_CST)
return int_fits_type_p (c, type);
c = convert (type, c);
return !TREE_OVERFLOW (c);
-}
+}
/* Convert EXPR to TYPE, warning about conversion problems with constants.
Invoke this function on every expression that is converted implicitly,
i.e. because of language rules and not because of an explicit cast. */
tree
-convert_and_check (type, expr)
- tree type, expr;
+convert_and_check (tree type, tree expr)
{
tree t = convert (type, expr);
if (TREE_CODE (t) == INTEGER_CST)
@@ -1502,21 +1464,18 @@ static struct tlist *warned_ids;
cache the results. */
static struct tlist_cache *save_expr_cache;
-static void add_tlist PARAMS ((struct tlist **, struct tlist *, tree, int));
-static void merge_tlist PARAMS ((struct tlist **, struct tlist *, int));
-static void verify_tree PARAMS ((tree, struct tlist **, struct tlist **, tree));
-static int warning_candidate_p PARAMS ((tree));
-static void warn_for_collisions PARAMS ((struct tlist *));
-static void warn_for_collisions_1 PARAMS ((tree, tree, struct tlist *, int));
-static struct tlist *new_tlist PARAMS ((struct tlist *, tree, tree));
-static void verify_sequence_points PARAMS ((tree));
+static void add_tlist (struct tlist **, struct tlist *, tree, int);
+static void merge_tlist (struct tlist **, struct tlist *, int);
+static void verify_tree (tree, struct tlist **, struct tlist **, tree);
+static int warning_candidate_p (tree);
+static void warn_for_collisions (struct tlist *);
+static void warn_for_collisions_1 (tree, tree, struct tlist *, int);
+static struct tlist *new_tlist (struct tlist *, tree, tree);
+static void verify_sequence_points (tree);
/* Create a new struct tlist and fill in its fields. */
static struct tlist *
-new_tlist (next, t, writer)
- struct tlist *next;
- tree t;
- tree writer;
+new_tlist (struct tlist *next, tree t, tree writer)
{
struct tlist *l;
l = (struct tlist *) obstack_alloc (&tlist_obstack, sizeof *l);
@@ -1530,11 +1489,7 @@ new_tlist (next, t, writer)
is nonnull, we ignore any node we find which has a writer equal to it. */
static void
-add_tlist (to, add, exclude_writer, copy)
- struct tlist **to;
- struct tlist *add;
- tree exclude_writer;
- int copy;
+add_tlist (struct tlist **to, struct tlist *add, tree exclude_writer, int copy)
{
while (add)
{
@@ -1554,10 +1509,7 @@ add_tlist (to, add, exclude_writer, copy)
write. */
static void
-merge_tlist (to, add, copy)
- struct tlist **to;
- struct tlist *add;
- int copy;
+merge_tlist (struct tlist **to, struct tlist *add, int copy)
{
struct tlist **end = to;
@@ -1592,10 +1544,8 @@ merge_tlist (to, add, copy)
is nonzero. */
static void
-warn_for_collisions_1 (written, writer, list, only_writes)
- tree written, writer;
- struct tlist *list;
- int only_writes;
+warn_for_collisions_1 (tree written, tree writer, struct tlist *list,
+ int only_writes)
{
struct tlist *tmp;
@@ -1622,11 +1572,10 @@ warn_for_collisions_1 (written, writer, list, only_writes)
can cause conflicts due to missing sequence points. */
static void
-warn_for_collisions (list)
- struct tlist *list;
+warn_for_collisions (struct tlist *list)
{
struct tlist *tmp;
-
+
for (tmp = list; tmp; tmp = tmp->next)
{
if (tmp->writer)
@@ -1637,8 +1586,7 @@ warn_for_collisions (list)
/* Return nonzero if X is a tree that can be verified by the sequence point
warnings. */
static int
-warning_candidate_p (x)
- tree x;
+warning_candidate_p (tree x)
{
return TREE_CODE (x) == VAR_DECL || TREE_CODE (x) == PARM_DECL;
}
@@ -1669,10 +1617,8 @@ warning_candidate_p (x)
way, so that no more than one access to B is recorded. */
static void
-verify_tree (x, pbefore_sp, pno_sp, writer)
- tree x;
- struct tlist **pbefore_sp, **pno_sp;
- tree writer;
+verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp,
+ tree writer)
{
struct tlist *tmp_before, *tmp_nosp, *tmp_list2, *tmp_list3;
enum tree_code code;
@@ -1867,8 +1813,7 @@ verify_tree (x, pbefore_sp, pno_sp, writer)
points. */
static void
-verify_sequence_points (expr)
- tree expr;
+verify_sequence_points (tree expr)
{
struct tlist *before_sp = 0, *after_sp = 0;
@@ -1886,8 +1831,7 @@ verify_sequence_points (expr)
}
tree
-c_expand_expr_stmt (expr)
- tree expr;
+c_expand_expr_stmt (tree expr)
{
/* Do default conversion if safe and possibly important,
in case within ({...}). */
@@ -1904,15 +1848,14 @@ c_expand_expr_stmt (expr)
&& TREE_CODE (TREE_TYPE (expr)) != ARRAY_TYPE)
error ("expression statement has incomplete type");
- last_expr_type = TREE_TYPE (expr);
+ last_expr_type = TREE_TYPE (expr);
return add_stmt (build_stmt (EXPR_STMT, expr));
}
/* Validate the expression after `case' and apply default promotions. */
tree
-check_case_value (value)
- tree value;
+check_case_value (tree value)
{
if (value == NULL_TREE)
return value;
@@ -1951,9 +1894,7 @@ check_case_value (value)
that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
tree
-c_common_type_for_size (bits, unsignedp)
- unsigned bits;
- int unsignedp;
+c_common_type_for_size (unsigned int bits, int unsignedp)
{
if (bits == TYPE_PRECISION (integer_type_node))
return unsignedp ? unsigned_type_node : integer_type_node;
@@ -1995,9 +1936,7 @@ c_common_type_for_size (bits, unsignedp)
then UNSIGNEDP selects between signed and unsigned types. */
tree
-c_common_type_for_mode (mode, unsignedp)
- enum machine_mode mode;
- int unsignedp;
+c_common_type_for_mode (enum machine_mode mode, int unsignedp)
{
if (mode == TYPE_MODE (integer_type_node))
return unsignedp ? unsigned_type_node : integer_type_node;
@@ -2087,8 +2026,7 @@ c_common_type_for_mode (mode, unsignedp)
/* Return an unsigned type the same as TYPE in other respects. */
tree
-c_common_unsigned_type (type)
- tree type;
+c_common_unsigned_type (tree type)
{
tree type1 = TYPE_MAIN_VARIANT (type);
if (type1 == signed_char_type_node || type1 == char_type_node)
@@ -2122,8 +2060,7 @@ c_common_unsigned_type (type)
/* Return a signed type the same as TYPE in other respects. */
tree
-c_common_signed_type (type)
- tree type;
+c_common_signed_type (tree type)
{
tree type1 = TYPE_MAIN_VARIANT (type);
if (type1 == unsigned_char_type_node || type1 == char_type_node)
@@ -2158,9 +2095,7 @@ c_common_signed_type (type)
signed according to UNSIGNEDP. */
tree
-c_common_signed_or_unsigned_type (unsignedp, type)
- int unsignedp;
- tree type;
+c_common_signed_or_unsigned_type (int unsignedp, tree type)
{
if (! INTEGRAL_TYPE_P (type)
|| TREE_UNSIGNED (type) == unsignedp)
@@ -2201,9 +2136,7 @@ c_common_signed_or_unsigned_type (unsignedp, type)
signed or unsigned type, UNSIGNEDP says which. */
unsigned int
-min_precision (value, unsignedp)
- tree value;
- int unsignedp;
+min_precision (tree value, int unsignedp)
{
int log;
@@ -2231,8 +2164,7 @@ min_precision (value, unsignedp)
c_common_truthvalue_conversion). */
void
-binary_op_error (code)
- enum tree_code code;
+binary_op_error (enum tree_code code)
{
const char *opname;
@@ -2308,10 +2240,8 @@ binary_op_error (code)
that value. */
tree
-shorten_compare (op0_ptr, op1_ptr, restype_ptr, rescode_ptr)
- tree *op0_ptr, *op1_ptr;
- tree *restype_ptr;
- enum tree_code *rescode_ptr;
+shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
+ enum tree_code *rescode_ptr)
{
tree type;
tree op0 = *op0_ptr;
@@ -2636,9 +2566,7 @@ shorten_compare (op0_ptr, op1_ptr, restype_ptr, rescode_ptr)
of pointer PTROP and integer INTOP. */
tree
-pointer_int_sum (resultcode, ptrop, intop)
- enum tree_code resultcode;
- tree ptrop, intop;
+pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop)
{
tree size_exp;
@@ -2712,7 +2640,7 @@ pointer_int_sum (resultcode, ptrop, intop)
if (TYPE_PRECISION (TREE_TYPE (intop)) != TYPE_PRECISION (sizetype)
|| TREE_UNSIGNED (TREE_TYPE (intop)) != TREE_UNSIGNED (sizetype))
- intop = convert (c_common_type_for_size (TYPE_PRECISION (sizetype),
+ intop = convert (c_common_type_for_size (TYPE_PRECISION (sizetype),
TREE_UNSIGNED (sizetype)), intop);
/* Replace the integer argument with a suitable product by the object size.
@@ -2745,8 +2673,7 @@ pointer_int_sum (resultcode, ptrop, intop)
The resulting type should always be `boolean_type_node'. */
tree
-c_common_truthvalue_conversion (expr)
- tree expr;
+c_common_truthvalue_conversion (tree expr)
{
if (TREE_CODE (expr) == ERROR_MARK)
return expr;
@@ -2907,17 +2834,15 @@ c_common_truthvalue_conversion (expr)
return build_binary_op (NE_EXPR, expr, integer_zero_node, 1);
}
-static tree builtin_function_2 PARAMS ((const char *, const char *, tree, tree,
- int, enum built_in_class, int, int,
- tree));
+static tree builtin_function_2 (const char *, const char *, tree, tree,
+ int, enum built_in_class, int, int,
+ tree);
/* Make a variant type in the proper way for C/C++, propagating qualifiers
down to the element type of an array. */
tree
-c_build_qualified_type (type, type_quals)
- tree type;
- int type_quals;
+c_build_qualified_type (tree type, int type_quals)
{
/* A restrict-qualified pointer type must be a pointer to object or
incomplete type. Note that the use of POINTER_TYPE_P also allows
@@ -2944,12 +2869,10 @@ c_build_qualified_type (type, type_quals)
/* Apply the TYPE_QUALS to the new DECL. */
void
-c_apply_type_quals_to_decl (type_quals, decl)
- int type_quals;
- tree decl;
+c_apply_type_quals_to_decl (int type_quals, tree decl)
{
if ((type_quals & TYPE_QUAL_CONST)
- || (TREE_TYPE (decl)
+ || (TREE_TYPE (decl)
&& TREE_CODE (TREE_TYPE (decl)) == REFERENCE_TYPE))
TREE_READONLY (decl) = 1;
if (type_quals & TYPE_QUAL_VOLATILE)
@@ -2975,11 +2898,10 @@ c_apply_type_quals_to_decl (type_quals, decl)
or a type. Return -1 if we don't do anything special. */
HOST_WIDE_INT
-c_common_get_alias_set (t)
- tree t;
+c_common_get_alias_set (tree t)
{
tree u;
-
+
/* Permit type-punning when accessing a union, provided the access
is directly through the union. For example, this code does not
permit taking the address of a union member and then storing
@@ -3059,18 +2981,15 @@ c_common_get_alias_set (t)
flag controls whether we should diagnose possibly ill-formed
constructs or not. */
tree
-c_sizeof_or_alignof_type (type, op, complain)
- tree type;
- enum tree_code op;
- int complain;
+c_sizeof_or_alignof_type (tree type, enum tree_code op, int complain)
{
const char *op_name;
tree value = NULL;
enum tree_code type_code = TREE_CODE (type);
-
+
my_friendly_assert (op == SIZEOF_EXPR || op == ALIGNOF_EXPR, 20020720);
op_name = op == SIZEOF_EXPR ? "sizeof" : "__alignof__";
-
+
if (type_code == FUNCTION_TYPE)
{
if (op == SIZEOF_EXPR)
@@ -3084,7 +3003,7 @@ c_sizeof_or_alignof_type (type, op, complain)
}
else if (type_code == VOID_TYPE || type_code == ERROR_MARK)
{
- if (type_code == VOID_TYPE
+ if (type_code == VOID_TYPE
&& complain && (pedantic || warn_pointer_arith))
pedwarn ("invalid application of `%s' to a void type", op_name);
value = size_one_node;
@@ -3112,7 +3031,7 @@ c_sizeof_or_alignof_type (type, op, complain)
`size_t', which is just a typedef for an ordinary integer type. */
value = fold (build1 (NOP_EXPR, size_type_node, value));
my_friendly_assert (!TYPE_IS_SIZETYPE (TREE_TYPE (value)), 20001021);
-
+
return value;
}
@@ -3122,14 +3041,13 @@ c_sizeof_or_alignof_type (type, op, complain)
"aligned" __attribute__ specification). */
tree
-c_alignof_expr (expr)
- tree expr;
+c_alignof_expr (tree expr)
{
tree t;
if (TREE_CODE (expr) == VAR_DECL)
t = size_int (DECL_ALIGN (expr) / BITS_PER_UNIT);
-
+
else if (TREE_CODE (expr) == COMPONENT_REF
&& DECL_C_BIT_FIELD (TREE_OPERAND (expr, 1)))
{
@@ -3139,13 +3057,13 @@ c_alignof_expr (expr)
else if (TREE_CODE (expr) == COMPONENT_REF
&& TREE_CODE (TREE_OPERAND (expr, 1)) == FIELD_DECL)
t = size_int (DECL_ALIGN (TREE_OPERAND (expr, 1)) / BITS_PER_UNIT);
-
+
else if (TREE_CODE (expr) == INDIRECT_REF)
{
tree t = TREE_OPERAND (expr, 0);
tree best = t;
int bestalign = TYPE_ALIGN (TREE_TYPE (TREE_TYPE (t)));
-
+
while (TREE_CODE (t) == NOP_EXPR
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == POINTER_TYPE)
{
@@ -3186,15 +3104,15 @@ static GTY(()) tree built_in_attributes[(int) ATTR_LAST];
static bool c_attrs_initialized = false;
-static void c_init_attributes PARAMS ((void));
+static void c_init_attributes (void);
/* Build tree nodes and builtin functions common to both C and C++ language
frontends. */
void
-c_common_nodes_and_builtins ()
+c_common_nodes_and_builtins (void)
{
- enum builtin_type
+ enum builtin_type
{
#define DEF_PRIMITIVE_TYPE(NAME, VALUE) NAME,
#define DEF_FUNCTION_TYPE_0(NAME, RETURN) NAME,
@@ -3469,7 +3387,7 @@ c_common_nodes_and_builtins ()
va_list_arg_type_node = va_list_type_node;
va_list_ref_type_node = build_reference_type (va_list_type_node);
}
-
+
#define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \
builtin_types[(int) ENUM] = VALUE;
#define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \
@@ -3484,7 +3402,7 @@ c_common_nodes_and_builtins ()
void_list_node));
#define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \
builtin_types[(int) ENUM] \
- = build_function_type \
+ = build_function_type \
(builtin_types[(int) RETURN], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG1], \
@@ -3510,9 +3428,9 @@ c_common_nodes_and_builtins ()
builtin_types[(int) ARG1], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG2], \
- tree_cons \
+ tree_cons \
(NULL_TREE, \
- builtin_types[(int) ARG3], \
+ builtin_types[(int) ARG3], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG4], \
void_list_node)))));
@@ -3521,14 +3439,14 @@ c_common_nodes_and_builtins ()
= build_function_type (builtin_types[(int) RETURN], NULL_TREE);
#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \
builtin_types[(int) ENUM] \
- = build_function_type (builtin_types[(int) RETURN], \
+ = build_function_type (builtin_types[(int) RETURN], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG1], \
NULL_TREE));
#define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \
builtin_types[(int) ENUM] \
- = build_function_type \
+ = build_function_type \
(builtin_types[(int) RETURN], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG1], \
@@ -3538,7 +3456,7 @@ c_common_nodes_and_builtins ()
#define DEF_FUNCTION_TYPE_VAR_3(ENUM, RETURN, ARG1, ARG2, ARG3) \
builtin_types[(int) ENUM] \
- = build_function_type \
+ = build_function_type \
(builtin_types[(int) RETURN], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG1], \
@@ -3596,7 +3514,7 @@ c_common_nodes_and_builtins ()
built_in_decls[(int) ENUM] = decl; \
if (IMPLICIT) \
implicit_built_in_decls[(int) ENUM] = decl; \
- }
+ }
#include "builtins.def"
#undef DEF_BUILTIN
@@ -3606,8 +3524,7 @@ c_common_nodes_and_builtins ()
}
tree
-build_va_arg (expr, type)
- tree expr, type;
+build_va_arg (tree expr, tree type)
{
return build1 (VA_ARG_EXPR, type, expr);
}
@@ -3622,14 +3539,13 @@ typedef struct disabled_builtin
} disabled_builtin;
static disabled_builtin *disabled_builtins = NULL;
-static bool builtin_function_disabled_p PARAMS ((const char *));
+static bool builtin_function_disabled_p (const char *);
/* Disable a built-in function specified by -fno-builtin-NAME. If NAME
begins with "__builtin_", give an error. */
void
-disable_builtin_function (name)
- const char *name;
+disable_builtin_function (const char *name)
{
if (strncmp (name, "__builtin_", strlen ("__builtin_")) == 0)
error ("cannot disable built-in function `%s'", name);
@@ -3647,8 +3563,7 @@ disable_builtin_function (name)
otherwise. */
static bool
-builtin_function_disabled_p (name)
- const char *name;
+builtin_function_disabled_p (const char *name)
{
disabled_builtin *p;
for (p = disabled_builtins; p != NULL; p = p->next)
@@ -3676,17 +3591,10 @@ builtin_function_disabled_p (name)
or if NONANSI_P and flag_no_nonansi_builtin. */
static tree
-builtin_function_2 (builtin_name, name, builtin_type, type, function_code,
- class, library_name_p, nonansi_p, attrs)
- const char *builtin_name;
- const char *name;
- tree builtin_type;
- tree type;
- int function_code;
- enum built_in_class class;
- int library_name_p;
- int nonansi_p;
- tree attrs;
+builtin_function_2 (const char *builtin_name, const char *name,
+ tree builtin_type, tree type, int function_code,
+ enum built_in_class class, int library_name_p,
+ int nonansi_p, tree attrs)
{
tree bdecl = NULL_TREE;
tree decl = NULL_TREE;
@@ -3706,8 +3614,7 @@ builtin_function_2 (builtin_name, name, builtin_type, type, function_code,
integral promotions defined in ISO C99 6.3.1.1/2. */
bool
-c_promoting_integer_type_p (t)
- tree t;
+c_promoting_integer_type_p (tree t)
{
switch (TREE_CODE (t))
{
@@ -3737,8 +3644,7 @@ c_promoting_integer_type_p (t)
and none of their types is affected by default promotions. */
int
-self_promoting_args_p (parms)
- tree parms;
+self_promoting_args_p (tree parms)
{
tree t;
for (t = parms; t; t = TREE_CHAIN (t))
@@ -3764,8 +3670,7 @@ self_promoting_args_p (parms)
element type is found. */
tree
-strip_array_types (type)
- tree type;
+strip_array_types (tree type)
{
while (TREE_CODE (type) == ARRAY_TYPE)
type = TREE_TYPE (type);
@@ -3773,8 +3678,7 @@ strip_array_types (type)
return type;
}
-static tree expand_unordered_cmp PARAMS ((tree, tree, enum tree_code,
- enum tree_code));
+static tree expand_unordered_cmp (tree, tree, enum tree_code, enum tree_code);
/* Expand a call to an unordered comparison function such as
__builtin_isgreater(). FUNCTION is the function's declaration and
@@ -3786,9 +3690,9 @@ static tree expand_unordered_cmp PARAMS ((tree, tree, enum tree_code,
rest. */
static tree
-expand_unordered_cmp (function, params, unordered_code, ordered_code)
- tree function, params;
- enum tree_code unordered_code, ordered_code;
+expand_unordered_cmp (tree function, tree params,
+ enum tree_code unordered_code,
+ enum tree_code ordered_code)
{
tree arg0, arg1, type;
enum tree_code code0, code1;
@@ -3857,8 +3761,7 @@ expand_unordered_cmp (function, params, unordered_code, ordered_code)
where the similar functionality exists in the other front ends. */
tree
-expand_tree_builtin (function, params, coerced_params)
- tree function, params, coerced_params;
+expand_tree_builtin (tree function, tree params, tree coerced_params)
{
if (DECL_BUILT_IN_CLASS (function) != BUILT_IN_NORMAL)
return NULL_TREE;
@@ -3932,11 +3835,8 @@ expand_tree_builtin (function, params, coerced_params)
We don't need a without_duplicates variant of this one because the
statement tree is a tree, not a graph. */
-tree
-walk_stmt_tree (tp, func, data)
- tree *tp;
- walk_tree_fn func;
- void *data;
+tree
+walk_stmt_tree (tree *tp, walk_tree_fn func, void *data)
{
enum tree_code code;
int walk_subtrees;
@@ -4001,9 +3901,7 @@ walk_stmt_tree (tp, func, data)
K2, and 0 if K1 and K2 are equal. */
int
-case_compare (k1, k2)
- splay_tree_key k1;
- splay_tree_key k2;
+case_compare (splay_tree_key k1, splay_tree_key k2)
{
/* Consider a NULL key (such as arises with a `default' label) to be
smaller than anything else. */
@@ -4025,11 +3923,8 @@ case_compare (k1, k2)
ERROR_MARK_NODE if no CASE_LABEL is created. */
tree
-c_add_case_label (cases, cond, low_value, high_value)
- splay_tree cases;
- tree cond;
- tree low_value;
- tree high_value;
+c_add_case_label (splay_tree cases, tree cond, tree low_value,
+ tree high_value)
{
tree type;
tree label;
@@ -4051,8 +3946,8 @@ c_add_case_label (cases, cond, low_value, high_value)
return error_mark_node;
}
- if ((low_value && TREE_TYPE (low_value)
- && POINTER_TYPE_P (TREE_TYPE (low_value)))
+ if ((low_value && TREE_TYPE (low_value)
+ && POINTER_TYPE_P (TREE_TYPE (low_value)))
|| (high_value && TREE_TYPE (high_value)
&& POINTER_TYPE_P (TREE_TYPE (high_value))))
error ("pointers are not permitted as case values");
@@ -4091,8 +3986,8 @@ c_add_case_label (cases, cond, low_value, high_value)
the HIGH_VALUE to simplify later processing. */
if (tree_int_cst_equal (low_value, high_value))
high_value = NULL_TREE;
- if (low_value && high_value
- && !tree_int_cst_lt (low_value, high_value))
+ if (low_value && high_value
+ && !tree_int_cst_lt (low_value, high_value))
warning ("empty range specified");
/* Look up the LOW_VALUE in the table of case labels we already
@@ -4130,7 +4025,7 @@ c_add_case_label (cases, cond, low_value, high_value)
range is bigger than the low end of the current range, so we
are only interested if the current range is a real range, and
not an ordinary case label. */
- else if (high_bound
+ else if (high_bound
&& high_value
&& (tree_int_cst_compare ((tree) high_bound->key,
high_value)
@@ -4145,7 +4040,7 @@ c_add_case_label (cases, cond, low_value, high_value)
if (high_value)
{
error ("duplicate (or overlapping) case value");
- error_with_decl (duplicate,
+ error_with_decl (duplicate,
"this is the first entry overlapping that value");
}
else if (low_value)
@@ -4165,7 +4060,7 @@ c_add_case_label (cases, cond, low_value, high_value)
/* Add a CASE_LABEL to the statement-tree. */
case_label = add_stmt (build_case_label (low_value, high_value, label));
/* Register this case label in the splay tree. */
- splay_tree_insert (cases,
+ splay_tree_insert (cases,
(splay_tree_key) low_value,
(splay_tree_value) case_label);
@@ -4175,9 +4070,8 @@ c_add_case_label (cases, cond, low_value, high_value)
/* Finish an expression taking the address of LABEL (an
IDENTIFIER_NODE). Returns an expression for the address. */
-tree
-finish_label_address_expr (label)
- tree label;
+tree
+finish_label_address_expr (tree label)
{
tree result;
@@ -4211,11 +4105,8 @@ finish_label_address_expr (label)
/* Hook used by expand_expr to expand language-specific tree codes. */
rtx
-c_expand_expr (exp, target, tmode, modifier)
- tree exp;
- rtx target;
- enum machine_mode tmode;
- int modifier; /* Actually enum_modifier. */
+c_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier)
+ /* Actually enum_modifier. */
{
switch (TREE_CODE (exp))
{
@@ -4293,7 +4184,7 @@ c_expand_expr (exp, target, tmode, modifier)
return result;
}
break;
-
+
case CALL_EXPR:
{
if (TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR
@@ -4328,14 +4219,12 @@ c_expand_expr (exp, target, tmode, modifier)
/* Hook used by safe_from_p to handle language-specific tree codes. */
int
-c_safe_from_p (target, exp)
- rtx target;
- tree exp;
+c_safe_from_p (rtx target, tree exp)
{
/* We can see statements here when processing the body of a
statement-expression. For a declaration statement declaring a
variable, look at the variable's initializer. */
- if (TREE_CODE (exp) == DECL_STMT)
+ if (TREE_CODE (exp) == DECL_STMT)
{
tree decl = DECL_STMT_DECL (exp);
@@ -4356,8 +4245,7 @@ c_safe_from_p (target, exp)
/* Hook used by unsafe_for_reeval to handle language-specific tree codes. */
int
-c_common_unsafe_for_reeval (exp)
- tree exp;
+c_common_unsafe_for_reeval (tree exp)
{
/* Statement expressions may not be reevaluated, likewise compound
literals. */
@@ -4372,8 +4260,7 @@ c_common_unsafe_for_reeval (exp)
/* Hook used by staticp to handle language-specific tree codes. */
int
-c_staticp (exp)
- tree exp;
+c_staticp (tree exp)
{
if (TREE_CODE (exp) == COMPOUND_LITERAL_EXPR
&& TREE_STATIC (COMPOUND_LITERAL_EXPR_DECL (exp)))
@@ -4385,11 +4272,8 @@ c_staticp (exp)
(!strncmp (IDENTIFIER_POINTER (DECL_NAME (NODE)), "__builtin_", 10))
static rtx
-c_expand_builtin (exp, target, tmode, modifier)
- tree exp;
- rtx target;
- enum machine_mode tmode;
- enum expand_modifier modifier;
+c_expand_builtin (tree exp, rtx target, enum machine_mode tmode,
+ enum expand_modifier modifier)
{
tree type = TREE_TYPE (exp);
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
@@ -4449,8 +4333,7 @@ c_expand_builtin (exp, target, tmode, modifier)
at the format specifier, with the remaining arguments immediately
following it. */
static int
-is_valid_printf_arglist (arglist)
- tree arglist;
+is_valid_printf_arglist (tree arglist)
{
/* Save this value so we can restore it later. */
const int SAVE_pedantic = pedantic;
@@ -4483,13 +4366,9 @@ is_valid_printf_arglist (arglist)
/* If the arguments passed to printf are suitable for optimizations,
we attempt to transform the call. */
static rtx
-c_expand_builtin_printf (arglist, target, tmode, modifier, ignore, unlocked)
- tree arglist;
- rtx target;
- enum machine_mode tmode;
- enum expand_modifier modifier;
- int ignore;
- int unlocked;
+c_expand_builtin_printf (tree arglist, rtx target, enum machine_mode tmode,
+ enum expand_modifier modifier, int ignore,
+ int unlocked)
{
tree fn_putchar = unlocked ?
implicit_built_in_decls[BUILT_IN_PUTCHAR_UNLOCKED] : implicit_built_in_decls[BUILT_IN_PUTCHAR];
@@ -4506,11 +4385,11 @@ c_expand_builtin_printf (arglist, target, tmode, modifier, ignore, unlocked)
if (arglist == 0
|| (TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != POINTER_TYPE))
return 0;
-
+
/* Check the specifier vs. the parameters. */
if (!is_valid_printf_arglist (arglist))
return 0;
-
+
format_arg = TREE_VALUE (arglist);
stripped_string = format_arg;
STRIP_NOPS (stripped_string);
@@ -4520,7 +4399,7 @@ c_expand_builtin_printf (arglist, target, tmode, modifier, ignore, unlocked)
/* If the format specifier isn't a STRING_CST, punt. */
if (TREE_CODE (stripped_string) != STRING_CST)
return 0;
-
+
/* OK! We can attempt optimization. */
/* If the format specifier was "%s\n", call __builtin_puts(arg2). */
@@ -4540,7 +4419,7 @@ c_expand_builtin_printf (arglist, target, tmode, modifier, ignore, unlocked)
/* We can't handle anything else with % args or %% ... yet. */
if (strchr (TREE_STRING_POINTER (stripped_string), '%'))
return 0;
-
+
/* If the resulting constant string has a length of 1, call
putchar. Note, TREE_STRING_LENGTH includes the terminating
NULL in its count. */
@@ -4551,7 +4430,7 @@ c_expand_builtin_printf (arglist, target, tmode, modifier, ignore, unlocked)
function. */
arglist = build_int_2 (TREE_STRING_POINTER (stripped_string)[0], 0);
arglist = build_tree_list (NULL_TREE, arglist);
-
+
fn = fn_putchar;
}
/* If the resulting constant was "string\n", call
@@ -4568,7 +4447,7 @@ c_expand_builtin_printf (arglist, target, tmode, modifier, ignore, unlocked)
char *newstr = (char *) alloca (newlen);
memcpy (newstr, TREE_STRING_POINTER (stripped_string), newlen - 1);
newstr[newlen - 1] = 0;
-
+
arglist = fix_string_type (build_string (newlen, newstr));
arglist = build_tree_list (NULL_TREE, arglist);
fn = fn_puts;
@@ -4578,7 +4457,7 @@ c_expand_builtin_printf (arglist, target, tmode, modifier, ignore, unlocked)
need stdout and don't have a way to get it ... yet. */
return 0;
}
-
+
return expand_expr (build_function_call (fn, arglist),
(ignore ? const0_rtx : target),
tmode, modifier);
@@ -4587,13 +4466,9 @@ c_expand_builtin_printf (arglist, target, tmode, modifier, ignore, unlocked)
/* If the arguments passed to fprintf are suitable for optimizations,
we attempt to transform the call. */
static rtx
-c_expand_builtin_fprintf (arglist, target, tmode, modifier, ignore, unlocked)
- tree arglist;
- rtx target;
- enum machine_mode tmode;
- enum expand_modifier modifier;
- int ignore;
- int unlocked;
+c_expand_builtin_fprintf (tree arglist, rtx target, enum machine_mode tmode,
+ enum expand_modifier modifier, int ignore,
+ int unlocked)
{
tree fn_fputc = unlocked ?
implicit_built_in_decls[BUILT_IN_FPUTC_UNLOCKED] : implicit_built_in_decls[BUILT_IN_FPUTC];
@@ -4613,11 +4488,11 @@ c_expand_builtin_fprintf (arglist, target, tmode, modifier, ignore, unlocked)
|| (TREE_CODE (TREE_TYPE (TREE_VALUE (TREE_CHAIN (arglist)))) !=
POINTER_TYPE))
return 0;
-
+
/* Check the specifier vs. the parameters. */
if (!is_valid_printf_arglist (TREE_CHAIN (arglist)))
return 0;
-
+
format_arg = TREE_VALUE (TREE_CHAIN (arglist));
stripped_string = format_arg;
STRIP_NOPS (stripped_string);
@@ -4627,7 +4502,7 @@ c_expand_builtin_fprintf (arglist, target, tmode, modifier, ignore, unlocked)
/* If the format specifier isn't a STRING_CST, punt. */
if (TREE_CODE (stripped_string) != STRING_CST)
return 0;
-
+
/* OK! We can attempt optimization. */
/* If the format specifier was "%s", call __builtin_fputs(arg3, arg1). */
@@ -4653,7 +4528,7 @@ c_expand_builtin_fprintf (arglist, target, tmode, modifier, ignore, unlocked)
/* We can't handle anything else with % args or %% ... yet. */
if (strchr (TREE_STRING_POINTER (stripped_string), '%'))
return 0;
-
+
/* When "string" doesn't contain %, replace all cases of
fprintf(stream,string) with fputs(string,stream). The fputs
builtin will take take of special cases like length==1. */
@@ -4661,7 +4536,7 @@ c_expand_builtin_fprintf (arglist, target, tmode, modifier, ignore, unlocked)
build_tree_list (NULL_TREE, TREE_VALUE (arglist)));
fn = fn_fputs;
}
-
+
return expand_expr (build_function_call (fn, arglist),
(ignore ? const0_rtx : target),
tmode, modifier);
@@ -4672,9 +4547,7 @@ c_expand_builtin_fprintf (arglist, target, tmode, modifier, ignore, unlocked)
or decrement (as indicated by CODE) of ARG. The front end must check for
invalid cases (e.g., decrement in C++). */
tree
-boolean_increment (code, arg)
- enum tree_code code;
- tree arg;
+boolean_increment (enum tree_code code, tree arg)
{
tree val;
tree true_res = (c_language == clk_cplusplus
@@ -4711,7 +4584,7 @@ boolean_increment (code, arg)
/* Built-in macros for stddef.h, that require macros defined in this
file. */
void
-c_stddef_cpp_builtins()
+c_stddef_cpp_builtins(void)
{
builtin_define_with_value ("__SIZE_TYPE__", SIZE_TYPE, 0);
builtin_define_with_value ("__PTRDIFF_TYPE__", PTRDIFF_TYPE, 0);
@@ -4720,7 +4593,7 @@ c_stddef_cpp_builtins()
}
static void
-c_init_attributes ()
+c_init_attributes (void)
{
/* Fill in the built_in_attributes array. */
#define DEF_ATTR_NULL_TREE(ENUM) \
@@ -4747,8 +4620,7 @@ c_init_attributes ()
/* Depending on the name of DECL, apply default attributes to it. */
void
-c_common_insert_default_attributes (decl)
- tree decl;
+c_common_insert_default_attributes (tree decl)
{
tree name = DECL_NAME (decl);
@@ -4774,10 +4646,7 @@ c_common_insert_default_attributes (decl)
/* Output a -Wshadow warning MSGCODE about NAME, and give the location
of the previous declaration DECL. */
void
-shadow_warning (msgcode, name, decl)
- enum sw_kind msgcode;
- const char *name;
- tree decl;
+shadow_warning (enum sw_kind msgcode, const char *name, tree decl)
{
static const char *const msgs[] = {
/* SW_PARAM */ N_("declaration of \"%s\" shadows a parameter"),
@@ -4795,12 +4664,8 @@ shadow_warning (msgcode, name, decl)
struct attribute_spec.handler. */
static tree
-handle_packed_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags;
- bool *no_add_attrs;
+handle_packed_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
+ int flags, bool *no_add_attrs)
{
tree *type = NULL;
if (DECL_P (*node))
@@ -4834,12 +4699,9 @@ handle_packed_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_nocommon_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_nocommon_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
if (TREE_CODE (*node) == VAR_DECL)
DECL_COMMON (*node) = 0;
@@ -4856,12 +4718,8 @@ handle_nocommon_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_common_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_common_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
if (TREE_CODE (*node) == VAR_DECL)
DECL_COMMON (*node) = 1;
@@ -4878,12 +4736,8 @@ handle_common_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_noreturn_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_noreturn_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
tree type = TREE_TYPE (*node);
@@ -4909,12 +4763,9 @@ handle_noreturn_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_noinline_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_noinline_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
if (TREE_CODE (*node) == FUNCTION_DECL)
DECL_UNINLINABLE (*node) = 1;
@@ -4931,12 +4782,10 @@ handle_noinline_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_always_inline_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_always_inline_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
if (TREE_CODE (*node) == FUNCTION_DECL)
{
@@ -4956,19 +4805,17 @@ handle_always_inline_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_used_attribute (pnode, name, args, flags, no_add_attrs)
- tree *pnode;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_used_attribute (tree *pnode, tree name, tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
tree node = *pnode;
if (TREE_CODE (node) == FUNCTION_DECL
|| (TREE_CODE (node) == VAR_DECL && TREE_STATIC (node)))
- TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (node))
- = TREE_USED (node) = 1;
+ {
+ mark_referenced (DECL_ASSEMBLER_NAME (node));
+ TREE_USED (node) = 1;
+ }
else
{
warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
@@ -4982,12 +4829,8 @@ handle_used_attribute (pnode, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_unused_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags;
- bool *no_add_attrs;
+handle_unused_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
if (DECL_P (*node))
{
@@ -5019,12 +4862,8 @@ handle_unused_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_const_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_const_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
tree type = TREE_TYPE (*node);
@@ -5050,12 +4889,9 @@ handle_const_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_transparent_union_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags;
- bool *no_add_attrs;
+handle_transparent_union_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED, int flags,
+ bool *no_add_attrs)
{
tree decl = NULL_TREE;
tree *type = NULL;
@@ -5097,12 +4933,10 @@ handle_transparent_union_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_constructor_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_constructor_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
tree decl = *node;
tree type = TREE_TYPE (decl);
@@ -5127,12 +4961,10 @@ handle_constructor_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_destructor_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_destructor_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
tree decl = *node;
tree type = TREE_TYPE (decl);
@@ -5157,12 +4989,8 @@ handle_destructor_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_mode_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_mode_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
tree type = *node;
@@ -5246,12 +5074,8 @@ handle_mode_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_section_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name ATTRIBUTE_UNUSED;
- tree args;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_section_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
tree decl = *node;
@@ -5304,12 +5128,8 @@ handle_section_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_aligned_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name ATTRIBUTE_UNUSED;
- tree args;
- int flags;
- bool *no_add_attrs;
+handle_aligned_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args,
+ int flags, bool *no_add_attrs)
{
tree decl = NULL_TREE;
tree *type = NULL;
@@ -5388,12 +5208,10 @@ handle_aligned_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_weak_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name ATTRIBUTE_UNUSED;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs ATTRIBUTE_UNUSED;
+handle_weak_attribute (tree *node, tree name ATTRIBUTE_UNUSED,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs ATTRIBUTE_UNUSED)
{
declare_weak (*node);
@@ -5404,12 +5222,8 @@ handle_weak_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_alias_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_alias_attribute (tree *node, tree name, tree args,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
tree decl = *node;
@@ -5453,12 +5267,9 @@ handle_alias_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_visibility_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_visibility_attribute (tree *node, tree name, tree args,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
tree decl = *node;
@@ -5496,12 +5307,8 @@ handle_visibility_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_tls_model_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_tls_model_attribute (tree *node, tree name, tree args,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
tree decl = *node;
@@ -5539,12 +5346,10 @@ handle_tls_model_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_no_instrument_function_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_no_instrument_function_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
tree decl = *node;
@@ -5572,12 +5377,8 @@ handle_no_instrument_function_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_malloc_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_malloc_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
if (TREE_CODE (*node) == FUNCTION_DECL)
DECL_IS_MALLOC (*node) = 1;
@@ -5595,12 +5396,10 @@ handle_malloc_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_no_limit_stack_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_no_limit_stack_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
tree decl = *node;
@@ -5628,12 +5427,8 @@ handle_no_limit_stack_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_pure_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_pure_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
if (TREE_CODE (*node) == FUNCTION_DECL)
DECL_IS_PURE (*node) = 1;
@@ -5649,24 +5444,21 @@ handle_pure_attribute (node, name, args, flags, no_add_attrs)
/* Handle a "deprecated" attribute; arguments as in
struct attribute_spec.handler. */
-
+
static tree
-handle_deprecated_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags;
- bool *no_add_attrs;
+handle_deprecated_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED, int flags,
+ bool *no_add_attrs)
{
tree type = NULL_TREE;
int warn = 0;
const char *what = NULL;
-
+
if (DECL_P (*node))
{
tree decl = *node;
type = TREE_TYPE (decl);
-
+
if (TREE_CODE (decl) == TYPE_DECL
|| TREE_CODE (decl) == PARM_DECL
|| TREE_CODE (decl) == VAR_DECL
@@ -5685,7 +5477,7 @@ handle_deprecated_attribute (node, name, args, flags, no_add_attrs)
}
else
warn = 1;
-
+
if (warn)
{
*no_add_attrs = true;
@@ -5701,7 +5493,7 @@ handle_deprecated_attribute (node, name, args, flags, no_add_attrs)
warning ("`%s' attribute ignored for `%s'",
IDENTIFIER_POINTER (name), what);
else
- warning ("`%s' attribute ignored",
+ warning ("`%s' attribute ignored",
IDENTIFIER_POINTER (name));
}
@@ -5719,12 +5511,9 @@ static GTY(()) tree vector_type_node_list = 0;
struct attribute_spec.handler. */
static tree
-handle_vector_size_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_vector_size_attribute (tree *node, tree name, tree args,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
unsigned HOST_WIDE_INT vecsize, nunits;
enum machine_mode mode, orig_mode, new_mode;
@@ -5870,8 +5659,7 @@ handle_vector_size_attribute (node, name, args, flags, no_add_attrs)
new type which we will point to. */
static tree
-vector_size_helper (type, bottom)
- tree type, bottom;
+vector_size_helper (tree type, tree bottom)
{
tree inner, outer;
@@ -5892,7 +5680,7 @@ vector_size_helper (type, bottom)
}
else
return bottom;
-
+
TREE_READONLY (outer) = TREE_READONLY (type);
TREE_THIS_VOLATILE (outer) = TREE_THIS_VOLATILE (type);
@@ -5901,12 +5689,9 @@ vector_size_helper (type, bottom)
/* Handle the "nonnull" attribute. */
static tree
-handle_nonnull_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name ATTRIBUTE_UNUSED;
- tree args;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_nonnull_attribute (tree *node, tree name ATTRIBUTE_UNUSED,
+ tree args, int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
tree type = *node;
unsigned HOST_WIDE_INT attr_arg_num;
@@ -5975,9 +5760,7 @@ handle_nonnull_attribute (node, name, args, flags, no_add_attrs)
that are marked as requiring a non-null pointer argument. */
static void
-check_function_nonnull (attrs, params)
- tree attrs;
- tree params;
+check_function_nonnull (tree attrs, tree params)
{
tree a, args, param;
int param_num;
@@ -5996,11 +5779,11 @@ check_function_nonnull (attrs, params)
param_num++, param = TREE_CHAIN (param))
{
if (! param)
- break;
+ break;
if (! args || nonnull_check_p (args, param_num))
- check_function_arguments_recurse (check_nonnull_arg, NULL,
- TREE_VALUE (param),
- param_num);
+ check_function_arguments_recurse (check_nonnull_arg, NULL,
+ TREE_VALUE (param),
+ param_num);
}
}
}
@@ -6011,9 +5794,7 @@ check_function_nonnull (attrs, params)
checked. */
static bool
-nonnull_check_p (args, param_num)
- tree args;
- unsigned HOST_WIDE_INT param_num;
+nonnull_check_p (tree args, unsigned HOST_WIDE_INT param_num)
{
unsigned HOST_WIDE_INT arg_num;
@@ -6033,10 +5814,8 @@ nonnull_check_p (args, param_num)
via check_function_arguments_recurse. */
static void
-check_nonnull_arg (ctx, param, param_num)
- void *ctx ATTRIBUTE_UNUSED;
- tree param;
- unsigned HOST_WIDE_INT param_num;
+check_nonnull_arg (void *ctx ATTRIBUTE_UNUSED, tree param,
+ unsigned HOST_WIDE_INT param_num)
{
/* Just skip checking the argument if it's not a pointer. This can
happen if the "nonnull" attribute was given without an operand
@@ -6054,9 +5833,7 @@ check_nonnull_arg (ctx, param, param_num)
from the attribute argument list. */
static bool
-get_nonnull_operand (arg_num_expr, valp)
- tree arg_num_expr;
- unsigned HOST_WIDE_INT *valp;
+get_nonnull_operand (tree arg_num_expr, unsigned HOST_WIDE_INT *valp)
{
/* Strip any conversions from the arg number and verify they
are constants. */
@@ -6077,12 +5854,8 @@ get_nonnull_operand (arg_num_expr, valp)
struct attribute_spec.handler. */
static tree
-handle_nothrow_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_nothrow_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
if (TREE_CODE (*node) == FUNCTION_DECL)
TREE_NOTHROW (*node) = 1;
@@ -6100,12 +5873,8 @@ handle_nothrow_attribute (node, name, args, flags, no_add_attrs)
struct attribute_spec.handler. */
static tree
-handle_cleanup_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_cleanup_attribute (tree *node, tree name, tree args,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
{
tree decl = *node;
tree cleanup_id, cleanup_decl;
@@ -6139,7 +5908,7 @@ handle_cleanup_attribute (node, name, args, flags, no_add_attrs)
return NULL_TREE;
}
- /* That the function has proper type is checked with the
+ /* That the function has proper type is checked with the
eventual call to build_function_call. */
return NULL_TREE;
@@ -6147,9 +5916,7 @@ handle_cleanup_attribute (node, name, args, flags, no_add_attrs)
/* Check for valid arguments being passed to a function. */
void
-check_function_arguments (attrs, params)
- tree attrs;
- tree params;
+check_function_arguments (tree attrs, tree params)
{
/* Check for null being passed in a pointer argument that must be
non-null. We also need to do this if format checking is enabled. */
@@ -6167,11 +5934,10 @@ check_function_arguments (attrs, params)
be checked. PARAM_NUM is the number of the argument. CALLBACK is invoked
once the argument is resolved. CTX is context for the callback. */
void
-check_function_arguments_recurse (callback, ctx, param, param_num)
- void (*callback) PARAMS ((void *, tree, unsigned HOST_WIDE_INT));
- void *ctx;
- tree param;
- unsigned HOST_WIDE_INT param_num;
+check_function_arguments_recurse (void (*callback)
+ (void *, tree, unsigned HOST_WIDE_INT),
+ void *ctx, tree param,
+ unsigned HOST_WIDE_INT param_num)
{
if (TREE_CODE (param) == NOP_EXPR)
{
diff --git a/gcc/c-common.h b/gcc/c-common.h
index b458afcf4ce..d97f460712d 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -305,38 +305,35 @@ struct c_language_function GTY(()) {
/* Language-specific hooks. */
-extern void (*lang_expand_stmt) PARAMS ((tree));
-extern void (*lang_expand_decl_stmt) PARAMS ((tree));
-extern void (*lang_expand_function_end) PARAMS ((void));
-extern tree gettags PARAMS ((void));
+extern void (*lang_expand_stmt) (tree);
+extern void (*lang_expand_decl_stmt) (tree);
+extern void (*lang_expand_function_end) (void);
+extern tree gettags (void);
/* Callback that determines if it's ok for a function to have no
noreturn attribute. */
-extern int (*lang_missing_noreturn_ok_p) PARAMS ((tree));
-
-extern int yyparse PARAMS ((void));
-extern void free_parser_stacks PARAMS ((void));
-
-extern stmt_tree current_stmt_tree PARAMS ((void));
-extern tree *current_scope_stmt_stack PARAMS ((void));
-extern void begin_stmt_tree PARAMS ((tree *));
-extern tree add_stmt PARAMS ((tree));
-extern void add_decl_stmt PARAMS ((tree));
-extern tree add_scope_stmt PARAMS ((int, int));
-extern void finish_stmt_tree PARAMS ((tree *));
-
-extern tree walk_stmt_tree PARAMS ((tree *,
- walk_tree_fn,
- void *));
-extern void prep_stmt PARAMS ((tree));
-extern void expand_stmt PARAMS ((tree));
-extern tree c_begin_if_stmt PARAMS ((void));
-extern tree c_begin_while_stmt PARAMS ((void));
-extern void c_finish_while_stmt_cond PARAMS ((tree, tree));
+extern int (*lang_missing_noreturn_ok_p) (tree);
+
+extern int yyparse (void);
+extern void free_parser_stacks (void);
+
+extern stmt_tree current_stmt_tree (void);
+extern tree *current_scope_stmt_stack (void);
+extern void begin_stmt_tree (tree *);
+extern tree add_stmt (tree);
+extern void add_decl_stmt (tree);
+extern tree add_scope_stmt (int, int);
+extern void finish_stmt_tree (tree *);
+
+extern tree walk_stmt_tree (tree *, walk_tree_fn, void *);
+extern void prep_stmt (tree);
+extern void expand_stmt (tree);
+extern tree c_begin_if_stmt (void);
+extern tree c_begin_while_stmt (void);
+extern void c_finish_while_stmt_cond (tree, tree);
enum sw_kind { SW_PARAM = 0, SW_LOCAL, SW_GLOBAL };
-extern void shadow_warning PARAMS ((enum sw_kind,
- const char *, tree));
+extern void shadow_warning (enum sw_kind, const char *, tree);
/* Extra information associated with a DECL. Other C dialects extend
this structure in various ways. The C front-end only uses this
@@ -777,7 +774,7 @@ extern int flag_abi_version;
extern int warn_abi;
-/* Nonzero means warn about invalid uses of offsetof. */
+/* Nonzero means warn about invalid uses of offsetof. */
extern int warn_invalid_offsetof;
@@ -876,66 +873,62 @@ extern const struct attribute_spec c_common_format_attribute_table[];
TYPE_DEP indicates whether it depends on type of the function or not
(i.e. __PRETTY_FUNCTION__). */
-extern tree (*make_fname_decl) PARAMS ((tree, int));
-
-extern tree identifier_global_value PARAMS ((tree));
-extern void record_builtin_type PARAMS ((enum rid,
- const char *, tree));
-extern tree build_void_list_node PARAMS ((void));
-extern void start_fname_decls PARAMS ((void));
-extern void finish_fname_decls PARAMS ((void));
-extern const char *fname_as_string PARAMS ((int));
-extern tree fname_decl PARAMS ((unsigned, tree));
-extern const char *fname_string PARAMS ((unsigned));
-
-extern void check_function_arguments PARAMS ((tree, tree));
-extern void check_function_arguments_recurse PARAMS ((void (*) (void *,
- tree,
- unsigned HOST_WIDE_INT),
- void *, tree,
- unsigned HOST_WIDE_INT));
-extern void check_function_format PARAMS ((int *, tree, tree));
-extern void set_Wformat PARAMS ((int));
-extern tree handle_format_attribute PARAMS ((tree *, tree, tree,
- int, bool *));
-extern tree handle_format_arg_attribute PARAMS ((tree *, tree, tree,
- int, bool *));
-extern void c_common_insert_default_attributes PARAMS ((tree));
+extern tree (*make_fname_decl) (tree, int);
+
+extern tree identifier_global_value (tree);
+extern void record_builtin_type (enum rid, const char *, tree);
+extern tree build_void_list_node (void);
+extern void start_fname_decls (void);
+extern void finish_fname_decls (void);
+extern const char *fname_as_string (int);
+extern tree fname_decl (unsigned, tree);
+extern const char *fname_string (unsigned);
+
+extern void check_function_arguments (tree, tree);
+extern void check_function_arguments_recurse (void (*)
+ (void *, tree,
+ unsigned HOST_WIDE_INT),
+ void *, tree,
+ unsigned HOST_WIDE_INT);
+extern void check_function_format (int *, tree, tree);
+extern void set_Wformat (int);
+extern tree handle_format_attribute (tree *, tree, tree, int, bool *);
+extern tree handle_format_arg_attribute (tree *, tree, tree, int, bool *);
+extern void c_common_insert_default_attributes (tree);
extern int c_common_handle_option (size_t code, const char *arg, int value);
-extern tree c_common_type_for_mode PARAMS ((enum machine_mode,
- int));
-extern tree c_common_type_for_size PARAMS ((unsigned int, int));
-extern tree c_common_unsigned_type PARAMS ((tree));
-extern tree c_common_signed_type PARAMS ((tree));
-extern tree c_common_signed_or_unsigned_type PARAMS ((int, tree));
-extern tree c_common_truthvalue_conversion PARAMS ((tree));
-extern void c_apply_type_quals_to_decl PARAMS ((int, tree));
-extern tree c_sizeof_or_alignof_type PARAMS ((tree, enum tree_code, int));
-extern tree c_alignof_expr PARAMS ((tree));
+extern tree c_common_type_for_mode (enum machine_mode, int);
+extern tree c_common_type_for_size (unsigned int, int);
+extern tree c_common_unsigned_type (tree);
+extern tree c_common_signed_type (tree);
+extern tree c_common_signed_or_unsigned_type (int, tree);
+extern tree c_common_truthvalue_conversion (tree);
+extern void c_apply_type_quals_to_decl (int, tree);
+extern tree c_sizeof_or_alignof_type (tree, enum tree_code, int);
+extern tree c_alignof_expr (tree);
/* Print an error message for invalid operands to arith operation CODE.
NOP_EXPR is used as a special case (see truthvalue_conversion). */
-extern void binary_op_error PARAMS ((enum tree_code));
+extern void binary_op_error (enum tree_code);
#define my_friendly_assert(EXP, N) (void) \
(((EXP) == 0) ? (fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0) : 0)
-extern tree c_expand_expr_stmt PARAMS ((tree));
-extern void c_expand_start_cond PARAMS ((tree, int, tree));
-extern void c_finish_then PARAMS ((void));
-extern void c_expand_start_else PARAMS ((void));
-extern void c_finish_else PARAMS ((void));
-extern void c_expand_end_cond PARAMS ((void));
+extern tree c_expand_expr_stmt (tree);
+extern void c_expand_start_cond (tree, int, tree);
+extern void c_finish_then (void);
+extern void c_expand_start_else (void);
+extern void c_finish_else (void);
+extern void c_expand_end_cond (void);
/* Validate the expression after `case' and apply default promotions. */
-extern tree check_case_value PARAMS ((tree));
-extern tree fix_string_type PARAMS ((tree));
+extern tree check_case_value (tree);
+extern tree fix_string_type (tree);
struct varray_head_tag;
-extern tree combine_strings PARAMS ((struct varray_head_tag *));
-extern void constant_expression_warning PARAMS ((tree));
-extern tree convert_and_check PARAMS ((tree, tree));
-extern void overflow_warning PARAMS ((tree));
-extern void unsigned_conversion_warning PARAMS ((tree, tree));
+extern tree combine_strings (struct varray_head_tag *);
+extern void constant_expression_warning (tree);
+extern tree convert_and_check (tree, tree);
+extern void overflow_warning (tree);
+extern void unsigned_conversion_warning (tree, tree);
/* Read the rest of the current #-directive line. */
-extern char *get_directive_line PARAMS ((void));
+extern char *get_directive_line (void);
#define GET_DIRECTIVE_LINE() get_directive_line ()
#define c_sizeof(T) c_sizeof_or_alignof_type (T, SIZEOF_EXPR, 1)
#define c_alignof(T) c_sizeof_or_alignof_type (T, ALIGNOF_EXPR, 1)
@@ -943,31 +936,31 @@ extern char *get_directive_line PARAMS ((void));
/* Subroutine of build_binary_op, used for comparison operations.
See if the operands have both been converted from subword integer types
and, if so, perhaps change them both back to their original type. */
-extern tree shorten_compare PARAMS ((tree *, tree *, tree *, enum tree_code *));
+extern tree shorten_compare (tree *, tree *, tree *, enum tree_code *);
-extern tree pointer_int_sum PARAMS ((enum tree_code, tree, tree));
-extern unsigned int min_precision PARAMS ((tree, int));
+extern tree pointer_int_sum (enum tree_code, tree, tree);
+extern unsigned int min_precision (tree, int);
/* Add qualifiers to a type, in the fashion for C. */
-extern tree c_build_qualified_type PARAMS ((tree, int));
+extern tree c_build_qualified_type (tree, int);
/* Build tree nodes and builtin functions common to both C and C++ language
frontends. */
-extern void c_common_nodes_and_builtins PARAMS ((void));
+extern void c_common_nodes_and_builtins (void);
-extern void disable_builtin_function PARAMS ((const char *));
+extern void disable_builtin_function (const char *);
-extern tree build_va_arg PARAMS ((tree, tree));
+extern tree build_va_arg (tree, tree);
-extern int c_common_init_options PARAMS ((enum c_language_kind));
-extern bool c_common_post_options PARAMS ((const char **));
-extern bool c_common_init PARAMS ((void));
-extern void c_common_finish PARAMS ((void));
-extern void c_common_parse_file PARAMS ((int));
-extern HOST_WIDE_INT c_common_get_alias_set PARAMS ((tree));
-extern bool c_promoting_integer_type_p PARAMS ((tree));
-extern int self_promoting_args_p PARAMS ((tree));
-extern tree strip_array_types PARAMS ((tree));
+extern int c_common_init_options (enum c_language_kind);
+extern bool c_common_post_options (const char **);
+extern bool c_common_init (void);
+extern void c_common_finish (void);
+extern void c_common_parse_file (int);
+extern HOST_WIDE_INT c_common_get_alias_set (tree);
+extern bool c_promoting_integer_type_p (tree);
+extern int self_promoting_args_p (tree);
+extern tree strip_array_types (tree);
/* These macros provide convenient access to the various _STMT nodes. */
@@ -1172,28 +1165,26 @@ extern bool statement_code_p[MAX_TREE_CODES];
statement_code_p[STMT_CODES[i]] = true; \
} while (0)
-extern void genrtl_do_pushlevel PARAMS ((void));
-extern void genrtl_goto_stmt PARAMS ((tree));
-extern void genrtl_expr_stmt PARAMS ((tree));
-extern void genrtl_expr_stmt_value PARAMS ((tree, int, int));
-extern void genrtl_decl_stmt PARAMS ((tree));
-extern void genrtl_if_stmt PARAMS ((tree));
-extern void genrtl_while_stmt PARAMS ((tree));
-extern void genrtl_do_stmt PARAMS ((tree));
-extern void genrtl_return_stmt PARAMS ((tree));
-extern void genrtl_for_stmt PARAMS ((tree));
-extern void genrtl_break_stmt PARAMS ((void));
-extern void genrtl_continue_stmt PARAMS ((void));
-extern void genrtl_scope_stmt PARAMS ((tree));
-extern void genrtl_switch_stmt PARAMS ((tree));
-extern void genrtl_case_label PARAMS ((tree));
-extern void genrtl_compound_stmt PARAMS ((tree));
-extern void genrtl_asm_stmt PARAMS ((tree, tree,
- tree, tree,
- tree, int));
-extern void genrtl_cleanup_stmt PARAMS ((tree));
-extern int stmts_are_full_exprs_p PARAMS ((void));
-extern int anon_aggr_type_p PARAMS ((tree));
+extern void genrtl_do_pushlevel (void);
+extern void genrtl_goto_stmt (tree);
+extern void genrtl_expr_stmt (tree);
+extern void genrtl_expr_stmt_value (tree, int, int);
+extern void genrtl_decl_stmt (tree);
+extern void genrtl_if_stmt (tree);
+extern void genrtl_while_stmt (tree);
+extern void genrtl_do_stmt (tree);
+extern void genrtl_return_stmt (tree);
+extern void genrtl_for_stmt (tree);
+extern void genrtl_break_stmt (void);
+extern void genrtl_continue_stmt (void);
+extern void genrtl_scope_stmt (tree);
+extern void genrtl_switch_stmt (tree);
+extern void genrtl_case_label (tree);
+extern void genrtl_compound_stmt (tree);
+extern void genrtl_asm_stmt (tree, tree, tree, tree, tree, int);
+extern void genrtl_cleanup_stmt (tree);
+extern int stmts_are_full_exprs_p (void);
+extern int anon_aggr_type_p (tree);
/* For a VAR_DECL that is an anonymous union, these are the various
sub-variables that make up the anonymous union. */
@@ -1211,16 +1202,16 @@ extern int anon_aggr_type_p PARAMS ((tree));
an explicit asm specification. */
#define DECL_C_HARD_REGISTER(DECL) DECL_LANG_FLAG_4 (VAR_DECL_CHECK (DECL))
-extern void emit_local_var PARAMS ((tree));
-extern void make_rtl_for_local_static PARAMS ((tree));
-extern tree expand_cond PARAMS ((tree));
-extern tree c_expand_return PARAMS ((tree));
-extern tree do_case PARAMS ((tree, tree));
-extern tree build_stmt PARAMS ((enum tree_code, ...));
-extern tree build_case_label PARAMS ((tree, tree, tree));
-extern tree build_continue_stmt PARAMS ((void));
-extern tree build_break_stmt PARAMS ((void));
-extern tree build_return_stmt PARAMS ((tree));
+extern void emit_local_var (tree);
+extern void make_rtl_for_local_static (tree);
+extern tree expand_cond (tree);
+extern tree c_expand_return (tree);
+extern tree do_case (tree, tree);
+extern tree build_stmt (enum tree_code, ...);
+extern tree build_case_label (tree, tree, tree);
+extern tree build_continue_stmt (void);
+extern tree build_break_stmt (void);
+extern tree build_return_stmt (tree);
#define COMPOUND_STMT_NO_SCOPE(NODE) TREE_LANG_FLAG_0 (NODE)
@@ -1228,63 +1219,55 @@ extern tree build_return_stmt PARAMS ((tree));
initializers and cleanups. */
#define COMPOUND_STMT_BODY_BLOCK(NODE) TREE_LANG_FLAG_3 (NODE)
-extern void c_expand_asm_operands PARAMS ((tree, tree, tree, tree, int, const char *, int));
+extern void c_expand_asm_operands (tree, tree, tree, tree, int, const char *, int);
/* These functions must be defined by each front-end which implements
a variant of the C language. They are used in c-common.c. */
-extern tree build_unary_op PARAMS ((enum tree_code,
- tree, int));
-extern tree build_binary_op PARAMS ((enum tree_code,
- tree, tree, int));
-extern int lvalue_p PARAMS ((tree));
-extern tree default_conversion PARAMS ((tree));
+extern tree build_unary_op (enum tree_code, tree, int);
+extern tree build_binary_op (enum tree_code, tree, tree, int);
+extern int lvalue_p (tree);
+extern tree default_conversion (tree);
/* Given two integer or real types, return the type for their sum.
Given two compatible ANSI C types, returns the merged type. */
-extern tree common_type PARAMS ((tree, tree));
+extern tree common_type (tree, tree);
-extern tree expand_tree_builtin PARAMS ((tree, tree, tree));
+extern tree expand_tree_builtin (tree, tree, tree);
-extern tree decl_constant_value PARAMS ((tree));
+extern tree decl_constant_value (tree);
/* Handle increment and decrement of boolean types. */
-extern tree boolean_increment PARAMS ((enum tree_code,
- tree));
+extern tree boolean_increment (enum tree_code, tree);
/* Hook currently used only by the C++ front end to reset internal state
after entering or leaving a header file. */
-extern void extract_interface_info PARAMS ((void));
+extern void extract_interface_info (void);
-extern int case_compare PARAMS ((splay_tree_key,
- splay_tree_key));
+extern int case_compare (splay_tree_key, splay_tree_key);
-extern tree c_add_case_label PARAMS ((splay_tree,
- tree, tree,
- tree));
+extern tree c_add_case_label (splay_tree, tree, tree, tree);
-extern tree build_function_call PARAMS ((tree, tree));
+extern tree build_function_call (tree, tree);
-extern tree finish_label_address_expr PARAMS ((tree));
+extern tree finish_label_address_expr (tree);
/* Same function prototype, but the C and C++ front ends have
different implementations. Used in c-common.c. */
-extern tree lookup_label PARAMS ((tree));
+extern tree lookup_label (tree);
-extern rtx c_expand_expr PARAMS ((tree, rtx,
- enum machine_mode,
- int));
+extern rtx c_expand_expr (tree, rtx, enum machine_mode, int);
-extern int c_safe_from_p PARAMS ((rtx, tree));
+extern int c_safe_from_p (rtx, tree);
-extern int c_staticp PARAMS ((tree));
+extern int c_staticp (tree);
-extern int c_common_unsafe_for_reeval PARAMS ((tree));
+extern int c_common_unsafe_for_reeval (tree);
-extern void init_c_lex PARAMS ((void));
+extern void init_c_lex (void);
-extern void c_cpp_builtins PARAMS ((cpp_reader *));
+extern void c_cpp_builtins (cpp_reader *);
/* Positive if an implicit `extern "C"' scope has just been entered;
negative if such a scope has just been exited. */
@@ -1299,28 +1282,23 @@ struct c_fileinfo
short interface_unknown;
};
-struct c_fileinfo *get_fileinfo PARAMS ((const char *));
-extern void dump_time_statistics PARAMS ((void));
-
-extern bool c_dump_tree PARAMS ((void *, tree));
-
-extern void pch_init PARAMS ((void));
-extern int c_common_valid_pch PARAMS ((cpp_reader *pfile,
- const char *name,
- int fd));
-extern void c_common_read_pch PARAMS ((cpp_reader *pfile,
- const char *name,
- int fd,
- const char *orig));
-extern void c_common_write_pch PARAMS ((void));
-extern void builtin_define_with_value PARAMS ((const char *,
- const char *, int));
-extern void c_stddef_cpp_builtins PARAMS ((void));
-extern void fe_file_change PARAMS ((const struct line_map *));
+struct c_fileinfo *get_fileinfo (const char *);
+extern void dump_time_statistics (void);
+
+extern bool c_dump_tree (void *, tree);
+
+extern void pch_init (void);
+extern int c_common_valid_pch (cpp_reader *pfile, const char *name, int fd);
+extern void c_common_read_pch (cpp_reader *pfile, const char *name, int fd,
+ const char *orig);
+extern void c_common_write_pch (void);
+extern void builtin_define_with_value (const char *, const char *, int);
+extern void c_stddef_cpp_builtins (void);
+extern void fe_file_change (const struct line_map *);
/* In c-ppoutput.c */
-extern void init_pp_output PARAMS ((FILE *));
-extern void preprocess_file PARAMS ((cpp_reader *));
-extern void pp_file_change PARAMS ((const struct line_map *));
+extern void init_pp_output (FILE *);
+extern void preprocess_file (cpp_reader *);
+extern void pp_file_change (const struct line_map *);
#endif /* ! GCC_C_COMMON_H */
diff --git a/gcc/c-convert.c b/gcc/c-convert.c
index 3c0a21a822a..ce095acc29a 100644
--- a/gcc/c-convert.c
+++ b/gcc/c-convert.c
@@ -1,5 +1,6 @@
/* Language-level data type conversion for GNU C.
- Copyright (C) 1987, 1988, 1991, 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1991, 1998, 2002, 2003
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -62,8 +63,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
not permitted by the language being compiled. */
tree
-convert (type, expr)
- tree type, expr;
+convert (tree type, tree expr)
{
tree e = expr;
enum tree_code code = TREE_CODE (type);
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c
index b17b469955b..1dfc5d0c167 100644
--- a/gcc/c-cppbuiltin.c
+++ b/gcc/c-cppbuiltin.c
@@ -45,35 +45,29 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#endif
/* Non-static as some targets don't use it. */
-void builtin_define_std PARAMS ((const char *)) ATTRIBUTE_UNUSED;
-static void builtin_define_with_value_n PARAMS ((const char *, const char *,
- size_t));
-static void builtin_define_with_int_value PARAMS ((const char *,
- HOST_WIDE_INT));
-static void builtin_define_with_hex_fp_value PARAMS ((const char *, tree,
- int, const char *,
- const char *));
-static void builtin_define_type_max PARAMS ((const char *, tree, int));
-static void builtin_define_type_precision PARAMS ((const char *, tree));
-static void builtin_define_float_constants PARAMS ((const char *,
- const char *, tree));
-static void define__GNUC__ PARAMS ((void));
+void builtin_define_std (const char *) ATTRIBUTE_UNUSED;
+static void builtin_define_with_value_n (const char *, const char *,
+ size_t);
+static void builtin_define_with_int_value (const char *, HOST_WIDE_INT);
+static void builtin_define_with_hex_fp_value (const char *, tree,
+ int, const char *,
+ const char *);
+static void builtin_define_type_max (const char *, tree, int);
+static void builtin_define_type_precision (const char *, tree);
+static void builtin_define_float_constants (const char *, const char *,
+ tree);
+static void define__GNUC__ (void);
/* Define NAME with value TYPE precision. */
static void
-builtin_define_type_precision (name, type)
- const char *name;
- tree type;
+builtin_define_type_precision (const char *name, tree type)
{
builtin_define_with_int_value (name, TYPE_PRECISION (type));
}
/* Define the float.h constants for TYPE using NAME_PREFIX and FP_SUFFIX. */
static void
-builtin_define_float_constants (name_prefix, fp_suffix, type)
- const char *name_prefix;
- const char *fp_suffix;
- tree type;
+builtin_define_float_constants (const char *name_prefix, const char *fp_suffix, tree type)
{
/* Used to convert radix-based values to base 10 values in several cases.
@@ -107,7 +101,7 @@ builtin_define_float_constants (name_prefix, fp_suffix, type)
p radix b digits and back again without change to the q decimal digits,
p log10 b if b is a power of 10
- floor((p - 1) log10 b) otherwise
+ floor((p - 1) log10 b) otherwise
*/
dig = (fmt->p - 1) * log10_b;
sprintf (name, "__%s_DIG__", name_prefix);
@@ -166,7 +160,7 @@ builtin_define_float_constants (name_prefix, fp_suffix, type)
/* The number of decimal digits, n, such that any floating-point number
can be rounded to n decimal digits and back again without change to
- the value.
+ the value.
p * log10(b) if b is a power of 10
ceil(1 + p * log10(b)) otherwise
@@ -233,7 +227,7 @@ builtin_define_float_constants (name_prefix, fp_suffix, type)
/* For C++ std::numeric_limits<T>::has_infinity. */
sprintf (name, "__%s_HAS_INFINITY__", name_prefix);
- builtin_define_with_int_value (name,
+ builtin_define_with_int_value (name,
MODE_HAS_INFINITIES (TYPE_MODE (type)));
/* For C++ std::numeric_limits<T>::has_quiet_NaN. We do not have a
predicate to distinguish a target that has both quiet and
@@ -246,7 +240,7 @@ builtin_define_float_constants (name_prefix, fp_suffix, type)
/* Define __GNUC__, __GNUC_MINOR__ and __GNUC_PATCHLEVEL__. */
static void
-define__GNUC__ ()
+define__GNUC__ (void)
{
/* The format of the version string, enforced below, is
([^0-9]*-)?[0-9]+[.][0-9]+([.][0-9]+)?([- ].*)? */
@@ -289,8 +283,7 @@ define__GNUC__ ()
/* Hook that registers front end and target-specific built-ins. */
void
-c_cpp_builtins (pfile)
- cpp_reader *pfile;
+c_cpp_builtins (cpp_reader *pfile)
{
/* -undef turns off target-specific built-ins. */
if (flag_undef)
@@ -357,7 +350,7 @@ c_cpp_builtins (pfile)
cpp_define (pfile, "_LP64");
cpp_define (pfile, "__LP64__");
}
-
+
/* Other target-independent built-ins determined by command-line
options. */
if (optimize_size)
@@ -410,8 +403,7 @@ c_cpp_builtins (pfile)
"unix". Passing "_mips" defines "__mips", "__mips__" and possibly
"_mips". */
void
-builtin_define_std (macro)
- const char *macro;
+builtin_define_std (const char *macro)
{
size_t len = strlen (macro);
char *buff = alloca (len + 5);
@@ -450,10 +442,7 @@ builtin_define_std (macro)
parameter says whether or not to turn the value into a string
constant. */
void
-builtin_define_with_value (macro, expansion, is_str)
- const char *macro;
- const char *expansion;
- int is_str;
+builtin_define_with_value (const char *macro, const char *expansion, int is_str)
{
char *buf;
size_t mlen = strlen (macro);
@@ -475,14 +464,11 @@ builtin_define_with_value (macro, expansion, is_str)
/* Pass an object-like macro and a value to define it to. The third
parameter is the length of the expansion. */
static void
-builtin_define_with_value_n (macro, expansion, elen)
- const char *macro;
- const char *expansion;
- size_t elen;
+builtin_define_with_value_n (const char *macro, const char *expansion, size_t elen)
{
char *buf;
size_t mlen = strlen (macro);
-
+
/* Space for an = and a NUL. */
buf = alloca (mlen + elen + 2);
memcpy (buf, macro, mlen);
@@ -495,9 +481,7 @@ builtin_define_with_value_n (macro, expansion, elen)
/* Pass an object-like macro and an integer value to define it to. */
static void
-builtin_define_with_int_value (macro, value)
- const char *macro;
- HOST_WIDE_INT value;
+builtin_define_with_int_value (const char *macro, HOST_WIDE_INT value)
{
char *buf;
size_t mlen = strlen (macro);
@@ -514,12 +498,9 @@ builtin_define_with_int_value (macro, value)
/* Pass an object-like macro a hexadecimal floating-point value. */
static void
-builtin_define_with_hex_fp_value (macro, type, digits, hex_str, fp_suffix)
- const char *macro;
- tree type ATTRIBUTE_UNUSED;
- int digits;
- const char *hex_str;
- const char *fp_suffix;
+builtin_define_with_hex_fp_value (const char *macro,
+ tree type ATTRIBUTE_UNUSED, int digits,
+ const char *hex_str, const char *fp_suffix)
{
REAL_VALUE_TYPE real;
char dec_str[64], buf[256];
@@ -530,7 +511,7 @@ builtin_define_with_hex_fp_value (macro, type, digits, hex_str, fp_suffix)
pedwarn from the preprocessor, which has no context, so we can't
suppress the warning with __extension__.
- So instead what we do is construct the number in hex (because
+ So instead what we do is construct the number in hex (because
it's easy to get the exact correct value), parse it as a real,
then print it back out as decimal. */
@@ -546,10 +527,7 @@ builtin_define_with_hex_fp_value (macro, type, digits, hex_str, fp_suffix)
unsigned types, since wchar_t might be unsigned. */
static void
-builtin_define_type_max (macro, type, is_long)
- const char *macro;
- tree type;
- int is_long;
+builtin_define_type_max (const char *macro, tree type, int is_long)
{
static const char *const values[]
= { "127", "255",
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index cc818d861d0..0caed47cabb 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -263,32 +263,31 @@ tree static_ctors, static_dtors;
/* Forward declarations. */
-static struct binding_level *make_binding_level PARAMS ((void));
-static void pop_binding_level PARAMS ((struct binding_level **));
-static int duplicate_decls PARAMS ((tree, tree, int));
-static int redeclaration_error_message PARAMS ((tree, tree));
-static void implicit_decl_warning PARAMS ((tree));
-static void storedecls PARAMS ((tree));
-static void storetags PARAMS ((tree));
-static tree lookup_tag PARAMS ((enum tree_code, tree, int));
-static tree lookup_name_current_level PARAMS ((tree));
-static tree grokdeclarator PARAMS ((tree, tree, enum decl_context,
- int));
-static tree grokparms PARAMS ((tree, int));
-static void layout_array_type PARAMS ((tree));
-static tree c_make_fname_decl PARAMS ((tree, int));
-static void c_expand_body_1 PARAMS ((tree, int));
-static tree any_external_decl PARAMS ((tree));
-static void record_external_decl PARAMS ((tree));
-static void warn_if_shadowing PARAMS ((tree, tree));
-static void clone_underlying_type PARAMS ((tree));
-static bool flexible_array_type_p PARAMS ((tree));
+static struct binding_level *make_binding_level (void);
+static void pop_binding_level (struct binding_level **);
+static int duplicate_decls (tree, tree, int);
+static int redeclaration_error_message (tree, tree);
+static void implicit_decl_warning (tree);
+static void storedecls (tree);
+static void storetags (tree);
+static tree lookup_tag (enum tree_code, tree, int);
+static tree lookup_name_current_level (tree);
+static tree grokdeclarator (tree, tree, enum decl_context, int);
+static tree grokparms (tree, int);
+static void layout_array_type (tree);
+static tree c_make_fname_decl (tree, int);
+static void c_expand_body_1 (tree, int);
+static tree any_external_decl (tree);
+static void record_external_decl (tree);
+static void warn_if_shadowing (tree, tree);
+static void clone_underlying_type (tree);
+static bool flexible_array_type_p (tree);
/* States indicating how grokdeclarator() should handle declspecs marked
with __attribute__((deprecated)). An object declared as
__attribute__((deprecated)) suppresses warnings of uses of other
deprecated items. */
-
+
enum deprecated_states {
DEPRECATED_NORMAL,
DEPRECATED_SUPPRESS
@@ -297,10 +296,7 @@ enum deprecated_states {
static enum deprecated_states deprecated_state = DEPRECATED_NORMAL;
void
-c_print_identifier (file, node, indent)
- FILE *file;
- tree node;
- int indent;
+c_print_identifier (FILE *file, tree node, int indent)
{
print_node (file, "symbol", IDENTIFIER_SYMBOL_VALUE (node), indent + 4);
print_node (file, "tag", IDENTIFIER_TAG_VALUE (node), indent + 4);
@@ -319,8 +315,7 @@ c_print_identifier (file, node, indent)
for a top-level tentative array defn that wasn't complete before. */
void
-c_finish_incomplete_decl (decl)
- tree decl;
+c_finish_incomplete_decl (tree decl)
{
if (TREE_CODE (decl) == VAR_DECL)
{
@@ -342,7 +337,7 @@ c_finish_incomplete_decl (decl)
/* Reuse or create a struct for this binding level. */
static struct binding_level *
-make_binding_level ()
+make_binding_level (void)
{
struct binding_level *result;
if (free_binding_level)
@@ -361,12 +356,11 @@ make_binding_level ()
/* Remove a binding level from a list and add it to the level chain. */
static void
-pop_binding_level (lp)
- struct binding_level **lp;
+pop_binding_level (struct binding_level **lp)
{
struct binding_level *l = *lp;
*lp = l->level_chain;
-
+
memset (l, 0, sizeof (struct binding_level));
l->level_chain = free_binding_level;
free_binding_level = l;
@@ -375,13 +369,13 @@ pop_binding_level (lp)
/* Nonzero if we are currently in the global binding level. */
int
-global_bindings_p ()
+global_bindings_p (void)
{
return current_binding_level == global_binding_level;
}
void
-keep_next_level ()
+keep_next_level (void)
{
keep_next_level_flag = 1;
}
@@ -389,7 +383,7 @@ keep_next_level ()
/* Nonzero if the current level needs to have a BLOCK made. */
int
-kept_level_p ()
+kept_level_p (void)
{
return ((current_binding_level->keep_if_subblocks
&& current_binding_level->blocks != 0)
@@ -404,8 +398,7 @@ kept_level_p ()
DEFINITION_FLAG, so we ignore it. */
void
-declare_parm_level (definition_flag)
- int definition_flag ATTRIBUTE_UNUSED;
+declare_parm_level (int definition_flag ATTRIBUTE_UNUSED)
{
current_binding_level->parm_flag = 1;
}
@@ -413,7 +406,7 @@ declare_parm_level (definition_flag)
/* Nonzero if currently making parm declarations. */
int
-in_parm_level_p ()
+in_parm_level_p (void)
{
return current_binding_level->parm_flag;
}
@@ -421,8 +414,7 @@ in_parm_level_p ()
/* Enter a new binding level. */
void
-pushlevel (dummy)
- int dummy ATTRIBUTE_UNUSED;
+pushlevel (int dummy ATTRIBUTE_UNUSED)
{
/* If this is the top level of a function, make sure that
NAMED_LABELS is 0. */
@@ -475,10 +467,7 @@ pushlevel (dummy)
them into the BLOCK. */
tree
-poplevel (keep, reverse, functionbody)
- int keep;
- int reverse;
- int functionbody;
+poplevel (int keep, int reverse, int functionbody)
{
tree link;
tree block;
@@ -659,8 +648,7 @@ poplevel (keep, reverse, functionbody)
to handle the BLOCK node inside the BIND_EXPR. */
void
-insert_block (block)
- tree block;
+insert_block (tree block)
{
TREE_USED (block) = 1;
current_binding_level->blocks
@@ -672,13 +660,12 @@ insert_block (block)
this hook, but it is not useful in function-at-a-time mode. */
void
-set_block (block)
- tree block ATTRIBUTE_UNUSED;
+set_block (tree block ATTRIBUTE_UNUSED)
{
}
void
-push_label_level ()
+push_label_level (void)
{
struct binding_level *newlevel;
@@ -696,7 +683,7 @@ push_label_level ()
}
void
-pop_label_level ()
+pop_label_level (void)
{
struct binding_level *level = label_level_chain;
tree link, prev;
@@ -755,8 +742,7 @@ pop_label_level ()
In that case, the TYPE_SIZE will be zero. */
void
-pushtag (name, type)
- tree name, type;
+pushtag (tree name, tree type)
{
struct binding_level *b = current_binding_level;
@@ -801,9 +787,7 @@ pushtag (name, type)
and OLDDECL is in an outer binding level and should thus not be changed. */
static int
-duplicate_decls (newdecl, olddecl, different_binding_level)
- tree newdecl, olddecl;
- int different_binding_level;
+duplicate_decls (tree newdecl, tree olddecl, int different_binding_level)
{
int types_match = comptypes (TREE_TYPE (newdecl), TREE_TYPE (olddecl));
int new_is_definition = (TREE_CODE (newdecl) == FUNCTION_DECL
@@ -1547,8 +1531,7 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
currently in scope. */
static tree
-any_external_decl (id)
- tree id;
+any_external_decl (tree id)
{
tree decl = IDENTIFIER_SYMBOL_VALUE (id);
tree t;
@@ -1568,8 +1551,7 @@ any_external_decl (id)
/* Record an external decl DECL. This only does something if a
shadowing decl already exists. */
static void
-record_external_decl (decl)
- tree decl;
+record_external_decl (tree decl)
{
tree name = DECL_NAME (decl);
if (!IDENTIFIER_SYMBOL_VALUE (name))
@@ -1582,8 +1564,7 @@ record_external_decl (decl)
OLD is the old IDENTIFIER_SYMBOL_VALUE of the DECL_NAME of X,
which might be a NULL_TREE. */
static void
-warn_if_shadowing (x, old)
- tree x, old;
+warn_if_shadowing (tree x, tree old)
{
const char *name;
@@ -1660,8 +1641,7 @@ warn_if_shadowing (x, old)
on a standard type by checking the current value of lineno. */
static void
-clone_underlying_type (x)
- tree x;
+clone_underlying_type (tree x)
{
if (DECL_SOURCE_LINE (x) == 0)
{
@@ -1689,8 +1669,7 @@ clone_underlying_type (x)
to agree with what X says. */
tree
-pushdecl (x)
- tree x;
+pushdecl (tree x)
{
tree name = DECL_NAME (x);
struct binding_level *scope = current_binding_level;
@@ -1744,7 +1723,7 @@ pushdecl (x)
else
record_external_decl (x);
}
-
+
if (TREE_CODE (x) == TYPE_DECL)
clone_underlying_type (x);
@@ -1797,8 +1776,7 @@ pushdecl (x)
and is limited to its needs. It will hork if there is _any_
visible binding for X (not just a global one). */
tree
-pushdecl_top_level (x)
- tree x;
+pushdecl_top_level (tree x)
{
tree name, old;
@@ -1834,9 +1812,7 @@ pushdecl_top_level (x)
called; if there is any preexisting decl for this identifier, it is
an ICE. */
tree
-pushdecl_function_level (x, name)
- tree x;
- tree name;
+pushdecl_function_level (tree x, tree name)
{
struct binding_level *scope;
@@ -1869,8 +1845,7 @@ pushdecl_function_level (x, name)
function of type int (). */
tree
-implicitly_declare (functionid)
- tree functionid;
+implicitly_declare (tree functionid)
{
tree decl = any_external_decl (functionid);
@@ -1922,8 +1897,7 @@ implicitly_declare (functionid)
}
static void
-implicit_decl_warning (id)
- tree id;
+implicit_decl_warning (tree id)
{
const char *name = IDENTIFIER_POINTER (id);
if (mesg_implicit_function_declaration == 2)
@@ -1939,8 +1913,7 @@ implicit_decl_warning (id)
and 3 if it is a conflicting declaration. */
static int
-redeclaration_error_message (newdecl, olddecl)
- tree newdecl, olddecl;
+redeclaration_error_message (tree newdecl, tree olddecl)
{
if (TREE_CODE (newdecl) == TYPE_DECL)
{
@@ -2001,8 +1974,7 @@ redeclaration_error_message (newdecl, olddecl)
This function is called for both label definitions and label references. */
tree
-lookup_label (id)
- tree id;
+lookup_label (tree id)
{
tree decl = IDENTIFIER_LABEL_VALUE (id);
@@ -2050,8 +2022,7 @@ lookup_label (id)
requires calling declare_nonlocal_label right away. */
tree
-shadow_label (name)
- tree name;
+shadow_label (tree name)
{
tree decl = IDENTIFIER_LABEL_VALUE (name);
@@ -2124,7 +2095,7 @@ define_label (const char* filename, int line, tree name)
store the result back using `storedecls' or you will lose. */
tree
-getdecls ()
+getdecls (void)
{
return current_binding_level->names;
}
@@ -2132,7 +2103,7 @@ getdecls ()
/* Return the list of type-tags (for structs, etc) of the current level. */
tree
-gettags ()
+gettags (void)
{
return current_binding_level->tags;
}
@@ -2142,8 +2113,7 @@ gettags ()
after they are modified in the light of any missing parameters. */
static void
-storedecls (decls)
- tree decls;
+storedecls (tree decls)
{
current_binding_level->names = decls;
}
@@ -2151,8 +2121,7 @@ storedecls (decls)
/* Similarly, store the list of tags of the current level. */
static void
-storetags (tags)
- tree tags;
+storetags (tree tags)
{
current_binding_level->tags = tags;
}
@@ -2165,10 +2134,7 @@ storetags (tags)
If the wrong kind of type is found, an error is reported. */
static tree
-lookup_tag (code, name, thislevel_only)
- enum tree_code code;
- tree name;
- int thislevel_only;
+lookup_tag (enum tree_code code, tree name, int thislevel_only)
{
tree tag = IDENTIFIER_TAG_VALUE (name);
int thislevel = 0;
@@ -2210,7 +2176,7 @@ lookup_tag (code, name, thislevel_only)
when used in the `struct foo;' construct for shadowing. */
void
-pending_xref_error ()
+pending_xref_error (void)
{
if (pending_invalid_xref != 0)
error ("%H`%s' defined as wrong kind of tag",
@@ -2226,8 +2192,7 @@ pending_xref_error ()
or return 0 if it is undefined. */
tree
-lookup_name (name)
- tree name;
+lookup_name (tree name)
{
tree decl = IDENTIFIER_SYMBOL_VALUE (name);
if (decl == 0 || decl == error_mark_node)
@@ -2240,8 +2205,7 @@ lookup_name (name)
/* Similar to `lookup_name' but look only at the current binding level. */
static tree
-lookup_name_current_level (name)
- tree name;
+lookup_name_current_level (tree name)
{
tree decl = IDENTIFIER_SYMBOL_VALUE (name);
@@ -2264,7 +2228,7 @@ lookup_name_current_level (name)
Make definitions for built-in primitive functions. */
void
-c_init_decl_processing ()
+c_init_decl_processing (void)
{
tree endlink;
tree ptr_ftype_void, ptr_ftype_ptr;
@@ -2330,9 +2294,7 @@ c_init_decl_processing ()
are string merging candidates, which is wrong for C99's __func__. FIXME. */
static tree
-c_make_fname_decl (id, type_dep)
- tree id;
- int type_dep;
+c_make_fname_decl (tree id, int type_dep)
{
const char *name = fname_as_string (type_dep);
tree decl, type, init;
@@ -2343,11 +2305,11 @@ c_make_fname_decl (id, type_dep)
build_index_type (size_int (length)));
decl = build_decl (VAR_DECL, id, type);
-
+
TREE_STATIC (decl) = 1;
TREE_READONLY (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
-
+
init = build_string (length + 1, name);
TREE_TYPE (init) = type;
DECL_INITIAL (decl) = init;
@@ -2372,13 +2334,9 @@ c_make_fname_decl (id, type_dep)
ATTRS is nonzero, use that for the function's attribute list. */
tree
-builtin_function (name, type, function_code, class, library_name, attrs)
- const char *name;
- tree type;
- int function_code;
- enum built_in_class class;
- const char *library_name;
- tree attrs;
+builtin_function (const char *name, tree type, int function_code,
+ enum built_in_class class, const char *library_name,
+ tree attrs)
{
tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
DECL_EXTERNAL (decl) = 1;
@@ -2408,8 +2366,7 @@ builtin_function (name, type, function_code, class, library_name, attrs)
attributes. */
void
-c_insert_default_attributes (decl)
- tree decl;
+c_insert_default_attributes (tree decl)
{
if (!TREE_PUBLIC (decl))
return;
@@ -2425,16 +2382,15 @@ c_insert_default_attributes (decl)
Otherwise, it is an error. */
void
-shadow_tag (declspecs)
- tree declspecs;
+shadow_tag (tree declspecs)
{
shadow_tag_warned (declspecs, 0);
}
void
-shadow_tag_warned (declspecs, warned)
- tree declspecs;
- int warned;
+shadow_tag_warned (tree declspecs, int warned)
+
+
/* 1 => we have done a pedwarn. 2 => we have done a warning, but
no pedwarn. */
{
@@ -2515,11 +2471,7 @@ shadow_tag_warned (declspecs, warned)
which has TREE_STATIC set if "static" is used. */
tree
-build_array_declarator (expr, quals, static_p, vla_unspec_p)
- tree expr;
- tree quals;
- int static_p;
- int vla_unspec_p;
+build_array_declarator (tree expr, tree quals, int static_p, int vla_unspec_p)
{
tree decl;
decl = build_nt (ARRAY_REF, NULL_TREE, expr);
@@ -2545,10 +2497,7 @@ build_array_declarator (expr, quals, static_p, vla_unspec_p)
C99 grammar. */
tree
-set_array_declarator_type (decl, type, abstract_p)
- tree decl;
- tree type;
- int abstract_p;
+set_array_declarator_type (tree decl, tree type, int abstract_p)
{
TREE_OPERAND (decl, 0) = type;
if (abstract_p && (TREE_TYPE (decl) != NULL_TREE || TREE_STATIC (decl)))
@@ -2559,8 +2508,7 @@ set_array_declarator_type (decl, type, abstract_p)
/* Decode a "typename", such as "int **", returning a ..._TYPE node. */
tree
-groktypename (typename)
- tree typename;
+groktypename (tree typename)
{
tree specs, attrs;
@@ -2580,8 +2528,7 @@ groktypename (typename)
/* Return a PARM_DECL node for a given pair of specs and declarator. */
tree
-groktypename_in_parm_context (typename)
- tree typename;
+groktypename_in_parm_context (tree typename)
{
if (TREE_CODE (typename) != TREE_LIST)
return typename;
@@ -2606,14 +2553,11 @@ groktypename_in_parm_context (typename)
grokfield and not through here. */
tree
-start_decl (declarator, declspecs, initialized, attributes)
- tree declarator, declspecs;
- int initialized;
- tree attributes;
+start_decl (tree declarator, tree declspecs, int initialized, tree attributes)
{
tree decl;
tree tem;
-
+
/* An object declared as __attribute__((deprecated)) suppresses
warnings of uses of other deprecated items. */
if (lookup_attribute ("deprecated", attributes))
@@ -2621,7 +2565,7 @@ start_decl (declarator, declspecs, initialized, attributes)
decl = grokdeclarator (declarator, declspecs,
NORMAL, initialized);
-
+
deprecated_state = DEPRECATED_NORMAL;
if (warn_main > 0 && TREE_CODE (decl) != FUNCTION_DECL
@@ -2773,9 +2717,7 @@ start_decl (declarator, declspecs, initialized, attributes)
it must be determined now, from the initial value, or it is an error. */
void
-finish_decl (decl, init, asmspec_tree)
- tree decl, init;
- tree asmspec_tree;
+finish_decl (tree decl, tree init, tree asmspec_tree)
{
tree type = TREE_TYPE (decl);
int was_incomplete = (DECL_SIZE (decl) == 0);
@@ -2790,7 +2732,7 @@ finish_decl (decl, init, asmspec_tree)
/* If `start_decl' didn't like having an initialization, ignore it now. */
if (init != 0 && DECL_INITIAL (decl) == 0)
init = 0;
-
+
/* Don't crash if parm is initialized. */
if (TREE_CODE (decl) == PARM_DECL)
init = 0;
@@ -2953,7 +2895,7 @@ finish_decl (decl, init, asmspec_tree)
ordinary, non-register local variable. Historically,
GCC has accepted -- but ignored -- the ASMSPEC in
this case. */
- if (TREE_CODE (decl) == VAR_DECL
+ if (TREE_CODE (decl) == VAR_DECL
&& !DECL_REGISTER (decl)
&& !TREE_STATIC (decl))
warning_with_decl (decl,
@@ -3038,8 +2980,7 @@ finish_decl (decl, init, asmspec_tree)
record the given order of parms in `parm_order'. */
void
-push_parm_decl (parm)
- tree parm;
+push_parm_decl (tree parm)
{
tree decl;
int old_immediate_size_expand = immediate_size_expand;
@@ -3077,7 +3018,7 @@ push_parm_decl (parm)
and also at semicolon terminating forward decls. */
void
-clear_parm_order ()
+clear_parm_order (void)
{
current_binding_level->parm_order = NULL_TREE;
}
@@ -3090,9 +3031,7 @@ static GTY(()) int compound_literal_number;
literal. */
tree
-build_compound_literal (type, init)
- tree type;
- tree init;
+build_compound_literal (tree type, tree init)
{
/* We do not use start_decl here because we have a type, not a declarator;
and do not use finish_decl because the decl should be stored inside
@@ -3132,7 +3071,7 @@ build_compound_literal (type, init)
a unique suffix to be added to the name. */
char *name;
- ASM_FORMAT_PRIVATE_NAME (name, "__compound_literal",
+ ASM_FORMAT_PRIVATE_NAME (name, "__compound_literal",
compound_literal_number);
compound_literal_number++;
DECL_NAME (decl) = get_identifier (name);
@@ -3151,10 +3090,7 @@ build_compound_literal (type, init)
2 if there was no information (in which case assume 1 if DO_DEFAULT). */
int
-complete_array_type (type, initial_value, do_default)
- tree type;
- tree initial_value;
- int do_default;
+complete_array_type (tree type, tree initial_value, int do_default)
{
tree maxindex = NULL_TREE;
int value = 0;
@@ -3220,8 +3156,7 @@ complete_array_type (type, initial_value, do_default)
or a union containing such a structure (possibly recursively). */
static bool
-flexible_array_type_p (type)
- tree type;
+flexible_array_type_p (tree type)
{
tree x;
switch (TREE_CODE (type))
@@ -3280,11 +3215,8 @@ flexible_array_type_p (type)
and `extern' are interpreted. */
static tree
-grokdeclarator (declarator, declspecs, decl_context, initialized)
- tree declspecs;
- tree declarator;
- enum decl_context decl_context;
- int initialized;
+grokdeclarator (tree declarator, tree declspecs,
+ enum decl_context decl_context, int initialized)
{
int specbits = 0;
tree spec;
@@ -4301,7 +4233,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
}
else if (type_quals)
type = c_build_qualified_type (type, type_quals);
-
+
type_as_written = type;
decl = build_decl (PARM_DECL, declarator, type);
@@ -4464,7 +4396,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
tree global_decl;
global_decl = identifier_global_value (declarator);
- if (global_decl
+ if (global_decl
&& TREE_CODE (global_decl) == VAR_DECL
&& !TREE_PUBLIC (global_decl))
error ("variable previously declared `static' redeclared "
@@ -4548,9 +4480,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
when FUNCDEF_FLAG is zero. */
static tree
-grokparms (parms_info, funcdef_flag)
- tree parms_info;
- int funcdef_flag;
+grokparms (tree parms_info, int funcdef_flag)
{
tree first_parm = TREE_CHAIN (parms_info);
@@ -4645,8 +4575,7 @@ grokparms (parms_info, funcdef_flag)
Zero means the parmlist ended with an ellipsis so don't append `void'. */
tree
-get_parm_info (void_at_end)
- int void_at_end;
+get_parm_info (int void_at_end)
{
tree decl, t;
tree types = 0;
@@ -4746,7 +4675,7 @@ get_parm_info (void_at_end)
defined within. Do so because these types cannot ever become complete. */
void
-parmlist_tags_warning ()
+parmlist_tags_warning (void)
{
tree elt;
static int already;
@@ -4792,9 +4721,7 @@ parmlist_tags_warning ()
Define the tag as a forward-reference if it is not defined. */
tree
-xref_tag (code, name)
- enum tree_code code;
- tree name;
+xref_tag (enum tree_code code, tree name)
{
/* If a cross reference is requested, look up the type
already defined for this tag and return it. */
@@ -4843,9 +4770,7 @@ xref_tag (code, name)
CODE says which kind of tag NAME ought to be. */
tree
-start_struct (code, name)
- enum tree_code code;
- tree name;
+start_struct (enum tree_code code, tree name)
{
/* If there is already a tag defined at this binding level
(as a forward reference), just return it. */
@@ -4862,7 +4787,7 @@ start_struct (code, name)
error ("redefinition of `union %s'", IDENTIFIER_POINTER (name));
else
error ("redefinition of `struct %s'", IDENTIFIER_POINTER (name));
- }
+ }
}
else
{
@@ -4871,7 +4796,7 @@ start_struct (code, name)
ref = make_node (code);
pushtag (name, ref);
}
-
+
C_TYPE_BEING_DEFINED (ref) = 1;
TYPE_PACKED (ref) = flag_pack_struct;
return ref;
@@ -4886,10 +4811,7 @@ start_struct (code, name)
are ultimately passed to `build_struct' to make the RECORD_TYPE node. */
tree
-grokfield (filename, line, declarator, declspecs, width)
- const char *filename ATTRIBUTE_UNUSED;
- int line ATTRIBUTE_UNUSED;
- tree declarator, declspecs, width;
+grokfield (tree declarator, tree declspecs, tree width)
{
tree value;
@@ -5009,10 +4931,7 @@ detect_field_duplicates (tree fieldlist)
ATTRIBUTES are attributes to be applied to the structure. */
tree
-finish_struct (t, fieldlist, attributes)
- tree t;
- tree fieldlist;
- tree attributes;
+finish_struct (tree t, tree fieldlist, tree attributes)
{
tree x;
int toplevel = global_binding_level == current_binding_level;
@@ -5289,8 +5208,7 @@ finish_struct (t, fieldlist, attributes)
/* Lay out the type T, and its element type, and so on. */
static void
-layout_array_type (t)
- tree t;
+layout_array_type (tree t)
{
if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)
layout_array_type (TREE_TYPE (t));
@@ -5304,8 +5222,7 @@ layout_array_type (t)
may be used to declare the individual values as they are read. */
tree
-start_enum (name)
- tree name;
+start_enum (tree name)
{
tree enumtype = 0;
@@ -5350,10 +5267,7 @@ start_enum (name)
Returns ENUMTYPE. */
tree
-finish_enum (enumtype, values, attributes)
- tree enumtype;
- tree values;
- tree attributes;
+finish_enum (tree enumtype, tree values, tree attributes)
{
tree pair, tem;
tree minnode = 0, maxnode = 0, enum_value_type;
@@ -5478,8 +5392,7 @@ finish_enum (enumtype, values, attributes)
Assignment of sequential values by default is handled here. */
tree
-build_enumerator (name, value)
- tree name, value;
+build_enumerator (tree name, tree value)
{
tree decl, type;
@@ -5554,8 +5467,7 @@ build_enumerator (name, value)
yyparse to report a parse error. */
int
-start_function (declspecs, declarator, attributes)
- tree declarator, declspecs, attributes;
+start_function (tree declspecs, tree declarator, tree attributes)
{
tree decl1, old_decl;
tree restype;
@@ -5768,7 +5680,7 @@ start_function (declspecs, declarator, attributes)
immediate_size_expand = old_immediate_size_expand;
start_fname_decls ();
-
+
return 1;
}
@@ -5780,7 +5692,7 @@ start_function (declspecs, declarator, attributes)
to specify at least the number of arguments. */
void
-store_parm_decls ()
+store_parm_decls (void)
{
tree fndecl = current_function_decl;
tree parm;
@@ -5806,10 +5718,10 @@ store_parm_decls ()
/* Nonzero if this definition is written with a prototype. */
int prototype = 0;
- int saved_warn_shadow = warn_shadow;
+ bool saved_warn_shadow = warn_shadow;
/* Don't re-emit shadow warnings. */
- warn_shadow = 0;
+ warn_shadow = false;
if (specparms != 0 && TREE_CODE (specparms) != TREE_LIST)
{
@@ -6175,7 +6087,7 @@ store_parm_decls ()
{
tree t;
- DECL_LANG_SPECIFIC (fndecl)->pending_sizes
+ DECL_LANG_SPECIFIC (fndecl)->pending_sizes
= nreverse (get_pending_sizes ());
for (t = DECL_LANG_SPECIFIC (fndecl)->pending_sizes;
t;
@@ -6206,9 +6118,7 @@ store_parm_decls ()
CAN_DEFER_P is nonzero if the function may be deferred. */
void
-finish_function (nested, can_defer_p)
- int nested;
- int can_defer_p;
+finish_function (int nested, int can_defer_p)
{
tree fndecl = current_function_decl;
@@ -6260,7 +6170,7 @@ finish_function (nested, can_defer_p)
#endif
}
}
-
+
finish_fname_decls ();
/* Tie off the statement tree for this function. */
@@ -6336,7 +6246,7 @@ finish_function (nested, can_defer_p)
current_function_decl = NULL;
return;
}
-
+
/* Then, inline any functions called in it. */
optimize_inline_calls (fndecl);
timevar_pop (TV_INTEGRATION);
@@ -6361,8 +6271,7 @@ finish_function (nested, can_defer_p)
/* Generate the RTL for a deferred function FNDECL. */
void
-c_expand_deferred_function (fndecl)
- tree fndecl;
+c_expand_deferred_function (tree fndecl)
{
/* DECL_INLINE or DECL_RESULT might got cleared after the inline
function was deferred, e.g. in duplicate_decls. */
@@ -6384,7 +6293,7 @@ c_expand_deferred_function (fndecl)
nested FUNCTION_DECL. */
static tree
-set_save_expr_context (tree *tp,
+set_save_expr_context (tree *tp,
int *walk_subtrees,
void *data)
{
@@ -6404,9 +6313,7 @@ set_save_expr_context (tree *tp,
generation of RTL. */
static void
-c_expand_body_1 (fndecl, nested_p)
- tree fndecl;
- int nested_p;
+c_expand_body_1 (tree fndecl, int nested_p)
{
timevar_push (TV_EXPAND);
@@ -6445,7 +6352,7 @@ c_expand_body_1 (fndecl, nested_p)
&& variably_modified_type_p (TREE_TYPE (fndecl)))
walk_tree (&TREE_TYPE (fndecl), set_save_expr_context, fndecl,
NULL);
-
+
/* If this function is `main', emit a call to `__main'
to run global initializers, etc. */
if (DECL_NAME (fndecl)
@@ -6467,7 +6374,7 @@ c_expand_body_1 (fndecl, nested_p)
(*lang_expand_function_end) ();
/* Generate rtl for function exit. */
- expand_function_end (input_filename, input_line, 0);
+ expand_function_end ();
/* If this is a nested function, protect the local variables in the stack
above us from being collected while we're compiling this function. */
@@ -6556,8 +6463,7 @@ c_expand_body_1 (fndecl, nested_p)
/* Like c_expand_body_1 but only for unnested functions. */
void
-c_expand_body (fndecl)
- tree fndecl;
+c_expand_body (tree fndecl)
{
c_expand_body_1 (fndecl, 0);
}
@@ -6565,7 +6471,7 @@ c_expand_body (fndecl)
/* Check the declarations given in a for-loop for satisfying the C99
constraints. */
void
-check_for_loop_decls ()
+check_for_loop_decls (void)
{
tree t;
@@ -6596,7 +6502,7 @@ check_for_loop_decls ()
if (TREE_PURPOSE (t) != 0)
{
enum tree_code code = TREE_CODE (TREE_VALUE (t));
-
+
if (code == RECORD_TYPE)
error ("`struct %s' declared in `for' loop initial declaration",
IDENTIFIER_POINTER (TREE_PURPOSE (t)));
@@ -6641,8 +6547,7 @@ struct language_function GTY(())
used during compilation of a C function. */
void
-c_push_function_context (f)
- struct function *f;
+c_push_function_context (struct function *f)
{
struct language_function *p;
p = ((struct language_function *)
@@ -6664,8 +6569,7 @@ c_push_function_context (f)
/* Restore the variables used during compilation of a C function. */
void
-c_pop_function_context (f)
- struct function *f;
+c_pop_function_context (struct function *f)
{
struct language_function *p = f->language;
tree link;
@@ -6703,8 +6607,7 @@ c_pop_function_context (f)
/* Copy the DECL_LANG_SPECIFIC data associated with DECL. */
void
-c_dup_lang_specific_decl (decl)
- tree decl;
+c_dup_lang_specific_decl (tree decl)
{
struct lang_decl *ld;
@@ -6727,7 +6630,7 @@ c_dup_lang_specific_decl (decl)
at the end of the statement. */
int
-stmts_are_full_exprs_p ()
+stmts_are_full_exprs_p (void)
{
return 0;
}
@@ -6737,7 +6640,7 @@ stmts_are_full_exprs_p ()
returned. */
stmt_tree
-current_stmt_tree ()
+current_stmt_tree (void)
{
return &c_stmt_tree;
}
@@ -6745,7 +6648,7 @@ current_stmt_tree ()
/* Returns the stack of SCOPE_STMTs for the current function. */
tree *
-current_scope_stmt_stack ()
+current_scope_stmt_stack (void)
{
return &c_scope_stmt_stack;
}
@@ -6754,8 +6657,7 @@ current_scope_stmt_stack ()
C. */
int
-anon_aggr_type_p (node)
- tree node ATTRIBUTE_UNUSED;
+anon_aggr_type_p (tree node ATTRIBUTE_UNUSED)
{
return 0;
}
@@ -6763,7 +6665,7 @@ anon_aggr_type_p (node)
/* Dummy function in place of callback used by C++. */
void
-extract_interface_info ()
+extract_interface_info (void)
{
}
@@ -6771,7 +6673,7 @@ extract_interface_info ()
statement tree. */
tree
-c_begin_compound_stmt ()
+c_begin_compound_stmt (void)
{
tree stmt;
@@ -6785,8 +6687,7 @@ c_begin_compound_stmt ()
common code. */
void
-c_expand_decl_stmt (t)
- tree t;
+c_expand_decl_stmt (tree t)
{
tree decl = DECL_STMT_DECL (t);
@@ -6800,8 +6701,7 @@ c_expand_decl_stmt (t)
/* Return the global value of T as a symbol. */
tree
-identifier_global_value (t)
- tree t;
+identifier_global_value (tree t)
{
tree decl = IDENTIFIER_SYMBOL_VALUE (t);
if (decl == 0 || DECL_CONTEXT (decl) == 0)
@@ -6820,10 +6720,7 @@ identifier_global_value (t)
otherwise the name is found in ridpointers from RID_INDEX. */
void
-record_builtin_type (rid_index, name, type)
- enum rid rid_index;
- const char *name;
- tree type;
+record_builtin_type (enum rid rid_index, const char *name, tree type)
{
tree id;
if (name == 0)
@@ -6835,7 +6732,7 @@ record_builtin_type (rid_index, name, type)
/* Build the void_list_node (void_type_node having been created). */
tree
-build_void_list_node ()
+build_void_list_node (void)
{
tree t = build_tree_list (NULL_TREE, void_type_node);
return t;
@@ -6851,8 +6748,7 @@ build_void_list_node ()
if attributes are present) and whose type is the modifier list. */
tree
-make_pointer_declarator (type_quals_attrs, target)
- tree type_quals_attrs, target;
+make_pointer_declarator (tree type_quals_attrs, tree target)
{
tree quals, attrs;
tree itarget = target;
diff --git a/gcc/c-dump.c b/gcc/c-dump.c
index 7f3464b38a0..5403bf88601 100644
--- a/gcc/c-dump.c
+++ b/gcc/c-dump.c
@@ -30,9 +30,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Dump information common to statements from STMT. */
void
-dump_stmt (di, t)
- dump_info_p di;
- tree t;
+dump_stmt (dump_info_p di, tree t)
{
dump_int (di, "line", STMT_LINENO (t));
}
@@ -40,9 +38,7 @@ dump_stmt (di, t)
/* Dump the next statement after STMT. */
void
-dump_next_stmt (di, t)
- dump_info_p di;
- tree t;
+dump_next_stmt (dump_info_p di, tree t)
{
dump_child ("next", TREE_CHAIN (t));
}
@@ -50,9 +46,7 @@ dump_next_stmt (di, t)
/* Dump any C-specific tree codes and attributes of common codes. */
bool
-c_dump_tree (dump_info, t)
- void *dump_info;
- tree t;
+c_dump_tree (void *dump_info, tree t)
{
enum tree_code code;
dump_info_p di = (dump_info_p) dump_info;
diff --git a/gcc/c-format.c b/gcc/c-format.c
index 01814e15467..1a2401955cb 100644
--- a/gcc/c-format.c
+++ b/gcc/c-format.c
@@ -34,8 +34,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Set format warning options according to a -Wformat=n option. */
void
-set_Wformat (setting)
- int setting;
+set_Wformat (int setting)
{
warn_format = setting;
warn_format_y2k = setting;
@@ -67,9 +66,8 @@ typedef struct function_format_info
unsigned HOST_WIDE_INT first_arg_num; /* number of first arg (zero for varargs) */
} function_format_info;
-static bool decode_format_attr PARAMS ((tree,
- function_format_info *, int));
-static enum format_type decode_format_type PARAMS ((const char *));
+static bool decode_format_attr (tree, function_format_info *, int);
+static enum format_type decode_format_type (const char *);
static bool check_format_string (tree argument,
unsigned HOST_WIDE_INT format_num,
@@ -81,12 +79,8 @@ static bool get_constant (tree expr, unsigned HOST_WIDE_INT *value,
/* Handle a "format_arg" attribute; arguments as in
struct attribute_spec.handler. */
tree
-handle_format_arg_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name ATTRIBUTE_UNUSED;
- tree args;
- int flags;
- bool *no_add_attrs;
+handle_format_arg_attribute (tree *node, tree name ATTRIBUTE_UNUSED,
+ tree args, int flags, bool *no_add_attrs)
{
tree type = *node;
tree format_num_expr = TREE_VALUE (args);
@@ -151,7 +145,7 @@ check_format_string (tree argument, unsigned HOST_WIDE_INT format_num,
/* Strip any conversions from the expression, verify it is a constant,
and store its value. If validated_p is true, abort on errors.
- Returns true on success, false otherwise. */
+ Returns true on success, false otherwise. */
bool
get_constant(tree expr, unsigned HOST_WIDE_INT *value, int validated_p)
{
@@ -180,10 +174,7 @@ get_constant(tree expr, unsigned HOST_WIDE_INT *value, int validated_p)
successfully decoded, false otherwise. */
static bool
-decode_format_attr (args, info, validated_p)
- tree args;
- function_format_info *info;
- int validated_p;
+decode_format_attr (tree args, function_format_info *info, int validated_p)
{
tree format_type_id = TREE_VALUE (args);
tree format_num_expr = TREE_VALUE (TREE_CHAIN (args));
@@ -855,6 +846,8 @@ static const format_kind_info format_types_orig[] =
new data if necessary, while still allowing the original data to be
const. */
static const format_kind_info *format_types = format_types_orig;
+/* We can modify this one. */
+static format_kind_info *dynamic_format_types;
/* Structure detailing the results of checking a format function call
where the format expression may be a conditional expression with
@@ -891,32 +884,30 @@ typedef struct
int *status;
} format_check_context;
-static void check_format_info PARAMS ((int *, function_format_info *, tree));
-static void check_format_arg PARAMS ((void *, tree, unsigned HOST_WIDE_INT));
-static void check_format_info_main PARAMS ((int *, format_check_results *,
- function_format_info *,
- const char *, int, tree,
- unsigned HOST_WIDE_INT));
-static void status_warning PARAMS ((int *, const char *, ...))
+static void check_format_info (int *, function_format_info *, tree);
+static void check_format_arg (void *, tree, unsigned HOST_WIDE_INT);
+static void check_format_info_main (int *, format_check_results *,
+ function_format_info *,
+ const char *, int, tree,
+ unsigned HOST_WIDE_INT);
+static void status_warning (int *, const char *, ...)
ATTRIBUTE_PRINTF_2;
-static void init_dollar_format_checking PARAMS ((int, tree));
-static int maybe_read_dollar_number PARAMS ((int *, const char **, int,
- tree, tree *,
- const format_kind_info *));
-static void finish_dollar_format_checking PARAMS ((int *, format_check_results *, int));
+static void init_dollar_format_checking (int, tree);
+static int maybe_read_dollar_number (int *, const char **, int,
+ tree, tree *, const format_kind_info *);
+static void finish_dollar_format_checking (int *, format_check_results *, int);
-static const format_flag_spec *get_flag_spec PARAMS ((const format_flag_spec *,
- int, const char *));
+static const format_flag_spec *get_flag_spec (const format_flag_spec *,
+ int, const char *);
-static void check_format_types PARAMS ((int *, format_wanted_type *));
+static void check_format_types (int *, format_wanted_type *);
/* Decode a format type from a string, returning the type, or
format_type_error if not valid, in which case the caller should print an
error message. */
static enum format_type
-decode_format_type (s)
- const char *s;
+decode_format_type (const char *s)
{
int i;
int slen;
@@ -943,10 +934,7 @@ decode_format_type (s)
attribute themselves. */
void
-check_function_format (status, attrs, params)
- int *status;
- tree attrs;
- tree params;
+check_function_format (int *status, tree attrs, tree params)
{
tree a;
@@ -1039,9 +1027,7 @@ static int dollar_format_warned;
function; PARAMS is the list of arguments starting at this argument. */
static void
-init_dollar_format_checking (first_arg_num, params)
- int first_arg_num;
- tree params;
+init_dollar_format_checking (int first_arg_num, tree params)
{
tree oparams = params;
@@ -1096,14 +1082,9 @@ init_dollar_format_checking (first_arg_num, params)
a $ format is found, *FORMAT is updated to point just after it. */
static int
-maybe_read_dollar_number (status, format, dollar_needed, params, param_ptr,
- fki)
- int *status;
- const char **format;
- int dollar_needed;
- tree params;
- tree *param_ptr;
- const format_kind_info *fki;
+maybe_read_dollar_number (int *status, const char **format,
+ int dollar_needed, tree params, tree *param_ptr,
+ const format_kind_info *fki)
{
int argnum;
int overflow_flag;
@@ -1208,10 +1189,7 @@ maybe_read_dollar_number (status, format, dollar_needed, params, param_ptr,
pointers. */
static void
-finish_dollar_format_checking (status, res, pointer_gap_ok)
- int *status;
- format_check_results *res;
- int pointer_gap_ok;
+finish_dollar_format_checking (int *status, format_check_results *res, int pointer_gap_ok)
{
int i;
bool found_pointer_gap = false;
@@ -1246,10 +1224,7 @@ finish_dollar_format_checking (status, res, pointer_gap_ok)
of these is found, it is returned, otherwise NULL is returned. */
static const format_flag_spec *
-get_flag_spec (spec, flag, predicates)
- const format_flag_spec *spec;
- int flag;
- const char *predicates;
+get_flag_spec (const format_flag_spec *spec, int flag, const char *predicates)
{
int i;
for (i = 0; spec[i].flag_char != 0; i++)
@@ -1277,10 +1252,7 @@ get_flag_spec (spec, flag, predicates)
PARAMS is the list of argument values. */
static void
-check_format_info (status, info, params)
- int *status;
- function_format_info *info;
- tree params;
+check_format_info (int *status, function_format_info *info, tree params)
{
format_check_context format_ctx;
unsigned HOST_WIDE_INT arg_num;
@@ -1378,10 +1350,8 @@ check_format_info (status, info, params)
format_check_context. */
static void
-check_format_arg (ctx, format_tree, arg_num)
- void *ctx;
- tree format_tree;
- unsigned HOST_WIDE_INT arg_num;
+check_format_arg (void *ctx, tree format_tree,
+ unsigned HOST_WIDE_INT arg_num)
{
format_check_context *format_ctx = ctx;
format_check_results *res = format_ctx->res;
@@ -1537,15 +1507,10 @@ check_format_arg (ctx, format_tree, arg_num)
argument in the list of arguments. */
static void
-check_format_info_main (status, res, info, format_chars, format_length,
- params, arg_num)
- int *status;
- format_check_results *res;
- function_format_info *info;
- const char *format_chars;
- int format_length;
- tree params;
- unsigned HOST_WIDE_INT arg_num;
+check_format_info_main (int *status, format_check_results *res,
+ function_format_info *info, const char *format_chars,
+ int format_length, tree params,
+ unsigned HOST_WIDE_INT arg_num)
{
const char *orig_format_chars = format_chars;
tree first_fillin_param = params;
@@ -2168,9 +2133,7 @@ check_format_info_main (status, res, info, format_chars, format_length,
/* Check the argument types from a single format conversion (possibly
including width and precision arguments). */
static void
-check_format_types (status, types)
- int *status;
- format_wanted_type *types;
+check_format_types (int *status, format_wanted_type *types)
{
for (; types != 0; types = types->next)
{
@@ -2367,15 +2330,72 @@ check_format_types (status, types)
}
}
+/* Given a format_length_info array FLI, and a character C, this
+ function returns the index into the conversion_specs where that
+ modifier's data is located. If the character isn't found it
+ aborts. */
+static unsigned int
+find_length_info_modifier_index (const format_length_info *fli, int c)
+{
+ unsigned int i = 0;
+
+ while (fli->name)
+ {
+ if (strchr (fli->name, c))
+ return i;
+ i++; fli++;
+ }
+
+ /* We shouldn't be looking for a non-existent modifier. */
+ abort ();
+}
+
+/* Determine the type of HOST_WIDE_INT in the code being compiled for
+ use in GCC's __asm_fprintf__ custom format attribute. You must
+ have set dynamic_format_types before calling this function. */
+static void
+init_dynamic_asm_fprintf_info (void)
+{
+ static tree hwi;
+
+ if (!hwi)
+ {
+ format_length_info *new_asm_fprintf_length_specs;
+ unsigned int i;
+
+ /* Find the underlying type for HOST_WIDE_INT. For the %w
+ length modifier to work, one must have issued: "typedef
+ HOST_WIDE_INT __gcc_host_wide_int__;" in one's source code
+ prior to using that modifier. */
+ if (!(hwi = maybe_get_identifier ("__gcc_host_wide_int__"))
+ || !(hwi = DECL_ORIGINAL_TYPE (identifier_global_value (hwi))))
+ abort ();
+
+ /* Create a new (writable) copy of asm_fprintf_length_specs. */
+ new_asm_fprintf_length_specs = xmemdup (asm_fprintf_length_specs,
+ sizeof (asm_fprintf_length_specs),
+ sizeof (asm_fprintf_length_specs));
+
+ /* HOST_WIDE_INT must be one of 'long' or 'long long'. */
+ i = find_length_info_modifier_index (new_asm_fprintf_length_specs, 'w');
+ if (hwi == long_integer_type_node)
+ new_asm_fprintf_length_specs[i].index = FMT_LEN_l;
+ else if (hwi == long_long_integer_type_node)
+ new_asm_fprintf_length_specs[i].index = FMT_LEN_ll;
+ else
+ abort ();
+
+ /* Assign the new data for use. */
+ dynamic_format_types[asm_fprintf_format_type].length_char_specs =
+ new_asm_fprintf_length_specs;
+ }
+}
+
/* Handle a "format" attribute; arguments as in
struct attribute_spec.handler. */
tree
-handle_format_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name ATTRIBUTE_UNUSED;
- tree args;
- int flags;
- bool *no_add_attrs;
+handle_format_attribute (tree *node, tree name ATTRIBUTE_UNUSED, tree args,
+ int flags, bool *no_add_attrs)
{
tree type = *node;
function_format_info info;
@@ -2424,44 +2444,14 @@ handle_format_attribute (node, name, args, flags, no_add_attrs)
GCC's notion of HOST_WIDE_INT for checking %wd. */
if (info.format_type == asm_fprintf_format_type)
{
- static tree hwi;
- tree orig;
-
- /* For this custom check to work, one must have issued:
- "typedef HOST_WIDE_INT __gcc_host_wide_int__;"
- in your source code prior to using this attribute. */
- if (!hwi)
- {
- format_kind_info *new_format_types;
- format_length_info *new_asm_fprintf_length_specs;
-
- if (!(hwi = maybe_get_identifier ("__gcc_host_wide_int__")))
- abort ();
-
- /* Create a new (writable) copy of asm_fprintf_length_specs. */
- new_asm_fprintf_length_specs =
- xmalloc (sizeof (asm_fprintf_length_specs));
- memcpy (new_asm_fprintf_length_specs, asm_fprintf_length_specs,
- sizeof (asm_fprintf_length_specs));
-
- /* Create a new (writable) copy of format_types. */
- new_format_types = xmalloc (sizeof (format_types_orig));
- memcpy (new_format_types, format_types_orig, sizeof (format_types_orig));
-
- /* Find the underlying type for HOST_WIDE_INT. */
- orig = DECL_ORIGINAL_TYPE (identifier_global_value (hwi));
- if (orig == long_integer_type_node)
- new_asm_fprintf_length_specs[1].index = FMT_LEN_l;
- else if (orig == long_long_integer_type_node)
- new_asm_fprintf_length_specs[1].index = FMT_LEN_ll;
- else
- abort ();
-
- /* Assign the new data for use. */
- new_format_types[asm_fprintf_format_type].length_char_specs =
- new_asm_fprintf_length_specs;
- format_types = new_format_types;
- }
+ /* Our first time through, we have to make sure that our
+ format_type data is allocated dynamically and is modifiable. */
+ if (!dynamic_format_types)
+ format_types = dynamic_format_types =
+ xmemdup (format_types_orig, sizeof (format_types_orig),
+ sizeof (format_types_orig));
+
+ init_dynamic_asm_fprintf_info();
}
return NULL_TREE;
diff --git a/gcc/c-incpath.c b/gcc/c-incpath.c
index abd738c027e..377653021a5 100644
--- a/gcc/c-incpath.c
+++ b/gcc/c-incpath.c
@@ -43,13 +43,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# define INO_T_COPY(DEST, SRC) (DEST) = (SRC)
#endif
-static void add_env_var_paths PARAMS ((const char *, int));
-static void add_standard_paths PARAMS ((const char *, const char *, int));
-static void free_path PARAMS ((struct cpp_path *, int));
-static void merge_include_chains PARAMS ((cpp_reader *, int));
-static struct cpp_path *
- remove_duplicates PARAMS ((cpp_reader *, struct cpp_path *,
- struct cpp_path *, struct cpp_path *, int));
+static void add_env_var_paths (const char *, int);
+static void add_standard_paths (const char *, const char *, int);
+static void free_path (struct cpp_path *, int);
+static void merge_include_chains (cpp_reader *, int);
+static struct cpp_path *remove_duplicates (cpp_reader *, struct cpp_path *,
+ struct cpp_path *,
+ struct cpp_path *, int);
/* Include chains heads and tails. */
static struct cpp_path *heads[4];
@@ -59,9 +59,7 @@ enum { REASON_QUIET = 0, REASON_NOENT, REASON_DUP, REASON_DUP_SYS };
/* Free an element of the include chain, possibly giving a reason. */
static void
-free_path (path, reason)
- struct cpp_path *path;
- int reason;
+free_path (struct cpp_path *path, int reason)
{
switch (reason)
{
@@ -83,16 +81,14 @@ free_path (path, reason)
break;
}
- free ((PTR) path->name);
+ free (path->name);
free (path);
}
/* Read ENV_VAR for a PATH_SEPARATOR-separated list of file names; and
append all the names to the search path CHAIN. */
static void
-add_env_var_paths (env_var, chain)
- const char *env_var;
- int chain;
+add_env_var_paths (const char *env_var, int chain)
{
char *p, *q, *path;
@@ -122,9 +118,7 @@ add_env_var_paths (env_var, chain)
/* Append the standard include chain defined in cppdefault.c. */
static void
-add_standard_paths (sysroot, iprefix, cxx_stdinc)
- const char *sysroot, *iprefix;
- int cxx_stdinc;
+add_standard_paths (const char *sysroot, const char *iprefix, int cxx_stdinc)
{
const struct default_include *p;
size_t len;
@@ -176,12 +170,9 @@ add_standard_paths (sysroot, iprefix, cxx_stdinc)
removed. Return the head of the resulting chain. Any of HEAD,
JOIN and SYSTEM can be NULL. */
static struct cpp_path *
-remove_duplicates (pfile, head, system, join, verbose)
- cpp_reader *pfile;
- struct cpp_path *head;
- struct cpp_path *system;
- struct cpp_path *join;
- int verbose;
+remove_duplicates (cpp_reader *pfile, struct cpp_path *head,
+ struct cpp_path *system, struct cpp_path *join,
+ int verbose)
{
struct cpp_path **pcur, *tmp, *cur;
struct stat st;
@@ -255,9 +246,7 @@ remove_duplicates (pfile, head, system, join, verbose)
to treat -Ibar -Ifoo -I- -Ifoo -Iquux as if written -Ibar -I- -Ifoo
-Iquux. */
static void
-merge_include_chains (pfile, verbose)
- cpp_reader *pfile;
- int verbose;
+merge_include_chains (cpp_reader *pfile, int verbose)
{
/* Join the SYSTEM and AFTER chains. Remove duplicates in the
resulting SYSTEM chain. */
@@ -300,7 +289,7 @@ merge_include_chains (pfile, verbose)
(Note that -I. -I- is not the same as the default setup; -I. uses
the compiler's working dir.) */
void
-split_quote_chain ()
+split_quote_chain (void)
{
heads[QUOTE] = heads[BRACKET];
tails[QUOTE] = tails[BRACKET];
@@ -313,10 +302,7 @@ split_quote_chain ()
/* Add PATH to the include chain CHAIN. PATH must be malloc-ed and
NUL-terminated. */
void
-add_path (path, chain, cxx_aware)
- char *path;
- int chain;
- int cxx_aware;
+add_path (char *path, int chain, int cxx_aware)
{
struct cpp_path *p;
@@ -338,11 +324,9 @@ add_path (path, chain, cxx_aware)
/* Exported function to handle include chain merging, duplicate
removal, and registration with cpplib. */
void
-register_include_chains (pfile, sysroot, iprefix,
- stdinc, cxx_stdinc, verbose)
- cpp_reader *pfile;
- const char *sysroot, *iprefix;
- int stdinc, cxx_stdinc, verbose;
+register_include_chains (cpp_reader *pfile, const char *sysroot,
+ const char *iprefix, int stdinc, int cxx_stdinc,
+ int verbose)
{
static const char *const lang_env_vars[] =
{ "C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH",
diff --git a/gcc/c-incpath.h b/gcc/c-incpath.h
index e5b02182a82..31ed657da2a 100644
--- a/gcc/c-incpath.h
+++ b/gcc/c-incpath.h
@@ -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. */
-extern void split_quote_chain PARAMS ((void));
-extern void add_path PARAMS ((char *, int, int));
-extern void register_include_chains PARAMS ((cpp_reader *, const char *,
- const char *, int, int, int));
+extern void split_quote_chain (void);
+extern void add_path (char *, int, int);
+extern void register_include_chains (cpp_reader *, const char *,
+ const char *, int, int, int);
enum { QUOTE = 0, BRACKET, SYSTEM, AFTER };
diff --git a/gcc/c-lang.c b/gcc/c-lang.c
index 92b9c6e4b28..6d8c89ab1c6 100644
--- a/gcc/c-lang.c
+++ b/gcc/c-lang.c
@@ -1,6 +1,6 @@
/* Language-specific hook definitions for C front end.
Copyright (C) 1991, 1995, 1997, 1998,
- 1999, 2000, 2001 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -31,7 +31,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "langhooks.h"
#include "langhooks-def.h"
-static int c_init_options PARAMS ((void));
+static int c_init_options (void);
/* ### When changing hooks, consider if ObjC needs changing too!! ### */
@@ -67,6 +67,8 @@ static int c_init_options PARAMS ((void));
#define LANG_HOOKS_UNSAFE_FOR_REEVAL c_common_unsafe_for_reeval
#undef LANG_HOOKS_STATICP
#define LANG_HOOKS_STATICP c_staticp
+#undef LANG_HOOKS_NO_BODY_BLOCKS
+#define LANG_HOOKS_NO_BODY_BLOCKS true
#undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL
#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL c_warn_unused_global_decl
#undef LANG_HOOKS_PRINT_IDENTIFIER
@@ -158,7 +160,7 @@ const char *const tree_code_name[] = {
#undef DEFTREECODE
static int
-c_init_options ()
+c_init_options (void)
{
return c_common_init_options (clk_c);
}
@@ -166,43 +168,37 @@ c_init_options ()
/* Used by c-lex.c, but only for objc. */
tree
-lookup_interface (arg)
- tree arg ATTRIBUTE_UNUSED;
+lookup_interface (tree arg ATTRIBUTE_UNUSED)
{
return 0;
}
tree
-is_class_name (arg)
- tree arg ATTRIBUTE_UNUSED;
+is_class_name (tree arg ATTRIBUTE_UNUSED)
{
return 0;
}
tree
-objc_is_id (arg)
- tree arg ATTRIBUTE_UNUSED;
+objc_is_id (tree arg ATTRIBUTE_UNUSED)
{
return 0;
}
void
-objc_check_decl (decl)
- tree decl ATTRIBUTE_UNUSED;
+objc_check_decl (tree decl ATTRIBUTE_UNUSED)
{
}
int
-objc_comptypes (lhs, rhs, reflexive)
- tree lhs ATTRIBUTE_UNUSED;
- tree rhs ATTRIBUTE_UNUSED;
- int reflexive ATTRIBUTE_UNUSED;
+objc_comptypes (tree lhs ATTRIBUTE_UNUSED, tree rhs ATTRIBUTE_UNUSED,
+ int reflexive ATTRIBUTE_UNUSED)
{
return -1;
}
tree
-objc_message_selector ()
+objc_message_selector (void)
{
return 0;
}
@@ -210,14 +206,13 @@ objc_message_selector ()
/* Used by c-typeck.c (build_external_ref), but only for objc. */
tree
-lookup_objc_ivar (id)
- tree id ATTRIBUTE_UNUSED;
+lookup_objc_ivar (tree id ATTRIBUTE_UNUSED)
{
return 0;
}
void
-finish_file ()
+finish_file (void)
{
c_objc_common_finish_file ();
}
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index ea0f80c7b83..f9c42254527 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -52,9 +52,6 @@ static unsigned int src_lineno;
static int header_time, body_time;
static splay_tree file_info_tree;
-/* File used for outputting assembler code. */
-extern FILE *asm_out_file;
-
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE TYPE_PRECISION (wchar_type_node)
@@ -67,27 +64,24 @@ int c_header_level; /* depth in C headers - C++ only */
/* Nonzero tells yylex to ignore \ in string constants. */
static int ignore_escape_flag;
-static tree interpret_integer PARAMS ((const cpp_token *, unsigned int));
-static tree interpret_float PARAMS ((const cpp_token *, unsigned int));
+static tree interpret_integer (const cpp_token *, unsigned int);
+static tree interpret_float (const cpp_token *, unsigned int);
static enum integer_type_kind
- narrowest_unsigned_type PARAMS ((tree, unsigned int));
+ narrowest_unsigned_type (tree, unsigned int);
static enum integer_type_kind
- narrowest_signed_type PARAMS ((tree, unsigned int));
-static tree lex_string PARAMS ((const cpp_string *));
-static tree lex_charconst PARAMS ((const cpp_token *));
-static void update_header_times PARAMS ((const char *));
-static int dump_one_header PARAMS ((splay_tree_node, void *));
-static void cb_line_change PARAMS ((cpp_reader *, const cpp_token *, int));
-static void cb_ident PARAMS ((cpp_reader *, unsigned int,
- const cpp_string *));
-static void cb_def_pragma PARAMS ((cpp_reader *, unsigned int));
-static void cb_define PARAMS ((cpp_reader *, unsigned int,
- cpp_hashnode *));
-static void cb_undef PARAMS ((cpp_reader *, unsigned int,
- cpp_hashnode *));
+ narrowest_signed_type (tree, unsigned int);
+static tree lex_string (const cpp_string *);
+static tree lex_charconst (const cpp_token *);
+static void update_header_times (const char *);
+static int dump_one_header (splay_tree_node, void *);
+static void cb_line_change (cpp_reader *, const cpp_token *, int);
+static void cb_ident (cpp_reader *, unsigned int, const cpp_string *);
+static void cb_def_pragma (cpp_reader *, unsigned int);
+static void cb_define (cpp_reader *, unsigned int, cpp_hashnode *);
+static void cb_undef (cpp_reader *, unsigned int, cpp_hashnode *);
void
-init_c_lex ()
+init_c_lex (void)
{
struct cpp_callbacks *cb;
struct c_fileinfo *toplevel;
@@ -103,7 +97,7 @@ init_c_lex ()
body_time = get_run_time ();
toplevel->time = body_time;
}
-
+
cb = cpp_get_callbacks (parse_in);
cb->line_change = cb_line_change;
@@ -123,8 +117,7 @@ init_c_lex ()
}
struct c_fileinfo *
-get_fileinfo (name)
- const char *name;
+get_fileinfo (const char *name)
{
splay_tree_node n;
struct c_fileinfo *fi;
@@ -143,8 +136,7 @@ get_fileinfo (name)
}
static void
-update_header_times (name)
- const char *name;
+update_header_times (const char *name)
{
/* Changing files again. This means currently collected time
is charged against header time, and body time starts back at 0. */
@@ -159,9 +151,7 @@ update_header_times (name)
}
static int
-dump_one_header (n, dummy)
- splay_tree_node n;
- void *dummy ATTRIBUTE_UNUSED;
+dump_one_header (splay_tree_node n, void *dummy ATTRIBUTE_UNUSED)
{
print_time ((const char *) n->key,
((struct c_fileinfo *) n->value)->time);
@@ -169,7 +159,7 @@ dump_one_header (n, dummy)
}
void
-dump_time_statistics ()
+dump_time_statistics (void)
{
struct c_fileinfo *file = get_fileinfo (input_filename);
int this_time = get_run_time ();
@@ -186,10 +176,9 @@ dump_time_statistics ()
}
static void
-cb_ident (pfile, line, str)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
- unsigned int line ATTRIBUTE_UNUSED;
- const cpp_string *str ATTRIBUTE_UNUSED;
+cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED,
+ unsigned int line ATTRIBUTE_UNUSED,
+ const cpp_string *str ATTRIBUTE_UNUSED)
{
#ifdef ASM_OUTPUT_IDENT
if (! flag_no_ident)
@@ -204,17 +193,14 @@ cb_ident (pfile, line, str)
/* Called at the start of every non-empty line. TOKEN is the first
lexed token on the line. Used for diagnostic line numbers. */
static void
-cb_line_change (pfile, token, parsing_args)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
- const cpp_token *token;
- int parsing_args ATTRIBUTE_UNUSED;
+cb_line_change (cpp_reader *pfile ATTRIBUTE_UNUSED, const cpp_token *token,
+ int parsing_args ATTRIBUTE_UNUSED)
{
src_lineno = SOURCE_LINE (map, token->line);
}
void
-fe_file_change (new_map)
- const struct line_map *new_map;
+fe_file_change (const struct line_map *new_map)
{
unsigned int to_line = SOURCE_LINE (new_map, new_map->to_line);
@@ -253,7 +239,7 @@ fe_file_change (new_map)
}
#endif
pop_srcloc ();
-
+
(*debug_hooks->end_source_file) (to_line);
}
@@ -268,9 +254,7 @@ fe_file_change (new_map)
}
static void
-cb_def_pragma (pfile, line)
- cpp_reader *pfile;
- unsigned int line;
+cb_def_pragma (cpp_reader *pfile, unsigned int line)
{
/* Issue a warning message if we have been asked to do so. Ignore
unknown pragmas in system headers unless an explicit
@@ -297,10 +281,7 @@ cb_def_pragma (pfile, line)
/* #define callback for DWARF and DWARF2 debug info. */
static void
-cb_define (pfile, line, node)
- cpp_reader *pfile;
- unsigned int line;
- cpp_hashnode *node;
+cb_define (cpp_reader *pfile, unsigned int line, cpp_hashnode *node)
{
(*debug_hooks->define) (SOURCE_LINE (map, line),
(const char *) cpp_macro_definition (pfile, node));
@@ -308,18 +289,15 @@ cb_define (pfile, line, node)
/* #undef callback for DWARF and DWARF2 debug info. */
static void
-cb_undef (pfile, line, node)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
- unsigned int line;
- cpp_hashnode *node;
+cb_undef (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
+ cpp_hashnode *node)
{
(*debug_hooks->undef) (SOURCE_LINE (map, line),
(const char *) NODE_NAME (node));
}
int
-c_lex (value)
- tree *value;
+c_lex (tree *value)
{
const cpp_token *tok;
@@ -406,9 +384,7 @@ c_lex (value)
minimum specified by FLAGS, that can fit VALUE, or itk_none if
there isn't one. */
static enum integer_type_kind
-narrowest_unsigned_type (value, flags)
- tree value;
- unsigned int flags;
+narrowest_unsigned_type (tree value, unsigned int flags)
{
enum integer_type_kind itk;
@@ -432,9 +408,7 @@ narrowest_unsigned_type (value, flags)
/* Ditto, but narrowest signed type. */
static enum integer_type_kind
-narrowest_signed_type (value, flags)
- tree value;
- unsigned int flags;
+narrowest_signed_type (tree value, unsigned int flags)
{
enum integer_type_kind itk;
@@ -458,9 +432,7 @@ narrowest_signed_type (value, flags)
/* Interpret TOKEN, an integer with FLAGS as classified by cpplib. */
static tree
-interpret_integer (token, flags)
- const cpp_token *token;
- unsigned int flags;
+interpret_integer (const cpp_token *token, unsigned int flags)
{
tree value, type;
enum integer_type_kind itk;
@@ -538,9 +510,7 @@ interpret_integer (token, flags)
/* Interpret TOKEN, a floating point number with FLAGS as classified
by cpplib. */
static tree
-interpret_float (token, flags)
- const cpp_token *token;
- unsigned int flags;
+interpret_float (const cpp_token *token, unsigned int flags)
{
tree type;
tree value;
@@ -602,15 +572,14 @@ interpret_float (token, flags)
}
static tree
-lex_string (str)
- const cpp_string *str;
+lex_string (const cpp_string *str)
{
bool wide;
tree value;
char *buf, *q;
cppchar_t c;
const unsigned char *p, *limit;
-
+
wide = str->text[0] == 'L';
p = str->text + 1 + wide;
limit = str->text + str->len - 1;
@@ -622,7 +591,7 @@ lex_string (str)
if (c == '\\' && !ignore_escape_flag)
c = cpp_parse_escape (parse_in, &p, limit, wide);
-
+
/* Add this single character into the buffer either as a wchar_t,
a multibyte sequence, or as a single byte. */
if (wide)
@@ -675,8 +644,7 @@ lex_string (str)
/* Converts a (possibly wide) character constant token into a tree. */
static tree
-lex_charconst (token)
- const cpp_token *token;
+lex_charconst (const cpp_token *token)
{
cppchar_t result;
tree type, value;
@@ -684,7 +652,7 @@ lex_charconst (token)
int unsignedp;
result = cpp_interpret_charconst (parse_in, token,
- &chars_seen, &unsignedp);
+ &chars_seen, &unsignedp);
/* Cast to cppchar_signed_t to get correct sign-extension of RESULT
before possibly widening to HOST_WIDE_INT for build_int_2. */
diff --git a/gcc/c-objc-common.c b/gcc/c-objc-common.c
index 32b894b4552..438b3fba808 100644
--- a/gcc/c-objc-common.c
+++ b/gcc/c-objc-common.c
@@ -1,5 +1,5 @@
/* Some code common to C and ObjC front ends.
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -39,17 +39,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "target.h"
#include "cgraph.h"
-static bool c_tree_printer PARAMS ((output_buffer *, text_info *));
-static tree inline_forbidden_p PARAMS ((tree *, int *, void *));
-static void expand_deferred_fns PARAMS ((void));
-static tree start_cdtor PARAMS ((int));
-static void finish_cdtor PARAMS ((tree));
+static bool c_tree_printer (output_buffer *, text_info *);
+static tree inline_forbidden_p (tree *, int *, void *);
+static void expand_deferred_fns (void);
+static tree start_cdtor (int);
+static void finish_cdtor (tree);
static GTY(()) varray_type deferred_fns;
int
-c_missing_noreturn_ok_p (decl)
- tree decl;
+c_missing_noreturn_ok_p (tree decl)
{
/* A missing noreturn is not ok for freestanding implementations and
ok for the `main' function in hosted implementations. */
@@ -61,8 +60,7 @@ c_missing_noreturn_ok_p (decl)
such functions always being inlined when optimizing. */
int
-c_disregard_inline_limits (fn)
- tree fn;
+c_disregard_inline_limits (tree fn)
{
if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL)
return 1;
@@ -71,10 +69,8 @@ c_disregard_inline_limits (fn)
}
static tree
-inline_forbidden_p (nodep, walk_subtrees, fn)
- tree *nodep;
- int *walk_subtrees ATTRIBUTE_UNUSED;
- void *fn;
+inline_forbidden_p (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
+ void *fn)
{
tree node = *nodep;
tree t;
@@ -160,8 +156,7 @@ inline_forbidden_p (nodep, walk_subtrees, fn)
}
int
-c_cannot_inline_tree_fn (fnp)
- tree *fnp;
+c_cannot_inline_tree_fn (tree *fnp)
{
tree fn = *fnp;
tree t;
@@ -170,7 +165,7 @@ c_cannot_inline_tree_fn (fnp)
&& lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL)
return 1;
- /* Don't auto-inline anything that might not be bound within
+ /* Don't auto-inline anything that might not be bound within
this unit of translation. */
if (!DECL_DECLARED_INLINE_P (fn) && !(*targetm.binds_local_p) (fn))
goto cannot_inline;
@@ -215,7 +210,7 @@ c_cannot_inline_tree_fn (fnp)
if (! t)
return 0;
}
-
+
if (walk_tree (&DECL_SAVED_TREE (fn), inline_forbidden_p, fn, NULL))
goto cannot_inline;
@@ -229,8 +224,7 @@ c_cannot_inline_tree_fn (fnp)
/* Called from check_global_declarations. */
bool
-c_warn_unused_global_decl (decl)
- tree decl;
+c_warn_unused_global_decl (tree decl)
{
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl))
return false;
@@ -242,7 +236,7 @@ c_warn_unused_global_decl (decl)
/* Initialization common to C and Objective-C front ends. */
bool
-c_objc_common_init ()
+c_objc_common_init (void)
{
static const enum tree_code stmt_codes[] = {
c_common_stmt_codes
@@ -282,8 +276,7 @@ c_objc_common_init ()
to RTL is only done at the end of the compilation. */
int
-defer_fn (fn)
- tree fn;
+defer_fn (tree fn)
{
VARRAY_PUSH_TREE (deferred_fns, fn);
@@ -293,7 +286,7 @@ defer_fn (fn)
/* Expand deferred functions for C and ObjC. */
static void
-expand_deferred_fns ()
+expand_deferred_fns (void)
{
unsigned int i;
@@ -315,8 +308,7 @@ expand_deferred_fns ()
}
static tree
-start_cdtor (method_type)
- int method_type;
+start_cdtor (int method_type)
{
tree fnname = get_file_function_name (method_type);
tree void_list_node_1 = build_tree_list (NULL_TREE, void_type_node);
@@ -342,8 +334,7 @@ start_cdtor (method_type)
}
static void
-finish_cdtor (body)
- tree body;
+finish_cdtor (tree body)
{
tree scope;
tree block;
@@ -361,7 +352,7 @@ finish_cdtor (body)
/* Called at end of parsing, but before end-of-file processing. */
void
-c_objc_common_finish_file ()
+c_objc_common_finish_file (void)
{
if (pch_file)
c_common_write_pch ();
@@ -420,9 +411,7 @@ c_objc_common_finish_file ()
Please notice when called, the `%' part was already skipped by the
diagnostic machinery. */
static bool
-c_tree_printer (buffer, text)
- output_buffer *buffer;
- text_info *text;
+c_tree_printer (output_buffer *buffer, text_info *text)
{
tree t = va_arg (*text->args_ptr, tree);
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index 680c3cbb722..dbe7e903f0a 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -100,22 +100,20 @@ static size_t deferred_count, deferred_size;
/* Number of deferred options scanned for -include. */
static size_t include_cursor;
-static void missing_arg PARAMS ((enum opt_code));
-static void set_Wimplicit PARAMS ((int));
-static void complain_wrong_lang PARAMS ((size_t, int));
-static void write_langs PARAMS ((char *, int));
-static void print_help PARAMS ((void));
-static void handle_OPT_d PARAMS ((const char *));
-static void set_std_cxx98 PARAMS ((int));
-static void set_std_c89 PARAMS ((int, int));
-static void set_std_c99 PARAMS ((int));
-static void check_deps_environment_vars PARAMS ((void));
-static void handle_deferred_opts PARAMS ((void));
-static void sanitize_cpp_opts PARAMS ((void));
-static void add_prefixed_path PARAMS ((const char *, size_t));
-static void push_command_line_include PARAMS ((void));
-static void cb_file_change PARAMS ((cpp_reader *, const struct line_map *));
-static void finish_options PARAMS ((void));
+void missing_arg (enum opt_code);
+static void set_Wimplicit (int);
+static void print_help (void);
+static void handle_OPT_d (const char *);
+static void set_std_cxx98 (int);
+static void set_std_c89 (int, int);
+static void set_std_c99 (int);
+static void check_deps_environment_vars (void);
+static void handle_deferred_opts (void);
+static void sanitize_cpp_opts (void);
+static void add_prefixed_path (const char *, size_t);
+static void push_command_line_include (void);
+static void cb_file_change (cpp_reader *, const struct line_map *);
+static void finish_options (void);
#ifndef STDC_0_IN_SYSTEM_HEADERS
#define STDC_0_IN_SYSTEM_HEADERS 0
@@ -123,7 +121,7 @@ static void finish_options PARAMS ((void));
/* Holds switches parsed by c_common_handle_option (), but whose
handling is deferred to c_common_post_options (). */
-static void defer_opt PARAMS ((enum opt_code, const char *));
+static void defer_opt (enum opt_code, const char *);
static struct deferred_opt
{
enum opt_code code;
@@ -132,7 +130,7 @@ static struct deferred_opt
/* Complain that switch OPT_INDEX expects an argument but none was
provided. */
-static void
+void
missing_arg (enum opt_code code)
{
const char *opt_text = cl_options[code].opt_text;
@@ -193,9 +191,7 @@ missing_arg (enum opt_code code)
/* Defer option CODE with argument ARG. */
static void
-defer_opt (code, arg)
- enum opt_code code;
- const char *arg;
+defer_opt (enum opt_code code, const char *arg)
{
/* FIXME: this should be in c_common_init_options, which should take
argc and argv. */
@@ -217,8 +213,7 @@ defer_opt (code, arg)
/* Common initialization before parsing options. */
int
-c_common_init_options (lang)
- enum c_language_kind lang;
+c_common_init_options (enum c_language_kind lang)
{
c_language = lang;
parse_in = cpp_create_reader (lang == clk_c ? CLK_GNUC89 : CLK_GNUCXX,
@@ -244,11 +239,11 @@ c_common_init_options (lang)
invalid, a negative number to prevent language-independent
processing in toplev.c (a hack necessary for the short-term). */
int
-c_common_handle_option (size_t scode, const char *arg, int on)
+c_common_handle_option (size_t scode, const char *arg, int value)
{
const struct cl_option *option = &cl_options[scode];
enum opt_code code = (enum opt_code) scode;
- int result = 1, lang_mask;
+ int result = 1;
if (code == N_OPTS)
{
@@ -262,19 +257,6 @@ c_common_handle_option (size_t scode, const char *arg, int on)
return 1;
}
- lang_mask = lang_flags[(c_language << 1) + flag_objc];
- if (!(option->flags & lang_mask))
- {
- complain_wrong_lang (code, on);
- return 1;
- }
-
- if (arg == NULL && (option->flags & (CL_JOINED | CL_SEPARATE)))
- {
- missing_arg (code);
- return 1;
- }
-
switch (code)
{
default:
@@ -372,95 +354,95 @@ c_common_handle_option (size_t scode, const char *arg, int on)
break;
case OPT_Wabi:
- warn_abi = on;
+ warn_abi = value;
break;
case OPT_Wall:
- set_Wunused (on);
- set_Wformat (on);
- set_Wimplicit (on);
- warn_char_subscripts = on;
- warn_missing_braces = on;
- warn_parentheses = on;
- warn_return_type = on;
- warn_sequence_point = on; /* Was C only. */
+ set_Wunused (value);
+ set_Wformat (value);
+ set_Wimplicit (value);
+ warn_char_subscripts = value;
+ warn_missing_braces = value;
+ warn_parentheses = value;
+ warn_return_type = value;
+ warn_sequence_point = value; /* Was C only. */
if (c_language == clk_cplusplus)
- warn_sign_compare = on;
- warn_switch = on;
- warn_strict_aliasing = on;
-
+ warn_sign_compare = value;
+ warn_switch = value;
+ warn_strict_aliasing = value;
+
/* Only warn about unknown pragmas that are not in system
- headers. */
- warn_unknown_pragmas = on;
+ headers. */
+ warn_unknown_pragmas = value;
/* We save the value of warn_uninitialized, since if they put
-Wuninitialized on the command line, we need to generate a
warning about not using it without also specifying -O. */
if (warn_uninitialized != 1)
- warn_uninitialized = (on ? 2 : 0);
+ warn_uninitialized = (value ? 2 : 0);
if (c_language == clk_c)
/* We set this to 2 here, but 1 in -Wmain, so -ffreestanding
can turn it off only if it's not explicit. */
- warn_main = on * 2;
+ warn_main = value * 2;
else
{
/* C++-specific warnings. */
- warn_nonvdtor = on;
- warn_reorder = on;
- warn_nontemplate_friend = on;
+ warn_nonvdtor = value;
+ warn_reorder = value;
+ warn_nontemplate_friend = value;
}
- cpp_opts->warn_trigraphs = on;
- cpp_opts->warn_comments = on;
- cpp_opts->warn_num_sign_change = on;
- cpp_opts->warn_multichar = on; /* Was C++ only. */
+ cpp_opts->warn_trigraphs = value;
+ cpp_opts->warn_comments = value;
+ cpp_opts->warn_num_sign_change = value;
+ cpp_opts->warn_multichar = value; /* Was C++ only. */
break;
case OPT_Wbad_function_cast:
- warn_bad_function_cast = on;
+ warn_bad_function_cast = value;
break;
case OPT_Wcast_qual:
- warn_cast_qual = on;
+ warn_cast_qual = value;
break;
case OPT_Wchar_subscripts:
- warn_char_subscripts = on;
+ warn_char_subscripts = value;
break;
case OPT_Wcomment:
case OPT_Wcomments:
- cpp_opts->warn_comments = on;
+ cpp_opts->warn_comments = value;
break;
case OPT_Wconversion:
- warn_conversion = on;
+ warn_conversion = value;
break;
case OPT_Wctor_dtor_privacy:
- warn_ctor_dtor_privacy = on;
+ warn_ctor_dtor_privacy = value;
break;
case OPT_Wdeprecated:
- warn_deprecated = on;
- cpp_opts->warn_deprecated = on;
+ warn_deprecated = value;
+ cpp_opts->warn_deprecated = value;
break;
case OPT_Wdiv_by_zero:
- warn_div_by_zero = on;
+ warn_div_by_zero = value;
break;
case OPT_Weffc__:
- warn_ecpp = on;
+ warn_ecpp = value;
break;
case OPT_Wendif_labels:
- cpp_opts->warn_endif_labels = on;
+ cpp_opts->warn_endif_labels = value;
break;
case OPT_Werror:
- cpp_opts->warnings_are_errors = on;
+ cpp_opts->warnings_are_errors = value;
break;
case OPT_Werror_implicit_function_declaration:
@@ -468,11 +450,11 @@ c_common_handle_option (size_t scode, const char *arg, int on)
break;
case OPT_Wfloat_equal:
- warn_float_equal = on;
+ warn_float_equal = value;
break;
case OPT_Wformat:
- set_Wformat (on);
+ set_Wformat (value);
break;
case OPT_Wformat_:
@@ -480,194 +462,194 @@ c_common_handle_option (size_t scode, const char *arg, int on)
break;
case OPT_Wformat_extra_args:
- warn_format_extra_args = on;
+ warn_format_extra_args = value;
break;
case OPT_Wformat_nonliteral:
- warn_format_nonliteral = on;
+ warn_format_nonliteral = value;
break;
case OPT_Wformat_security:
- warn_format_security = on;
+ warn_format_security = value;
break;
case OPT_Wformat_y2k:
- warn_format_y2k = on;
+ warn_format_y2k = value;
break;
case OPT_Wformat_zero_length:
- warn_format_zero_length = on;
+ warn_format_zero_length = value;
break;
case OPT_Wimplicit:
- set_Wimplicit (on);
+ set_Wimplicit (value);
break;
case OPT_Wimplicit_function_declaration:
- mesg_implicit_function_declaration = on;
+ mesg_implicit_function_declaration = value;
break;
case OPT_Wimplicit_int:
- warn_implicit_int = on;
+ warn_implicit_int = value;
break;
case OPT_Wimport:
- cpp_opts->warn_import = on;
+ cpp_opts->warn_import = value;
break;
case OPT_Winvalid_offsetof:
- warn_invalid_offsetof = on;
+ warn_invalid_offsetof = value;
break;
case OPT_Winvalid_pch:
- cpp_opts->warn_invalid_pch = on;
+ cpp_opts->warn_invalid_pch = value;
break;
case OPT_Wlong_long:
- warn_long_long = on;
+ warn_long_long = value;
break;
case OPT_Wmain:
- if (on)
+ if (value)
warn_main = 1;
else
warn_main = -1;
break;
case OPT_Wmissing_braces:
- warn_missing_braces = on;
+ warn_missing_braces = value;
break;
case OPT_Wmissing_declarations:
- warn_missing_declarations = on;
+ warn_missing_declarations = value;
break;
case OPT_Wmissing_format_attribute:
- warn_missing_format_attribute = on;
+ warn_missing_format_attribute = value;
break;
case OPT_Wmissing_prototypes:
- warn_missing_prototypes = on;
+ warn_missing_prototypes = value;
break;
case OPT_Wmultichar:
- cpp_opts->warn_multichar = on;
+ cpp_opts->warn_multichar = value;
break;
case OPT_Wnested_externs:
- warn_nested_externs = on;
+ warn_nested_externs = value;
break;
case OPT_Wnon_template_friend:
- warn_nontemplate_friend = on;
+ warn_nontemplate_friend = value;
break;
case OPT_Wnon_virtual_dtor:
- warn_nonvdtor = on;
+ warn_nonvdtor = value;
break;
case OPT_Wnonnull:
- warn_nonnull = on;
+ warn_nonnull = value;
break;
case OPT_Wold_style_cast:
- warn_old_style_cast = on;
+ warn_old_style_cast = value;
break;
case OPT_Woverloaded_virtual:
- warn_overloaded_virtual = on;
+ warn_overloaded_virtual = value;
break;
case OPT_Wparentheses:
- warn_parentheses = on;
+ warn_parentheses = value;
break;
case OPT_Wpmf_conversions:
- warn_pmf2ptr = on;
+ warn_pmf2ptr = value;
break;
case OPT_Wpointer_arith:
- warn_pointer_arith = on;
+ warn_pointer_arith = value;
break;
case OPT_Wprotocol:
- warn_protocol = on;
+ warn_protocol = value;
break;
case OPT_Wselector:
- warn_selector = on;
+ warn_selector = value;
break;
case OPT_Wredundant_decls:
- warn_redundant_decls = on;
+ warn_redundant_decls = value;
break;
case OPT_Wreorder:
- warn_reorder = on;
+ warn_reorder = value;
break;
case OPT_Wreturn_type:
- warn_return_type = on;
+ warn_return_type = value;
break;
case OPT_Wsequence_point:
- warn_sequence_point = on;
+ warn_sequence_point = value;
break;
case OPT_Wsign_compare:
- warn_sign_compare = on;
+ warn_sign_compare = value;
break;
case OPT_Wsign_promo:
- warn_sign_promo = on;
+ warn_sign_promo = value;
break;
case OPT_Wstrict_prototypes:
- warn_strict_prototypes = on;
+ warn_strict_prototypes = value;
break;
case OPT_Wsynth:
- warn_synth = on;
+ warn_synth = value;
break;
case OPT_Wsystem_headers:
- cpp_opts->warn_system_headers = on;
+ cpp_opts->warn_system_headers = value;
break;
case OPT_Wtraditional:
- warn_traditional = on;
- cpp_opts->warn_traditional = on;
+ warn_traditional = value;
+ cpp_opts->warn_traditional = value;
break;
case OPT_Wtrigraphs:
- cpp_opts->warn_trigraphs = on;
+ cpp_opts->warn_trigraphs = value;
break;
case OPT_Wundeclared_selector:
- warn_undeclared_selector = on;
+ warn_undeclared_selector = value;
break;
case OPT_Wundef:
- cpp_opts->warn_undef = on;
+ cpp_opts->warn_undef = value;
break;
case OPT_Wunknown_pragmas:
/* Set to greater than 1, so that even unknown pragmas in
- system headers will be warned about. */
- warn_unknown_pragmas = on * 2;
+ system headers will be warned about. */
+ warn_unknown_pragmas = value * 2;
break;
case OPT_Wunused_macros:
- warn_unused_macros = on;
+ warn_unused_macros = value;
break;
case OPT_Wwrite_strings:
if (c_language == clk_c)
- flag_const_strings = on;
+ flag_const_strings = value;
else
- warn_write_strings = on;
+ warn_write_strings = value;
break;
-
+
case OPT_ansi:
if (c_language == clk_c)
set_std_c89 (false, true);
@@ -682,7 +664,7 @@ c_common_handle_option (size_t scode, const char *arg, int on)
case OPT_fcond_mismatch:
if (c_language == clk_c)
{
- flag_cond_mismatch = on;
+ flag_cond_mismatch = value;
break;
}
/* Fall through. */
@@ -705,96 +687,96 @@ c_common_handle_option (size_t scode, const char *arg, int on)
break;
case OPT_fabi_version_:
- flag_abi_version = read_integral_parameter (arg, option->opt_text, 1);
+ flag_abi_version = value;
break;
case OPT_faccess_control:
- flag_access_control = on;
+ flag_access_control = value;
break;
case OPT_falt_external_templates:
- flag_alt_external_templates = on;
- if (on)
+ flag_alt_external_templates = value;
+ if (value)
flag_external_templates = true;
cp_deprecated:
warning ("switch \"%s\" is deprecated, please see documentation for details", option->opt_text);
break;
case OPT_fasm:
- flag_no_asm = !on;
+ flag_no_asm = !value;
break;
case OPT_fbuiltin:
- flag_no_builtin = !on;
+ flag_no_builtin = !value;
break;
case OPT_fbuiltin_:
- if (on)
+ if (value)
result = 0;
else
disable_builtin_function (arg);
break;
case OPT_fdollars_in_identifiers:
- cpp_opts->dollars_in_ident = on;
+ cpp_opts->dollars_in_ident = value;
break;
case OPT_fdump_:
- if (!dump_switch_p (option->opt_text + strlen ("f")))
+ if (!dump_switch_p (arg))
result = 0;
break;
case OPT_ffreestanding:
- on = !on;
+ value = !value;
/* Fall through... */
case OPT_fhosted:
- flag_hosted = on;
- flag_no_builtin = !on;
+ flag_hosted = value;
+ flag_no_builtin = !value;
/* warn_main will be 2 if set by -Wall, 1 if set by -Wmain */
- if (!on && warn_main == 2)
+ if (!value && warn_main == 2)
warn_main = 0;
break;
case OPT_fshort_double:
- flag_short_double = on;
+ flag_short_double = value;
break;
case OPT_fshort_enums:
- flag_short_enums = on;
+ flag_short_enums = value;
break;
case OPT_fshort_wchar:
- flag_short_wchar = on;
+ flag_short_wchar = value;
break;
case OPT_fsigned_bitfields:
- flag_signed_bitfields = on;
+ flag_signed_bitfields = value;
explicit_flag_signed_bitfields = 1;
break;
case OPT_fsigned_char:
- flag_signed_char = on;
+ flag_signed_char = value;
break;
case OPT_funsigned_bitfields:
- flag_signed_bitfields = !on;
+ flag_signed_bitfields = !value;
explicit_flag_signed_bitfields = 1;
break;
case OPT_funsigned_char:
- flag_signed_char = !on;
+ flag_signed_char = !value;
break;
case OPT_fcheck_new:
- flag_check_new = on;
+ flag_check_new = value;
break;
case OPT_fconserve_space:
- flag_conserve_space = on;
+ flag_conserve_space = value;
break;
case OPT_fconst_strings:
- flag_const_strings = on;
+ flag_const_strings = value;
break;
case OPT_fconstant_string_class_:
@@ -802,131 +784,127 @@ c_common_handle_option (size_t scode, const char *arg, int on)
break;
case OPT_fdefault_inline:
- flag_default_inline = on;
+ flag_default_inline = value;
break;
case OPT_felide_constructors:
- flag_elide_constructors = on;
+ flag_elide_constructors = value;
break;
case OPT_fenforce_eh_specs:
- flag_enforce_eh_specs = on;
+ flag_enforce_eh_specs = value;
break;
case OPT_fexternal_templates:
- flag_external_templates = on;
+ flag_external_templates = value;
goto cp_deprecated;
case OPT_ffixed_form:
case OPT_ffixed_line_length_:
/* Fortran front end options ignored when preprocessing only. */
- if (flag_preprocess_only)
- result = -1;
+ if (!flag_preprocess_only)
+ result = 0;
break;
case OPT_ffor_scope:
- flag_new_for_scope = on;
+ flag_new_for_scope = value;
break;
case OPT_fgnu_keywords:
- flag_no_gnu_keywords = !on;
+ flag_no_gnu_keywords = !value;
break;
case OPT_fgnu_runtime:
- flag_next_runtime = !on;
+ flag_next_runtime = !value;
break;
case OPT_fhandle_exceptions:
warning ("-fhandle-exceptions has been renamed -fexceptions (and is now on by default)");
- flag_exceptions = on;
+ flag_exceptions = value;
break;
case OPT_fimplement_inlines:
- flag_implement_inlines = on;
+ flag_implement_inlines = value;
break;
case OPT_fimplicit_inline_templates:
- flag_implicit_inline_templates = on;
+ flag_implicit_inline_templates = value;
break;
case OPT_fimplicit_templates:
- flag_implicit_templates = on;
+ flag_implicit_templates = value;
break;
case OPT_fms_extensions:
- flag_ms_extensions = on;
+ flag_ms_extensions = value;
break;
case OPT_fnext_runtime:
- flag_next_runtime = on;
+ flag_next_runtime = value;
break;
case OPT_fnonansi_builtins:
- flag_no_nonansi_builtin = !on;
+ flag_no_nonansi_builtin = !value;
break;
case OPT_foperator_names:
- cpp_opts->operator_names = on;
+ cpp_opts->operator_names = value;
break;
case OPT_foptional_diags:
- flag_optional_diags = on;
+ flag_optional_diags = value;
break;
case OPT_fpch_deps:
- cpp_opts->restore_pch_deps = on;
+ cpp_opts->restore_pch_deps = value;
break;
case OPT_fpermissive:
- flag_permissive = on;
+ flag_permissive = value;
break;
case OPT_fpreprocessed:
- cpp_opts->preprocessed = on;
+ cpp_opts->preprocessed = value;
break;
case OPT_frepo:
- flag_use_repository = on;
- if (on)
+ flag_use_repository = value;
+ if (value)
flag_implicit_templates = 0;
break;
case OPT_frtti:
- flag_rtti = on;
+ flag_rtti = value;
break;
case OPT_fshow_column:
- cpp_opts->show_column = on;
+ cpp_opts->show_column = value;
break;
case OPT_fstats:
- flag_detailed_statistics = on;
+ flag_detailed_statistics = value;
break;
case OPT_ftabstop_:
/* It is documented that we silently ignore silly values. */
- {
- char *endptr;
- long tabstop = strtol (arg, &endptr, 10);
- if (*endptr == '\0' && tabstop >= 1 && tabstop <= 100)
- cpp_opts->tabstop = tabstop;
- }
+ if (value >= 1 && value <= 100)
+ cpp_opts->tabstop = value;
break;
case OPT_ftemplate_depth_:
- max_tinst_depth = read_integral_parameter (arg, option->opt_text, 0);
+ max_tinst_depth = value;
break;
case OPT_fvtable_gc:
- flag_vtable_gc = on;
+ flag_vtable_gc = value;
break;
case OPT_fuse_cxa_atexit:
- flag_use_cxa_atexit = on;
+ flag_use_cxa_atexit = value;
break;
case OPT_fweak:
- flag_weak = on;
+ flag_weak = value;
break;
case OPT_gen_decls:
@@ -1058,8 +1036,7 @@ c_common_handle_option (size_t scode, const char *arg, int on)
/* Post-switch processing. */
bool
-c_common_post_options (pfilename)
- const char **pfilename;
+c_common_post_options (const char **pfilename)
{
/* Canonicalize the input and output filenames. */
if (in_fname == NULL || !strcmp (in_fname, "-"))
@@ -1157,7 +1134,7 @@ c_common_post_options (pfilename)
/* Front end initialization common to C, ObjC and C++. */
bool
-c_common_init ()
+c_common_init (void)
{
input_line = saved_lineno;
@@ -1183,13 +1160,12 @@ c_common_init ()
return true;
}
-/* A thin wrapper around the real parser that initializes the
+/* A thin wrapper around the real parser that initializes the
integrated preprocessor after debug output has been initialized.
Also, make sure the start_source_file debug hook gets called for
the primary source file. */
void
-c_common_parse_file (set_yydebug)
- int set_yydebug ATTRIBUTE_UNUSED;
+c_common_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
{
#if YYDEBUG != 0
yydebug = set_yydebug;
@@ -1206,7 +1182,7 @@ c_common_parse_file (set_yydebug)
/* Common finish hook for the C, ObjC and C++ front ends. */
void
-c_common_finish ()
+c_common_finish (void)
{
FILE *deps_stream = NULL;
@@ -1244,7 +1220,7 @@ c_common_finish ()
rather than overwriting it, and like Sun's compiler
SUNPRO_DEPENDENCIES suppresses the dependency on the main file. */
static void
-check_deps_environment_vars ()
+check_deps_environment_vars (void)
{
char *spec;
@@ -1282,7 +1258,7 @@ check_deps_environment_vars ()
/* Handle deferred command line switches. */
static void
-handle_deferred_opts ()
+handle_deferred_opts (void)
{
size_t i;
@@ -1298,7 +1274,7 @@ handle_deferred_opts ()
/* These settings are appropriate for GCC, but not necessarily so for
cpplib as a library. */
static void
-sanitize_cpp_opts ()
+sanitize_cpp_opts (void)
{
/* If we don't know what style of dependencies to output, complain
if any other dependency switches have been given. */
@@ -1330,9 +1306,7 @@ sanitize_cpp_opts ()
/* Add include path with a prefix at the front of its name. */
static void
-add_prefixed_path (suffix, chain)
- const char *suffix;
- size_t chain;
+add_prefixed_path (const char *suffix, size_t chain)
{
char *path;
const char *prefix;
@@ -1352,7 +1326,7 @@ add_prefixed_path (suffix, chain)
/* Handle -D, -U, -A, -imacros, and the first -include. */
static void
-finish_options ()
+finish_options (void)
{
if (!cpp_opts->preprocessed)
{
@@ -1407,15 +1381,15 @@ finish_options ()
/* Give CPP the next file given by -include, if any. */
static void
-push_command_line_include ()
+push_command_line_include (void)
{
if (cpp_opts->preprocessed)
return;
-
+
while (include_cursor < deferred_count)
{
struct deferred_opt *opt = &deferred_opts[include_cursor++];
-
+
if (opt->code == OPT_include && cpp_push_include (parse_in, opt->arg))
return;
}
@@ -1432,9 +1406,8 @@ push_command_line_include ()
/* File change callback. Has to handle -include files. */
static void
-cb_file_change (pfile, new_map)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
- const struct line_map *new_map;
+cb_file_change (cpp_reader *pfile ATTRIBUTE_UNUSED,
+ const struct line_map *new_map)
{
if (flag_preprocess_only)
pp_file_change (new_map);
@@ -1448,8 +1421,7 @@ cb_file_change (pfile, new_map)
/* Set the C 89 standard (with 1994 amendments if C94, without GNU
extensions if ISO). There is no concept of gnu94. */
static void
-set_std_c89 (c94, iso)
- int c94, iso;
+set_std_c89 (int c94, int iso)
{
cpp_set_lang (parse_in, c94 ? CLK_STDC94: iso ? CLK_STDC89: CLK_GNUC89);
flag_iso = iso;
@@ -1464,8 +1436,7 @@ set_std_c89 (c94, iso)
/* Set the C 99 standard (without GNU extensions if ISO). */
static void
-set_std_c99 (iso)
- int iso;
+set_std_c99 (int iso)
{
cpp_set_lang (parse_in, iso ? CLK_STDC99: CLK_GNUC99);
flag_no_asm = iso;
@@ -1479,8 +1450,7 @@ set_std_c99 (iso)
/* Set the C++ 98 standard (without GNU extensions if ISO). */
static void
-set_std_cxx98 (iso)
- int iso;
+set_std_cxx98 (int iso)
{
cpp_set_lang (parse_in, iso ? CLK_CXX98: CLK_GNUCXX);
flag_no_gnu_keywords = iso;
@@ -1491,8 +1461,7 @@ set_std_cxx98 (iso)
/* Handle setting implicit to ON. */
static void
-set_Wimplicit (on)
- int on;
+set_Wimplicit (int on)
{
warn_implicit = on;
warn_implicit_int = on;
@@ -1508,8 +1477,7 @@ set_Wimplicit (on)
/* Args to -d specify what to dump. Silently ignore
unrecognized options; they may be aimed at toplev.c. */
static void
-handle_OPT_d (arg)
- const char *arg;
+handle_OPT_d (const char *arg)
{
char c;
@@ -1528,49 +1496,9 @@ handle_OPT_d (arg)
}
}
-/* Write a slash-separated list of languages in FLAGS to BUF. */
-static void
-write_langs (buf, flags)
- char *buf;
- int flags;
-{
- *buf = '\0';
- if (flags & CL_C)
- strcat (buf, "C");
- if (flags & CL_ObjC)
- {
- if (*buf)
- strcat (buf, "/");
- strcat (buf, "ObjC");
- }
- if (flags & CL_CXX)
- {
- if (*buf)
- strcat (buf, "/");
- strcat (buf, "C++");
- }
-}
-
-/* Complain that switch OPT_INDEX does not apply to this front end. */
-static void
-complain_wrong_lang (opt_index, on)
- size_t opt_index;
- int on;
-{
- char ok_langs[60], bad_langs[60];
- int ok_flags = cl_options[opt_index].flags;
-
- write_langs (ok_langs, ok_flags);
- write_langs (bad_langs, ~ok_flags);
- /* Eventually this should become a hard error. */
- warning ("\"-%c%s%s\" is valid for %s but not for %s",
- cl_options[opt_index].opt_text[0], on ? "" : "no-",
- cl_options[opt_index].opt_text + 1, ok_langs, bad_langs);
-}
-
/* Handle --help output. */
static void
-print_help ()
+print_help (void)
{
/* To keep the lines from getting too long for some compilers, limit
to about 500 characters (6 lines) per chunk. */
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index 477ae629fe7..ae8545366b0 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -1862,7 +1862,7 @@ component_decl:
declspecs_nosc_ts setspecs components
{ $$ = $3;
POP_DECLSPEC_STACK; }
- | declspecs_nosc_ts setspecs save_filename save_lineno
+ | declspecs_nosc_ts setspecs
{
/* Support for unnamed structs or unions as members of
structs or unions (which is [a] useful and [b] supports
@@ -1870,7 +1870,7 @@ component_decl:
if (pedantic)
pedwarn ("ISO C doesn't support unnamed structs/unions");
- $$ = grokfield($3, $4, NULL, current_declspecs, NULL_TREE);
+ $$ = grokfield(NULL, current_declspecs, NULL_TREE);
POP_DECLSPEC_STACK; }
| declspecs_nosc_nots setspecs components_notype
{ $$ = $3;
@@ -1900,29 +1900,33 @@ components_notype:
;
component_declarator:
- save_filename save_lineno declarator maybe_attribute
- { $$ = grokfield ($1, $2, $3, current_declspecs, NULL_TREE);
- decl_attributes (&$$, chainon ($4, all_prefix_attributes), 0); }
- | save_filename save_lineno
- declarator ':' expr_no_commas maybe_attribute
- { $$ = grokfield ($1, $2, $3, current_declspecs, $5);
- decl_attributes (&$$, chainon ($6, all_prefix_attributes), 0); }
- | save_filename save_lineno ':' expr_no_commas maybe_attribute
- { $$ = grokfield ($1, $2, NULL_TREE, current_declspecs, $4);
- decl_attributes (&$$, chainon ($5, all_prefix_attributes), 0); }
+ declarator maybe_attribute
+ { $$ = grokfield ($1, current_declspecs, NULL_TREE);
+ decl_attributes (&$$,
+ chainon ($2, all_prefix_attributes), 0); }
+ | declarator ':' expr_no_commas maybe_attribute
+ { $$ = grokfield ($1, current_declspecs, $3);
+ decl_attributes (&$$,
+ chainon ($4, all_prefix_attributes), 0); }
+ | ':' expr_no_commas maybe_attribute
+ { $$ = grokfield (NULL_TREE, current_declspecs, $2);
+ decl_attributes (&$$,
+ chainon ($3, all_prefix_attributes), 0); }
;
component_notype_declarator:
- save_filename save_lineno notype_declarator maybe_attribute
- { $$ = grokfield ($1, $2, $3, current_declspecs, NULL_TREE);
- decl_attributes (&$$, chainon ($4, all_prefix_attributes), 0); }
- | save_filename save_lineno
- notype_declarator ':' expr_no_commas maybe_attribute
- { $$ = grokfield ($1, $2, $3, current_declspecs, $5);
- decl_attributes (&$$, chainon ($6, all_prefix_attributes), 0); }
- | save_filename save_lineno ':' expr_no_commas maybe_attribute
- { $$ = grokfield ($1, $2, NULL_TREE, current_declspecs, $4);
- decl_attributes (&$$, chainon ($5, all_prefix_attributes), 0); }
+ notype_declarator maybe_attribute
+ { $$ = grokfield ($1, current_declspecs, NULL_TREE);
+ decl_attributes (&$$,
+ chainon ($2, all_prefix_attributes), 0); }
+ | notype_declarator ':' expr_no_commas maybe_attribute
+ { $$ = grokfield ($1, current_declspecs, $3);
+ decl_attributes (&$$,
+ chainon ($4, all_prefix_attributes), 0); }
+ | ':' expr_no_commas maybe_attribute
+ { $$ = grokfield (NULL_TREE, current_declspecs, $2);
+ decl_attributes (&$$,
+ chainon ($3, all_prefix_attributes), 0); }
;
/* We chain the enumerators in reverse order.
diff --git a/gcc/c-pch.c b/gcc/c-pch.c
index 6a2131404c9..22b7ccc3a1a 100644
--- a/gcc/c-pch.c
+++ b/gcc/c-pch.c
@@ -1,5 +1,5 @@
/* Precompiled header implementation for the C languages.
- Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -48,7 +48,7 @@ static FILE *pch_outfile;
static long asm_file_startpos;
-static const char * get_ident PARAMS((void));
+static const char *get_ident (void);
/* Compute an appropriate 8-byte magic number for the PCH file, so that
utilities like file(1) can identify it, and so that GCC can quickly
@@ -56,7 +56,7 @@ static const char * get_ident PARAMS((void));
format. */
static const char *
-get_ident()
+get_ident(void)
{
static char result[IDENT_LENGTH];
static const char template[IDENT_LENGTH] = "gpch.011";
@@ -75,7 +75,7 @@ get_ident()
compilation. */
void
-pch_init ()
+pch_init (void)
{
FILE *f;
struct c_pch_validity v;
@@ -111,7 +111,7 @@ pch_init ()
will produce a PCH file. */
void
-c_common_write_pch ()
+c_common_write_pch (void)
{
char *buf;
long asm_file_end;
@@ -157,10 +157,7 @@ c_common_write_pch ()
in this compilation. */
int
-c_common_valid_pch (pfile, name, fd)
- cpp_reader *pfile;
- const char *name;
- int fd;
+c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
{
int sizeread;
int result;
@@ -232,11 +229,8 @@ c_common_valid_pch (pfile, name, fd)
by ORIG_NAME. */
void
-c_common_read_pch (pfile, name, fd, orig_name)
- cpp_reader *pfile;
- const char *name;
- int fd;
- const char *orig_name ATTRIBUTE_UNUSED;
+c_common_read_pch (cpp_reader *pfile, const char *name,
+ int fd, const char *orig_name ATTRIBUTE_UNUSED)
{
FILE *f;
struct c_pch_header h;
diff --git a/gcc/c-ppoutput.c b/gcc/c-ppoutput.c
index 2c1835def71..333da30b2e9 100644
--- a/gcc/c-ppoutput.c
+++ b/gcc/c-ppoutput.c
@@ -40,30 +40,28 @@ static struct
} print;
/* General output routines. */
-static void scan_translation_unit PARAMS ((cpp_reader *));
-static void scan_translation_unit_trad PARAMS ((cpp_reader *));
-static void account_for_newlines PARAMS ((const uchar *, size_t));
-static int dump_macro PARAMS ((cpp_reader *, cpp_hashnode *, void *));
+static void scan_translation_unit (cpp_reader *);
+static void scan_translation_unit_trad (cpp_reader *);
+static void account_for_newlines (const uchar *, size_t);
+static int dump_macro (cpp_reader *, cpp_hashnode *, void *);
-static void print_line PARAMS ((const struct line_map *, unsigned int,
- const char *));
-static void maybe_print_line PARAMS ((const struct line_map *, unsigned int));
+static void print_line (const struct line_map *, unsigned int,
+ const char *);
+static void maybe_print_line (const struct line_map *, unsigned int);
/* Callback routines for the parser. Most of these are active only
in specific modes. */
-static void cb_line_change PARAMS ((cpp_reader *, const cpp_token *, int));
-static void cb_define PARAMS ((cpp_reader *, unsigned int, cpp_hashnode *));
-static void cb_undef PARAMS ((cpp_reader *, unsigned int, cpp_hashnode *));
-static void cb_include PARAMS ((cpp_reader *, unsigned int,
- const unsigned char *, const char *, int));
-static void cb_ident PARAMS ((cpp_reader *, unsigned int,
- const cpp_string *));
-static void cb_def_pragma PARAMS ((cpp_reader *, unsigned int));
+static void cb_line_change (cpp_reader *, const cpp_token *, int);
+static void cb_define (cpp_reader *, unsigned int, cpp_hashnode *);
+static void cb_undef (cpp_reader *, unsigned int, cpp_hashnode *);
+static void cb_include (cpp_reader *, unsigned int, const unsigned char *,
+ const char *, int);
+static void cb_ident (cpp_reader *, unsigned int, const cpp_string *);
+static void cb_def_pragma (cpp_reader *, unsigned int);
/* Preprocess and output. */
void
-preprocess_file (pfile)
- cpp_reader *pfile;
+preprocess_file (cpp_reader *pfile)
{
/* A successful cpp_read_main_file guarantees that we can call
cpp_scan_nooutput or cpp_get_token next. */
@@ -90,8 +88,7 @@ preprocess_file (pfile)
/* Set up the callbacks as appropriate. */
void
-init_pp_output (out_stream)
- FILE *out_stream;
+init_pp_output (FILE *out_stream)
{
cpp_callbacks *cb = cpp_get_callbacks (parse_in);
@@ -129,8 +126,7 @@ init_pp_output (out_stream)
/* Writes out the preprocessed file, handling spacing and paste
avoidance issues. */
static void
-scan_translation_unit (pfile)
- cpp_reader *pfile;
+scan_translation_unit (cpp_reader *pfile)
{
bool avoid_paste = false;
@@ -178,9 +174,7 @@ scan_translation_unit (pfile)
/* Adjust print.line for newlines embedded in output. */
static void
-account_for_newlines (str, len)
- const uchar *str;
- size_t len;
+account_for_newlines (const uchar *str, size_t len)
{
while (len--)
if (*str++ == '\n')
@@ -189,8 +183,7 @@ account_for_newlines (str, len)
/* Writes out a traditionally preprocessed file. */
static void
-scan_translation_unit_trad (pfile)
- cpp_reader *pfile;
+scan_translation_unit_trad (cpp_reader *pfile)
{
while (_cpp_read_logical_line_trad (pfile))
{
@@ -207,9 +200,7 @@ scan_translation_unit_trad (pfile)
different line to the current one, output the required newlines or
a line marker, and return 1. Otherwise return 0. */
static void
-maybe_print_line (map, line)
- const struct line_map *map;
- unsigned int line;
+maybe_print_line (const struct line_map *map, unsigned int line)
{
/* End the previous line of text. */
if (print.printed)
@@ -234,10 +225,7 @@ maybe_print_line (map, line)
/* Output a line marker for logical line LINE. Special flags are "1"
or "2" indicating entering or leaving a file. */
static void
-print_line (map, line, special_flags)
- const struct line_map *map;
- unsigned int line;
- const char *special_flags;
+print_line (const struct line_map *map, unsigned int line, const char *special_flags)
{
/* End any previous line of text. */
if (print.printed)
@@ -272,10 +260,7 @@ print_line (map, line, special_flags)
/* Called when a line of output is started. TOKEN is the first token
of the line, and at end of file will be CPP_EOF. */
static void
-cb_line_change (pfile, token, parsing_args)
- cpp_reader *pfile;
- const cpp_token *token;
- int parsing_args;
+cb_line_change (cpp_reader *pfile, const cpp_token *token, int parsing_args)
{
if (token->type == CPP_EOF || parsing_args)
return;
@@ -303,10 +288,8 @@ cb_line_change (pfile, token, parsing_args)
}
static void
-cb_ident (pfile, line, str)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
- unsigned int line;
- const cpp_string * str;
+cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
+ const cpp_string *str)
{
maybe_print_line (print.map, line);
fprintf (print.outf, "#ident \"%s\"\n", str->text);
@@ -314,10 +297,7 @@ cb_ident (pfile, line, str)
}
static void
-cb_define (pfile, line, node)
- cpp_reader *pfile;
- unsigned int line;
- cpp_hashnode *node;
+cb_define (cpp_reader *pfile, unsigned int line, cpp_hashnode *node)
{
maybe_print_line (print.map, line);
fputs ("#define ", print.outf);
@@ -334,10 +314,8 @@ cb_define (pfile, line, node)
}
static void
-cb_undef (pfile, line, node)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
- unsigned int line;
- cpp_hashnode *node;
+cb_undef (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
+ cpp_hashnode *node)
{
maybe_print_line (print.map, line);
fprintf (print.outf, "#undef %s\n", NODE_NAME (node));
@@ -345,12 +323,8 @@ cb_undef (pfile, line, node)
}
static void
-cb_include (pfile, line, dir, header, angle_brackets)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
- unsigned int line;
- const unsigned char *dir;
- const char *header;
- int angle_brackets;
+cb_include (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
+ const unsigned char *dir, const char *header, int angle_brackets)
{
maybe_print_line (print.map, line);
if (angle_brackets)
@@ -365,8 +339,7 @@ cb_include (pfile, line, dir, header, angle_brackets)
pointing to freed memory, and so must not be dereferenced. */
void
-pp_file_change (map)
- const struct line_map *map;
+pp_file_change (const struct line_map *map)
{
const char *flags = "";
@@ -398,9 +371,7 @@ pp_file_change (map)
/* Copy a #pragma directive to the preprocessed output. */
static void
-cb_def_pragma (pfile, line)
- cpp_reader *pfile;
- unsigned int line;
+cb_def_pragma (cpp_reader *pfile, unsigned int line)
{
maybe_print_line (print.map, line);
fputs ("#pragma ", print.outf);
@@ -410,10 +381,7 @@ cb_def_pragma (pfile, line)
/* Dump out the hash table. */
static int
-dump_macro (pfile, node, v)
- cpp_reader *pfile;
- cpp_hashnode *node;
- void *v ATTRIBUTE_UNUSED;
+dump_macro (cpp_reader *pfile, cpp_hashnode *node, void *v ATTRIBUTE_UNUSED)
{
if (node->type == NT_MACRO && !(node->flags & NODE_BUILTIN))
{
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c
index 7f026d10b69..71b34096b77 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -49,7 +49,7 @@ typedef struct align_stack GTY(())
static GTY(()) struct align_stack * alignment_stack;
#ifdef HANDLE_PRAGMA_PACK
-static void handle_pragma_pack PARAMS ((cpp_reader *));
+static void handle_pragma_pack (cpp_reader *);
#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
/* If we have a "global" #pragma pack(<n>) in effect when the first
@@ -61,14 +61,12 @@ static int default_alignment;
#define SET_GLOBAL_ALIGNMENT(ALIGN) \
(default_alignment = maximum_field_alignment = (ALIGN))
-static void push_alignment PARAMS ((int, tree));
-static void pop_alignment PARAMS ((tree));
+static void push_alignment (int, tree);
+static void pop_alignment (tree);
/* Push an alignment value onto the stack. */
static void
-push_alignment (alignment, id)
- int alignment;
- tree id;
+push_alignment (int alignment, tree id)
{
if (alignment_stack == NULL
|| alignment_stack->alignment != alignment
@@ -99,8 +97,7 @@ push_alignment (alignment, id)
/* Undo a push of an alignment onto the stack. */
static void
-pop_alignment (id)
- tree id;
+pop_alignment (tree id)
{
align_stack * entry;
@@ -157,8 +154,7 @@ pop_alignment (id)
#pragma pack (pop)
#pragma pack (pop, ID) */
static void
-handle_pragma_pack (dummy)
- cpp_reader *dummy ATTRIBUTE_UNUSED;
+handle_pragma_pack (cpp_reader *dummy ATTRIBUTE_UNUSED)
{
tree x, id = 0;
int align = -1;
@@ -261,12 +257,11 @@ handle_pragma_pack (dummy)
static GTY(()) tree pending_weaks;
#ifdef HANDLE_PRAGMA_WEAK
-static void apply_pragma_weak PARAMS ((tree, tree));
-static void handle_pragma_weak PARAMS ((cpp_reader *));
+static void apply_pragma_weak (tree, tree);
+static void handle_pragma_weak (cpp_reader *);
static void
-apply_pragma_weak (decl, value)
- tree decl, value;
+apply_pragma_weak (tree decl, tree value)
{
if (value)
{
@@ -285,8 +280,7 @@ apply_pragma_weak (decl, value)
}
void
-maybe_apply_pragma_weak (decl)
- tree decl;
+maybe_apply_pragma_weak (tree decl)
{
tree *p, t, id;
@@ -311,8 +305,7 @@ maybe_apply_pragma_weak (decl)
/* #pragma weak name [= value] */
static void
-handle_pragma_weak (dummy)
- cpp_reader *dummy ATTRIBUTE_UNUSED;
+handle_pragma_weak (cpp_reader *dummy ATTRIBUTE_UNUSED)
{
tree name, value, x, decl;
enum cpp_ttype t;
@@ -343,8 +336,7 @@ handle_pragma_weak (dummy)
}
#else
void
-maybe_apply_pragma_weak (decl)
- tree decl ATTRIBUTE_UNUSED;
+maybe_apply_pragma_weak (tree decl ATTRIBUTE_UNUSED)
{
}
#endif /* HANDLE_PRAGMA_WEAK */
@@ -352,12 +344,11 @@ maybe_apply_pragma_weak (decl)
static GTY(()) tree pending_redefine_extname;
#ifdef HANDLE_PRAGMA_REDEFINE_EXTNAME
-static void handle_pragma_redefine_extname PARAMS ((cpp_reader *));
+static void handle_pragma_redefine_extname (cpp_reader *);
/* #pragma redefined_extname oldname newname */
static void
-handle_pragma_redefine_extname (dummy)
- cpp_reader *dummy ATTRIBUTE_UNUSED;
+handle_pragma_redefine_extname (cpp_reader *dummy ATTRIBUTE_UNUSED)
{
tree oldname, newname, decl, x;
enum cpp_ttype t;
@@ -390,8 +381,7 @@ handle_pragma_redefine_extname (dummy)
#endif
void
-add_to_renaming_pragma_list (oldname, newname)
- tree oldname, newname;
+add_to_renaming_pragma_list (tree oldname, tree newname)
{
pending_redefine_extname
= tree_cons (oldname, newname, pending_redefine_extname);
@@ -400,12 +390,11 @@ add_to_renaming_pragma_list (oldname, newname)
static GTY(()) tree pragma_extern_prefix;
#ifdef HANDLE_PRAGMA_EXTERN_PREFIX
-static void handle_pragma_extern_prefix PARAMS ((cpp_reader *));
+static void handle_pragma_extern_prefix (cpp_reader *);
/* #pragma extern_prefix "prefix" */
static void
-handle_pragma_extern_prefix (dummy)
- cpp_reader *dummy ATTRIBUTE_UNUSED;
+handle_pragma_extern_prefix (cpp_reader *dummy ATTRIBUTE_UNUSED)
{
tree prefix, x;
enum cpp_ttype t;
@@ -428,8 +417,7 @@ handle_pragma_extern_prefix (dummy)
pragmas that rename variables. */
tree
-maybe_apply_renaming_pragma (decl, asmname)
- tree decl, asmname;
+maybe_apply_renaming_pragma (tree decl, tree asmname)
{
tree oldname;
@@ -486,17 +474,15 @@ maybe_apply_renaming_pragma (decl, asmname)
/* Front-end wrapper for pragma registration to avoid dragging
cpplib.h in almost everywhere. */
void
-c_register_pragma (space, name, handler)
- const char *space;
- const char *name;
- void (*handler) PARAMS ((struct cpp_reader *));
+c_register_pragma (const char *space, const char *name,
+ void (*handler) (struct cpp_reader *))
{
cpp_register_pragma (parse_in, space, name, handler);
}
/* Set up front-end pragmas. */
void
-init_pragma ()
+init_pragma (void)
{
#ifdef HANDLE_PRAGMA_PACK
c_register_pragma (0, "pack", handle_pragma_pack);
diff --git a/gcc/c-pragma.h b/gcc/c-pragma.h
index f6cf50f52ca..57f78845de0 100644
--- a/gcc/c-pragma.h
+++ b/gcc/c-pragma.h
@@ -47,17 +47,17 @@ extern struct cpp_reader* parse_in;
#define HANDLE_PRAGMA_PACK 1
#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
-extern void init_pragma PARAMS ((void));
+extern void init_pragma (void);
/* Front-end wrapper for pragma registration to avoid dragging
cpplib.h in almost everywhere. */
extern void c_register_pragma
PARAMS ((const char *, const char *,
- void (*) PARAMS ((struct cpp_reader *))));
-extern void maybe_apply_pragma_weak PARAMS ((tree));
-extern tree maybe_apply_renaming_pragma PARAMS ((tree, tree));
-extern void add_to_renaming_pragma_list PARAMS ((tree, tree));
+ void (*) (struct cpp_reader *)));
+extern void maybe_apply_pragma_weak (tree);
+extern tree maybe_apply_renaming_pragma (tree, tree);
+extern void add_to_renaming_pragma_list (tree, tree);
-extern int c_lex PARAMS ((tree *));
+extern int c_lex (tree *);
#endif /* GCC_C_PRAGMA_H */
diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c
index 39d72588281..b376ac94901 100644
--- a/gcc/c-pretty-print.c
+++ b/gcc/c-pretty-print.c
@@ -1,5 +1,5 @@
/* Subroutines common to both C and C++ pretty-printers.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
This file is part of GCC.
@@ -28,55 +28,51 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "c-tree.h"
/* literal */
-static void pp_c_char PARAMS ((c_pretty_printer, int));
-static void pp_c_character_literal PARAMS ((c_pretty_printer, tree));
-static void pp_c_bool_literal PARAMS ((c_pretty_printer, tree));
-static bool pp_c_enumerator PARAMS ((c_pretty_printer, tree));
-static void pp_c_integer_literal PARAMS ((c_pretty_printer, tree));
-static void pp_c_real_literal PARAMS ((c_pretty_printer, tree));
-static void pp_c_string_literal PARAMS ((c_pretty_printer, tree));
+static void pp_c_char (c_pretty_printer, int);
+static void pp_c_character_literal (c_pretty_printer, tree);
+static void pp_c_bool_literal (c_pretty_printer, tree);
+static bool pp_c_enumerator (c_pretty_printer, tree);
+static void pp_c_integer_literal (c_pretty_printer, tree);
+static void pp_c_real_literal (c_pretty_printer, tree);
+static void pp_c_string_literal (c_pretty_printer, tree);
-static void pp_c_primary_expression PARAMS ((c_pretty_printer, tree));
+static void pp_c_primary_expression (c_pretty_printer, tree);
/* postfix-expression */
-static void pp_c_initializer_list PARAMS ((c_pretty_printer, tree));
-
-static void pp_c_unary_expression PARAMS ((c_pretty_printer, tree));
-static void pp_c_multiplicative_expression PARAMS ((c_pretty_printer, tree));
-static void pp_c_additive_expression PARAMS ((c_pretty_printer, tree));
-static void pp_c_shift_expression PARAMS ((c_pretty_printer, tree));
-static void pp_c_relational_expression PARAMS ((c_pretty_printer, tree));
-static void pp_c_equality_expression PARAMS ((c_pretty_printer, tree));
-static void pp_c_and_expression PARAMS ((c_pretty_printer, tree));
-static void pp_c_exclusive_or_expression PARAMS ((c_pretty_printer,
- tree));
-static void pp_c_inclusive_or_expression PARAMS ((c_pretty_printer,
- tree));
-static void pp_c_logical_and_expression PARAMS ((c_pretty_printer, tree));
-static void pp_c_conditional_expression PARAMS ((c_pretty_printer, tree));
-static void pp_c_assignment_expression PARAMS ((c_pretty_printer, tree));
+static void pp_c_initializer_list (c_pretty_printer, tree);
+
+static void pp_c_unary_expression (c_pretty_printer, tree);
+static void pp_c_multiplicative_expression (c_pretty_printer, tree);
+static void pp_c_additive_expression (c_pretty_printer, tree);
+static void pp_c_shift_expression (c_pretty_printer, tree);
+static void pp_c_relational_expression (c_pretty_printer, tree);
+static void pp_c_equality_expression (c_pretty_printer, tree);
+static void pp_c_and_expression (c_pretty_printer, tree);
+static void pp_c_exclusive_or_expression (c_pretty_printer, tree);
+static void pp_c_inclusive_or_expression (c_pretty_printer, tree);
+static void pp_c_logical_and_expression (c_pretty_printer, tree);
+static void pp_c_conditional_expression (c_pretty_printer, tree);
+static void pp_c_assignment_expression (c_pretty_printer, tree);
/* declarations. */
-static void pp_c_declaration_specifiers PARAMS ((c_pretty_printer, tree));
-static void pp_c_init_declarator PARAMS ((c_pretty_printer, tree));
-static void pp_c_declarator PARAMS ((c_pretty_printer, tree));
-static void pp_c_direct_declarator PARAMS ((c_pretty_printer, tree));
-static void pp_c_abstract_declarator PARAMS ((c_pretty_printer, tree));
-static void pp_c_specifier_qualifier_list PARAMS ((c_pretty_printer, tree));
-static void pp_c_simple_type_specifier PARAMS ((c_pretty_printer, tree));
-static void pp_c_parameter_declaration PARAMS ((c_pretty_printer, tree));
-static void pp_c_type_id PARAMS ((c_pretty_printer, tree));
-static void pp_c_storage_class_specifier PARAMS ((c_pretty_printer, tree));
-static void pp_c_function_specifier PARAMS ((c_pretty_printer, tree));
+static void pp_c_declaration_specifiers (c_pretty_printer, tree);
+static void pp_c_init_declarator (c_pretty_printer, tree);
+static void pp_c_declarator (c_pretty_printer, tree);
+static void pp_c_direct_declarator (c_pretty_printer, tree);
+static void pp_c_abstract_declarator (c_pretty_printer, tree);
+static void pp_c_specifier_qualifier_list (c_pretty_printer, tree);
+static void pp_c_simple_type_specifier (c_pretty_printer, tree);
+static void pp_c_parameter_declaration (c_pretty_printer, tree);
+static void pp_c_type_id (c_pretty_printer, tree);
+static void pp_c_storage_class_specifier (c_pretty_printer, tree);
+static void pp_c_function_specifier (c_pretty_printer, tree);
/* Declarations. */
/* Print out CV-qualifiers. Take care of possible extensions. */
void
-pp_c_cv_qualifier (ppi, cv)
- c_pretty_printer ppi;
- int cv;
+pp_c_cv_qualifier (c_pretty_printer ppi, int cv)
{
if (cv & TYPE_QUAL_CONST)
pp_c_identifier (ppi, "const");
@@ -87,9 +83,7 @@ pp_c_cv_qualifier (ppi, cv)
}
static void
-pp_c_simple_type_specifier (ppi, t)
- c_pretty_printer ppi;
- tree t;
+pp_c_simple_type_specifier (c_pretty_printer ppi, tree t)
{
const enum tree_code code = TREE_CODE (t);
switch (code)
@@ -107,7 +101,7 @@ pp_c_simple_type_specifier (ppi, t)
case IDENTIFIER_NODE:
pp_c_tree_identifier (ppi, t);
break;
-
+
case VOID_TYPE:
case BOOLEAN_TYPE:
case CHAR_TYPE:
@@ -115,7 +109,7 @@ pp_c_simple_type_specifier (ppi, t)
case REAL_TYPE:
pp_c_tree_identifier (ppi, DECL_NAME (t));
break;
-
+
case COMPLEX_TYPE:
case VECTOR_TYPE:
pp_c_simple_type_specifier (ppi, TYPE_MAIN_VARIANT (TREE_TYPE (t)));
@@ -143,7 +137,7 @@ pp_c_simple_type_specifier (ppi, t)
pp_c_identifier (ppi, "enum");
else
pp_c_identifier (ppi, "<tag-error>");
-
+
if (TYPE_NAME (t))
pp_c_tree_identifier (ppi, TYPE_NAME (t));
else
@@ -156,36 +150,28 @@ pp_c_simple_type_specifier (ppi, t)
}
static inline void
-pp_c_specifier_qualifier_list (ppi, t)
- c_pretty_printer ppi;
- tree t;
+pp_c_specifier_qualifier_list (c_pretty_printer ppi, tree t)
{
pp_c_simple_type_specifier (ppi, TYPE_MAIN_VARIANT (TREE_TYPE (t)));
pp_c_cv_qualifier (ppi, TYPE_QUALS (t));
}
static void
-pp_c_abstract_declarator (ppi, t)
- c_pretty_printer ppi;
- tree t;
+pp_c_abstract_declarator (c_pretty_printer ppi, tree t)
{
pp_unsupported_tree (ppi, t);
}
static inline void
-pp_c_type_id (ppi, t)
- c_pretty_printer ppi;
- tree t;
+pp_c_type_id (c_pretty_printer ppi, tree t)
{
pp_c_specifier_qualifier_list (ppi, t);
pp_c_abstract_declarator (ppi, t);
}
static inline void
-pp_c_storage_class_specifier (pp, t)
- c_pretty_printer pp;
- tree t;
+pp_c_storage_class_specifier (c_pretty_printer pp, tree t)
{
if (TREE_CODE (t) == TYPE_DECL)
pp_c_identifier (pp, "typedef");
@@ -194,18 +180,14 @@ pp_c_storage_class_specifier (pp, t)
}
static inline void
-pp_c_function_specifier (pp, t)
- c_pretty_printer pp;
- tree t;
+pp_c_function_specifier (c_pretty_printer pp, tree t)
{
if (TREE_CODE (t) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (t))
pp_c_identifier (pp, "inline");
}
static inline void
-pp_c_declaration_specifiers (pp, t)
- c_pretty_printer pp;
- tree t;
+pp_c_declaration_specifiers (c_pretty_printer pp, tree t)
{
pp_c_storage_class_specifier (pp, t);
pp_c_function_specifier (pp, t);
@@ -214,25 +196,19 @@ pp_c_declaration_specifiers (pp, t)
}
static inline void
-pp_c_direct_declarator (pp, t)
- c_pretty_printer pp;
- tree t;
+pp_c_direct_declarator (c_pretty_printer pp, tree t)
{
pp_unsupported_tree (pp, t);
}
static inline void
-pp_c_declarator (pp, t)
- c_pretty_printer pp;
- tree t;
+pp_c_declarator (c_pretty_printer pp, tree t)
{
pp_unsupported_tree (pp, t);
}
static inline void
-pp_c_init_declarator (pp, t)
- c_pretty_printer pp;
- tree t;
+pp_c_init_declarator (c_pretty_printer pp, tree t)
{
pp_declarator (pp, t);
if (DECL_INITIAL (t))
@@ -245,33 +221,27 @@ pp_c_init_declarator (pp, t)
}
void
-pp_c_declaration (pp, t)
- c_pretty_printer pp;
- tree t;
+pp_c_declaration (c_pretty_printer pp, tree t)
{
pp_declaration_specifiers (pp, t);
pp_c_init_declarator (pp, t);
}
static void
-pp_c_parameter_declaration (pp, t)
- c_pretty_printer pp;
- tree t;
+pp_c_parameter_declaration (c_pretty_printer pp, tree t)
{
pp_unsupported_tree (pp, t);
}
/* Pretty-print ATTRIBUTES using GNU C extension syntax. */
-void
-pp_c_attributes (pp, attributes)
- c_pretty_printer pp;
- tree attributes;
+void
+pp_c_attributes (c_pretty_printer pp, tree attributes)
{
if (attributes == NULL_TREE)
return;
-
+
pp_c_identifier (pp, "__attribute__");
- pp_c_left_paren (pp);
+ pp_c_left_paren (pp);
pp_c_left_paren (pp);
for (; attributes != NULL_TREE; attributes = TREE_CHAIN (attributes))
{
@@ -282,7 +252,7 @@ pp_c_attributes (pp, attributes)
pp_c_expression_list (pp, TREE_VALUE (attributes));
pp_c_right_paren (pp);
}
-
+
if (TREE_CHAIN (attributes))
pp_separate_with (pp, ',');
}
@@ -295,9 +265,7 @@ pp_c_attributes (pp, attributes)
/* Print out a c-char. */
static void
-pp_c_char (ppi, c)
- c_pretty_printer ppi;
- int c;
+pp_c_char (c_pretty_printer ppi, int c)
{
switch (c)
{
@@ -342,9 +310,7 @@ pp_c_char (ppi, c)
/* Print out a STRING literal. */
static inline void
-pp_c_string_literal (ppi, s)
- c_pretty_printer ppi;
- tree s;
+pp_c_string_literal (c_pretty_printer ppi, tree s)
{
const char *p = TREE_STRING_POINTER (s);
int n = TREE_STRING_LENGTH (s) - 1;
@@ -357,9 +323,7 @@ pp_c_string_literal (ppi, s)
/* Print out a CHARACTER literal. */
static inline void
-pp_c_character_literal (ppi, c)
- c_pretty_printer ppi;
- tree c;
+pp_c_character_literal (c_pretty_printer ppi, tree c)
{
pp_quote (ppi);
pp_c_char (ppi, tree_low_cst (c, 0));
@@ -368,9 +332,7 @@ pp_c_character_literal (ppi, c)
/* Print out a BOOLEAN literal. */
static inline void
-pp_c_bool_literal (ppi, b)
- c_pretty_printer ppi;
- tree b;
+pp_c_bool_literal (c_pretty_printer ppi, tree b)
{
if (b == boolean_false_node || integer_zerop (b))
{
@@ -394,24 +356,22 @@ pp_c_bool_literal (ppi, b)
pp_unsupported_tree (ppi, b);
}
-/* Attempt to print out an ENUMERATOR. Return true on success. Else return
+/* Attempt to print out an ENUMERATOR. Return true on success. Else return
false; that means the value was obtained by a cast, in which case
print out the type-id part of the cast-expression -- the casted value
is then printed by pp_c_integer_literal. */
static bool
-pp_c_enumerator (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_enumerator (c_pretty_printer ppi, tree e)
{
tree type = TREE_TYPE (e);
tree value;
/* Find the name of this constant. */
- for (value = TYPE_VALUES (type);
+ for (value = TYPE_VALUES (type);
value != NULL_TREE && !tree_int_cst_equal (TREE_VALUE (value), e);
value = TREE_CHAIN (value))
;
-
+
if (value != NULL_TREE)
pp_c_tree_identifier (ppi, TREE_PURPOSE (value));
else
@@ -422,18 +382,16 @@ pp_c_enumerator (ppi, e)
pp_c_right_paren (ppi);
return false;
}
-
+
return true;
}
/* Print out an INTEGER constant value. */
static void
-pp_c_integer_literal (ppi, i)
- c_pretty_printer ppi;
- tree i;
+pp_c_integer_literal (c_pretty_printer ppi, tree i)
{
tree type = TREE_TYPE (i);
-
+
if (type == boolean_type_node)
pp_c_bool_literal (ppi, i);
else if (type == char_type_node)
@@ -453,7 +411,7 @@ pp_c_integer_literal (ppi, i)
i = build_int_2 (-TREE_INT_CST_LOW (i),
~TREE_INT_CST_HIGH (i) + !TREE_INT_CST_LOW (i));
sprintf (pp_buffer (ppi)->digit_buffer,
- HOST_WIDE_INT_PRINT_DOUBLE_HEX,
+ HOST_WIDE_INT_PRINT_DOUBLE_HEX,
TREE_INT_CST_HIGH (i), TREE_INT_CST_LOW (i));
pp_identifier (ppi, pp_buffer (ppi)->digit_buffer);
@@ -464,9 +422,7 @@ pp_c_integer_literal (ppi, i)
/* Print out a REAL value. */
static inline void
-pp_c_real_literal (ppi, r)
- c_pretty_printer ppi;
- tree r;
+pp_c_real_literal (c_pretty_printer ppi, tree r)
{
real_to_decimal (pp_buffer (ppi)->digit_buffer, &TREE_REAL_CST (r),
sizeof (pp_buffer (ppi)->digit_buffer), 0, 1);
@@ -475,23 +431,21 @@ pp_c_real_literal (ppi, r)
void
-pp_c_literal (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_literal (c_pretty_printer ppi, tree e)
{
switch (TREE_CODE (e))
{
case INTEGER_CST:
pp_c_integer_literal (ppi, e);
break;
-
+
case REAL_CST:
pp_c_real_literal (ppi, e);
break;
-
+
case STRING_CST:
pp_c_string_literal (ppi, e);
- break;
+ break;
default:
pp_unsupported_tree (ppi, e);
@@ -501,9 +455,7 @@ pp_c_literal (ppi, e)
/* Pretty-print a C primary-expression. */
static void
-pp_c_primary_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_primary_expression (c_pretty_printer ppi, tree e)
{
switch (TREE_CODE (e))
{
@@ -522,7 +474,7 @@ pp_c_primary_expression (ppi, e)
case ERROR_MARK:
pp_c_identifier (ppi, "<erroneous-expression>");
break;
-
+
case RESULT_DECL:
pp_c_identifier (ppi, "<return-value>");
break;
@@ -566,9 +518,7 @@ pp_c_primary_expression (ppi, e)
/* Print out a C initializer -- also support C compound-literals. */
void
-pp_c_initializer (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_initializer (c_pretty_printer ppi, tree e)
{
if (TREE_CODE (e) == CONSTRUCTOR)
{
@@ -587,9 +537,7 @@ pp_c_initializer (ppi, e)
}
static void
-pp_c_initializer_list (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_initializer_list (c_pretty_printer ppi, tree e)
{
tree type = TREE_TYPE (e);
const enum tree_code code = TREE_CODE (type);
@@ -624,9 +572,7 @@ pp_c_initializer_list (ppi, e)
}
void
-pp_c_postfix_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_postfix_expression (c_pretty_printer ppi, tree e)
{
enum tree_code code = TREE_CODE (e);
switch (code)
@@ -636,7 +582,7 @@ pp_c_postfix_expression (ppi, e)
pp_postfix_expression (ppi, TREE_OPERAND (e, 0));
pp_identifier (ppi, code == POSTINCREMENT_EXPR ? "++" : "--");
break;
-
+
case ARROW_EXPR:
pp_postfix_expression (ppi, TREE_OPERAND (e, 0));
pp_arrow (ppi);
@@ -658,7 +604,7 @@ pp_c_postfix_expression (ppi, e)
case ABS_EXPR:
case FFS_EXPR:
- pp_c_identifier (ppi,
+ pp_c_identifier (ppi,
code == ABS_EXPR ? "__builtin_abs" : "__builtin_ffs");
pp_c_left_paren (ppi);
pp_c_expression (ppi, TREE_OPERAND (e, 0));
@@ -689,7 +635,7 @@ pp_c_postfix_expression (ppi, e)
pp_type_id (ppi, TREE_TYPE (e));
pp_c_right_paren (ppi);
pp_left_brace (ppi);
-
+
if (code == COMPLEX_CST)
{
pp_c_expression (ppi, TREE_REALPART (e));
@@ -704,7 +650,7 @@ pp_c_postfix_expression (ppi, e)
pp_separate_with (ppi, ',');
pp_c_expression (ppi, TREE_OPERAND (e, 1));
}
-
+
pp_right_brace (ppi);
break;
@@ -714,7 +660,7 @@ pp_c_postfix_expression (ppi, e)
case CONSTRUCTOR:
pp_initializer (ppi, e);
break;
-
+
case VA_ARG_EXPR:
pp_c_identifier (ppi, "__builtin_va_arg");
pp_c_left_paren (ppi);
@@ -732,9 +678,7 @@ pp_c_postfix_expression (ppi, e)
/* Print out an expression-list; E is expected to be a TREE_LIST */
void
-pp_c_expression_list (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_expression_list (c_pretty_printer ppi, tree e)
{
for (; e != NULL_TREE; e = TREE_CHAIN (e))
{
@@ -745,9 +689,7 @@ pp_c_expression_list (ppi, e)
}
static void
-pp_c_unary_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_unary_expression (c_pretty_printer ppi, tree e)
{
enum tree_code code = TREE_CODE (e);
switch (code)
@@ -757,7 +699,7 @@ pp_c_unary_expression (ppi, e)
pp_identifier (ppi, code == PREINCREMENT_EXPR ? "++" : "--");
pp_c_unary_expression (ppi, TREE_OPERAND (e, 0));
break;
-
+
case ADDR_EXPR:
case INDIRECT_REF:
case CONVERT_EXPR:
@@ -798,7 +740,7 @@ pp_c_unary_expression (ppi, e)
pp_c_whitespace (ppi);
pp_unary_expression (ppi, TREE_OPERAND (e, 0));
break;
-
+
default:
pp_postfix_expression (ppi, e);
break;
@@ -806,9 +748,7 @@ pp_c_unary_expression (ppi, e)
}
void
-pp_c_cast_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_cast_expression (c_pretty_printer ppi, tree e)
{
if (TREE_CODE (e) == CONVERT_EXPR || TREE_CODE (e) == FLOAT_EXPR)
{
@@ -822,9 +762,7 @@ pp_c_cast_expression (ppi, e)
}
static void
-pp_c_multiplicative_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_multiplicative_expression (c_pretty_printer ppi, tree e)
{
enum tree_code code = TREE_CODE (e);
switch (code)
@@ -851,9 +789,7 @@ pp_c_multiplicative_expression (ppi, e)
}
static inline void
-pp_c_additive_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_additive_expression (c_pretty_printer ppi, tree e)
{
enum tree_code code = TREE_CODE (e);
switch (code)
@@ -877,9 +813,7 @@ pp_c_additive_expression (ppi, e)
}
static inline void
-pp_c_shift_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_shift_expression (c_pretty_printer ppi, tree e)
{
enum tree_code code = TREE_CODE (e);
switch (code)
@@ -899,9 +833,7 @@ pp_c_shift_expression (ppi, e)
}
static void
-pp_c_relational_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_relational_expression (c_pretty_printer ppi, tree e)
{
enum tree_code code = TREE_CODE (e);
switch (code)
@@ -931,9 +863,7 @@ pp_c_relational_expression (ppi, e)
}
static inline void
-pp_c_equality_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_equality_expression (c_pretty_printer ppi, tree e)
{
enum tree_code code = TREE_CODE (e);
switch (code)
@@ -945,8 +875,8 @@ pp_c_equality_expression (ppi, e)
pp_identifier (ppi, code == EQ_EXPR ? "==" : "!=");
pp_c_whitespace (ppi);
pp_c_relational_expression (ppi, TREE_OPERAND (e, 1));
- break;
-
+ break;
+
default:
pp_c_relational_expression (ppi, e);
break;
@@ -954,9 +884,7 @@ pp_c_equality_expression (ppi, e)
}
static inline void
-pp_c_and_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_and_expression (c_pretty_printer ppi, tree e)
{
if (TREE_CODE (e) == BIT_AND_EXPR)
{
@@ -971,9 +899,7 @@ pp_c_and_expression (ppi, e)
}
static inline void
-pp_c_exclusive_or_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_exclusive_or_expression (c_pretty_printer ppi, tree e)
{
if (TREE_CODE (e) == BIT_XOR_EXPR)
{
@@ -988,9 +914,7 @@ pp_c_exclusive_or_expression (ppi, e)
}
static inline void
-pp_c_inclusive_or_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_inclusive_or_expression (c_pretty_printer ppi, tree e)
{
if (TREE_CODE (e) == BIT_IOR_EXPR)
{
@@ -1005,9 +929,7 @@ pp_c_inclusive_or_expression (ppi, e)
}
static inline void
-pp_c_logical_and_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_logical_and_expression (c_pretty_printer ppi, tree e)
{
if (TREE_CODE (e) == TRUTH_ANDIF_EXPR)
{
@@ -1022,9 +944,7 @@ pp_c_logical_and_expression (ppi, e)
}
void
-pp_c_logical_or_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_logical_or_expression (c_pretty_printer ppi, tree e)
{
if (TREE_CODE (e) == TRUTH_ORIF_EXPR)
{
@@ -1039,9 +959,7 @@ pp_c_logical_or_expression (ppi, e)
}
static void
-pp_c_conditional_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_conditional_expression (c_pretty_printer ppi, tree e)
{
if (TREE_CODE (e) == COND_EXPR)
{
@@ -1062,9 +980,7 @@ pp_c_conditional_expression (ppi, e)
/* Pretty-print a C assignment-expression. */
static void
-pp_c_assignment_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_assignment_expression (c_pretty_printer ppi, tree e)
{
if (TREE_CODE (e) == MODIFY_EXPR || TREE_CODE (e) == INIT_EXPR)
{
@@ -1080,16 +996,14 @@ pp_c_assignment_expression (ppi, e)
/* Pretty-print an expression. */
void
-pp_c_expression (ppi, e)
- c_pretty_printer ppi;
- tree e;
+pp_c_expression (c_pretty_printer ppi, tree e)
{
switch (TREE_CODE (e))
{
case INTEGER_CST:
pp_c_integer_literal (ppi, e);
break;
-
+
case REAL_CST:
pp_c_real_literal (ppi, e);
break;
@@ -1097,7 +1011,7 @@ pp_c_expression (ppi, e)
case STRING_CST:
pp_c_string_literal (ppi, e);
break;
-
+
case FUNCTION_DECL:
case VAR_DECL:
case CONST_DECL:
@@ -1206,7 +1120,7 @@ pp_c_expression (ppi, e)
pp_assignment_expression (ppi, TREE_OPERAND (e, 1));
pp_c_right_paren (ppi);
break;
-
+
default:
pp_unsupported_tree (ppi, e);
@@ -1217,9 +1131,7 @@ pp_c_expression (ppi, e)
/* Statements. */
void
-pp_c_statement (ppi, stmt)
- c_pretty_printer ppi;
- tree stmt;
+pp_c_statement (c_pretty_printer ppi, tree stmt)
{
const enum tree_code code = TREE_CODE (stmt);
switch (code)
@@ -1262,7 +1174,7 @@ pp_c_statement (ppi, stmt)
case EXPR_STMT:
case CLEANUP_STMT:
pp_newline (ppi);
- pp_c_expression (ppi, code == EXPR_STMT
+ pp_c_expression (ppi, code == EXPR_STMT
? EXPR_STMT_EXPR (stmt)
: CLEANUP_EXPR (stmt));
pp_semicolon (ppi);
@@ -1346,7 +1258,7 @@ pp_c_statement (ppi, stmt)
pp_statement (ppi, FOR_BODY (stmt));
pp_newline_and_indent (ppi, -3);
break;
-
+
case BREAK_STMT:
case CONTINUE_STMT:
pp_newline (ppi);
@@ -1358,7 +1270,7 @@ pp_c_statement (ppi, stmt)
case RETURN_STMT:
case GOTO_STMT:
{
- tree e = code == RETURN_STMT
+ tree e = code == RETURN_STMT
? RETURN_STMT_EXPR (stmt)
: GOTO_DESTINATION (stmt);
@@ -1396,7 +1308,7 @@ pp_c_statement (ppi, stmt)
case ASM_STMT:
{
bool has_volatile_p = ASM_VOLATILE_P (stmt);
- bool is_extended = has_volatile_p || ASM_INPUTS (stmt)
+ bool is_extended = has_volatile_p || ASM_INPUTS (stmt)
|| ASM_OUTPUTS (stmt) || ASM_CLOBBERS (stmt);
pp_c_identifier (ppi, is_extended ? "__asm__" : "asm");
if (has_volatile_p)
@@ -1443,8 +1355,7 @@ pp_c_statement (ppi, stmt)
/* Initialize the PRETTY-PRINTER for handling C codes. */
void
-pp_c_pretty_printer_init (pp)
- c_pretty_printer pp;
+pp_c_pretty_printer_init (c_pretty_printer pp)
{
pp->offset_list = 0;
diff --git a/gcc/c-pretty-print.h b/gcc/c-pretty-print.h
index 3bdd6fec4a7..95cd4eff198 100644
--- a/gcc/c-pretty-print.h
+++ b/gcc/c-pretty-print.h
@@ -1,5 +1,5 @@
/* Various declarations for the C and C++ pretty-printers.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
This file is part of GCC.
@@ -32,7 +32,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
typedef struct c_pretty_print_info *c_pretty_printer;
/* The type of a C pretty-printer 'member' function. */
-typedef void (*c_pretty_print_fn) PARAMS ((c_pretty_printer, tree));
+typedef void (*c_pretty_print_fn) (c_pretty_printer, tree);
struct c_pretty_print_info
{
@@ -144,22 +144,22 @@ struct c_pretty_print_info
macro must be overridden by any subclass of c_pretty_print_info. */
#define pp_c_base(PP) (PP)
-extern void pp_c_pretty_printer_init PARAMS ((c_pretty_printer));
+extern void pp_c_pretty_printer_init (c_pretty_printer);
/* Declarations. */
-void pp_c_attributes PARAMS ((c_pretty_printer, tree));
-void pp_c_cv_qualifier PARAMS ((c_pretty_printer, int));
-void pp_c_parameter_declaration_clause PARAMS ((c_pretty_printer, tree));
-void pp_c_declaration PARAMS ((c_pretty_printer, tree));
+void pp_c_attributes (c_pretty_printer, tree);
+void pp_c_cv_qualifier (c_pretty_printer, int);
+void pp_c_parameter_declaration_clause (c_pretty_printer, tree);
+void pp_c_declaration (c_pretty_printer, tree);
/* Statements. */
-void pp_c_statement PARAMS ((c_pretty_printer, tree));
+void pp_c_statement (c_pretty_printer, tree);
/* Expressions. */
-void pp_c_expression PARAMS ((c_pretty_printer, tree));
-void pp_c_logical_or_expression PARAMS ((c_pretty_printer, tree));
-void pp_c_expression_list PARAMS ((c_pretty_printer, tree));
-void pp_c_cast_expression PARAMS ((c_pretty_printer, tree));
-void pp_c_postfix_expression PARAMS ((c_pretty_printer, tree));
-void pp_c_initializer PARAMS ((c_pretty_printer, tree));
-void pp_c_literal PARAMS ((c_pretty_printer, tree));
+void pp_c_expression (c_pretty_printer, tree);
+void pp_c_logical_or_expression (c_pretty_printer, tree);
+void pp_c_expression_list (c_pretty_printer, tree);
+void pp_c_cast_expression (c_pretty_printer, tree);
+void pp_c_postfix_expression (c_pretty_printer, tree);
+void pp_c_initializer (c_pretty_printer, tree);
+void pp_c_literal (c_pretty_printer, tree);
#endif /* GCC_C_PRETTY_PRINTER */
diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c
index 374e9f13dec..e75caa70101 100644
--- a/gcc/c-semantics.c
+++ b/gcc/c-semantics.c
@@ -1,6 +1,6 @@
/* This file contains the definitions and documentation for the common
tree codes used in the GNU C and C++ compilers (see c-common.def
- for the standard codes).
+ for the standard codes).
Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Written by Benjamin Chelf (chelf@codesourcery.com).
@@ -43,26 +43,25 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* If non-NULL, the address of a language-specific function for
expanding statements. */
-void (*lang_expand_stmt) PARAMS ((tree));
+void (*lang_expand_stmt) (tree);
/* If non-NULL, the address of a language-specific function for
expanding a DECL_STMT. After the language-independent cases are
handled, this function will be called. If this function is not
defined, it is assumed that declarations other than those for
variables and labels do not require any RTL generation. */
-void (*lang_expand_decl_stmt) PARAMS ((tree));
+void (*lang_expand_decl_stmt) (tree);
-static tree find_reachable_label_1 PARAMS ((tree *, int *, void *));
-static tree find_reachable_label PARAMS ((tree));
-static bool expand_unreachable_if_stmt PARAMS ((tree));
-static tree expand_unreachable_stmt PARAMS ((tree, int));
-static void genrtl_do_stmt_1 PARAMS ((tree, tree));
+static tree find_reachable_label_1 (tree *, int *, void *);
+static tree find_reachable_label (tree);
+static bool expand_unreachable_if_stmt (tree);
+static tree expand_unreachable_stmt (tree, int);
+static void genrtl_do_stmt_1 (tree, tree);
/* Create an empty statement tree rooted at T. */
void
-begin_stmt_tree (t)
- tree *t;
+begin_stmt_tree (tree *t)
{
/* We create a trivial EXPR_STMT so that last_tree is never NULL in
what follows. We remove the extraneous statement in
@@ -76,8 +75,7 @@ begin_stmt_tree (t)
/* T is a statement. Add it to the statement-tree. */
tree
-add_stmt (t)
- tree t;
+add_stmt (tree t)
{
if (input_filename != last_expr_filename)
{
@@ -95,7 +93,7 @@ add_stmt (t)
/* Add T to the statement-tree. */
TREE_CHAIN (last_tree) = t;
last_tree = t;
-
+
/* When we expand a statement-tree, we must know whether or not the
statements are full-expressions. We record that fact here. */
STMT_IS_FULL_EXPR_P (last_tree) = stmts_are_full_exprs_p ();
@@ -111,14 +109,13 @@ add_stmt (t)
DECL. */
void
-add_decl_stmt (decl)
- tree decl;
+add_decl_stmt (tree decl)
{
tree decl_stmt;
/* We need the type to last until instantiation time. */
decl_stmt = build_stmt (DECL_STMT, decl);
- add_stmt (decl_stmt);
+ add_stmt (decl_stmt);
}
/* Add a scope-statement to the statement-tree. BEGIN_P indicates
@@ -132,9 +129,7 @@ add_decl_stmt (decl)
SCOPE_BEGIN_P set. */
tree
-add_scope_stmt (begin_p, partial_p)
- int begin_p;
- int partial_p;
+add_scope_stmt (int begin_p, int partial_p)
{
tree *stack_ptr = current_scope_stmt_stack ();
tree ss;
@@ -168,11 +163,10 @@ add_scope_stmt (begin_p, partial_p)
/* Finish the statement tree rooted at T. */
void
-finish_stmt_tree (t)
- tree *t;
+finish_stmt_tree (tree *t)
{
tree stmt;
-
+
/* Remove the fake extra statement added in begin_stmt_tree. */
stmt = TREE_CHAIN (*t);
*t = stmt;
@@ -200,7 +194,7 @@ build_stmt (enum tree_code code, ...)
int length;
int i;
va_list p;
-
+
va_start (p, code);
t = make_node (code);
@@ -220,23 +214,21 @@ build_stmt (enum tree_code code, ...)
as the condition is returned. Otherwise, T itself is returned. */
tree
-expand_cond (t)
- tree t;
+expand_cond (tree t)
{
if (t && TREE_CODE (t) == TREE_LIST)
{
expand_stmt (TREE_PURPOSE (t));
return TREE_VALUE (t);
}
- else
+ else
return t;
}
/* Create RTL for the local static variable DECL. */
void
-make_rtl_for_local_static (decl)
- tree decl;
+make_rtl_for_local_static (tree decl)
{
const char *asmspec = NULL;
@@ -271,8 +263,7 @@ make_rtl_for_local_static (decl)
/* Let the back-end know about DECL. */
void
-emit_local_var (decl)
- tree decl;
+emit_local_var (tree decl)
{
/* Create RTL for this variable. */
if (!DECL_RTL_SET_P (decl))
@@ -303,7 +294,7 @@ emit_local_var (decl)
/* Helper for generating the RTL at the beginning of a scope. */
void
-genrtl_do_pushlevel ()
+genrtl_do_pushlevel (void)
{
emit_line_note (input_filename, input_line);
clear_last_expr ();
@@ -312,23 +303,22 @@ genrtl_do_pushlevel ()
/* Generate the RTL for DESTINATION, which is a GOTO_STMT. */
void
-genrtl_goto_stmt (destination)
- tree destination;
+genrtl_goto_stmt (tree destination)
{
if (TREE_CODE (destination) == IDENTIFIER_NODE)
abort ();
-
+
/* We warn about unused labels with -Wunused. That means we have to
mark the used labels as used. */
if (TREE_CODE (destination) == LABEL_DECL)
TREE_USED (destination) = 1;
-
+
emit_line_note (input_filename, input_line);
-
+
if (TREE_CODE (destination) == LABEL_DECL)
{
label_rtx (destination);
- expand_goto (destination);
+ expand_goto (destination);
}
else
expand_computed_goto (destination);
@@ -339,8 +329,7 @@ genrtl_goto_stmt (destination)
used for new code. */
void
-genrtl_expr_stmt (expr)
- tree expr;
+genrtl_expr_stmt (tree expr)
{
genrtl_expr_stmt_value (expr, -1, 1);
}
@@ -352,21 +341,19 @@ genrtl_expr_stmt (expr)
MAYBE_LAST is nonzero if this EXPR_STMT might be the last statement
in expression statement. */
-void
-genrtl_expr_stmt_value (expr, want_value, maybe_last)
- tree expr;
- int want_value, maybe_last;
+void
+genrtl_expr_stmt_value (tree expr, int want_value, int maybe_last)
{
if (expr != NULL_TREE)
{
emit_line_note (input_filename, input_line);
-
+
if (stmts_are_full_exprs_p ())
expand_start_target_temps ();
-
+
if (expr != error_mark_node)
expand_expr_stmt_value (expr, want_value, maybe_last);
-
+
if (stmts_are_full_exprs_p ())
expand_end_target_temps ();
}
@@ -375,8 +362,7 @@ genrtl_expr_stmt_value (expr, want_value, maybe_last)
/* Generate the RTL for T, which is a DECL_STMT. */
void
-genrtl_decl_stmt (t)
- tree t;
+genrtl_decl_stmt (tree t)
{
tree decl;
emit_line_note (input_filename, input_line);
@@ -387,7 +373,7 @@ genrtl_decl_stmt (t)
`extern'). We don't have to handle the initialization
of those objects here; they can only be declarations,
rather than definitions. */
- if (TREE_CODE (decl) == VAR_DECL
+ if (TREE_CODE (decl) == VAR_DECL
&& !TREE_STATIC (decl)
&& !DECL_EXTERNAL (decl))
{
@@ -395,12 +381,12 @@ genrtl_decl_stmt (t)
if (!anon_aggr_type_p (TREE_TYPE (decl)))
emit_local_var (decl);
else
- expand_anon_union_decl (decl, NULL_TREE,
+ expand_anon_union_decl (decl, NULL_TREE,
DECL_ANON_UNION_ELEMS (decl));
}
else if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
make_rtl_for_local_static (decl);
- else if (TREE_CODE (decl) == LABEL_DECL
+ else if (TREE_CODE (decl) == LABEL_DECL
&& C_DECLARED_LABEL_FLAG (decl))
declare_nonlocal_label (decl);
else if (lang_expand_decl_stmt)
@@ -410,8 +396,7 @@ genrtl_decl_stmt (t)
/* Generate the RTL for T, which is an IF_STMT. */
void
-genrtl_if_stmt (t)
- tree t;
+genrtl_if_stmt (tree t)
{
tree cond;
genrtl_do_pushlevel ();
@@ -421,7 +406,7 @@ genrtl_if_stmt (t)
if (THEN_CLAUSE (t))
{
tree nextt = THEN_CLAUSE (t);
-
+
if (cond && integer_zerop (cond))
nextt = expand_unreachable_stmt (nextt, warn_notreached);
expand_stmt (nextt);
@@ -441,14 +426,13 @@ genrtl_if_stmt (t)
/* Generate the RTL for T, which is a WHILE_STMT. */
void
-genrtl_while_stmt (t)
- tree t;
+genrtl_while_stmt (tree t)
{
tree cond = WHILE_COND (t);
emit_nop ();
emit_line_note (input_filename, input_line);
- expand_start_loop (1);
+ expand_start_loop (1);
genrtl_do_pushlevel ();
if (cond && !integer_nonzerop (cond))
@@ -458,7 +442,7 @@ genrtl_while_stmt (t)
expand_exit_loop_top_cond (0, cond);
genrtl_do_pushlevel ();
}
-
+
expand_stmt (WHILE_BODY (t));
expand_end_loop ();
@@ -468,8 +452,7 @@ genrtl_while_stmt (t)
body. This is reused for expanding unreachable WHILE_STMTS. */
static void
-genrtl_do_stmt_1 (cond, body)
- tree cond, body;
+genrtl_do_stmt_1 (tree cond, tree body)
{
/* Recognize the common special-case of do { ... } while (0) and do
not emit the loop widgetry in this case. In particular this
@@ -512,8 +495,7 @@ genrtl_do_stmt_1 (cond, body)
/* Generate the RTL for T, which is a DO_STMT. */
void
-genrtl_do_stmt (t)
- tree t;
+genrtl_do_stmt (tree t)
{
genrtl_do_stmt_1 (DO_COND (t), DO_BODY (t));
}
@@ -521,8 +503,7 @@ genrtl_do_stmt (t)
/* Build the node for a return statement and return it. */
tree
-build_return_stmt (expr)
- tree expr;
+build_return_stmt (tree expr)
{
return (build_stmt (RETURN_STMT, expr));
}
@@ -530,8 +511,7 @@ build_return_stmt (expr)
/* Generate the RTL for STMT, which is a RETURN_STMT. */
void
-genrtl_return_stmt (stmt)
- tree stmt;
+genrtl_return_stmt (tree stmt)
{
tree expr;
@@ -551,8 +531,7 @@ genrtl_return_stmt (stmt)
/* Generate the RTL for T, which is a FOR_STMT. */
void
-genrtl_for_stmt (t)
- tree t;
+genrtl_for_stmt (tree t)
{
tree cond = FOR_COND (t);
location_t saved_loc;
@@ -566,7 +545,7 @@ genrtl_for_stmt (t)
emit_nop ();
emit_line_note (input_filename, input_line);
if (FOR_EXPR (t))
- expand_start_loop_continue_elsewhere (1);
+ expand_start_loop_continue_elsewhere (1);
else
expand_start_loop (1);
genrtl_do_pushlevel ();
@@ -601,7 +580,7 @@ genrtl_for_stmt (t)
/* Build a break statement node and return it. */
tree
-build_break_stmt ()
+build_break_stmt (void)
{
return (build_stmt (BREAK_STMT));
}
@@ -609,7 +588,7 @@ build_break_stmt ()
/* Generate the RTL for a BREAK_STMT. */
void
-genrtl_break_stmt ()
+genrtl_break_stmt (void)
{
emit_line_note (input_filename, input_line);
if ( ! expand_exit_something ())
@@ -619,7 +598,7 @@ genrtl_break_stmt ()
/* Build a continue statement node and return it. */
tree
-build_continue_stmt ()
+build_continue_stmt (void)
{
return (build_stmt (CONTINUE_STMT));
}
@@ -627,18 +606,17 @@ build_continue_stmt ()
/* Generate the RTL for a CONTINUE_STMT. */
void
-genrtl_continue_stmt ()
+genrtl_continue_stmt (void)
{
emit_line_note (input_filename, input_line);
if (! expand_continue_loop (0))
- error ("continue statement not within a loop");
+ error ("continue statement not within a loop");
}
/* Generate the RTL for T, which is a SCOPE_STMT. */
void
-genrtl_scope_stmt (t)
- tree t;
+genrtl_scope_stmt (tree t)
{
tree block = SCOPE_STMT_BLOCK (t);
@@ -651,10 +629,8 @@ genrtl_scope_stmt (t)
}
else if (!SCOPE_NULLIFIED_P (t))
{
- rtx note = emit_note (NULL,
- (SCOPE_BEGIN_P (t)
- ? NOTE_INSN_BLOCK_BEG
- : NOTE_INSN_BLOCK_END));
+ rtx note = emit_note (SCOPE_BEGIN_P (t)
+ ? NOTE_INSN_BLOCK_BEG : NOTE_INSN_BLOCK_END);
NOTE_BLOCK (note) = block;
}
@@ -666,7 +642,7 @@ genrtl_scope_stmt (t)
for (fn = BLOCK_VARS (block); fn; fn = TREE_CHAIN (fn))
{
- if (TREE_CODE (fn) == FUNCTION_DECL
+ if (TREE_CODE (fn) == FUNCTION_DECL
&& DECL_CONTEXT (fn) == current_function_decl
&& DECL_SAVED_INSNS (fn)
&& !TREE_ASM_WRITTEN (fn)
@@ -683,12 +659,11 @@ genrtl_scope_stmt (t)
/* Generate the RTL for T, which is a SWITCH_STMT. */
void
-genrtl_switch_stmt (t)
- tree t;
+genrtl_switch_stmt (tree t)
{
tree cond;
genrtl_do_pushlevel ();
-
+
cond = expand_cond (SWITCH_COND (t));
if (cond == error_mark_node)
/* The code is in error, but we don't want expand_end_case to
@@ -704,10 +679,7 @@ genrtl_switch_stmt (t)
/* Create a CASE_LABEL tree node and return it. */
tree
-build_case_label (low_value, high_value, label_decl)
- tree low_value;
- tree high_value;
- tree label_decl;
+build_case_label (tree low_value, tree high_value, tree label_decl)
{
return build_stmt (CASE_LABEL, low_value, high_value, label_decl);
}
@@ -715,9 +687,8 @@ build_case_label (low_value, high_value, label_decl)
/* Generate the RTL for a CASE_LABEL. */
-void
-genrtl_case_label (case_label)
- tree case_label;
+void
+genrtl_case_label (tree case_label)
{
tree duplicate;
tree cleanup;
@@ -735,15 +706,14 @@ genrtl_case_label (case_label)
}
}
- add_case_node (CASE_LOW (case_label), CASE_HIGH (case_label),
+ add_case_node (CASE_LOW (case_label), CASE_HIGH (case_label),
CASE_LABEL_DECL (case_label), &duplicate);
}
/* Generate the RTL for T, which is a COMPOUND_STMT. */
void
-genrtl_compound_stmt (t)
- tree t;
+genrtl_compound_stmt (tree t)
{
#ifdef ENABLE_CHECKING
struct nesting *n = current_nesting_level ();
@@ -761,14 +731,8 @@ genrtl_compound_stmt (t)
/* Generate the RTL for an ASM_STMT. */
void
-genrtl_asm_stmt (cv_qualifier, string, output_operands,
- input_operands, clobbers, asm_input_p)
- tree cv_qualifier;
- tree string;
- tree output_operands;
- tree input_operands;
- tree clobbers;
- int asm_input_p;
+genrtl_asm_stmt (tree cv_qualifier, tree string, tree output_operands,
+ tree input_operands, tree clobbers, int asm_input_p)
{
if (cv_qualifier != NULL_TREE
&& cv_qualifier != ridpointers[(int) RID_VOLATILE])
@@ -782,16 +746,15 @@ genrtl_asm_stmt (cv_qualifier, string, output_operands,
if (asm_input_p)
expand_asm (string, cv_qualifier != NULL_TREE);
else
- c_expand_asm_operands (string, output_operands, input_operands,
+ c_expand_asm_operands (string, output_operands, input_operands,
clobbers, cv_qualifier != NULL_TREE,
input_filename, input_line);
}
/* Generate the RTL for a CLEANUP_STMT. */
-void
-genrtl_cleanup_stmt (t)
- tree t;
+void
+genrtl_cleanup_stmt (tree t)
{
tree decl = CLEANUP_DECL (t);
if (!decl || (DECL_SIZE (decl) && TREE_TYPE (decl) != error_mark_node))
@@ -802,8 +765,7 @@ genrtl_cleanup_stmt (t)
for the substitution. */
void
-prep_stmt (t)
- tree t;
+prep_stmt (tree t)
{
if (!STMT_LINENO_FOR_FN_P (t))
input_line = STMT_LINENO (t);
@@ -814,8 +776,7 @@ prep_stmt (t)
other statements at its nesting level. */
void
-expand_stmt (t)
- tree t;
+expand_stmt (tree t)
{
while (t && t != error_mark_node)
{
@@ -895,7 +856,7 @@ expand_stmt (t)
&& TREE_CODE (GOTO_DESTINATION (t)) == LABEL_DECL
&& flag_guess_branch_prob)
{
- rtx note = emit_note (NULL, NOTE_INSN_PREDICTION);
+ rtx note = emit_note (NOTE_INSN_PREDICTION);
NOTE_PREDICTION (note) = NOTE_PREDICT (PRED_GOTO, NOT_TAKEN);
}
@@ -920,7 +881,7 @@ expand_stmt (t)
default:
if (lang_expand_stmt)
(*lang_expand_stmt) (t);
- else
+ else
abort ();
break;
}
@@ -938,10 +899,8 @@ expand_stmt (t)
/* If *TP is a potentially reachable label, return nonzero. */
static tree
-find_reachable_label_1 (tp, walk_subtrees, data)
- tree *tp;
- int *walk_subtrees ATTRIBUTE_UNUSED;
- void *data ATTRIBUTE_UNUSED;
+find_reachable_label_1 (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED)
{
switch (TREE_CODE (*tp))
{
@@ -958,8 +917,7 @@ find_reachable_label_1 (tp, walk_subtrees, data)
/* Determine whether expression EXP contains a potentially
reachable label. */
static tree
-find_reachable_label (exp)
- tree exp;
+find_reachable_label (tree exp)
{
location_t saved_loc = input_location;
tree ret = walk_tree (&exp, find_reachable_label_1, NULL, NULL);
@@ -970,11 +928,10 @@ find_reachable_label (exp)
/* Expand an unreachable if statement, T. This function returns
true if the IF_STMT contains a potentially reachable code_label. */
static bool
-expand_unreachable_if_stmt (t)
- tree t;
+expand_unreachable_if_stmt (tree t)
{
tree n;
-
+
if (find_reachable_label (IF_COND (t)) != NULL_TREE)
{
genrtl_if_stmt (t);
@@ -984,7 +941,7 @@ expand_unreachable_if_stmt (t)
if (THEN_CLAUSE (t) && ELSE_CLAUSE (t))
{
n = expand_unreachable_stmt (THEN_CLAUSE (t), 0);
-
+
if (n != NULL_TREE)
{
rtx label;
@@ -1004,9 +961,9 @@ expand_unreachable_if_stmt (t)
n = expand_unreachable_stmt (ELSE_CLAUSE (t), 0);
else
n = NULL_TREE;
-
+
expand_stmt (n);
-
+
return n != NULL_TREE;
}
@@ -1015,9 +972,7 @@ expand_unreachable_if_stmt (t)
then returns the label (or, in same cases, the statement after
one containing the label). */
static tree
-expand_unreachable_stmt (t, warn)
- tree t;
- int warn;
+expand_unreachable_stmt (tree t, int warn)
{
int saved;
@@ -1102,4 +1057,3 @@ expand_unreachable_stmt (t, warn)
}
return NULL_TREE;
}
-
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index 368c970557e..bd3e22eb48c 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -153,91 +153,88 @@ struct lang_type GTY(())
/* in c-lang.c and objc-act.c */
-extern tree lookup_interface PARAMS ((tree));
-extern tree is_class_name PARAMS ((tree));
-extern tree objc_is_id PARAMS ((tree));
-extern void objc_check_decl PARAMS ((tree));
-extern void finish_file PARAMS ((void));
-extern int objc_comptypes PARAMS ((tree, tree, int));
-extern tree objc_message_selector PARAMS ((void));
-extern tree lookup_objc_ivar PARAMS ((tree));
-extern void c_expand_body PARAMS ((tree));
+extern tree lookup_interface (tree);
+extern tree is_class_name (tree);
+extern tree objc_is_id (tree);
+extern void objc_check_decl (tree);
+extern void finish_file (void);
+extern int objc_comptypes (tree, tree, int);
+extern tree objc_message_selector (void);
+extern tree lookup_objc_ivar (tree);
+extern void c_expand_body (tree);
/* in c-parse.in */
-extern void c_parse_init PARAMS ((void));
+extern void c_parse_init (void);
/* in c-aux-info.c */
-extern void gen_aux_info_record PARAMS ((tree, int, int, int));
+extern void gen_aux_info_record (tree, int, int, int);
/* in c-decl.c */
-extern int global_bindings_p PARAMS ((void));
-extern int kept_level_p PARAMS ((void));
-extern tree getdecls PARAMS ((void));
-extern void pushlevel PARAMS ((int));
-extern tree poplevel PARAMS ((int,int, int));
-extern void insert_block PARAMS ((tree));
-extern void set_block PARAMS ((tree));
-extern tree pushdecl PARAMS ((tree));
-
-extern void c_insert_default_attributes PARAMS ((tree));
-extern void c_init_decl_processing PARAMS ((void));
-extern void c_dup_lang_specific_decl PARAMS ((tree));
-extern void c_print_identifier PARAMS ((FILE *, tree, int));
-extern tree build_array_declarator PARAMS ((tree, tree, int, int));
-extern tree build_enumerator PARAMS ((tree, tree));
-extern void check_for_loop_decls PARAMS ((void));
-extern void clear_parm_order PARAMS ((void));
-extern int complete_array_type PARAMS ((tree, tree, int));
-extern void declare_parm_level PARAMS ((int));
-extern tree define_label PARAMS ((const char *, int,
- tree));
-extern void finish_decl PARAMS ((tree, tree, tree));
-extern tree finish_enum PARAMS ((tree, tree, tree));
-extern void finish_function PARAMS ((int, int));
-extern tree finish_struct PARAMS ((tree, tree, tree));
-extern tree get_parm_info PARAMS ((int));
-extern tree grokfield PARAMS ((const char *, int, tree, tree, tree));
-extern tree groktypename PARAMS ((tree));
-extern tree groktypename_in_parm_context PARAMS ((tree));
-extern tree implicitly_declare PARAMS ((tree));
-extern int in_parm_level_p PARAMS ((void));
-extern void keep_next_level PARAMS ((void));
-extern tree lookup_name PARAMS ((tree));
-extern void parmlist_tags_warning PARAMS ((void));
-extern void pending_xref_error PARAMS ((void));
-extern void c_push_function_context PARAMS ((struct function *));
-extern void c_pop_function_context PARAMS ((struct function *));
-extern void pop_label_level PARAMS ((void));
-extern void push_label_level PARAMS ((void));
-extern void push_parm_decl PARAMS ((tree));
-extern tree pushdecl_top_level PARAMS ((tree));
-extern tree pushdecl_function_level PARAMS ((tree, tree));
-extern void pushtag PARAMS ((tree, tree));
-extern tree set_array_declarator_type PARAMS ((tree, tree, int));
-extern tree shadow_label PARAMS ((tree));
-extern void shadow_tag PARAMS ((tree));
-extern void shadow_tag_warned PARAMS ((tree, int));
-extern tree start_enum PARAMS ((tree));
-extern int start_function PARAMS ((tree, tree, tree));
-extern tree start_decl PARAMS ((tree, tree, int,
- tree));
-extern tree start_struct PARAMS ((enum tree_code, tree));
-extern void store_parm_decls PARAMS ((void));
-extern tree xref_tag PARAMS ((enum tree_code, tree));
-extern tree c_begin_compound_stmt PARAMS ((void));
-extern void c_expand_deferred_function PARAMS ((tree));
-extern void c_expand_decl_stmt PARAMS ((tree));
-extern tree make_pointer_declarator PARAMS ((tree, tree));
+extern int global_bindings_p (void);
+extern int kept_level_p (void);
+extern tree getdecls (void);
+extern void pushlevel (int);
+extern void insert_block (tree);
+extern void set_block (tree);
+extern tree pushdecl (tree);
+
+extern void c_insert_default_attributes (tree);
+extern void c_init_decl_processing (void);
+extern void c_dup_lang_specific_decl (tree);
+extern void c_print_identifier (FILE *, tree, int);
+extern tree build_array_declarator (tree, tree, int, int);
+extern tree build_enumerator (tree, tree);
+extern void check_for_loop_decls (void);
+extern void clear_parm_order (void);
+extern int complete_array_type (tree, tree, int);
+extern void declare_parm_level (int);
+extern tree define_label (const char *, int, tree);
+extern void finish_decl (tree, tree, tree);
+extern tree finish_enum (tree, tree, tree);
+extern void finish_function (int, int);
+extern tree finish_struct (tree, tree, tree);
+extern tree get_parm_info (int);
+extern tree grokfield (tree, tree, tree);
+extern tree groktypename (tree);
+extern tree groktypename_in_parm_context (tree);
+extern tree implicitly_declare (tree);
+extern int in_parm_level_p (void);
+extern void keep_next_level (void);
+extern tree lookup_name (tree);
+extern void parmlist_tags_warning (void);
+extern void pending_xref_error (void);
+extern void c_push_function_context (struct function *);
+extern void c_pop_function_context (struct function *);
+extern void pop_label_level (void);
+extern void push_label_level (void);
+extern void push_parm_decl (tree);
+extern tree pushdecl_top_level (tree);
+extern tree pushdecl_function_level (tree, tree);
+extern void pushtag (tree, tree);
+extern tree set_array_declarator_type (tree, tree, int);
+extern tree shadow_label (tree);
+extern void shadow_tag (tree);
+extern void shadow_tag_warned (tree, int);
+extern tree start_enum (tree);
+extern int start_function (tree, tree, tree);
+extern tree start_decl (tree, tree, int, tree);
+extern tree start_struct (enum tree_code, tree);
+extern void store_parm_decls (void);
+extern tree xref_tag (enum tree_code, tree);
+extern tree c_begin_compound_stmt (void);
+extern void c_expand_deferred_function (tree);
+extern void c_expand_decl_stmt (tree);
+extern tree make_pointer_declarator (tree, tree);
/* in c-objc-common.c */
-extern int c_disregard_inline_limits PARAMS ((tree));
-extern int c_cannot_inline_tree_fn PARAMS ((tree *));
-extern bool c_objc_common_init PARAMS ((void));
-extern int c_missing_noreturn_ok_p PARAMS ((tree));
-extern void c_objc_common_finish_file PARAMS ((void));
-extern int defer_fn PARAMS ((tree));
-extern bool c_warn_unused_global_decl PARAMS ((tree));
+extern int c_disregard_inline_limits (tree);
+extern int c_cannot_inline_tree_fn (tree *);
+extern bool c_objc_common_init (void);
+extern int c_missing_noreturn_ok_p (tree);
+extern void c_objc_common_finish_file (void);
+extern int defer_fn (tree);
+extern bool c_warn_unused_global_decl (tree);
#define c_build_type_variant(TYPE, CONST_P, VOLATILE_P) \
c_build_qualified_type ((TYPE), \
@@ -246,46 +243,42 @@ extern bool c_warn_unused_global_decl PARAMS ((tree));
#define c_sizeof_nowarn(T) c_sizeof_or_alignof_type (T, SIZEOF_EXPR, 0)
/* in c-typeck.c */
-extern tree require_complete_type PARAMS ((tree));
-extern int comptypes PARAMS ((tree, tree));
-extern tree c_size_in_bytes PARAMS ((tree));
-extern bool c_mark_addressable PARAMS ((tree));
-extern void c_incomplete_type_error PARAMS ((tree, tree));
-extern tree c_type_promotes_to PARAMS ((tree));
-extern tree build_component_ref PARAMS ((tree, tree));
-extern tree build_indirect_ref PARAMS ((tree, const char *));
-extern tree build_array_ref PARAMS ((tree, tree));
-extern tree build_external_ref PARAMS ((tree, int));
-extern tree parser_build_binary_op PARAMS ((enum tree_code,
- tree, tree));
-extern int c_tree_expr_nonnegative_p PARAMS ((tree));
-extern void readonly_warning PARAMS ((tree, const char *));
-extern tree build_conditional_expr PARAMS ((tree, tree, tree));
-extern tree build_compound_expr PARAMS ((tree));
-extern tree c_cast_expr PARAMS ((tree, tree));
-extern tree build_c_cast PARAMS ((tree, tree));
-extern tree build_modify_expr PARAMS ((tree, enum tree_code,
- tree));
-extern void store_init_value PARAMS ((tree, tree));
-extern void error_init PARAMS ((const char *));
-extern void pedwarn_init PARAMS ((const char *));
-extern void start_init PARAMS ((tree, tree, int));
-extern void finish_init PARAMS ((void));
-extern void really_start_incremental_init PARAMS ((tree));
-extern void push_init_level PARAMS ((int));
-extern tree pop_init_level PARAMS ((int));
-extern void set_init_index PARAMS ((tree, tree));
-extern void set_init_label PARAMS ((tree));
-extern void process_init_element PARAMS ((tree));
-extern tree build_compound_literal PARAMS ((tree, tree));
-extern void pedwarn_c99 PARAMS ((const char *, ...))
- ATTRIBUTE_PRINTF_1;
-extern tree c_start_case PARAMS ((tree));
-extern void c_finish_case PARAMS ((void));
-extern tree simple_asm_stmt PARAMS ((tree));
-extern tree build_asm_stmt PARAMS ((tree, tree, tree,
- tree, tree));
-extern tree c_convert_parm_for_inlining PARAMS ((tree, tree, tree));
+extern tree require_complete_type (tree);
+extern int comptypes (tree, tree);
+extern tree c_size_in_bytes (tree);
+extern bool c_mark_addressable (tree);
+extern void c_incomplete_type_error (tree, tree);
+extern tree c_type_promotes_to (tree);
+extern tree build_component_ref (tree, tree);
+extern tree build_indirect_ref (tree, const char *);
+extern tree build_array_ref (tree, tree);
+extern tree build_external_ref (tree, int);
+extern tree parser_build_binary_op (enum tree_code, tree, tree);
+extern int c_tree_expr_nonnegative_p (tree);
+extern void readonly_warning (tree, const char *);
+extern tree build_conditional_expr (tree, tree, tree);
+extern tree build_compound_expr (tree);
+extern tree c_cast_expr (tree, tree);
+extern tree build_c_cast (tree, tree);
+extern tree build_modify_expr (tree, enum tree_code, tree);
+extern void store_init_value (tree, tree);
+extern void error_init (const char *);
+extern void pedwarn_init (const char *);
+extern void start_init (tree, tree, int);
+extern void finish_init (void);
+extern void really_start_incremental_init (tree);
+extern void push_init_level (int);
+extern tree pop_init_level (int);
+extern void set_init_index (tree, tree);
+extern void set_init_label (tree);
+extern void process_init_element (tree);
+extern tree build_compound_literal (tree, tree);
+extern void pedwarn_c99 (const char *, ...) ATTRIBUTE_PRINTF_1;
+extern tree c_start_case (tree);
+extern void c_finish_case (void);
+extern tree simple_asm_stmt (tree);
+extern tree build_asm_stmt (tree, tree, tree, tree, tree);
+extern tree c_convert_parm_for_inlining (tree, tree, tree);
/* Set to 0 at beginning of a function definition, set to 1 if
a return statement that specifies a return value is seen. */
@@ -307,7 +300,7 @@ extern int current_function_returns_abnormally;
extern int system_header_p;
/* In c-decl.c */
-extern void c_finish_incomplete_decl PARAMS ((tree));
+extern void c_finish_incomplete_decl (tree);
extern GTY(()) tree static_ctors;
extern GTY(()) tree static_dtors;
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 8d6ed0be9fd..4bb171f6609 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -90,8 +90,7 @@ static tree find_init_member PARAMS ((tree));
does not have an incomplete type. (That includes void types.) */
tree
-require_complete_type (value)
- tree value;
+require_complete_type (tree value)
{
tree type = TREE_TYPE (value);
@@ -111,9 +110,7 @@ require_complete_type (value)
and TYPE is the type that was invalid. */
void
-c_incomplete_type_error (value, type)
- tree value;
- tree type;
+c_incomplete_type_error (tree value, tree type)
{
const char *type_code_string;
@@ -180,8 +177,7 @@ c_incomplete_type_error (value, type)
arguments and return the new type. */
tree
-c_type_promotes_to (type)
- tree type;
+c_type_promotes_to (tree type)
{
if (TYPE_MAIN_VARIANT (type) == float_type_node)
return double_type_node;
@@ -202,10 +198,9 @@ c_type_promotes_to (type)
as well as those of TYPE. */
static tree
-qualify_type (type, like)
- tree type, like;
+qualify_type (tree type, tree like)
{
- return c_build_qualified_type (type,
+ return c_build_qualified_type (type,
TYPE_QUALS (type) | TYPE_QUALS (like));
}
@@ -218,8 +213,7 @@ qualify_type (type, like)
if the operands have the given two types. */
tree
-common_type (t1, t2)
- tree t1, t2;
+common_type (tree t1, tree t2)
{
enum tree_code code1;
enum tree_code code2;
@@ -328,9 +322,9 @@ common_type (t1, t2)
tree pointed_to_2 = TREE_TYPE (t2);
tree target = common_type (TYPE_MAIN_VARIANT (pointed_to_1),
TYPE_MAIN_VARIANT (pointed_to_2));
- t1 = build_pointer_type (c_build_qualified_type
- (target,
- TYPE_QUALS (pointed_to_1) |
+ t1 = build_pointer_type (c_build_qualified_type
+ (target,
+ TYPE_QUALS (pointed_to_1) |
TYPE_QUALS (pointed_to_2)));
return build_type_attribute_variant (t1, attributes);
}
@@ -406,7 +400,7 @@ common_type (t1, t2)
TREE_VALUE (n) = TREE_VALUE (p1);
goto parm_done;
}
-
+
/* Given wait (union {union wait *u; int *i} *)
and wait (union wait *),
prefer union wait * as type of parm. */
@@ -459,8 +453,7 @@ common_type (t1, t2)
but a warning may be needed if you use them together. */
int
-comptypes (type1, type2)
- tree type1, type2;
+comptypes (tree type1, tree type2)
{
tree t1 = type1;
tree t2 = type2;
@@ -482,7 +475,7 @@ comptypes (type1, type2)
&& TYPE_DOMAIN (t2) != 0)
t2 = TYPE_DOMAIN (t2);
- /* Treat an enum type as the integer type of the same width and
+ /* Treat an enum type as the integer type of the same width and
signedness. */
if (TREE_CODE (t1) == ENUMERAL_TYPE)
@@ -591,9 +584,7 @@ comptypes (type1, type2)
*/
static int
-comp_target_types (ttl, ttr, reflexive)
- tree ttl, ttr;
- int reflexive;
+comp_target_types (tree ttl, tree ttr, int reflexive)
{
int val;
@@ -614,13 +605,12 @@ comp_target_types (ttl, ttr, reflexive)
/* Return 1 if two function types F1 and F2 are compatible.
If either type specifies no argument types,
the other must specify a fixed number of self-promoting arg types.
- Otherwise, if one type specifies only the number of arguments,
+ Otherwise, if one type specifies only the number of arguments,
the other must specify that number of self-promoting arg types.
Otherwise, the argument types must match. */
static int
-function_types_compatible_p (f1, f2)
- tree f1, f2;
+function_types_compatible_p (tree f1, tree f2)
{
tree args1, args2;
/* 1 if no need for warning yet, 2 if warning cause has been seen. */
@@ -683,8 +673,7 @@ function_types_compatible_p (f1, f2)
or 2 for compatible with warning. */
static int
-type_lists_compatible_p (args1, args2)
- tree args1, args2;
+type_lists_compatible_p (tree args1, tree args2)
{
/* 1 if no need for warning yet, 2 if warning cause has been seen. */
int val = 1;
@@ -712,7 +701,7 @@ type_lists_compatible_p (args1, args2)
if (c_type_promotes_to (TREE_VALUE (args1)) != TREE_VALUE (args1))
return 0;
}
- else if (! (newval = comptypes (TYPE_MAIN_VARIANT (TREE_VALUE (args1)),
+ else if (! (newval = comptypes (TYPE_MAIN_VARIANT (TREE_VALUE (args1)),
TYPE_MAIN_VARIANT (TREE_VALUE (args2)))))
{
/* Allow wait (union {union wait *u; int *i} *)
@@ -763,8 +752,7 @@ type_lists_compatible_p (args1, args2)
/* Compute the size to increment a pointer by. */
tree
-c_size_in_bytes (type)
- tree type;
+c_size_in_bytes (tree type)
{
enum tree_code code = TREE_CODE (type);
@@ -786,8 +774,7 @@ c_size_in_bytes (type)
/* Return either DECL or its known constant value (if it has one). */
tree
-decl_constant_value (decl)
- tree decl;
+decl_constant_value (tree decl)
{
if (/* Don't change a variable array bound or initial value to a constant
in a place where a variable is invalid. */
@@ -815,8 +802,7 @@ decl_constant_value (decl)
right test for avoiding misoptimizations either. */
static tree
-decl_constant_value_for_broken_optimization (decl)
- tree decl;
+decl_constant_value_for_broken_optimization (tree decl)
{
if (pedantic || DECL_MODE (decl) == BLKmode)
return decl;
@@ -830,8 +816,7 @@ decl_constant_value_for_broken_optimization (decl)
return EXP. */
static tree
-default_function_array_conversion (exp)
- tree exp;
+default_function_array_conversion (tree exp)
{
tree orig_exp;
tree type = TREE_TYPE (exp);
@@ -839,7 +824,7 @@ default_function_array_conversion (exp)
int not_lvalue = 0;
/* Strip NON_LVALUE_EXPRs and no-op conversions, since we aren't using as
- an lvalue.
+ an lvalue.
Do not use STRIP_NOPS here! It will remove conversions from pointer
to integer and cause infinite recursion. */
@@ -877,9 +862,9 @@ default_function_array_conversion (exp)
}
if (TYPE_QUALS (type) || constp || volatilep)
- restype
+ restype
= c_build_qualified_type (restype,
- TYPE_QUALS (type)
+ TYPE_QUALS (type)
| (constp * TYPE_QUAL_CONST)
| (volatilep * TYPE_QUAL_VOLATILE));
@@ -933,8 +918,7 @@ default_function_array_conversion (exp)
In addition, manifest constants symbols are replaced by their values. */
tree
-default_conversion (exp)
- tree exp;
+default_conversion (tree exp)
{
tree orig_exp;
tree type = TREE_TYPE (exp);
@@ -957,7 +941,7 @@ default_conversion (exp)
}
/* Strip NON_LVALUE_EXPRs and no-op conversions, since we aren't using as
- an lvalue.
+ an lvalue.
Do not use STRIP_NOPS here! It will remove conversions from pointer
to integer and cause infinite recursion. */
@@ -1018,10 +1002,9 @@ default_conversion (exp)
TREE_VALUE of the list. Normally the list is of length one, but if
the component is embedded within (nested) anonymous structures or
unions, the list steps down the chain to the component. */
-
+
static tree
-lookup_field (decl, component)
- tree decl, component;
+lookup_field (tree decl, tree component)
{
tree type = TREE_TYPE (decl);
tree field;
@@ -1057,7 +1040,7 @@ lookup_field (decl, component)
if (anon)
return tree_cons (NULL_TREE, field, anon);
- }
+ }
}
/* Entire record is only anon unions. */
@@ -1110,8 +1093,7 @@ lookup_field (decl, component)
structure or union value DATUM. COMPONENT is an IDENTIFIER_NODE. */
tree
-build_component_ref (datum, component)
- tree datum, component;
+build_component_ref (tree datum, tree component)
{
tree type = TREE_TYPE (datum);
enum tree_code code = TREE_CODE (type);
@@ -1199,9 +1181,7 @@ build_component_ref (datum, component)
ERRORSTRING is the name of the operator to appear in error messages. */
tree
-build_indirect_ref (ptr, errorstring)
- tree ptr;
- const char *errorstring;
+build_indirect_ref (tree ptr, const char *errorstring)
{
tree pointer = default_conversion (ptr);
tree type = TREE_TYPE (pointer);
@@ -1254,8 +1234,7 @@ build_indirect_ref (ptr, errorstring)
by functions). */
tree
-build_array_ref (array, index)
- tree array, index;
+build_array_ref (tree array, tree index)
{
if (index == 0)
{
@@ -1339,7 +1318,7 @@ build_array_ref (array, index)
TREE_THIS_VOLATILE (rval)
|= (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (array)))
/* This was added by rms on 16 Nov 91.
- It fixes vol struct foo *a; a->elts[1]
+ It fixes vol struct foo *a; a->elts[1]
in an inline function.
Hope it doesn't break something else. */
| TREE_THIS_VOLATILE (array));
@@ -1390,8 +1369,7 @@ build_array_ref (array, index)
including a reference to a builtin outside of function-call context.
Arrange to suppress further errors for the same identifier. */
static void
-undeclared_variable (id)
- tree id;
+undeclared_variable (tree id)
{
if (current_function_decl == 0)
{
@@ -1421,9 +1399,7 @@ undeclared_variable (id)
/* Build an external reference to identifier ID. FUN indicates
whether this will be used for a function call. */
tree
-build_external_ref (id, fun)
- tree id;
- int fun;
+build_external_ref (tree id, int fun)
{
tree ref;
tree decl = lookup_name (id);
@@ -1480,7 +1456,7 @@ build_external_ref (id, fun)
|| TREE_CODE (ref) == FUNCTION_DECL))
{
tree context = decl_function_context (ref);
-
+
if (context != 0 && context != current_function_decl)
DECL_NONLOCAL (ref) = 1;
}
@@ -1494,8 +1470,7 @@ build_external_ref (id, fun)
FUNCTION's data type may be a function type or a pointer-to-function. */
tree
-build_function_call (function, params)
- tree function, params;
+build_function_call (tree function, tree params)
{
tree fntype, fundecl = 0;
tree coerced_params;
@@ -1592,8 +1567,7 @@ build_function_call (function, params)
with the elements of the list in the TREE_VALUE slots of those nodes. */
static tree
-convert_arguments (typelist, values, name, fundecl)
- tree typelist, values, name, fundecl;
+convert_arguments (tree typelist, tree values, tree name, tree fundecl)
{
tree typetail, valtail;
tree result = NULL;
@@ -1724,10 +1698,10 @@ convert_arguments (typelist, values, name, fundecl)
}
}
- parmval = convert_for_assignment (type, val,
+ parmval = convert_for_assignment (type, val,
(char *) 0, /* arg passing */
fundecl, name, parmnum + 1);
-
+
if (PROMOTE_PROTOTYPES
&& INTEGRAL_TYPE_P (type)
&& (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)))
@@ -1767,9 +1741,7 @@ convert_arguments (typelist, values, name, fundecl)
in a way that is likely to confuse the user. */
tree
-parser_build_binary_op (code, arg1, arg2)
- enum tree_code code;
- tree arg1, arg2;
+parser_build_binary_op (enum tree_code code, tree arg1, tree arg2)
{
tree result = build_binary_op (code, arg1, arg2, 1);
@@ -1887,10 +1859,7 @@ parser_build_binary_op (code, arg1, arg2)
the arithmetic is to be done. */
tree
-build_binary_op (code, orig_op0, orig_op1, convert_p)
- enum tree_code code;
- tree orig_op0, orig_op1;
- int convert_p;
+build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, int convert_p)
{
tree type0, type1;
enum tree_code code0, code1;
@@ -2223,7 +2192,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
if (comp_target_types (type0, type1, 1))
{
result_type = common_type (type0, type1);
- if (pedantic
+ if (pedantic
&& TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
pedwarn ("ISO C forbids ordered comparisons of pointers to functions");
}
@@ -2251,7 +2220,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
if (!COMPLETE_TYPE_P (TREE_TYPE (type0))
!= !COMPLETE_TYPE_P (TREE_TYPE (type1)))
pedwarn ("comparison of complete and incomplete pointers");
- else if (pedantic
+ else if (pedantic
&& TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
pedwarn ("ISO C forbids ordered comparisons of pointers to functions");
}
@@ -2436,7 +2405,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
pass the copies by reference, then copy them back afterward. */
tree xop0 = op0, xop1 = op1, xresult_type = result_type;
enum tree_code xresultcode = resultcode;
- tree val
+ tree val
= shorten_compare (&xop0, &xop1, &xresult_type, &xresultcode);
if (val != 0)
@@ -2460,7 +2429,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
STRIP_TYPE_NOPS (xop1);
/* Give warnings for comparisons between signed and unsigned
- quantities that may fail.
+ quantities that may fail.
Do the checking based on the original operand trees, so that
casts will be considered, but default promotions won't be.
@@ -2527,7 +2496,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
else
primop1 = get_narrower (TREE_OPERAND (primop1, 0),
&unsignedp1);
-
+
if (host_integerp (primop0, 0) || host_integerp (primop1, 0))
{
tree primop;
@@ -2582,9 +2551,9 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
if (! converted)
{
if (TREE_TYPE (op0) != result_type)
- op0 = convert (result_type, op0);
+ op0 = convert (result_type, op0);
if (TREE_TYPE (op1) != result_type)
- op1 = convert (result_type, op1);
+ op1 = convert (result_type, op1);
}
if (build_type == NULL_TREE)
@@ -2607,8 +2576,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
/* Return true if `t' is known to be non-negative. */
int
-c_tree_expr_nonnegative_p (t)
- tree t;
+c_tree_expr_nonnegative_p (tree t)
{
if (TREE_CODE (t) == STMT_EXPR)
{
@@ -2616,7 +2584,7 @@ c_tree_expr_nonnegative_p (t)
/* Find the last statement in the chain, ignoring the final
* scope statement */
- while (TREE_CHAIN (t) != NULL_TREE
+ while (TREE_CHAIN (t) != NULL_TREE
&& TREE_CODE (TREE_CHAIN (t)) != SCOPE_STMT)
t = TREE_CHAIN (t);
return tree_expr_nonnegative_p (TREE_OPERAND (t, 0));
@@ -2628,8 +2596,7 @@ c_tree_expr_nonnegative_p (t)
The resulting tree has type int. */
static tree
-pointer_diff (op0, op1)
- tree op0, op1;
+pointer_diff (tree op0, tree op1)
{
tree result, folded;
tree restype = ptrdiff_type_node;
@@ -2714,10 +2681,7 @@ pointer_diff (op0, op1)
arrays to pointers in C99. */
tree
-build_unary_op (code, xarg, flag)
- enum tree_code code;
- tree xarg;
- int flag;
+build_unary_op (enum tree_code code, tree xarg, int flag)
{
/* No default_conversion here. It causes trouble for ADDR_EXPR. */
tree arg = xarg;
@@ -2835,7 +2799,7 @@ build_unary_op (code, xarg, flag)
return fold (build1 (IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (arg)), arg));
else
return convert (TREE_TYPE (arg), integer_zero_node);
-
+
case PREINCREMENT_EXPR:
case POSTINCREMENT_EXPR:
case PREDECREMENT_EXPR:
@@ -2973,7 +2937,7 @@ build_unary_op (code, xarg, flag)
/* Report a read-only lvalue. */
if (TREE_READONLY (arg))
- readonly_warning (arg,
+ readonly_warning (arg,
((code == PREINCREMENT_EXPR
|| code == POSTINCREMENT_EXPR)
? "increment" : "decrement"));
@@ -3086,8 +3050,7 @@ build_unary_op (code, xarg, flag)
Lvalues can have their address taken, unless they have DECL_REGISTER. */
int
-lvalue_p (ref)
- tree ref;
+lvalue_p (tree ref)
{
enum tree_code code = TREE_CODE (ref);
@@ -3124,9 +3087,7 @@ lvalue_p (ref)
otherwise, print an error message and return zero. */
int
-lvalue_or_else (ref, msgid)
- tree ref;
- const char *msgid;
+lvalue_or_else (tree ref, const char *msgid)
{
int win = lvalue_p (ref);
@@ -3143,12 +3104,9 @@ lvalue_or_else (ref, msgid)
a pointer in C99.
If ARG is not a kind of expression we can handle, return zero. */
-
+
static tree
-unary_complex_lvalue (code, arg, flag)
- enum tree_code code;
- tree arg;
- int flag;
+unary_complex_lvalue (enum tree_code code, tree arg, int flag)
{
/* Handle (a, b) used as an "lvalue". */
if (TREE_CODE (arg) == COMPOUND_EXPR)
@@ -3185,8 +3143,7 @@ unary_complex_lvalue (code, arg, flag)
COMPOUND_EXPR, or CONVERT_EXPR (for casts). */
static void
-pedantic_lvalue_warning (code)
- enum tree_code code;
+pedantic_lvalue_warning (enum tree_code code)
{
if (pedantic)
switch (code)
@@ -3206,9 +3163,7 @@ pedantic_lvalue_warning (code)
/* Warn about storing in something that is `const'. */
void
-readonly_warning (arg, msgid)
- tree arg;
- const char *msgid;
+readonly_warning (tree arg, const char *msgid)
{
if (TREE_CODE (arg) == COMPONENT_REF)
{
@@ -3230,8 +3185,7 @@ readonly_warning (arg, msgid)
Returns true if successful. */
bool
-c_mark_addressable (exp)
- tree exp;
+c_mark_addressable (tree exp)
{
tree x = exp;
@@ -3312,8 +3266,7 @@ c_mark_addressable (exp)
/* Build and return a conditional expression IFEXP ? OP1 : OP2. */
tree
-build_conditional_expr (ifexp, op1, op2)
- tree ifexp, op1, op2;
+build_conditional_expr (tree ifexp, tree op1, tree op2)
{
tree type1;
tree type2;
@@ -3340,7 +3293,7 @@ build_conditional_expr (ifexp, op1, op2)
code1 = TREE_CODE (type1);
type2 = TREE_TYPE (op2);
code2 = TREE_CODE (type2);
-
+
/* Quickly detect the usual case where op1 and op2 have the same type
after promotion. */
if (TYPE_MAIN_VARIANT (type1) == TYPE_MAIN_VARIANT (type2))
@@ -3463,7 +3416,7 @@ build_conditional_expr (ifexp, op1, op2)
op1 = convert_and_check (result_type, op1);
if (result_type != TREE_TYPE (op2))
op2 = convert_and_check (result_type, op2);
-
+
if (TREE_CODE (ifexp) == INTEGER_CST)
return pedantic_non_lvalue (integer_zerop (ifexp) ? op2 : op1);
@@ -3474,16 +3427,13 @@ build_conditional_expr (ifexp, op1, op2)
that performs them all and returns the value of the last of them. */
tree
-build_compound_expr (list)
- tree list;
+build_compound_expr (tree list)
{
return internal_build_compound_expr (list, TRUE);
}
static tree
-internal_build_compound_expr (list, first_p)
- tree list;
- int first_p;
+internal_build_compound_expr (tree list, int first_p)
{
tree rest;
@@ -3532,12 +3482,10 @@ internal_build_compound_expr (list, first_p)
/* Build an expression representing a cast to type TYPE of expression EXPR. */
tree
-build_c_cast (type, expr)
- tree type;
- tree expr;
+build_c_cast (tree type, tree expr)
{
tree value = expr;
-
+
if (type == error_mark_node || expr == error_mark_node)
return error_mark_node;
@@ -3689,7 +3637,7 @@ build_c_cast (type, expr)
&& flag_strict_aliasing && warn_strict_aliasing
&& !VOID_TYPE_P (TREE_TYPE (type)))
{
- /* Casting the address of a decl to non void pointer. Warn
+ /* Casting the address of a decl to non void pointer. Warn
if the cast breaks type based aliasing. */
if (!COMPLETE_TYPE_P (TREE_TYPE (type)))
warning ("type-punning to incomplete type might break strict-aliasing rules");
@@ -3728,8 +3676,7 @@ build_c_cast (type, expr)
/* Interpret a cast of expression EXPR to type TYPE. */
tree
-c_cast_expr (type, expr)
- tree type, expr;
+c_cast_expr (tree type, tree expr)
{
int saved_wsp = warn_strict_prototypes;
@@ -3750,9 +3697,7 @@ c_cast_expr (type, expr)
Or else MODIFYCODE is NOP_EXPR meaning do a simple assignment. */
tree
-build_modify_expr (lhs, modifycode, rhs)
- tree lhs, rhs;
- enum tree_code modifycode;
+build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
{
tree result;
tree newrhs;
@@ -3786,7 +3731,7 @@ build_modify_expr (lhs, modifycode, rhs)
return error_mark_node;
return build (COMPOUND_EXPR, lhstype,
TREE_OPERAND (lhs, 0), newrhs);
-
+
/* Handle (a ? b : c) used as an "lvalue". */
case COND_EXPR:
pedantic_lvalue_warning (COND_EXPR);
@@ -3850,7 +3795,7 @@ build_modify_expr (lhs, modifycode, rhs)
pedantic_lvalue_warning (CONVERT_EXPR);
return convert (TREE_TYPE (lhs), result);
}
-
+
default:
break;
}
@@ -3927,11 +3872,7 @@ build_modify_expr (lhs, modifycode, rhs)
PARMNUM is the number of the argument, for printing in error messages. */
static tree
-convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
- tree type, rhs;
- const char *errtype;
- tree fundecl, funname;
- int parmnum;
+convert_for_assignment (tree type, tree rhs, const char *errtype, tree fundecl, tree funname, int parmnum)
{
enum tree_code codel = TREE_CODE (type);
tree rhstype;
@@ -3971,7 +3912,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
error ("void value not ignored as it ought to be");
return error_mark_node;
}
- /* A type converts to a reference to it.
+ /* A type converts to a reference to it.
This code doesn't fully support references, it's just for the
special case of va_start and va_copy. */
if (codel == REFERENCE_TYPE
@@ -4003,7 +3944,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
|| (*targetm.vector_opaque_p) (rhstype)))
return convert (type, rhs);
/* Arithmetic types all interconvert, and enum is treated like int. */
- else if ((codel == INTEGER_TYPE || codel == REAL_TYPE
+ else if ((codel == INTEGER_TYPE || codel == REAL_TYPE
|| codel == ENUMERAL_TYPE || codel == COMPLEX_TYPE
|| codel == BOOLEAN_TYPE)
&& (coder == INTEGER_TYPE || coder == REAL_TYPE
@@ -4096,7 +4037,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
errtype, funname,
parmnum);
}
-
+
if (pedantic && ! DECL_IN_SYSTEM_HEADER (fundecl))
pedwarn ("ISO C prohibits argument conversion to union type");
@@ -4202,13 +4143,13 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
if (!errtype)
{
if (funname)
- {
- tree selector = objc_message_selector ();
-
- if (selector && parmnum > 2)
- error ("incompatible type for argument %d of `%s'",
+ {
+ tree selector = objc_message_selector ();
+
+ if (selector && parmnum > 2)
+ error ("incompatible type for argument %d of `%s'",
parmnum - 2, IDENTIFIER_POINTER (selector));
- else
+ else
error ("incompatible type for argument %d of `%s'",
parmnum, IDENTIFIER_POINTER (funname));
}
@@ -4225,8 +4166,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
/* Convert VALUE for assignment into inlined parameter PARM. */
tree
-c_convert_parm_for_inlining (parm, value, fn)
- tree parm, value, fn;
+c_convert_parm_for_inlining (tree parm, tree value, tree fn)
{
tree ret, type;
@@ -4236,7 +4176,7 @@ c_convert_parm_for_inlining (parm, value, fn)
return value;
type = TREE_TYPE (parm);
- ret = convert_for_assignment (type, value,
+ ret = convert_for_assignment (type, value,
(char *) 0 /* arg passing */, fn,
DECL_NAME (fn), 0);
if (PROMOTE_PROTOTYPES
@@ -4254,17 +4194,13 @@ c_convert_parm_for_inlining (parm, value, fn)
Objective-C selector. */
static void
-warn_for_assignment (msgid, opname, function, argnum)
- const char *msgid;
- const char *opname;
- tree function;
- int argnum;
+warn_for_assignment (const char *msgid, const char *opname, tree function, int argnum)
{
if (opname == 0)
{
tree selector = objc_message_selector ();
char * new_opname;
-
+
if (selector && argnum > 2)
{
function = selector;
@@ -4273,7 +4209,7 @@ warn_for_assignment (msgid, opname, function, argnum)
if (argnum == 0)
{
if (function)
- {
+ {
/* Function name is known; supply it. */
const char *const argstring = _("passing arg of `%s'");
new_opname = (char *) alloca (IDENTIFIER_LENGTH (function)
@@ -4319,9 +4255,7 @@ warn_for_assignment (msgid, opname, function, argnum)
which is allowed with a warning when -pedantic is specified. */
static tree
-valid_compound_expr_initializer (value, endtype)
- tree value;
- tree endtype;
+valid_compound_expr_initializer (tree value, tree endtype)
{
if (TREE_CODE (value) == COMPOUND_EXPR)
{
@@ -4344,8 +4278,7 @@ valid_compound_expr_initializer (value, endtype)
If the init is invalid, store an ERROR_MARK. */
void
-store_init_value (decl, init)
- tree decl, init;
+store_init_value (tree decl, tree init)
{
tree value, type;
@@ -4456,8 +4389,7 @@ static int spelling_size; /* Size of the spelling stack. */
/* Push STRING on the stack. Printed literally. */
static void
-push_string (string)
- const char *string;
+push_string (const char *string)
{
PUSH_SPELLING (SPELLING_STRING, string, u.s);
}
@@ -4465,9 +4397,7 @@ push_string (string)
/* Push a member name on the stack. Printed as '.' STRING. */
static void
-push_member_name (decl)
- tree decl;
-
+push_member_name (tree decl)
{
const char *const string
= DECL_NAME (decl) ? IDENTIFIER_POINTER (DECL_NAME (decl)) : "<anonymous>";
@@ -4477,8 +4407,7 @@ push_member_name (decl)
/* Push an array bounds on the stack. Printed as [BOUNDS]. */
static void
-push_array_bounds (bounds)
- int bounds;
+push_array_bounds (int bounds)
{
PUSH_SPELLING (SPELLING_BOUNDS, bounds, u.i);
}
@@ -4486,7 +4415,7 @@ push_array_bounds (bounds)
/* Compute the maximum size in bytes of the printed spelling. */
static int
-spelling_length ()
+spelling_length (void)
{
int size = 0;
struct spelling *p;
@@ -4505,8 +4434,7 @@ spelling_length ()
/* Print the spelling to BUFFER and return it. */
static char *
-print_spelling (buffer)
- char *buffer;
+print_spelling (char *buffer)
{
char *d = buffer;
struct spelling *p;
@@ -4534,8 +4462,7 @@ print_spelling (buffer)
The component name is taken from the spelling stack. */
void
-error_init (msgid)
- const char *msgid;
+error_init (const char *msgid)
{
char *ofwhat;
@@ -4550,8 +4477,7 @@ error_init (msgid)
The component name is taken from the spelling stack. */
void
-pedwarn_init (msgid)
- const char *msgid;
+pedwarn_init (const char *msgid)
{
char *ofwhat;
@@ -4566,8 +4492,7 @@ pedwarn_init (msgid)
The component name is taken from the spelling stack. */
static void
-warning_init (msgid)
- const char *msgid;
+warning_init (const char *msgid)
{
char *ofwhat;
@@ -4584,9 +4509,7 @@ warning_init (msgid)
elements are seen. */
static tree
-digest_init (type, init, require_constant)
- tree type, init;
- int require_constant;
+digest_init (tree type, tree init, int require_constant)
{
enum tree_code code = TREE_CODE (type);
tree inside_init = init;
@@ -4726,7 +4649,7 @@ digest_init (type, init, require_constant)
if (flag_pedantic_errors)
inside_init = error_mark_node;
}
- else if (require_constant
+ else if (require_constant
&& (!TREE_CONSTANT (inside_init)
/* This test catches things like `7 / 0' which
result in an expression for which TREE_CONSTANT
@@ -4954,10 +4877,7 @@ struct initializer_stack *initializer_stack;
/* Prepare to parse and output the initializer for variable DECL. */
void
-start_init (decl, asmspec_tree, top_level)
- tree decl;
- tree asmspec_tree;
- int top_level;
+start_init (tree decl, tree asmspec_tree, int top_level)
{
const char *locus;
struct initializer_stack *p
@@ -5020,7 +4940,7 @@ start_init (decl, asmspec_tree, top_level)
}
void
-finish_init ()
+finish_init (void)
{
struct initializer_stack *p = initializer_stack;
@@ -5059,8 +4979,7 @@ finish_init ()
For an initializer for a decl, TYPE is zero. */
void
-really_start_incremental_init (type)
- tree type;
+really_start_incremental_init (tree type)
{
struct constructor_stack *p
= (struct constructor_stack *) xmalloc (sizeof (struct constructor_stack));
@@ -5166,8 +5085,7 @@ really_start_incremental_init (type)
IMPLICIT is 1 (or 2 if the push is because of designator list). */
void
-push_init_level (implicit)
- int implicit;
+push_init_level (int implicit)
{
struct constructor_stack *p;
tree value = NULL_TREE;
@@ -5181,7 +5099,7 @@ push_init_level (implicit)
&& constructor_fields == 0)
process_init_element (pop_init_level (1));
else if (TREE_CODE (constructor_type) == ARRAY_TYPE
- && constructor_max_index
+ && constructor_max_index
&& tree_int_cst_lt (constructor_max_index, constructor_index))
process_init_element (pop_init_level (1));
else
@@ -5327,7 +5245,7 @@ push_init_level (implicit)
constructor_max_index = build_int_2 (-1, -1);
constructor_index
- = convert (bitsizetype,
+ = convert (bitsizetype,
TYPE_MIN_VALUE (TYPE_DOMAIN (constructor_type)));
}
else
@@ -5350,7 +5268,7 @@ push_init_level (implicit)
}
}
-/* At the end of an implicit or explicit brace level,
+/* At the end of an implicit or explicit brace level,
finish up that level of constructor.
If we were outputting the elements as they are read, return 0
from inner levels (process_init_element ignores that),
@@ -5359,8 +5277,7 @@ push_init_level (implicit)
Otherwise, return a CONSTRUCTOR expression. */
tree
-pop_init_level (implicit)
- int implicit;
+pop_init_level (int implicit)
{
struct constructor_stack *p;
tree constructor = 0;
@@ -5512,8 +5429,7 @@ pop_init_level (implicit)
ARRAY argument is nonzero for array ranges. Returns zero for success. */
static int
-set_designator (array)
- int array;
+set_designator (int array)
{
tree subtype;
enum tree_code subcode;
@@ -5582,8 +5498,7 @@ set_designator (array)
NULL_TREE if there is no range designator at this level. */
static void
-push_range_stack (range_end)
- tree range_end;
+push_range_stack (tree range_end)
{
struct constructor_range_stack *p;
@@ -5606,8 +5521,7 @@ push_range_stack (range_end)
of indices, running from FIRST through LAST. */
void
-set_init_index (first, last)
- tree first, last;
+set_init_index (tree first, tree last)
{
if (set_designator (1))
return;
@@ -5673,8 +5587,7 @@ set_init_index (first, last)
/* Within a struct initializer, specify the next field to be initialized. */
void
-set_init_label (fieldname)
- tree fieldname;
+set_init_label (tree fieldname)
{
tree tail;
@@ -5689,7 +5602,7 @@ set_init_label (fieldname)
error_init ("field name not in record or union initializer");
return;
}
-
+
for (tail = TYPE_FIELDS (constructor_type); tail;
tail = TREE_CHAIN (tail))
{
@@ -5711,12 +5624,11 @@ set_init_label (fieldname)
}
/* Add a new initializer to the tree of pending initializers. PURPOSE
- identifies the initializer, either array index or field in a structure.
+ identifies the initializer, either array index or field in a structure.
VALUE is the value of that index or field. */
static void
-add_pending_init (purpose, value)
- tree purpose, value;
+add_pending_init (tree purpose, tree value)
{
struct init_node *p, **q, *r;
@@ -5931,7 +5843,7 @@ add_pending_init (purpose, value)
/* Build AVL tree from a sorted chain. */
static void
-set_nonincremental_init ()
+set_nonincremental_init (void)
{
tree chain;
@@ -5950,7 +5862,7 @@ set_nonincremental_init ()
&& DECL_C_BIT_FIELD (constructor_unfilled_fields)
&& DECL_NAME (constructor_unfilled_fields) == 0)
constructor_unfilled_fields = TREE_CHAIN (constructor_unfilled_fields);
-
+
}
else if (TREE_CODE (constructor_type) == ARRAY_TYPE)
{
@@ -5967,8 +5879,7 @@ set_nonincremental_init ()
/* Build AVL tree from a string constant. */
static void
-set_nonincremental_init_from_string (str)
- tree str;
+set_nonincremental_init_from_string (tree str)
{
tree value, purpose, type;
HOST_WIDE_INT val[2];
@@ -6051,8 +5962,7 @@ set_nonincremental_init_from_string (str)
not initialized yet. */
static tree
-find_init_member (field)
- tree field;
+find_init_member (tree field)
{
struct init_node *p;
@@ -6114,9 +6024,7 @@ find_init_member (field)
it is 0 while outputting pending elements, to avoid recursion.) */
static void
-output_init_element (value, type, field, pending)
- tree value, type, field;
- int pending;
+output_init_element (tree value, tree type, tree field, int pending)
{
if (type == error_mark_node)
{
@@ -6273,8 +6181,7 @@ output_init_element (value, type, field, pending)
we can output all the pending elements. */
static void
-output_pending_init_elements (all)
- int all;
+output_pending_init_elements (int all)
{
struct init_node *elt = constructor_pending_elts;
tree next;
@@ -6285,7 +6192,7 @@ output_pending_init_elements (all)
If we find an element that should be output now,
output it. Otherwise, set NEXT to the element
that comes first among those still pending. */
-
+
next = 0;
while (elt)
{
@@ -6414,8 +6321,7 @@ output_pending_init_elements (all)
it calls output_init_element. */
void
-process_init_element (value)
- tree value;
+process_init_element (tree value)
{
tree orig_value = value;
int string_flag = value != 0 && TREE_CODE (value) == STRING_CST;
@@ -6771,8 +6677,7 @@ process_init_element (value)
/* Build a simple asm-statement, from one string literal. */
tree
-simple_asm_stmt (expr)
- tree expr;
+simple_asm_stmt (tree expr)
{
STRIP_NOPS (expr);
@@ -6798,12 +6703,7 @@ simple_asm_stmt (expr)
STRING, some OUTPUTS, some INPUTS, and some CLOBBERS. */
tree
-build_asm_stmt (cv_qualifier, string, outputs, inputs, clobbers)
- tree cv_qualifier;
- tree string;
- tree outputs;
- tree inputs;
- tree clobbers;
+build_asm_stmt (tree cv_qualifier, tree string, tree outputs, tree inputs, tree clobbers)
{
tree tail;
@@ -6852,7 +6752,7 @@ build_asm_stmt (cv_qualifier, string, outputs, inputs, clobbers)
TREE_VALUE (tail) = output;
}
- /* Perform default conversions on array and function inputs.
+ /* Perform default conversions on array and function inputs.
Don't do this for other types as it would screw up operands
expected to be in memory. */
for (tail = inputs; tail; tail = TREE_CHAIN (tail))
@@ -6869,11 +6769,9 @@ build_asm_stmt (cv_qualifier, string, outputs, inputs, clobbers)
Arguments are same as for expand_asm_operands. */
void
-c_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
- tree string, outputs, inputs, clobbers;
- int vol;
- const char *filename;
- int line;
+c_expand_asm_operands (tree string, tree outputs, tree inputs,
+ tree clobbers, int vol, const char *filename,
+ int line)
{
int noutputs = list_length (outputs);
int i;
@@ -6929,8 +6827,7 @@ c_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
or a null pointer for `return;' with no value. */
tree
-c_expand_return (retval)
- tree retval;
+c_expand_return (tree retval)
{
tree valtype = TREE_TYPE (TREE_TYPE (current_function_decl));
@@ -6993,7 +6890,7 @@ c_expand_return (retval)
inner = TREE_OPERAND (inner, 0);
continue;
}
-
+
case ADDR_EXPR:
inner = TREE_OPERAND (inner, 0);
@@ -7045,8 +6942,7 @@ static struct c_switch *switch_stack;
SWITCH_STMT. */
tree
-c_start_case (exp)
- tree exp;
+c_start_case (tree exp)
{
enum tree_code code;
tree type, orig_type = error_mark_node;
@@ -7090,9 +6986,7 @@ c_start_case (exp)
/* Process a case label. */
tree
-do_case (low_value, high_value)
- tree low_value;
- tree high_value;
+do_case (tree low_value, tree high_value)
{
tree label = NULL_TREE;
@@ -7100,8 +6994,8 @@ do_case (low_value, high_value)
{
bool switch_was_empty_p = (SWITCH_BODY (switch_stack->switch_stmt) == NULL_TREE);
- label = c_add_case_label (switch_stack->cases,
- SWITCH_COND (switch_stack->switch_stmt),
+ label = c_add_case_label (switch_stack->cases,
+ SWITCH_COND (switch_stack->switch_stmt),
low_value, high_value);
if (label == error_mark_node)
label = NULL_TREE;
@@ -7123,7 +7017,7 @@ do_case (low_value, high_value)
/* Finish the switch statement. */
void
-c_finish_case ()
+c_finish_case (void)
{
struct c_switch *cs = switch_stack;
diff --git a/gcc/c.opt b/gcc/c.opt
index f277512efbc..15c344b887e 100644
--- a/gcc/c.opt
+++ b/gcc/c.opt
@@ -32,7 +32,11 @@
; compiler recognize the switch, as declared by "Language" entries.
; If the switch takes an argument, then you should also specify
; "Joined" and/or "Separate" to indicate where the argument can
-; appear.
+; appear. If a Joined argument can legitimately be omitted, specify
+; "JoinedOrMissing" instead of "Joined". If the argument to a switch
+; is a non-negative integer, you can specify "UInteger" and the switch
+; decoder will convert the argument for you, or complain to the user
+; if the argument is invalid.
; Comments can appear on their own line anwhere in the file, preceded
; by a semicolon. Whitespace is permitted before the semicolon.
@@ -311,7 +315,7 @@ d
C ObjC C++ ObjC++ Joined
fabi-version=
-C++ ObjC++ Joined
+C++ ObjC++ Joined UInteger
faccess-control
C++ ObjC++
@@ -479,10 +483,10 @@ fstrict-prototype
C++ ObjC++
ftabstop=
-C ObjC C++ ObjC++ Joined RejectNegative
+C ObjC C++ ObjC++ Joined RejectNegative UInteger
ftemplate-depth-
-C++ ObjC++ Joined
+C++ ObjC++ Joined RejectNegative UInteger
fthis-is-variable
C++ ObjC++
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index 53f3aa54a5c..689f4f8b22a 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -1,6 +1,6 @@
/* Save and restore call-clobbered registers which are live across a call.
Copyright (C) 1989, 1992, 1994, 1995, 1997, 1998,
- 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -51,13 +51,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
register because it is live we first try to save in multi-register modes.
If that is not possible the save is done one register at a time. */
-static enum machine_mode
+static enum machine_mode
regno_save_mode[FIRST_PSEUDO_REGISTER][MAX_MOVE_MAX / MIN_UNITS_PER_WORD + 1];
/* For each hard register, a place on the stack where it can be saved,
if needed. */
-static rtx
+static rtx
regno_save_mem[FIRST_PSEUDO_REGISTER][MAX_MOVE_MAX / MIN_UNITS_PER_WORD + 1];
/* We will only make a register eligible for caller-save if it can be
@@ -68,7 +68,7 @@ static rtx
static int
reg_save_code[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
-static int
+static int
reg_restore_code[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
/* Set of hard regs currently residing in save area (during insn scan). */
@@ -88,29 +88,28 @@ static HARD_REG_SET referenced_regs;
static HARD_REG_SET this_insn_sets;
-static void mark_set_regs PARAMS ((rtx, rtx, void *));
-static void mark_referenced_regs PARAMS ((rtx));
-static int insert_save PARAMS ((struct insn_chain *, int, int,
- HARD_REG_SET *,
- enum machine_mode *));
-static int insert_restore PARAMS ((struct insn_chain *, int, int,
- int, enum machine_mode *));
-static struct insn_chain *insert_one_insn PARAMS ((struct insn_chain *, int,
- int, rtx));
-static void add_stored_regs PARAMS ((rtx, rtx, void *));
+static void mark_set_regs (rtx, rtx, void *);
+static void mark_referenced_regs (rtx);
+static int insert_save (struct insn_chain *, int, int, HARD_REG_SET *,
+ enum machine_mode *);
+static int insert_restore (struct insn_chain *, int, int, int,
+ enum machine_mode *);
+static struct insn_chain *insert_one_insn (struct insn_chain *, int, int,
+ rtx);
+static void add_stored_regs (rtx, rtx, void *);
/* Initialize for caller-save.
Look at all the hard registers that are used by a call and for which
regclass.c has not already excluded from being used across a call.
- Ensure that we can find a mode to save the register and that there is a
+ Ensure that we can find a mode to save the register and that there is a
simple insn to save and restore the register. This latter check avoids
problems that would occur if we tried to save the MQ register of some
machines directly into memory. */
void
-init_caller_save ()
+init_caller_save (void)
{
rtx addr_reg;
int offset;
@@ -184,7 +183,7 @@ init_caller_save ()
address = addr_reg;
/* Next we try to form an insn to save and restore the register. We
- see if such an insn is recognized and meets its constraints.
+ see if such an insn is recognized and meets its constraints.
To avoid lots of unnecessary RTL allocation, we construct all the RTL
once, then modify the memory and register operands in-place. */
@@ -256,7 +255,7 @@ init_caller_save ()
/* Initialize save areas by showing that we haven't allocated any yet. */
void
-init_save_areas ()
+init_save_areas (void)
{
int i, j;
@@ -274,17 +273,17 @@ init_save_areas ()
Future work:
In the fallback case we should iterate backwards across all possible
- modes for the save, choosing the largest available one instead of
+ modes for the save, choosing the largest available one instead of
falling back to the smallest mode immediately. (eg TF -> DF -> SF).
We do not try to use "move multiple" instructions that exist
- on some machines (such as the 68k moveml). It could be a win to try
+ on some machines (such as the 68k moveml). It could be a win to try
and use them when possible. The hard part is doing it in a way that is
- machine independent since they might be saving non-consecutive
+ machine independent since they might be saving non-consecutive
registers. (imagine caller-saving d0,d1,a0,a1 on the 68k) */
void
-setup_save_areas ()
+setup_save_areas (void)
{
int i, j, k;
unsigned int r;
@@ -300,7 +299,7 @@ setup_save_areas ()
if (reg_renumber[i] >= 0 && REG_N_CALLS_CROSSED (i) > 0)
{
unsigned int regno = reg_renumber[i];
- unsigned int endregno
+ unsigned int endregno
= regno + HARD_REGNO_NREGS (regno, GET_MODE (regno_reg_rtx[i]));
for (r = regno; r < endregno; r++)
@@ -367,7 +366,7 @@ setup_save_areas ()
/* Find the places where hard regs are live across calls and save them. */
void
-save_call_clobbered_regs ()
+save_call_clobbered_regs (void)
{
struct insn_chain *chain, *next;
enum machine_mode save_mode [FIRST_PSEUDO_REGISTER];
@@ -488,7 +487,7 @@ save_call_clobbered_regs ()
regno += insert_restore (chain, GET_CODE (insn) == JUMP_INSN,
regno, MOVE_MAX_WORDS, save_mode);
}
- }
+ }
}
/* Here from note_stores when an insn stores a value in a register.
@@ -496,10 +495,8 @@ save_call_clobbered_regs ()
been assigned hard regs have had their register number changed already,
so we can ignore pseudos. */
static void
-mark_set_regs (reg, setter, data)
- rtx reg;
- rtx setter ATTRIBUTE_UNUSED;
- void *data ATTRIBUTE_UNUSED;
+mark_set_regs (rtx reg, rtx setter ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED)
{
int regno, endregno, i;
enum machine_mode mode = GET_MODE (reg);
@@ -529,10 +526,7 @@ mark_set_regs (reg, setter, data)
been assigned hard regs have had their register number changed already,
so we can ignore pseudos. */
static void
-add_stored_regs (reg, setter, data)
- rtx reg;
- rtx setter;
- void *data;
+add_stored_regs (rtx reg, rtx setter, void *data)
{
int regno, endregno, i;
enum machine_mode mode = GET_MODE (reg);
@@ -562,8 +556,7 @@ add_stored_regs (reg, setter, data)
/* Walk X and record all referenced registers in REFERENCED_REGS. */
static void
-mark_referenced_regs (x)
- rtx x;
+mark_referenced_regs (rtx x)
{
enum rtx_code code = GET_CODE (x);
const char *fmt;
@@ -639,12 +632,8 @@ mark_referenced_regs (x)
Return the extra number of registers saved. */
static int
-insert_restore (chain, before_p, regno, maxrestore, save_mode)
- struct insn_chain *chain;
- int before_p;
- int regno;
- int maxrestore;
- enum machine_mode *save_mode;
+insert_restore (struct insn_chain *chain, int before_p, int regno,
+ int maxrestore, enum machine_mode *save_mode)
{
int i, k;
rtx pat = NULL_RTX;
@@ -695,7 +684,7 @@ insert_restore (chain, before_p, regno, maxrestore, save_mode)
&& numregs == (unsigned int) HARD_REGNO_NREGS (regno, save_mode [regno]))
mem = adjust_address (mem, save_mode[regno], 0);
pat = gen_rtx_SET (VOIDmode,
- gen_rtx_REG (GET_MODE (mem),
+ gen_rtx_REG (GET_MODE (mem),
regno), mem);
code = reg_restore_code[regno][GET_MODE (mem)];
new = insert_one_insn (chain, before_p, code, pat);
@@ -715,12 +704,8 @@ insert_restore (chain, before_p, regno, maxrestore, save_mode)
/* Like insert_restore above, but save registers instead. */
static int
-insert_save (chain, before_p, regno, to_save, save_mode)
- struct insn_chain *chain;
- int before_p;
- int regno;
- HARD_REG_SET *to_save;
- enum machine_mode *save_mode;
+insert_save (struct insn_chain *chain, int before_p, int regno,
+ HARD_REG_SET (*to_save), enum machine_mode *save_mode)
{
int i;
unsigned int k;
@@ -742,7 +727,7 @@ insert_save (chain, before_p, regno, to_save, save_mode)
/* Get the pattern to emit and update our status.
- See if we can save several registers with a single instruction.
+ See if we can save several registers with a single instruction.
Work backwards to the single register case. */
for (i = MOVE_MAX_WORDS; i > 0; i--)
{
@@ -790,15 +775,11 @@ insert_save (chain, before_p, regno, to_save, save_mode)
/* Emit a new caller-save insn and set the code. */
static struct insn_chain *
-insert_one_insn (chain, before_p, code, pat)
- struct insn_chain *chain;
- int before_p;
- int code;
- rtx pat;
+insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat)
{
rtx insn = chain->insn;
struct insn_chain *new;
-
+
#ifdef HAVE_cc0
/* If INSN references CC0, put our insns in front of the insn that sets
CC0. This is always safe, since the only way we could be passed an
diff --git a/gcc/calls.c b/gcc/calls.c
index ad18318627b..f220a6d7817 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -140,59 +140,41 @@ static sbitmap stored_args_map;
argument list for the constructor call. */
int stack_arg_under_construction;
-static int calls_function PARAMS ((tree, int));
-static int calls_function_1 PARAMS ((tree, int));
-
-static void emit_call_1 PARAMS ((rtx, tree, tree, HOST_WIDE_INT,
- HOST_WIDE_INT, HOST_WIDE_INT, rtx,
- rtx, int, rtx, int,
- CUMULATIVE_ARGS *));
-static void precompute_register_parameters PARAMS ((int,
- struct arg_data *,
- int *));
-static int store_one_arg PARAMS ((struct arg_data *, rtx, int, int,
- int));
-static void store_unaligned_arguments_into_pseudos PARAMS ((struct arg_data *,
- int));
-static int finalize_must_preallocate PARAMS ((int, int,
- struct arg_data *,
- struct args_size *));
-static void precompute_arguments PARAMS ((int, int,
- struct arg_data *));
-static int compute_argument_block_size PARAMS ((int,
- struct args_size *,
- int));
-static void initialize_argument_information PARAMS ((int,
- struct arg_data *,
- struct args_size *,
- int, tree, tree,
- CUMULATIVE_ARGS *,
- int, rtx *, int *,
- int *, int *));
-static void compute_argument_addresses PARAMS ((struct arg_data *,
- rtx, int));
-static rtx rtx_for_function_call PARAMS ((tree, tree));
-static void load_register_parameters PARAMS ((struct arg_data *,
- int, rtx *, int,
- int, int *));
-static rtx emit_library_call_value_1 PARAMS ((int, rtx, rtx,
- enum libcall_type,
- enum machine_mode,
- int, va_list));
-static int special_function_p PARAMS ((tree, int));
-static rtx try_to_integrate PARAMS ((tree, tree, rtx,
- int, tree, rtx));
-static int check_sibcall_argument_overlap_1 PARAMS ((rtx));
-static int check_sibcall_argument_overlap PARAMS ((rtx, struct arg_data *,
- int));
-
-static int combine_pending_stack_adjustment_and_call
- PARAMS ((int, struct args_size *, int));
-static tree fix_unsafe_tree PARAMS ((tree));
+static int calls_function (tree, int);
+static int calls_function_1 (tree, int);
+
+static void emit_call_1 (rtx, tree, tree, HOST_WIDE_INT, HOST_WIDE_INT,
+ HOST_WIDE_INT, rtx, rtx, int, rtx, int,
+ CUMULATIVE_ARGS *);
+static void precompute_register_parameters (int, struct arg_data *, int *);
+static int store_one_arg (struct arg_data *, rtx, int, int, int);
+static void store_unaligned_arguments_into_pseudos (struct arg_data *, int);
+static int finalize_must_preallocate (int, int, struct arg_data *,
+ struct args_size *);
+static void precompute_arguments (int, int, struct arg_data *);
+static int compute_argument_block_size (int, struct args_size *, int);
+static void initialize_argument_information (int, struct arg_data *,
+ struct args_size *, int, tree,
+ tree, CUMULATIVE_ARGS *, int,
+ rtx *, int *, int *, int *);
+static void compute_argument_addresses (struct arg_data *, rtx, int);
+static rtx rtx_for_function_call (tree, tree);
+static void load_register_parameters (struct arg_data *, int, rtx *, int,
+ int, int *);
+static rtx emit_library_call_value_1 (int, rtx, rtx, enum libcall_type,
+ enum machine_mode, int, va_list);
+static int special_function_p (tree, int);
+static rtx try_to_integrate (tree, tree, rtx, int, tree, rtx);
+static int check_sibcall_argument_overlap_1 (rtx);
+static int check_sibcall_argument_overlap (rtx, struct arg_data *, int);
+
+static int combine_pending_stack_adjustment_and_call (int, struct args_size *,
+ int);
+static tree fix_unsafe_tree (tree);
#ifdef REG_PARM_STACK_SPACE
-static rtx save_fixed_argument_area PARAMS ((int, rtx, int *, int *));
-static void restore_fixed_argument_area PARAMS ((rtx, rtx, int, int));
+static rtx save_fixed_argument_area (int, rtx, int *, int *);
+static void restore_fixed_argument_area (rtx, rtx, int, int);
#endif
/* If WHICH is 1, return 1 if EXP contains a call to the built-in function
@@ -206,9 +188,7 @@ static void restore_fixed_argument_area PARAMS ((rtx, rtx, int, int));
static tree calls_function_save_exprs;
static int
-calls_function (exp, which)
- tree exp;
- int which;
+calls_function (tree exp, int which)
{
int val;
@@ -221,9 +201,7 @@ calls_function (exp, which)
/* Recursive function to do the work of above function. */
static int
-calls_function_1 (exp, which)
- tree exp;
- int which;
+calls_function_1 (tree exp, int which)
{
int i;
enum tree_code code = TREE_CODE (exp);
@@ -323,12 +301,8 @@ calls_function_1 (exp, which)
CALL_INSN_FUNCTION_USAGE information. */
rtx
-prepare_call_address (funexp, fndecl, call_fusage, reg_parm_seen, sibcallp)
- rtx funexp;
- tree fndecl;
- rtx *call_fusage;
- int reg_parm_seen;
- int sibcallp;
+prepare_call_address (rtx funexp, tree fndecl, rtx *call_fusage,
+ int reg_parm_seen, int sibcallp)
{
rtx static_chain_value = 0;
@@ -409,21 +383,13 @@ prepare_call_address (funexp, fndecl, call_fusage, reg_parm_seen, sibcallp)
denote registers used by the called function. */
static void
-emit_call_1 (funexp, fndecl, funtype, stack_size, rounded_stack_size,
- struct_value_size, next_arg_reg, valreg, old_inhibit_defer_pop,
- call_fusage, ecf_flags, args_so_far)
- rtx funexp;
- tree fndecl ATTRIBUTE_UNUSED;
- tree funtype ATTRIBUTE_UNUSED;
- HOST_WIDE_INT stack_size ATTRIBUTE_UNUSED;
- HOST_WIDE_INT rounded_stack_size;
- HOST_WIDE_INT struct_value_size ATTRIBUTE_UNUSED;
- rtx next_arg_reg ATTRIBUTE_UNUSED;
- rtx valreg;
- int old_inhibit_defer_pop;
- rtx call_fusage;
- int ecf_flags;
- CUMULATIVE_ARGS *args_so_far ATTRIBUTE_UNUSED;
+emit_call_1 (rtx funexp, tree fndecl ATTRIBUTE_UNUSED, tree funtype ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT stack_size ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT rounded_stack_size,
+ HOST_WIDE_INT struct_value_size ATTRIBUTE_UNUSED,
+ rtx next_arg_reg ATTRIBUTE_UNUSED, rtx valreg,
+ int old_inhibit_defer_pop, rtx call_fusage, int ecf_flags,
+ CUMULATIVE_ARGS *args_so_far ATTRIBUTE_UNUSED)
{
rtx rounded_stack_size_rtx = GEN_INT (rounded_stack_size);
rtx call_insn;
@@ -437,7 +403,7 @@ emit_call_1 (funexp, fndecl, funtype, stack_size, rounded_stack_size,
#ifdef CALL_POPS_ARGS
n_popped += CALL_POPS_ARGS (* args_so_far);
#endif
-
+
/* Ensure address is valid. SYMBOL_REF is already valid, so no need,
and we don't want to load it into a register as an optimization,
because prepare_call_address already did it if it should be done. */
@@ -643,9 +609,7 @@ emit_call_1 (funexp, fndecl, funtype, stack_size, rounded_stack_size,
space from the stack such as alloca. */
static int
-special_function_p (fndecl, flags)
- tree fndecl;
- int flags;
+special_function_p (tree fndecl, int flags)
{
if (! (flags & ECF_MALLOC)
&& fndecl && DECL_NAME (fndecl)
@@ -725,16 +689,14 @@ special_function_p (fndecl, flags)
/* Return nonzero when tree represent call to longjmp. */
int
-setjmp_call_p (fndecl)
- tree fndecl;
+setjmp_call_p (tree fndecl)
{
return special_function_p (fndecl, 0) & ECF_RETURNS_TWICE;
}
/* Return true when exp contains alloca call. */
bool
-alloca_call_p (exp)
- tree exp;
+alloca_call_p (tree exp)
{
if (TREE_CODE (exp) == CALL_EXPR
&& TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR
@@ -749,8 +711,7 @@ alloca_call_p (exp)
/* Detect flags (function attributes) from the function decl or type node. */
int
-flags_from_decl_or_type (exp)
- tree exp;
+flags_from_decl_or_type (tree exp)
{
int flags = 0;
tree type = exp;
@@ -805,10 +766,7 @@ flags_from_decl_or_type (exp)
Set REG_PARM_SEEN if we encounter a register parameter. */
static void
-precompute_register_parameters (num_actuals, args, reg_parm_seen)
- int num_actuals;
- struct arg_data *args;
- int *reg_parm_seen;
+precompute_register_parameters (int num_actuals, struct arg_data *args, int *reg_parm_seen)
{
int i;
@@ -873,12 +831,7 @@ precompute_register_parameters (num_actuals, args, reg_parm_seen)
parameters, we must save and restore it. */
static rtx
-save_fixed_argument_area (reg_parm_stack_space, argblock,
- low_to_save, high_to_save)
- int reg_parm_stack_space;
- rtx argblock;
- int *low_to_save;
- int *high_to_save;
+save_fixed_argument_area (int reg_parm_stack_space, rtx argblock, int *low_to_save, int *high_to_save)
{
int low;
int high;
@@ -945,11 +898,7 @@ save_fixed_argument_area (reg_parm_stack_space, argblock,
}
static void
-restore_fixed_argument_area (save_area, argblock, high_to_save, low_to_save)
- rtx save_area;
- rtx argblock;
- int high_to_save;
- int low_to_save;
+restore_fixed_argument_area (rtx save_area, rtx argblock, int high_to_save, int low_to_save)
{
enum machine_mode save_mode = GET_MODE (save_area);
int delta;
@@ -984,9 +933,7 @@ restore_fixed_argument_area (save_area, argblock, high_to_save, low_to_save)
the aligned_regs array if it is nonzero. */
static void
-store_unaligned_arguments_into_pseudos (args, num_actuals)
- struct arg_data *args;
- int num_actuals;
+store_unaligned_arguments_into_pseudos (struct arg_data *args, int num_actuals)
{
int i, j;
@@ -1067,23 +1014,15 @@ store_unaligned_arguments_into_pseudos (args, num_actuals)
flags which may may be modified by this routine. */
static void
-initialize_argument_information (num_actuals, args, args_size, n_named_args,
- actparms, fndecl, args_so_far,
- reg_parm_stack_space, old_stack_level,
- old_pending_adj, must_preallocate,
- ecf_flags)
- int num_actuals ATTRIBUTE_UNUSED;
- struct arg_data *args;
- struct args_size *args_size;
- int n_named_args ATTRIBUTE_UNUSED;
- tree actparms;
- tree fndecl;
- CUMULATIVE_ARGS *args_so_far;
- int reg_parm_stack_space;
- rtx *old_stack_level;
- int *old_pending_adj;
- int *must_preallocate;
- int *ecf_flags;
+initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
+ struct arg_data *args,
+ struct args_size *args_size,
+ int n_named_args ATTRIBUTE_UNUSED,
+ tree actparms, tree fndecl,
+ CUMULATIVE_ARGS *args_so_far,
+ int reg_parm_stack_space,
+ rtx *old_stack_level, int *old_pending_adj,
+ int *must_preallocate, int *ecf_flags)
{
/* 1 if scanning parms front to back, -1 if scanning back to front. */
int inc;
@@ -1324,11 +1263,9 @@ initialize_argument_information (num_actuals, args, args_size, n_named_args,
for arguments passed in registers. */
static int
-compute_argument_block_size (reg_parm_stack_space, args_size,
- preferred_stack_boundary)
- int reg_parm_stack_space;
- struct args_size *args_size;
- int preferred_stack_boundary ATTRIBUTE_UNUSED;
+compute_argument_block_size (int reg_parm_stack_space,
+ struct args_size *args_size,
+ int preferred_stack_boundary ATTRIBUTE_UNUSED)
{
int unadjusted_args_size = args_size->constant;
@@ -1411,10 +1348,7 @@ compute_argument_block_size (reg_parm_stack_space, args_size,
precomputed argument. */
static void
-precompute_arguments (flags, num_actuals, args)
- int flags;
- int num_actuals;
- struct arg_data *args;
+precompute_arguments (int flags, int num_actuals, struct arg_data *args)
{
int i;
@@ -1482,11 +1416,7 @@ precompute_arguments (flags, num_actuals, args)
compute and return the final value for MUST_PREALLOCATE. */
static int
-finalize_must_preallocate (must_preallocate, num_actuals, args, args_size)
- int must_preallocate;
- int num_actuals;
- struct arg_data *args;
- struct args_size *args_size;
+finalize_must_preallocate (int must_preallocate, int num_actuals, struct arg_data *args, struct args_size *args_size)
{
/* See if we have or want to preallocate stack space.
@@ -1545,10 +1475,7 @@ finalize_must_preallocate (must_preallocate, num_actuals, args, args_size)
ARGBLOCK is an rtx for the address of the outgoing arguments. */
static void
-compute_argument_addresses (args, argblock, num_actuals)
- struct arg_data *args;
- rtx argblock;
- int num_actuals;
+compute_argument_addresses (struct arg_data *args, rtx argblock, int num_actuals)
{
if (argblock)
{
@@ -1609,9 +1536,7 @@ compute_argument_addresses (args, argblock, num_actuals)
ADDR is the operand 0 of CALL_EXPR for this call. */
static rtx
-rtx_for_function_call (fndecl, addr)
- tree fndecl;
- tree addr;
+rtx_for_function_call (tree fndecl, tree addr)
{
rtx funexp;
@@ -1645,20 +1570,15 @@ rtx_for_function_call (fndecl, addr)
expressions were already evaluated.
Mark all register-parms as living through the call, putting these USE
- insns in the CALL_INSN_FUNCTION_USAGE field.
-
+ insns in the CALL_INSN_FUNCTION_USAGE field.
+
When IS_SIBCALL, perform the check_sibcall_overlap_argument_overlap
checking, setting *SIBCALL_FAILURE if appropriate. */
static void
-load_register_parameters (args, num_actuals, call_fusage, flags,
- is_sibcall, sibcall_failure)
- struct arg_data *args;
- int num_actuals;
- rtx *call_fusage;
- int flags;
- int is_sibcall;
- int *sibcall_failure;
+load_register_parameters (struct arg_data *args, int num_actuals,
+ rtx *call_fusage, int flags, int is_sibcall,
+ int *sibcall_failure)
{
int i, j;
@@ -1736,13 +1656,8 @@ load_register_parameters (args, num_actuals, call_fusage, flags,
about the parameters. */
static rtx
-try_to_integrate (fndecl, actparms, target, ignore, type, structure_value_addr)
- tree fndecl;
- tree actparms;
- rtx target;
- int ignore;
- tree type;
- rtx structure_value_addr;
+try_to_integrate (tree fndecl, tree actparms, rtx target, int ignore,
+ tree type, rtx structure_value_addr)
{
rtx temp;
rtx before_call;
@@ -1864,12 +1779,9 @@ try_to_integrate (fndecl, actparms, target, ignore, type, structure_value_addr)
be popped after the call. Returns the adjustment. */
static int
-combine_pending_stack_adjustment_and_call (unadjusted_args_size,
- args_size,
- preferred_unit_stack_boundary)
- int unadjusted_args_size;
- struct args_size *args_size;
- int preferred_unit_stack_boundary;
+combine_pending_stack_adjustment_and_call (int unadjusted_args_size,
+ struct args_size *args_size,
+ int preferred_unit_stack_boundary)
{
/* The number of bytes to pop so that the stack will be
under-aligned by UNADJUSTED_ARGS_SIZE bytes. */
@@ -1920,8 +1832,7 @@ combine_pending_stack_adjustment_and_call (unadjusted_args_size,
zero otherwise. */
static int
-check_sibcall_argument_overlap_1 (x)
- rtx x;
+check_sibcall_argument_overlap_1 (rtx x)
{
RTX_CODE code;
int i, j;
@@ -1984,10 +1895,7 @@ check_sibcall_argument_overlap_1 (x)
slots, zero otherwise. */
static int
-check_sibcall_argument_overlap (insn, arg, mark_stored_args_map)
- rtx insn;
- struct arg_data *arg;
- int mark_stored_args_map;
+check_sibcall_argument_overlap (rtx insn, struct arg_data *arg, int mark_stored_args_map)
{
int low, high;
@@ -2016,8 +1924,7 @@ check_sibcall_argument_overlap (insn, arg, mark_stored_args_map)
}
static tree
-fix_unsafe_tree (t)
- tree t;
+fix_unsafe_tree (tree t)
{
switch (unsafe_for_reeval (t))
{
@@ -2051,10 +1958,7 @@ fix_unsafe_tree (t)
If IGNORE is nonzero, then we ignore the value of the function call. */
rtx
-expand_call (exp, target, ignore)
- tree exp;
- rtx target;
- int ignore;
+expand_call (tree exp, rtx target, int ignore)
{
/* Nonzero if we are currently expanding a call. */
static int currently_expanding_call = 0;
@@ -2931,7 +2835,7 @@ expand_call (exp, target, ignore)
break;
}
}
-
+
compute_argument_addresses (args, argblock, num_actuals);
/* If we push args individually in reverse order, perform stack alignment
@@ -3385,13 +3289,13 @@ expand_call (exp, target, ignore)
by at least the delay slot scheduling pass. We do this now instead of
adding to call_fusage before the call to emit_call_1 because TARGET
may be modified in the meantime. */
- if (structure_value_addr != 0 && target != 0
+ if (structure_value_addr != 0 && target != 0
&& GET_CODE (target) == MEM && RTX_UNCHANGING_P (target))
add_function_usage_to
(last_call_insn (),
gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_CLOBBER (VOIDmode, target),
NULL_RTX));
-
+
insns = get_insns ();
end_sequence ();
@@ -3572,14 +3476,9 @@ split_complex_types (tree types)
parameters are documented in the emit_library_call function below. */
static rtx
-emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
- int retval;
- rtx orgfun;
- rtx value;
- enum libcall_type fn_type;
- enum machine_mode outmode;
- int nargs;
- va_list p;
+emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
+ enum libcall_type fn_type,
+ enum machine_mode outmode, int nargs, va_list p)
{
/* Total size in bytes of all the stack-parms scanned so far. */
struct args_size args_size;
@@ -3799,7 +3698,7 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
{
rtx slot;
int must_copy = 1
-#ifdef FUNCTION_ARG_CALLEE_COPIES
+#ifdef FUNCTION_ARG_CALLEE_COPIES
&& ! FUNCTION_ARG_CALLEE_COPIES (args_so_far, mode,
NULL_TREE, 1)
#endif
@@ -4298,7 +4197,7 @@ emit_library_call (rtx orgfun, enum libcall_type fn_type,
enum machine_mode outmode, int nargs, ...)
{
va_list p;
-
+
va_start (p, nargs);
emit_library_call_value_1 (0, orgfun, NULL_RTX, fn_type, outmode, nargs, p);
va_end (p);
@@ -4319,7 +4218,7 @@ emit_library_call_value (rtx orgfun, rtx value,
{
rtx result;
va_list p;
-
+
va_start (p, nargs);
result = emit_library_call_value_1 (1, orgfun, value, fn_type, outmode,
nargs, p);
@@ -4348,12 +4247,8 @@ emit_library_call_value (rtx orgfun, rtx value,
zero otherwise. */
static int
-store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
- struct arg_data *arg;
- rtx argblock;
- int flags;
- int variable_size ATTRIBUTE_UNUSED;
- int reg_parm_stack_space;
+store_one_arg (struct arg_data *arg, rtx argblock, int flags,
+ int variable_size ATTRIBUTE_UNUSED, int reg_parm_stack_space)
{
tree pval = arg->tree_value;
rtx reg = 0;
@@ -4533,7 +4428,7 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
/* This isn't already where we want it on the stack, so put it there.
This can either be done with push or copy insns. */
- emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), NULL_RTX,
+ emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), NULL_RTX,
PARM_BOUNDARY, partial, reg, used - size, argblock,
ARGS_SIZE_RTX (arg->locate.offset), reg_parm_stack_space,
ARGS_SIZE_RTX (arg->locate.alignment_pad));
@@ -4682,9 +4577,7 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
For a little-endian machine, the reverse is true. */
bool
-default_must_pass_in_stack (mode, type)
- enum machine_mode mode;
- tree type;
+default_must_pass_in_stack (enum machine_mode mode, tree type)
{
if (!type)
return false;
diff --git a/gcc/cfg.c b/gcc/cfg.c
index 80b32c19af9..b55a2c0f3d1 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -1,6 +1,6 @@
/* Control flow graph manipulation code for GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -138,13 +138,13 @@ struct basic_block_def entry_exit_blocks[2]
}
};
-void debug_flow_info PARAMS ((void));
-static void free_edge PARAMS ((edge));
+void debug_flow_info (void);
+static void free_edge (edge);
/* Called once at initialization time. */
void
-init_flow ()
+init_flow (void)
{
static int initialized;
@@ -163,7 +163,7 @@ init_flow ()
obstack_free (&flow_obstack, flow_firstobj);
flow_firstobj = (char *) obstack_alloc (&flow_obstack, 0);
}
- bb_pool = create_alloc_pool ("Basic block pool",
+ bb_pool = create_alloc_pool ("Basic block pool",
sizeof (struct basic_block_def), 100);
edge_pool = create_alloc_pool ("Edge pool",
sizeof (struct edge_def), 100);
@@ -173,8 +173,7 @@ init_flow ()
without actually unlinking it from the pred/succ lists. */
static void
-free_edge (e)
- edge e;
+free_edge (edge e)
{
n_edges--;
pool_free (edge_pool, e);
@@ -183,7 +182,7 @@ free_edge (e)
/* Free the memory associated with the edge structures. */
void
-clear_edges ()
+clear_edges (void)
{
basic_block bb;
edge e;
@@ -223,7 +222,7 @@ clear_edges ()
/* Allocate memory for basic_block. */
basic_block
-alloc_block ()
+alloc_block (void)
{
basic_block bb;
bb = pool_alloc (bb_pool);
@@ -233,8 +232,7 @@ alloc_block ()
/* Link block B to chain after AFTER. */
void
-link_block (b, after)
- basic_block b, after;
+link_block (basic_block b, basic_block after)
{
b->next_bb = after->next_bb;
b->prev_bb = after;
@@ -244,8 +242,7 @@ link_block (b, after)
/* Unlink block B from chain. */
void
-unlink_block (b)
- basic_block b;
+unlink_block (basic_block b)
{
b->next_bb->prev_bb = b->prev_bb;
b->prev_bb->next_bb = b->next_bb;
@@ -253,11 +250,11 @@ unlink_block (b)
/* Sequentially order blocks and compact the arrays. */
void
-compact_blocks ()
+compact_blocks (void)
{
int i;
basic_block bb;
-
+
i = 0;
FOR_EACH_BB (bb)
{
@@ -275,8 +272,7 @@ compact_blocks ()
/* Remove block B from the basic block array. */
void
-expunge_block (b)
- basic_block b;
+expunge_block (basic_block b)
{
unlink_block (b);
BASIC_BLOCK (b->index) = NULL;
@@ -289,9 +285,7 @@ expunge_block (b)
possibly already exist. */
edge
-unchecked_make_edge (src, dst, flags)
- basic_block src, dst;
- int flags;
+unchecked_make_edge (basic_block src, basic_block dst, int flags)
{
edge e;
e = pool_alloc (edge_pool);
@@ -314,10 +308,7 @@ unchecked_make_edge (src, dst, flags)
edge cache CACHE. Return the new edge, NULL if already exist. */
edge
-cached_make_edge (edge_cache, src, dst, flags)
- sbitmap *edge_cache;
- basic_block src, dst;
- int flags;
+cached_make_edge (sbitmap *edge_cache, basic_block src, basic_block dst, int flags)
{
int use_edge_cache;
edge e;
@@ -349,7 +340,7 @@ cached_make_edge (edge_cache, src, dst, flags)
}
break;
}
-
+
e = unchecked_make_edge (src, dst, flags);
if (use_edge_cache)
@@ -362,9 +353,7 @@ cached_make_edge (edge_cache, src, dst, flags)
created edge or NULL if already exist. */
edge
-make_edge (src, dest, flags)
- basic_block src, dest;
- int flags;
+make_edge (basic_block src, basic_block dest, int flags)
{
return cached_make_edge (NULL, src, dest, flags);
}
@@ -373,9 +362,7 @@ make_edge (src, dest, flags)
that it is the single edge leaving SRC. */
edge
-make_single_succ_edge (src, dest, flags)
- basic_block src, dest;
- int flags;
+make_single_succ_edge (basic_block src, basic_block dest, int flags)
{
edge e = make_edge (src, dest, flags);
@@ -387,8 +374,7 @@ make_single_succ_edge (src, dest, flags)
/* This function will remove an edge from the flow graph. */
void
-remove_edge (e)
- edge e;
+remove_edge (edge e)
{
edge last_pred = NULL;
edge last_succ = NULL;
@@ -423,9 +409,7 @@ remove_edge (e)
/* Redirect an edge's successor from one block to another. */
void
-redirect_edge_succ (e, new_succ)
- edge e;
- basic_block new_succ;
+redirect_edge_succ (edge e, basic_block new_succ)
{
edge *pe;
@@ -443,9 +427,7 @@ redirect_edge_succ (e, new_succ)
/* Like previous but avoid possible duplicate edge. */
edge
-redirect_edge_succ_nodup (e, new_succ)
- edge e;
- basic_block new_succ;
+redirect_edge_succ_nodup (edge e, basic_block new_succ)
{
edge s;
@@ -473,9 +455,7 @@ redirect_edge_succ_nodup (e, new_succ)
/* Redirect an edge's predecessor from one block to another. */
void
-redirect_edge_pred (e, new_pred)
- edge e;
- basic_block new_pred;
+redirect_edge_pred (edge e, basic_block new_pred)
{
edge *pe;
@@ -492,7 +472,7 @@ redirect_edge_pred (e, new_pred)
}
void
-clear_bb_flags ()
+clear_bb_flags (void)
{
basic_block bb;
@@ -501,8 +481,7 @@ clear_bb_flags ()
}
void
-dump_flow_info (file)
- FILE *file;
+dump_flow_info (FILE *file)
{
int i;
int max_regno = max_reg_num ();
@@ -625,16 +604,13 @@ dump_flow_info (file)
}
void
-debug_flow_info ()
+debug_flow_info (void)
{
dump_flow_info (stderr);
}
void
-dump_edge_info (file, e, do_succ)
- FILE *file;
- edge e;
- int do_succ;
+dump_edge_info (FILE *file, edge e, int do_succ)
{
basic_block side = (do_succ ? e->dest : e->src);
@@ -693,9 +669,7 @@ static void *first_edge_aux_obj = 0;
be first initialized by alloc_aux_for_blocks. */
inline void
-alloc_aux_for_block (bb, size)
- basic_block bb;
- int size;
+alloc_aux_for_block (basic_block bb, int size)
{
/* Verify that aux field is clear. */
if (bb->aux || !first_block_aux_obj)
@@ -708,8 +682,7 @@ alloc_aux_for_block (bb, size)
alloc_aux_for_block for each basic block. */
void
-alloc_aux_for_blocks (size)
- int size;
+alloc_aux_for_blocks (int size)
{
static int initialized;
@@ -735,7 +708,7 @@ alloc_aux_for_blocks (size)
/* Clear AUX pointers of all blocks. */
void
-clear_aux_for_blocks ()
+clear_aux_for_blocks (void)
{
basic_block bb;
@@ -747,7 +720,7 @@ clear_aux_for_blocks ()
of all blocks. */
void
-free_aux_for_blocks ()
+free_aux_for_blocks (void)
{
if (!first_block_aux_obj)
abort ();
@@ -761,9 +734,7 @@ free_aux_for_blocks ()
be first initialized by alloc_aux_for_edges. */
inline void
-alloc_aux_for_edge (e, size)
- edge e;
- int size;
+alloc_aux_for_edge (edge e, int size)
{
/* Verify that aux field is clear. */
if (e->aux || !first_edge_aux_obj)
@@ -776,8 +747,7 @@ alloc_aux_for_edge (e, size)
alloc_aux_for_edge for each basic edge. */
void
-alloc_aux_for_edges (size)
- int size;
+alloc_aux_for_edges (int size)
{
static int initialized;
@@ -809,7 +779,7 @@ alloc_aux_for_edges (size)
/* Clear AUX pointers of all edges. */
void
-clear_aux_for_edges ()
+clear_aux_for_edges (void)
{
basic_block bb;
edge e;
@@ -825,7 +795,7 @@ clear_aux_for_edges ()
of all edges. */
void
-free_aux_for_edges ()
+free_aux_for_edges (void)
{
if (!first_edge_aux_obj)
abort ();
@@ -835,12 +805,12 @@ free_aux_for_edges ()
clear_aux_for_edges ();
}
-/* Verify the CFG consistency.
-
+/* Verify the CFG consistency.
+
Currently it does following checks edge and basic block list correctness
and calls into IL dependent checking then. */
void
-verify_flow_info ()
+verify_flow_info (void)
{
size_t *edge_checksum;
int num_bb_notes, err = 0;
@@ -984,9 +954,7 @@ verify_flow_info ()
/* Print out one basic block with live information at start and end. */
void
-dump_bb (bb, outf)
- basic_block bb;
- FILE *outf;
+dump_bb (basic_block bb, FILE *outf)
{
edge e;
@@ -1004,15 +972,13 @@ dump_bb (bb, outf)
}
void
-debug_bb (bb)
- basic_block bb;
+debug_bb (basic_block bb)
{
dump_bb (bb, stderr);
}
basic_block
-debug_bb_n (n)
- int n;
+debug_bb_n (int n)
{
basic_block bb = BASIC_BLOCK (n);
dump_bb (bb, stderr);
diff --git a/gcc/cfganal.c b/gcc/cfganal.c
index adbe8661124..186a6c422d5 100644
--- a/gcc/cfganal.c
+++ b/gcc/cfganal.c
@@ -46,29 +46,25 @@ struct depth_first_search_dsS {
};
typedef struct depth_first_search_dsS *depth_first_search_ds;
-static void flow_dfs_compute_reverse_init
- PARAMS ((depth_first_search_ds));
-static void flow_dfs_compute_reverse_add_bb
- PARAMS ((depth_first_search_ds, basic_block));
-static basic_block flow_dfs_compute_reverse_execute
- PARAMS ((depth_first_search_ds));
-static void flow_dfs_compute_reverse_finish
- PARAMS ((depth_first_search_ds));
-static void remove_fake_successors PARAMS ((basic_block));
-static bool need_fake_edge_p PARAMS ((rtx));
-static bool flow_active_insn_p PARAMS ((rtx));
+static void flow_dfs_compute_reverse_init (depth_first_search_ds);
+static void flow_dfs_compute_reverse_add_bb (depth_first_search_ds,
+ basic_block);
+static basic_block flow_dfs_compute_reverse_execute (depth_first_search_ds);
+static void flow_dfs_compute_reverse_finish (depth_first_search_ds);
+static void remove_fake_successors (basic_block);
+static bool need_fake_edge_p (rtx);
+static bool flow_active_insn_p (rtx);
/* Like active_insn_p, except keep the return value clobber around
even after reload. */
static bool
-flow_active_insn_p (insn)
- rtx insn;
+flow_active_insn_p (rtx insn)
{
if (active_insn_p (insn))
return true;
- /* A clobber of the function return value exists for buggy
+ /* A clobber of the function return value exists for buggy
programs that fail to return a value. Its effect is to
keep the return value from being live across the entire
function. If we allow it to be skipped, we introduce the
@@ -85,8 +81,7 @@ flow_active_insn_p (insn)
its single destination. */
bool
-forwarder_block_p (bb)
- basic_block bb;
+forwarder_block_p (basic_block bb)
{
rtx insn;
@@ -106,8 +101,7 @@ forwarder_block_p (bb)
/* Return nonzero if we can reach target from src by falling through. */
bool
-can_fallthru (src, target)
- basic_block src, target;
+can_fallthru (basic_block src, basic_block target)
{
rtx insn = src->end;
rtx insn2 = target->head;
@@ -133,7 +127,7 @@ can_fallthru (src, target)
and heavily borrowed from flow_depth_first_order_compute. */
bool
-mark_dfs_back_edges ()
+mark_dfs_back_edges (void)
{
edge *stack;
int *pre;
@@ -217,7 +211,7 @@ mark_dfs_back_edges ()
/* Set the flag EDGE_CAN_FALLTHRU for edges that can be fallthru. */
void
-set_edge_can_fallthru_flag ()
+set_edge_can_fallthru_flag (void)
{
basic_block bb;
@@ -252,8 +246,7 @@ set_edge_can_fallthru_flag ()
Helper function for the flow_call_edges_add. */
static bool
-need_fake_edge_p (insn)
- rtx insn;
+need_fake_edge_p (rtx insn)
{
if (!INSN_P (insn))
return false;
@@ -282,8 +275,7 @@ need_fake_edge_p (insn)
that all subsequent instructions must be executed. */
int
-flow_call_edges_add (blocks)
- sbitmap blocks;
+flow_call_edges_add (sbitmap blocks)
{
int i;
int blocks_split = 0;
@@ -405,7 +397,7 @@ flow_call_edges_add (blocks)
block is reachable. */
void
-find_unreachable_blocks ()
+find_unreachable_blocks (void)
{
edge e;
basic_block *tos, *worklist, bb;
@@ -461,7 +453,7 @@ find_unreachable_blocks ()
and the data structure is filled in. */
struct edge_list *
-create_edge_list ()
+create_edge_list (void)
{
struct edge_list *elist;
edge e;
@@ -499,8 +491,7 @@ create_edge_list ()
/* This function free's memory associated with an edge list. */
void
-free_edge_list (elist)
- struct edge_list *elist;
+free_edge_list (struct edge_list *elist)
{
if (elist)
{
@@ -512,9 +503,7 @@ free_edge_list (elist)
/* This function provides debug output showing an edge list. */
void
-print_edge_list (f, elist)
- FILE *f;
- struct edge_list *elist;
+print_edge_list (FILE *f, struct edge_list *elist)
{
int x;
@@ -541,9 +530,7 @@ print_edge_list (f, elist)
extra edges. */
void
-verify_edge_list (f, elist)
- FILE *f;
- struct edge_list *elist;
+verify_edge_list (FILE *f, struct edge_list *elist)
{
int pred, succ, index;
edge e;
@@ -608,9 +595,7 @@ verify_edge_list (f, elist)
a specified predecessor and successor. */
int
-find_edge_index (edge_list, pred, succ)
- struct edge_list *edge_list;
- basic_block pred, succ;
+find_edge_index (struct edge_list *edge_list, basic_block pred, basic_block succ)
{
int x;
@@ -625,10 +610,7 @@ find_edge_index (edge_list, pred, succ)
/* Dump the list of basic blocks in the bitmap NODES. */
void
-flow_nodes_print (str, nodes, file)
- const char *str;
- const sbitmap nodes;
- FILE *file;
+flow_nodes_print (const char *str, const sbitmap nodes, FILE *file)
{
int node;
@@ -643,11 +625,7 @@ flow_nodes_print (str, nodes, file)
/* Dump the list of edges in the array EDGE_LIST. */
void
-flow_edge_list_print (str, edge_list, num_edges, file)
- const char *str;
- const edge *edge_list;
- int num_edges;
- FILE *file;
+flow_edge_list_print (const char *str, const edge *edge_list, int num_edges, FILE *file)
{
int i;
@@ -668,8 +646,7 @@ flow_edge_list_print (str, edge_list, num_edges, file)
list it is in. */
static void
-remove_fake_successors (bb)
- basic_block bb;
+remove_fake_successors (basic_block bb)
{
edge e;
@@ -688,7 +665,7 @@ remove_fake_successors (bb)
fake predecessors. */
void
-remove_fake_edges ()
+remove_fake_edges (void)
{
basic_block bb;
@@ -701,7 +678,7 @@ remove_fake_edges ()
edges to exist. */
void
-add_noreturn_fake_exit_edges ()
+add_noreturn_fake_exit_edges (void)
{
basic_block bb;
@@ -722,7 +699,7 @@ add_noreturn_fake_exit_edges ()
nodes not reachable from the exit block. */
void
-connect_infinite_loops_to_exit ()
+connect_infinite_loops_to_exit (void)
{
basic_block unvisited_block;
struct depth_first_search_dsS dfs_ds;
@@ -750,8 +727,7 @@ connect_infinite_loops_to_exit ()
/* Compute reverse top sort order */
void
-flow_reverse_top_sort_order_compute (rts_order)
- int *rts_order;
+flow_reverse_top_sort_order_compute (int *rts_order)
{
edge *stack;
int sp;
@@ -819,9 +795,7 @@ flow_reverse_top_sort_order_compute (rts_order)
possible. */
int
-flow_depth_first_order_compute (dfs_order, rc_order)
- int *dfs_order;
- int *rc_order;
+flow_depth_first_order_compute (int *dfs_order, int *rc_order)
{
edge *stack;
int sp;
@@ -922,8 +896,7 @@ struct dfst_node
2) Walking the resulting tree from right to left. */
void
-flow_preorder_transversal_compute (pot_order)
- int *pot_order;
+flow_preorder_transversal_compute (int *pot_order)
{
edge e;
edge *stack;
@@ -1062,8 +1035,7 @@ flow_preorder_transversal_compute (pot_order)
element on the stack. */
static void
-flow_dfs_compute_reverse_init (data)
- depth_first_search_ds data;
+flow_dfs_compute_reverse_init (depth_first_search_ds data)
{
/* Allocate stack for back-tracking up CFG. */
data->stack = (basic_block *) xmalloc ((n_basic_blocks - (INVALID_BLOCK + 1))
@@ -1084,9 +1056,7 @@ flow_dfs_compute_reverse_init (data)
block. */
static void
-flow_dfs_compute_reverse_add_bb (data, bb)
- depth_first_search_ds data;
- basic_block bb;
+flow_dfs_compute_reverse_add_bb (depth_first_search_ds data, basic_block bb)
{
data->stack[data->sp++] = bb;
SET_BIT (data->visited_blocks, bb->index - (INVALID_BLOCK + 1));
@@ -1098,8 +1068,7 @@ flow_dfs_compute_reverse_add_bb (data, bb)
available. */
static basic_block
-flow_dfs_compute_reverse_execute (data)
- depth_first_search_ds data;
+flow_dfs_compute_reverse_execute (depth_first_search_ds data)
{
basic_block bb;
edge e;
@@ -1127,8 +1096,7 @@ flow_dfs_compute_reverse_execute (data)
reverse graph. */
static void
-flow_dfs_compute_reverse_finish (data)
- depth_first_search_ds data;
+flow_dfs_compute_reverse_finish (depth_first_search_ds data)
{
free (data->stack);
sbitmap_free (data->visited_blocks);
@@ -1138,13 +1106,9 @@ flow_dfs_compute_reverse_finish (data)
if REVERSE, go against direction of edges. Returns number of blocks
found and their list in RSLT. RSLT can contain at most RSLT_MAX items. */
int
-dfs_enumerate_from (bb, reverse, predicate, rslt, rslt_max, data)
- basic_block bb;
- int reverse;
- bool (*predicate) PARAMS ((basic_block, void *));
- basic_block *rslt;
- int rslt_max;
- void *data;
+dfs_enumerate_from (basic_block bb, int reverse,
+ bool (*predicate) (basic_block, void *),
+ basic_block *rslt, int rslt_max, void *data)
{
basic_block *st, lbb;
int sp = 0, tv = 0;
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index de57653ab46..eb7fd22e331 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -48,23 +48,20 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "toplev.h"
#include "timevar.h"
-static int count_basic_blocks PARAMS ((rtx));
-static void find_basic_blocks_1 PARAMS ((rtx));
-static rtx find_label_refs PARAMS ((rtx, rtx));
-static void make_edges PARAMS ((rtx, basic_block,
- basic_block, int));
-static void make_label_edge PARAMS ((sbitmap *, basic_block,
- rtx, int));
-static void make_eh_edge PARAMS ((sbitmap *, basic_block, rtx));
-static void find_bb_boundaries PARAMS ((basic_block));
-static void compute_outgoing_frequencies PARAMS ((basic_block));
+static int count_basic_blocks (rtx);
+static void find_basic_blocks_1 (rtx);
+static rtx find_label_refs (rtx, rtx);
+static void make_edges (rtx, basic_block, basic_block, int);
+static void make_label_edge (sbitmap *, basic_block, rtx, int);
+static void make_eh_edge (sbitmap *, basic_block, rtx);
+static void find_bb_boundaries (basic_block);
+static void compute_outgoing_frequencies (basic_block);
/* Return true if insn is something that should be contained inside basic
block. */
bool
-inside_basic_block_p (insn)
- rtx insn;
+inside_basic_block_p (rtx insn)
{
switch (GET_CODE (insn))
{
@@ -96,8 +93,7 @@ inside_basic_block_p (insn)
the basic block. */
bool
-control_flow_insn_p (insn)
- rtx insn;
+control_flow_insn_p (rtx insn)
{
rtx note;
@@ -138,8 +134,7 @@ control_flow_insn_p (insn)
/* Count the basic blocks of the function. */
static int
-count_basic_blocks (f)
- rtx f;
+count_basic_blocks (rtx f)
{
int count = 0;
bool saw_insn = false;
@@ -180,9 +175,7 @@ count_basic_blocks (f)
This is used to scan the alternatives of a call placeholder. */
static rtx
-find_label_refs (f, lvl)
- rtx f;
- rtx lvl;
+find_label_refs (rtx f, rtx lvl)
{
rtx insn;
@@ -229,11 +222,7 @@ find_label_refs (f, lvl)
/* Create an edge from a basic block to a label. */
static void
-make_label_edge (edge_cache, src, label, flags)
- sbitmap *edge_cache;
- basic_block src;
- rtx label;
- int flags;
+make_label_edge (sbitmap *edge_cache, basic_block src, rtx label, int flags)
{
if (GET_CODE (label) != CODE_LABEL)
abort ();
@@ -252,10 +241,7 @@ make_label_edge (edge_cache, src, label, flags)
/* Create the edges generated by INSN in REGION. */
static void
-make_eh_edge (edge_cache, src, insn)
- sbitmap *edge_cache;
- basic_block src;
- rtx insn;
+make_eh_edge (sbitmap *edge_cache, basic_block src, rtx insn)
{
int is_call = GET_CODE (insn) == CALL_INSN ? EDGE_ABNORMAL_CALL : 0;
rtx handlers, i;
@@ -278,10 +264,7 @@ make_eh_edge (edge_cache, src, insn)
the list of exception regions active at the end of the basic block. */
static void
-make_edges (label_value_list, min, max, update_p)
- rtx label_value_list;
- basic_block min, max;
- int update_p;
+make_edges (rtx label_value_list, basic_block min, basic_block max, int update_p)
{
basic_block bb;
sbitmap *edge_cache = NULL;
@@ -464,8 +447,7 @@ make_edges (label_value_list, min, max, update_p)
will be used in make_edges for use with computed gotos. */
static void
-find_basic_blocks_1 (f)
- rtx f;
+find_basic_blocks_1 (rtx f)
{
rtx insn, next;
rtx bb_note = NULL_RTX;
@@ -604,10 +586,8 @@ find_basic_blocks_1 (f)
numbers in use. */
void
-find_basic_blocks (f, nregs, file)
- rtx f;
- int nregs ATTRIBUTE_UNUSED;
- FILE *file ATTRIBUTE_UNUSED;
+find_basic_blocks (rtx f, int nregs ATTRIBUTE_UNUSED,
+ FILE *file ATTRIBUTE_UNUSED)
{
basic_block bb;
@@ -622,7 +602,7 @@ find_basic_blocks (f, nregs, file)
tag for reuse during create_basic_block, just in case some pass
copies around basic block notes improperly. */
FOR_EACH_BB (bb)
- bb->aux = NULL;
+ bb->aux = NULL;
VARRAY_FREE (basic_block_info);
}
@@ -667,8 +647,7 @@ enum state {BLOCK_NEW = 0, BLOCK_ORIGINAL, BLOCK_TO_SPLIT};
and create new basic blocks in the progress. */
static void
-find_bb_boundaries (bb)
- basic_block bb;
+find_bb_boundaries (basic_block bb)
{
rtx insn = bb->head;
rtx end = bb->end;
@@ -734,8 +713,7 @@ find_bb_boundaries (bb)
and probabilities of outgoing edges. */
static void
-compute_outgoing_frequencies (b)
- basic_block b;
+compute_outgoing_frequencies (basic_block b)
{
edge e, f;
@@ -771,8 +749,7 @@ compute_outgoing_frequencies (b)
basic block. Update the data structure. */
void
-find_many_sub_basic_blocks (blocks)
- sbitmap blocks;
+find_many_sub_basic_blocks (sbitmap blocks)
{
basic_block bb, min, max;
@@ -826,8 +803,7 @@ find_many_sub_basic_blocks (blocks)
/* Like above but for single basic block only. */
void
-find_sub_basic_blocks (bb)
- basic_block bb;
+find_sub_basic_blocks (basic_block bb)
{
basic_block min, max, b;
basic_block next = bb->next_bb;
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index b61d287bca4..62f7f301e5b 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -1,6 +1,6 @@
/* Control flow optimization code for GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -67,36 +67,30 @@ enum bb_flags
#define FORWARDER_BLOCK_P(BB) (BB_FLAGS (BB) & BB_FORWARDER_BLOCK)
-static bool try_crossjump_to_edge PARAMS ((int, edge, edge));
-static bool try_crossjump_bb PARAMS ((int, basic_block));
-static bool outgoing_edges_match PARAMS ((int,
- basic_block, basic_block));
-static int flow_find_cross_jump PARAMS ((int, basic_block, basic_block,
- rtx *, rtx *));
-static bool insns_match_p PARAMS ((int, rtx, rtx));
-
-static bool label_is_jump_target_p PARAMS ((rtx, rtx));
-static bool tail_recursion_label_p PARAMS ((rtx));
-static void merge_blocks_move_predecessor_nojumps PARAMS ((basic_block,
- basic_block));
-static void merge_blocks_move_successor_nojumps PARAMS ((basic_block,
- basic_block));
-static basic_block merge_blocks PARAMS ((edge,basic_block,basic_block,
- int));
-static bool try_optimize_cfg PARAMS ((int));
-static bool try_simplify_condjump PARAMS ((basic_block));
-static bool try_forward_edges PARAMS ((int, basic_block));
-static edge thread_jump PARAMS ((int, edge, basic_block));
-static bool mark_effect PARAMS ((rtx, bitmap));
-static void notice_new_block PARAMS ((basic_block));
-static void update_forwarder_flag PARAMS ((basic_block));
-static int mentions_nonequal_regs PARAMS ((rtx *, void *));
+static bool try_crossjump_to_edge (int, edge, edge);
+static bool try_crossjump_bb (int, basic_block);
+static bool outgoing_edges_match (int, basic_block, basic_block);
+static int flow_find_cross_jump (int, basic_block, basic_block, rtx *, rtx *);
+static bool insns_match_p (int, rtx, rtx);
+
+static bool label_is_jump_target_p (rtx, rtx);
+static bool tail_recursion_label_p (rtx);
+static void merge_blocks_move_predecessor_nojumps (basic_block, basic_block);
+static void merge_blocks_move_successor_nojumps (basic_block, basic_block);
+static basic_block merge_blocks (edge,basic_block,basic_block, int);
+static bool try_optimize_cfg (int);
+static bool try_simplify_condjump (basic_block);
+static bool try_forward_edges (int, basic_block);
+static edge thread_jump (int, edge, basic_block);
+static bool mark_effect (rtx, bitmap);
+static void notice_new_block (basic_block);
+static void update_forwarder_flag (basic_block);
+static int mentions_nonequal_regs (rtx *, void *);
/* Set flags for newly created block. */
static void
-notice_new_block (bb)
- basic_block bb;
+notice_new_block (basic_block bb)
{
if (!bb)
return;
@@ -108,8 +102,7 @@ notice_new_block (bb)
/* Recompute forwarder flag after block has been modified. */
static void
-update_forwarder_flag (bb)
- basic_block bb;
+update_forwarder_flag (basic_block bb)
{
if (forwarder_block_p (bb))
BB_SET_FLAG (bb, BB_FORWARDER_BLOCK);
@@ -121,8 +114,7 @@ update_forwarder_flag (bb)
Return true if something changed. */
static bool
-try_simplify_condjump (cbranch_block)
- basic_block cbranch_block;
+try_simplify_condjump (basic_block cbranch_block)
{
basic_block jump_block, jump_dest_block, cbranch_dest_block;
edge cbranch_jump_edge, cbranch_fallthru_edge;
@@ -190,9 +182,7 @@ try_simplify_condjump (cbranch_block)
on register. Used by jump threading. */
static bool
-mark_effect (exp, nonequal)
- rtx exp;
- regset nonequal;
+mark_effect (rtx exp, regset nonequal)
{
int regno;
rtx dest;
@@ -241,9 +231,7 @@ mark_effect (exp, nonequal)
/* Return nonzero if X is an register set in regset DATA.
Called via for_each_rtx. */
static int
-mentions_nonequal_regs (x, data)
- rtx *x;
- void *data;
+mentions_nonequal_regs (rtx *x, void *data)
{
regset nonequal = (regset) data;
if (REG_P (*x))
@@ -268,10 +256,7 @@ mentions_nonequal_regs (x, data)
if exist, NULL otherwise. */
static edge
-thread_jump (mode, e, b)
- int mode;
- edge e;
- basic_block b;
+thread_jump (int mode, edge e, basic_block b)
{
rtx set1, set2, cond1, cond2, insn;
enum rtx_code code1, code2, reversed_code2;
@@ -413,9 +398,7 @@ failed_exit:
Return true if successful. */
static bool
-try_forward_edges (mode, b)
- basic_block b;
- int mode;
+try_forward_edges (int mode, basic_block b)
{
bool changed = false;
edge e, next, *threaded_edges = NULL;
@@ -648,8 +631,7 @@ try_forward_edges (mode, b)
not apply to the fallthru case of a conditional jump. */
static bool
-label_is_jump_target_p (label, jump_insn)
- rtx label, jump_insn;
+label_is_jump_target_p (rtx label, rtx jump_insn)
{
rtx tmp = JUMP_LABEL (jump_insn);
@@ -672,8 +654,7 @@ label_is_jump_target_p (label, jump_insn)
/* Return true if LABEL is used for tail recursion. */
static bool
-tail_recursion_label_p (label)
- rtx label;
+tail_recursion_label_p (rtx label)
{
rtx x;
@@ -689,8 +670,7 @@ tail_recursion_label_p (label)
any jumps (aside from the jump from A to B). */
static void
-merge_blocks_move_predecessor_nojumps (a, b)
- basic_block a, b;
+merge_blocks_move_predecessor_nojumps (basic_block a, basic_block b)
{
rtx barrier;
@@ -732,8 +712,7 @@ merge_blocks_move_predecessor_nojumps (a, b)
any jumps (aside from the jump from A to B). */
static void
-merge_blocks_move_successor_nojumps (a, b)
- basic_block a, b;
+merge_blocks_move_successor_nojumps (basic_block a, basic_block b)
{
rtx barrier, real_b_end;
@@ -795,10 +774,7 @@ merge_blocks_move_successor_nojumps (a, b)
relative ordering of these two. Hopefully it is not too common. */
static basic_block
-merge_blocks (e, b, c, mode)
- edge e;
- basic_block b, c;
- int mode;
+merge_blocks (edge e, basic_block b, basic_block c, int mode)
{
basic_block next;
/* If C has a tail recursion label, do not merge. There is no
@@ -895,9 +871,7 @@ merge_blocks (e, b, c, mode)
/* Return true if I1 and I2 are equivalent and thus can be crossjumped. */
static bool
-insns_match_p (mode, i1, i2)
- int mode ATTRIBUTE_UNUSED;
- rtx i1, i2;
+insns_match_p (int mode ATTRIBUTE_UNUSED, rtx i1, rtx i2)
{
rtx p1, p2;
@@ -1010,10 +984,8 @@ insns_match_p (mode, i1, i2)
store the head of the blocks in *F1 and *F2. */
static int
-flow_find_cross_jump (mode, bb1, bb2, f1, f2)
- int mode ATTRIBUTE_UNUSED;
- basic_block bb1, bb2;
- rtx *f1, *f2;
+flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1,
+ basic_block bb2, rtx *f1, rtx *f2)
{
rtx i1, i2, last1, last2, afterlast1, afterlast2;
int ninsns = 0;
@@ -1122,10 +1094,7 @@ flow_find_cross_jump (mode, bb1, bb2, f1, f2)
We may assume that there exists one edge with a common destination. */
static bool
-outgoing_edges_match (mode, bb1, bb2)
- int mode;
- basic_block bb1;
- basic_block bb2;
+outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
{
int nehedges1 = 0, nehedges2 = 0;
edge fallthru1 = 0, fallthru2 = 0;
@@ -1394,9 +1363,7 @@ outgoing_edges_match (mode, bb1, bb2)
(maybe the middle of) E1->SRC to (maybe the middle of) E2->SRC. */
static bool
-try_crossjump_to_edge (mode, e1, e2)
- int mode;
- edge e1, e2;
+try_crossjump_to_edge (int mode, edge e1, edge e2)
{
int nmatch;
basic_block src1 = e1->src, src2 = e2->src;
@@ -1580,9 +1547,7 @@ try_crossjump_to_edge (mode, e1, e2)
any changes made. */
static bool
-try_crossjump_bb (mode, bb)
- int mode;
- basic_block bb;
+try_crossjump_bb (int mode, basic_block bb)
{
edge e, e2, nexte2, nexte, fallthru;
bool changed;
@@ -1675,8 +1640,7 @@ try_crossjump_bb (mode, bb)
instructions etc. Return nonzero if changes were made. */
static bool
-try_optimize_cfg (mode)
- int mode;
+try_optimize_cfg (int mode)
{
bool changed_overall = false;
bool changed;
@@ -1856,7 +1820,7 @@ try_optimize_cfg (mode)
/* Delete all unreachable basic blocks. */
bool
-delete_unreachable_blocks ()
+delete_unreachable_blocks (void)
{
bool changed = false;
basic_block b, next_bb;
@@ -1884,8 +1848,7 @@ delete_unreachable_blocks ()
/* Tidy the CFG by deleting unreachable code and whatnot. */
bool
-cleanup_cfg (mode)
- int mode;
+cleanup_cfg (int mode)
{
bool changed = false;
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index d5815a12307..525289c04f8 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -34,15 +34,15 @@ extern struct cfg_hooks cfg_layout_rtl_cfg_hooks;
struct cfg_hooks *cfg_hooks;
/* Initialization of functions specific to the rtl IR. */
-void
-rtl_register_cfg_hooks ()
+void
+rtl_register_cfg_hooks (void)
{
cfg_hooks = &rtl_cfg_hooks;
}
/* Initialization of functions specific to the rtl IR. */
-void
-cfg_layout_rtl_register_cfg_hooks ()
+void
+cfg_layout_rtl_register_cfg_hooks (void)
{
cfg_hooks = &cfg_layout_rtl_cfg_hooks;
}
diff --git a/gcc/cfghooks.h b/gcc/cfghooks.h
index 39acd662b27..3097b214da6 100644
--- a/gcc/cfghooks.h
+++ b/gcc/cfghooks.h
@@ -26,30 +26,30 @@ struct cfg_hooks
{
/* Debugging. Do not use macros to hook these so they can be called from
debugger! */
- int (*cfgh_verify_flow_info) PARAMS ((void));
- void (*dump_bb) PARAMS ((basic_block, FILE *));
+ int (*cfgh_verify_flow_info) (void);
+ void (*dump_bb) (basic_block, FILE *);
/* Basic CFG manipulation. */
/* Redirect edge E to the given basic block B and update underlying program
representation. Returns false when edge is not easilly redirectable for
whatever reason. */
- bool (*redirect_edge_and_branch) PARAMS ((edge e, basic_block b));
+ bool (*redirect_edge_and_branch) (edge e, basic_block b);
/* Same as the above but allows redirecting of fallthru edges. In that case
newly created forwarder basic block is returned. It aborts when called
on abnormal edge. */
- basic_block (*redirect_edge_and_branch_force)PARAMS ((edge, basic_block));
+ basic_block (*redirect_edge_and_branch_force) (edge, basic_block);
/* Remove given basic block and all edges possibly pointing into it. */
- void (*delete_block)PARAMS ((basic_block));
+ void (*delete_block) (basic_block);
/* Split basic block B after specified instruction I. */
- edge (*split_block) PARAMS ((basic_block b, void * i));
+ edge (*split_block) (basic_block b, void * i);
/* Higher level functions representable by primitive operations above if
we didn't have some oddities in RTL and Tree representations. */
- basic_block (*cfgh_split_edge) PARAMS ((edge));
+ basic_block (*cfgh_split_edge) (edge);
};
#define redirect_edge_and_branch(e,b) cfg_hooks->redirect_edge_and_branch (e,b)
@@ -65,7 +65,7 @@ extern struct cfg_hooks rtl_cfg_hooks;
extern struct cfg_hooks *cfg_hooks;
/* Declarations. */
-extern void rtl_register_cfg_hooks PARAMS ((void));
-extern void cfg_layout_rtl_register_cfg_hooks PARAMS ((void));
+extern void rtl_register_cfg_hooks (void);
+extern void cfg_layout_rtl_register_cfg_hooks (void);
#endif /* GCC_CFGHOOKS_H */
diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c
index 5bd3ca05655..736d8887ec5 100644
--- a/gcc/cfglayout.c
+++ b/gcc/cfglayout.c
@@ -1,5 +1,5 @@
/* Basic block reordering routines for the GNU compiler.
- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -42,25 +42,23 @@ extern struct obstack flow_obstack;
/* Holds the interesting trailing notes for the function. */
rtx cfg_layout_function_footer;
-static rtx skip_insns_after_block PARAMS ((basic_block));
-static void record_effective_endpoints PARAMS ((void));
-static rtx label_for_bb PARAMS ((basic_block));
-static void fixup_reorder_chain PARAMS ((void));
+static rtx skip_insns_after_block (basic_block);
+static void record_effective_endpoints (void);
+static rtx label_for_bb (basic_block);
+static void fixup_reorder_chain (void);
-static void set_block_levels PARAMS ((tree, int));
-static void change_scope PARAMS ((rtx, tree, tree));
+static void set_block_levels (tree, int);
+static void change_scope (rtx, tree, tree);
-void verify_insn_chain PARAMS ((void));
-static void cleanup_unconditional_jumps PARAMS ((struct loops *));
-static void fixup_fallthru_exit_predecessor PARAMS ((void));
-static rtx duplicate_insn_chain PARAMS ((rtx, rtx));
-static void break_superblocks PARAMS ((void));
-static tree insn_scope PARAMS ((rtx));
+void verify_insn_chain (void);
+static void cleanup_unconditional_jumps (struct loops *);
+static void fixup_fallthru_exit_predecessor (void);
+static rtx duplicate_insn_chain (rtx, rtx);
+static void break_superblocks (void);
+static tree insn_scope (rtx);
rtx
-unlink_insn_chain (first, last)
- rtx first;
- rtx last;
+unlink_insn_chain (rtx first, rtx last)
{
rtx prevfirst = PREV_INSN (first);
rtx nextlast = NEXT_INSN (last);
@@ -83,8 +81,7 @@ unlink_insn_chain (first, last)
we return the last one. Otherwise, we return the end of BB. */
static rtx
-skip_insns_after_block (bb)
- basic_block bb;
+skip_insns_after_block (basic_block bb)
{
rtx insn, last_insn, next_head, prev;
@@ -171,8 +168,7 @@ skip_insns_after_block (bb)
/* Locate or create a label for a given basic block. */
static rtx
-label_for_bb (bb)
- basic_block bb;
+label_for_bb (basic_block bb)
{
rtx label = bb->head;
@@ -191,7 +187,7 @@ label_for_bb (bb)
block, as defined by skip_insns_after_block above. */
static void
-record_effective_endpoints ()
+record_effective_endpoints (void)
{
rtx next_insn = get_insns ();
basic_block bb;
@@ -235,7 +231,7 @@ int epilogue_locator;
INSN_LOCATORs. */
void
-insn_locators_initialize ()
+insn_locators_initialize (void)
{
tree block = NULL;
tree last_block = NULL;
@@ -325,9 +321,7 @@ insn_locators_initialize ()
found in the block tree. */
static void
-set_block_levels (block, level)
- tree block;
- int level;
+set_block_levels (tree block, int level)
{
while (block)
{
@@ -339,8 +333,7 @@ set_block_levels (block, level)
/* Return sope resulting from combination of S1 and S2. */
tree
-choose_inner_scope (s1, s2)
- tree s1, s2;
+choose_inner_scope (tree s1, tree s2)
{
if (!s1)
return s2;
@@ -354,9 +347,7 @@ choose_inner_scope (s1, s2)
/* Emit lexical block notes needed to change scope from S1 to S2. */
static void
-change_scope (orig_insn, s1, s2)
- rtx orig_insn;
- tree s1, s2;
+change_scope (rtx orig_insn, tree s1, tree s2)
{
rtx insn = orig_insn;
tree com = NULL_TREE;
@@ -400,8 +391,7 @@ change_scope (orig_insn, s1, s2)
/* Return lexical scope block insn belong to. */
static tree
-insn_scope (insn)
- rtx insn;
+insn_scope (rtx insn)
{
int max = VARRAY_ACTIVE_SIZE (block_locators_locs);
int min = 0;
@@ -429,8 +419,7 @@ insn_scope (insn)
/* Return line number of the statement that produced this insn. */
int
-insn_line (insn)
- rtx insn;
+insn_line (rtx insn)
{
int max = VARRAY_ACTIVE_SIZE (line_locators_locs);
int min = 0;
@@ -458,8 +447,7 @@ insn_line (insn)
/* Return source file of the statement that produced this insn. */
const char *
-insn_file (insn)
- rtx insn;
+insn_file (rtx insn)
{
int max = VARRAY_ACTIVE_SIZE (file_locators_locs);
int min = 0;
@@ -489,7 +477,7 @@ insn_file (insn)
on the scope tree and the newly reordered instructions. */
void
-reemit_insn_block_notes ()
+reemit_insn_block_notes (void)
{
tree cur_block = DECL_INITIAL (cfun->decl);
rtx insn, note;
@@ -512,7 +500,7 @@ reemit_insn_block_notes ()
this_block = NULL;
for (i = 0; i < XVECLEN (body, 0); i++)
this_block = choose_inner_scope (this_block,
- insn_scope (XVECEXP (body, 0, i)));
+ insn_scope (XVECEXP (body, 0, i)));
}
if (! this_block)
continue;
@@ -525,7 +513,7 @@ reemit_insn_block_notes ()
}
/* change_scope emits before the insn, not after. */
- note = emit_note (NULL, NOTE_INSN_DELETED);
+ note = emit_note (NOTE_INSN_DELETED);
change_scope (note, cur_block, DECL_INITIAL (cfun->decl));
delete_insn (note);
@@ -535,7 +523,7 @@ reemit_insn_block_notes ()
/* Given a reorder chain, rearrange the code to match. */
static void
-fixup_reorder_chain ()
+fixup_reorder_chain (void)
{
basic_block bb, prev_bb;
int index;
@@ -623,7 +611,7 @@ fixup_reorder_chain ()
/* The degenerated case of conditional jump jumping to the next
instruction can happen on target having jumps with side
- effects.
+ effects.
Create temporarily the duplicated edge representing branch.
It will get unidentified by force_nonfallthru_and_redirect
@@ -776,7 +764,7 @@ fixup_reorder_chain ()
3. Check that get_last_insn () returns the actual end of chain. */
void
-verify_insn_chain ()
+verify_insn_chain (void)
{
rtx x, prevx, nextx;
int insn_cnt1, insn_cnt2;
@@ -807,8 +795,7 @@ verify_insn_chain ()
dominators. */
static void
-cleanup_unconditional_jumps (loops)
- struct loops *loops;
+cleanup_unconditional_jumps (struct loops *loops)
{
basic_block bb;
@@ -885,7 +872,7 @@ cleanup_unconditional_jumps (loops)
/* The block falling through to exit must be the last one in the
reordered chain. Ensure that this condition is met. */
static void
-fixup_fallthru_exit_predecessor ()
+fixup_fallthru_exit_predecessor (void)
{
edge e;
basic_block bb = NULL;
@@ -913,8 +900,7 @@ fixup_fallthru_exit_predecessor ()
/* Return true in case it is possible to duplicate the basic block BB. */
bool
-cfg_layout_can_duplicate_bb_p (bb)
- basic_block bb;
+cfg_layout_can_duplicate_bb_p (basic_block bb)
{
edge s;
@@ -951,14 +937,13 @@ cfg_layout_can_duplicate_bb_p (bb)
}
static rtx
-duplicate_insn_chain (from, to)
- rtx from, to;
+duplicate_insn_chain (rtx from, rtx to)
{
rtx insn, last;
/* Avoid updating of boundaries of previous basic block. The
note will get removed from insn stream in fixup. */
- last = emit_note (NULL, NOTE_INSN_DELETED);
+ last = emit_note (NOTE_INSN_DELETED);
/* Create copy at the end of INSN chain. The chain will
be reordered later. */
@@ -1023,7 +1008,8 @@ duplicate_insn_chain (from, to)
abort ();
break;
case NOTE_INSN_REPEATED_LINE_NUMBER:
- emit_note (NOTE_SOURCE_FILE (insn), NOTE_LINE_NUMBER (insn));
+ emit_line_note (NOTE_SOURCE_FILE (insn),
+ NOTE_LINE_NUMBER (insn));
break;
default:
@@ -1031,7 +1017,8 @@ duplicate_insn_chain (from, to)
abort ();
/* It is possible that no_line_number is set and the note
won't be emitted. */
- emit_note (NOTE_SOURCE_FILE (insn), NOTE_LINE_NUMBER (insn));
+ emit_line_note (NOTE_SOURCE_FILE (insn),
+ NOTE_LINE_NUMBER (insn));
}
break;
default:
@@ -1045,9 +1032,7 @@ duplicate_insn_chain (from, to)
/* Create a duplicate of the basic block BB and redirect edge E into it. */
basic_block
-cfg_layout_duplicate_bb (bb, e)
- basic_block bb;
- edge e;
+cfg_layout_duplicate_bb (basic_block bb, edge e)
{
rtx insn;
edge s, n;
@@ -1139,8 +1124,7 @@ cfg_layout_duplicate_bb (bb, e)
CFG layout changes. It keeps LOOPS up-to-date if not null. */
void
-cfg_layout_initialize (loops)
- struct loops *loops;
+cfg_layout_initialize (struct loops *loops)
{
/* Our algorithm depends on fact that there are now dead jumptables
around the code. */
@@ -1154,7 +1138,7 @@ cfg_layout_initialize (loops)
/* Splits superblocks. */
static void
-break_superblocks ()
+break_superblocks (void)
{
sbitmap superblocks;
int i, need;
@@ -1185,7 +1169,7 @@ break_superblocks ()
compensation code, rebuild scope forest. */
void
-cfg_layout_finalize ()
+cfg_layout_finalize (void)
{
#ifdef ENABLE_CHECKING
verify_flow_info ();
diff --git a/gcc/cfglayout.h b/gcc/cfglayout.h
index 4ae8b6677c9..1ab3e1f956a 100644
--- a/gcc/cfglayout.h
+++ b/gcc/cfglayout.h
@@ -1,5 +1,5 @@
/* Basic block reordering routines for the GNU compiler.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -37,9 +37,9 @@ typedef struct reorder_block_def
extern rtx cfg_layout_function_footer;
-extern void cfg_layout_initialize PARAMS ((struct loops *));
-extern void cfg_layout_finalize PARAMS ((void));
-extern bool cfg_layout_can_duplicate_bb_p PARAMS ((basic_block));
-extern basic_block cfg_layout_duplicate_bb PARAMS ((basic_block, edge));
-extern void insn_locators_initialize PARAMS ((void));
-extern void reemit_insn_block_notes PARAMS ((void));
+extern void cfg_layout_initialize (struct loops *);
+extern void cfg_layout_finalize (void);
+extern bool cfg_layout_can_duplicate_bb_p (basic_block);
+extern basic_block cfg_layout_duplicate_bb (basic_block, edge);
+extern void insn_locators_initialize (void);
+extern void reemit_insn_block_notes (void);
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index 92d90556993..4bb165f9ccf 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -1,5 +1,5 @@
/* Natural loop discovery code for GNU compiler.
- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -33,29 +33,24 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
considered to belong to inner loop with same header. */
#define HEAVY_EDGE_RATIO 8
-static void flow_loops_cfg_dump PARAMS ((const struct loops *,
- FILE *));
-static void flow_loop_entry_edges_find PARAMS ((struct loop *));
-static void flow_loop_exit_edges_find PARAMS ((struct loop *));
-static int flow_loop_nodes_find PARAMS ((basic_block, struct loop *));
-static void flow_loop_pre_header_scan PARAMS ((struct loop *));
-static basic_block flow_loop_pre_header_find PARAMS ((basic_block,
- dominance_info));
-static int flow_loop_level_compute PARAMS ((struct loop *));
-static int flow_loops_level_compute PARAMS ((struct loops *));
-static void establish_preds PARAMS ((struct loop *));
-static basic_block make_forwarder_block PARAMS ((basic_block, int, int,
- edge, int));
-static void canonicalize_loop_headers PARAMS ((void));
-static bool glb_enum_p PARAMS ((basic_block, void *));
-static void redirect_edge_with_latch_update PARAMS ((edge, basic_block));
+static void flow_loops_cfg_dump (const struct loops *, FILE *);
+static void flow_loop_entry_edges_find (struct loop *);
+static void flow_loop_exit_edges_find (struct loop *);
+static int flow_loop_nodes_find (basic_block, struct loop *);
+static void flow_loop_pre_header_scan (struct loop *);
+static basic_block flow_loop_pre_header_find (basic_block, dominance_info);
+static int flow_loop_level_compute (struct loop *);
+static int flow_loops_level_compute (struct loops *);
+static void establish_preds (struct loop *);
+static basic_block make_forwarder_block (basic_block, int, int, edge, int);
+static void canonicalize_loop_headers (void);
+static bool glb_enum_p (basic_block, void *);
+static void redirect_edge_with_latch_update (edge, basic_block);
/* Dump loop related CFG information. */
static void
-flow_loops_cfg_dump (loops, file)
- const struct loops *loops;
- FILE *file;
+flow_loops_cfg_dump (const struct loops *loops, FILE *file)
{
int i;
basic_block bb;
@@ -97,9 +92,7 @@ flow_loops_cfg_dump (loops, file)
/* Return nonzero if the nodes of LOOP are a subset of OUTER. */
bool
-flow_loop_nested_p (outer, loop)
- const struct loop *outer;
- const struct loop *loop;
+flow_loop_nested_p (const struct loop *outer, const struct loop *loop)
{
return loop->depth > outer->depth
&& loop->pred[outer->depth] == outer;
@@ -109,11 +102,9 @@ flow_loop_nested_p (outer, loop)
using auxiliary dump callback function LOOP_DUMP_AUX if non null. */
void
-flow_loop_dump (loop, file, loop_dump_aux, verbose)
- const struct loop *loop;
- FILE *file;
- void (*loop_dump_aux) PARAMS((const struct loop *, FILE *, int));
- int verbose;
+flow_loop_dump (const struct loop *loop, FILE *file,
+ void (*loop_dump_aux) (const struct loop *, FILE *, int),
+ int verbose)
{
basic_block *bbs;
unsigned i;
@@ -154,11 +145,7 @@ flow_loop_dump (loop, file, loop_dump_aux, verbose)
using auxiliary dump callback function LOOP_DUMP_AUX if non null. */
void
-flow_loops_dump (loops, file, loop_dump_aux, verbose)
- const struct loops *loops;
- FILE *file;
- void (*loop_dump_aux) PARAMS((const struct loop *, FILE *, int));
- int verbose;
+flow_loops_dump (const struct loops *loops, FILE *file, void (*loop_dump_aux) (const struct loop *, FILE *, int), int verbose)
{
int i;
int num_loops;
@@ -186,8 +173,7 @@ flow_loops_dump (loops, file, loop_dump_aux, verbose)
/* Free data allocated for LOOP. */
void
-flow_loop_free (loop)
- struct loop *loop;
+flow_loop_free (struct loop *loop)
{
if (loop->pre_header_edges)
free (loop->pre_header_edges);
@@ -203,8 +189,7 @@ flow_loop_free (loop)
/* Free all the memory allocated for LOOPS. */
void
-flow_loops_free (loops)
- struct loops *loops;
+flow_loops_free (struct loops *loops)
{
if (loops->parray)
{
@@ -240,9 +225,8 @@ flow_loops_free (loops)
/* Find the entry edges into the LOOP. */
-static void
-flow_loop_entry_edges_find (loop)
- struct loop *loop;
+static void
+flow_loop_entry_edges_find (struct loop *loop)
{
edge e;
int num_entries;
@@ -272,8 +256,7 @@ flow_loop_entry_edges_find (loop)
/* Find the exit edges from the LOOP. */
static void
-flow_loop_exit_edges_find (loop)
- struct loop *loop;
+flow_loop_exit_edges_find (struct loop *loop)
{
edge e;
basic_block node, *bbs;
@@ -328,9 +311,7 @@ flow_loop_exit_edges_find (loop)
Return the number of nodes within the loop. */
static int
-flow_loop_nodes_find (header, loop)
- basic_block header;
- struct loop *loop;
+flow_loop_nodes_find (basic_block header, struct loop *loop)
{
basic_block *stack;
int sp;
@@ -347,14 +328,14 @@ flow_loop_nodes_find (header, loop)
stack[sp++] = loop->latch;
loop->latch->loop_father = loop;
loop->latch->loop_depth = loop->depth;
-
+
while (sp)
{
basic_block node;
edge e;
node = stack[--sp];
-
+
for (e = node->pred; e; e = e->pred_next)
{
basic_block ancestor = e->src;
@@ -378,8 +359,7 @@ flow_loop_nodes_find (header, loop)
the edges along the trace from the root node to the loop header. */
static void
-flow_loop_pre_header_scan (loop)
- struct loop *loop;
+flow_loop_pre_header_scan (struct loop *loop)
{
int num;
basic_block ebb;
@@ -415,9 +395,7 @@ flow_loop_pre_header_scan (loop)
there is no pre-header. */
static basic_block
-flow_loop_pre_header_find (header, dom)
- basic_block header;
- dominance_info dom;
+flow_loop_pre_header_find (basic_block header, dominance_info dom)
{
basic_block pre_header;
edge e;
@@ -448,8 +426,7 @@ flow_loop_pre_header_find (header, dom)
}
static void
-establish_preds (loop)
- struct loop *loop;
+establish_preds (struct loop *loop)
{
struct loop *ploop, *father = loop->outer;
@@ -469,9 +446,7 @@ establish_preds (loop)
pred field will be initialized correctly. */
void
-flow_loop_tree_node_add (father, loop)
- struct loop *father;
- struct loop *loop;
+flow_loop_tree_node_add (struct loop *father, struct loop *loop)
{
loop->next = father->inner;
father->inner = loop;
@@ -483,8 +458,7 @@ flow_loop_tree_node_add (father, loop)
/* Remove LOOP from the loop hierarchy tree. */
void
-flow_loop_tree_node_remove (loop)
- struct loop *loop;
+flow_loop_tree_node_remove (struct loop *loop)
{
struct loop *prev, *father;
@@ -509,8 +483,7 @@ flow_loop_tree_node_remove (loop)
for the natural loop specified by LOOP. Returns the loop level. */
static int
-flow_loop_level_compute (loop)
- struct loop *loop;
+flow_loop_level_compute (struct loop *loop)
{
struct loop *inner;
int level = 1;
@@ -540,8 +513,7 @@ flow_loop_level_compute (loop)
level. */
static int
-flow_loops_level_compute (loops)
- struct loops *loops;
+flow_loops_level_compute (struct loops *loops)
{
return flow_loop_level_compute (loops->tree_root);
}
@@ -550,10 +522,7 @@ flow_loops_level_compute (loops)
about it specified by FLAGS. */
int
-flow_loop_scan (loops, loop, flags)
- struct loops *loops;
- struct loop *loop;
- int flags;
+flow_loop_scan (struct loops *loops, struct loop *loop, int flags)
{
if (flags & LOOP_ENTRY_EDGES)
{
@@ -588,9 +557,7 @@ flow_loop_scan (loops, loop, flags)
/* Redirect edge and update latch and header info. */
static void
-redirect_edge_with_latch_update (e, to)
- edge e;
- basic_block to;
+redirect_edge_with_latch_update (edge e, basic_block to)
{
basic_block jump;
@@ -612,13 +579,7 @@ redirect_edge_with_latch_update (e, to)
part. */
static basic_block
-make_forwarder_block (bb, redirect_latch, redirect_nonlatch, except,
- conn_latch)
- basic_block bb;
- int redirect_latch;
- int redirect_nonlatch;
- edge except;
- int conn_latch;
+make_forwarder_block (basic_block bb, int redirect_latch, int redirect_nonlatch, edge except, int conn_latch)
{
edge e, next_e, fallthru;
basic_block dummy;
@@ -664,12 +625,12 @@ make_forwarder_block (bb, redirect_latch, redirect_nonlatch, except,
/* Takes care of merging natural loops with shared headers. */
static void
-canonicalize_loop_headers ()
+canonicalize_loop_headers (void)
{
dominance_info dom;
basic_block header;
edge e;
-
+
/* Compute the dominators. */
dom = calculate_dominance_info (CDI_DOMINATORS);
@@ -709,7 +670,7 @@ canonicalize_loop_headers ()
/* We could not redirect edges freely here. On the other hand,
we can simply split the edge from entry block. */
bb = split_edge (ENTRY_BLOCK_PTR->succ);
-
+
alloc_aux_for_edge (bb->succ, sizeof (int));
LATCH_EDGE (bb->succ) = 0;
alloc_aux_for_block (bb, sizeof (int));
@@ -776,9 +737,7 @@ canonicalize_loop_headers ()
loops found. */
int
-flow_loops_find (loops, flags)
- struct loops *loops;
- int flags;
+flow_loops_find (struct loops *loops, int flags)
{
int i;
int b;
@@ -822,7 +781,7 @@ flow_loops_find (loops, flags)
FOR_EACH_BB (header)
{
int more_latches = 0;
-
+
header->loop_depth = 0;
/* If we have an abnormal predecessor, do not consider the
@@ -906,7 +865,7 @@ flow_loops_find (loops, flags)
continue;
header = BASIC_BLOCK (rc_order[b]);
-
+
loop = loops->parray[num_loops] = xcalloc (1, sizeof (struct loop));
loop->header = header;
@@ -961,9 +920,7 @@ flow_loops_find (loops, flags)
specified by LOOPS. */
int
-flow_loops_update (loops, flags)
- struct loops *loops;
- int flags;
+flow_loops_update (struct loops *loops, int flags)
{
/* One day we may want to update the current loop data. For now
throw away the old stuff and rebuild what we need. */
@@ -975,9 +932,7 @@ flow_loops_update (loops, flags)
/* Return nonzero if basic block BB belongs to LOOP. */
bool
-flow_bb_inside_loop_p (loop, bb)
- const struct loop *loop;
- const basic_block bb;
+flow_bb_inside_loop_p (const struct loop *loop, const basic_block bb)
{
struct loop *source_loop;
@@ -991,9 +946,7 @@ flow_bb_inside_loop_p (loop, bb)
/* Return nonzero if edge E enters header of LOOP from outside of LOOP. */
bool
-flow_loop_outside_edge_p (loop, e)
- const struct loop *loop;
- edge e;
+flow_loop_outside_edge_p (const struct loop *loop, edge e)
{
if (e->dest != loop->header)
abort ();
@@ -1002,17 +955,14 @@ flow_loop_outside_edge_p (loop, e)
/* Enumeration predicate for get_loop_body. */
static bool
-glb_enum_p (bb, glb_header)
- basic_block bb;
- void *glb_header;
+glb_enum_p (basic_block bb, void *glb_header)
{
return bb != (basic_block) glb_header;
}
/* Gets basic blocks of a loop. */
basic_block *
-get_loop_body (loop)
- const struct loop *loop;
+get_loop_body (const struct loop *loop)
{
basic_block *tovisit, bb;
unsigned tv = 0;
@@ -1046,9 +996,7 @@ get_loop_body (loop)
/* Gets exit edges of a LOOP, returning their number in N_EDGES. */
edge *
-get_loop_exit_edges (loop, n_edges)
- const struct loop *loop;
- unsigned *n_edges;
+get_loop_exit_edges (const struct loop *loop, unsigned int *n_edges)
{
edge *edges, e;
unsigned i, n;
@@ -1077,12 +1025,10 @@ get_loop_exit_edges (loop, n_edges)
/* Adds basic block BB to LOOP. */
void
-add_bb_to_loop (bb, loop)
- basic_block bb;
- struct loop *loop;
- {
+add_bb_to_loop (basic_block bb, struct loop *loop)
+{
int i;
-
+
bb->loop_father = loop;
bb->loop_depth = loop->depth;
loop->num_nodes++;
@@ -1092,9 +1038,8 @@ add_bb_to_loop (bb, loop)
/* Remove basic block BB from loops. */
void
-remove_bb_from_loops (bb)
- basic_block bb;
- {
+remove_bb_from_loops (basic_block bb)
+{
int i;
struct loop *loop = bb->loop_father;
@@ -1107,13 +1052,11 @@ remove_bb_from_loops (bb)
/* Finds nearest common ancestor in loop tree for given loops. */
struct loop *
-find_common_loop (loop_s, loop_d)
- struct loop *loop_s;
- struct loop *loop_d;
+find_common_loop (struct loop *loop_s, struct loop *loop_d)
{
if (!loop_s) return loop_d;
if (!loop_d) return loop_s;
-
+
if (loop_s->depth < loop_d->depth)
loop_d = loop_d->pred[loop_s->depth];
else if (loop_s->depth > loop_d->depth)
@@ -1129,9 +1072,7 @@ find_common_loop (loop_s, loop_d)
/* Cancels the LOOP; it must be innermost one. */
void
-cancel_loop (loops, loop)
- struct loops *loops;
- struct loop *loop;
+cancel_loop (struct loops *loops, struct loop *loop)
{
basic_block *bbs;
unsigned i;
@@ -1156,9 +1097,7 @@ cancel_loop (loops, loop)
/* Cancels LOOP and all its subloops. */
void
-cancel_loop_tree (loops, loop)
- struct loops *loops;
- struct loop *loop;
+cancel_loop_tree (struct loops *loops, struct loop *loop)
{
while (loop->inner)
cancel_loop_tree (loops, loop->inner);
@@ -1173,8 +1112,7 @@ cancel_loop_tree (loops, loop)
-- irreducible loops are correctly marked
*/
void
-verify_loop_structure (loops)
- struct loops *loops;
+verify_loop_structure (struct loops *loops)
{
unsigned *sizes, i, j;
sbitmap irreds;
@@ -1283,7 +1221,7 @@ verify_loop_structure (loops)
RESET_BIT (irreds, bb->index);
for (e = bb->succ; e; e = e->succ_next)
if (e->flags & EDGE_IRREDUCIBLE_LOOP)
- e->flags |= EDGE_ALL_FLAGS + 1;
+ e->flags |= EDGE_ALL_FLAGS + 1;
}
/* Recount it. */
@@ -1332,8 +1270,7 @@ verify_loop_structure (loops)
/* Returns latch edge of LOOP. */
edge
-loop_latch_edge (loop)
- const struct loop *loop;
+loop_latch_edge (const struct loop *loop)
{
edge e;
@@ -1345,8 +1282,7 @@ loop_latch_edge (loop)
/* Returns preheader edge of LOOP. */
edge
-loop_preheader_edge (loop)
- const struct loop *loop;
+loop_preheader_edge (const struct loop *loop)
{
edge e;
@@ -1355,4 +1291,3 @@ loop_preheader_edge (loop)
return e;
}
-
diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h
index 0f6b04537a5..d3ab8e8739b 100644
--- a/gcc/cfgloop.h
+++ b/gcc/cfgloop.h
@@ -255,47 +255,42 @@ struct loops
#define LOOP_ALL 15 /* All of the above */
/* Loop recognition. */
-extern int flow_loops_find PARAMS ((struct loops *, int flags));
-extern int flow_loops_update PARAMS ((struct loops *, int flags));
-extern void flow_loops_free PARAMS ((struct loops *));
-extern void flow_loops_dump PARAMS ((const struct loops *, FILE *,
- void (*)(const struct loop *,
- FILE *, int), int));
-extern void flow_loop_dump PARAMS ((const struct loop *, FILE *,
- void (*)(const struct loop *,
- FILE *, int), int));
-extern int flow_loop_scan PARAMS ((struct loops *,
- struct loop *, int));
-extern void flow_loop_free PARAMS ((struct loop *));
-void mark_irreducible_loops PARAMS ((struct loops *));
+extern int flow_loops_find (struct loops *, int flags);
+extern int flow_loops_update (struct loops *, int flags);
+extern void flow_loops_free (struct loops *);
+extern void flow_loops_dump (const struct loops *, FILE *,
+ void (*)(const struct loop *, FILE *, int), int);
+extern void flow_loop_dump (const struct loop *, FILE *,
+ void (*)(const struct loop *, FILE *, int), int);
+extern int flow_loop_scan (struct loops *, struct loop *, int);
+extern void flow_loop_free (struct loop *);
+void mark_irreducible_loops (struct loops *);
/* Loop datastructure manipulation/querying. */
-extern void flow_loop_tree_node_add PARAMS ((struct loop *, struct loop *));
-extern void flow_loop_tree_node_remove PARAMS ((struct loop *));
-extern bool flow_loop_outside_edge_p PARAMS ((const struct loop *, edge));
-extern bool flow_loop_nested_p PARAMS ((const struct loop *,
- const struct loop *));
-extern bool flow_bb_inside_loop_p PARAMS ((const struct loop *,
- const basic_block));
-extern struct loop * find_common_loop PARAMS ((struct loop *, struct loop *));
-extern int num_loop_insns PARAMS ((struct loop *));
-extern int average_num_loop_insns PARAMS ((struct loop *));
+extern void flow_loop_tree_node_add (struct loop *, struct loop *);
+extern void flow_loop_tree_node_remove (struct loop *);
+extern bool flow_loop_outside_edge_p (const struct loop *, edge);
+extern bool flow_loop_nested_p (const struct loop *, const struct loop *);
+extern bool flow_bb_inside_loop_p (const struct loop *, const basic_block);
+extern struct loop * find_common_loop (struct loop *, struct loop *);
+extern int num_loop_insns (struct loop *);
+extern int average_num_loop_insns (struct loop *);
/* Loops & cfg manipulation. */
-extern basic_block *get_loop_body PARAMS ((const struct loop *));
-extern edge *get_loop_exit_edges PARAMS ((const struct loop *, unsigned *));
+extern basic_block *get_loop_body (const struct loop *);
+extern edge *get_loop_exit_edges (const struct loop *, unsigned *);
-extern edge loop_preheader_edge PARAMS ((const struct loop *));
-extern edge loop_latch_edge PARAMS ((const struct loop *));
+extern edge loop_preheader_edge (const struct loop *);
+extern edge loop_latch_edge (const struct loop *);
-extern void add_bb_to_loop PARAMS ((basic_block, struct loop *));
-extern void remove_bb_from_loops PARAMS ((basic_block));
+extern void add_bb_to_loop (basic_block, struct loop *);
+extern void remove_bb_from_loops (basic_block);
-extern void cancel_loop PARAMS ((struct loops *, struct loop *));
-extern void cancel_loop_tree PARAMS ((struct loops *, struct loop *));
+extern void cancel_loop (struct loops *, struct loop *);
+extern void cancel_loop_tree (struct loops *, struct loop *);
-extern basic_block loop_split_edge_with PARAMS ((edge, rtx, struct loops *));
-extern int fix_loop_placement PARAMS ((struct loop *));
+extern basic_block loop_split_edge_with (edge, rtx, struct loops *);
+extern int fix_loop_placement (struct loop *);
enum
{
@@ -303,42 +298,38 @@ enum
CP_INSIDE_CFGLAYOUT = 2
};
-extern void create_preheaders PARAMS ((struct loops *, int));
-extern void force_single_succ_latches PARAMS ((struct loops *));
+extern void create_preheaders (struct loops *, int);
+extern void force_single_succ_latches (struct loops *);
-extern void verify_loop_structure PARAMS ((struct loops *));
+extern void verify_loop_structure (struct loops *);
/* Loop analysis. */
-extern bool simple_loop_p PARAMS ((struct loops *, struct loop *,
- struct loop_desc *));
-extern rtx count_loop_iterations PARAMS ((struct loop_desc *, rtx, rtx));
-extern bool just_once_each_iteration_p PARAMS ((struct loops *,struct loop *,
- basic_block));
-extern unsigned expected_loop_iterations PARAMS ((const struct loop *));
+extern bool simple_loop_p (struct loops *, struct loop *, struct loop_desc *);
+extern rtx count_loop_iterations (struct loop_desc *, rtx, rtx);
+extern bool just_once_each_iteration_p (struct loops *,struct loop *,
+ basic_block);
+extern unsigned expected_loop_iterations (const struct loop *);
/* Loop manipulation. */
-extern bool can_duplicate_loop_p PARAMS ((struct loop *loop));
+extern bool can_duplicate_loop_p (struct loop *loop);
#define DLTHE_FLAG_UPDATE_FREQ 1 /* Update frequencies in
duplicate_loop_to_header_edge. */
-extern int duplicate_loop_to_header_edge PARAMS ((struct loop *, edge,
- struct loops *, unsigned,
- sbitmap, edge, edge *,
- unsigned *, int));
-extern struct loop *loopify PARAMS ((struct loops *, edge,
- edge, basic_block));
-extern void unloop PARAMS ((struct loops *, struct loop *));
-extern bool remove_path PARAMS ((struct loops *, edge));
-extern edge split_loop_bb PARAMS ((struct loops *, basic_block,
- rtx));
+extern int duplicate_loop_to_header_edge (struct loop *, edge, struct loops *,
+ unsigned, sbitmap, edge, edge *,
+ unsigned *, int);
+extern struct loop *loopify (struct loops *, edge, edge, basic_block);
+extern void unloop (struct loops *, struct loop *);
+extern bool remove_path (struct loops *, edge);
+extern edge split_loop_bb (struct loops *, basic_block, rtx);
/* Loop optimizer initialization. */
-extern struct loops *loop_optimizer_init PARAMS ((FILE *));
-extern void loop_optimizer_finalize PARAMS ((struct loops *, FILE *));
+extern struct loops *loop_optimizer_init (FILE *);
+extern void loop_optimizer_finalize (struct loops *, FILE *);
/* Optimization passes. */
-extern void unswitch_loops PARAMS ((struct loops *));
+extern void unswitch_loops (struct loops *);
enum
{
@@ -347,4 +338,4 @@ enum
UAP_UNROLL_ALL = 4 /* Enables peeling of all loops. */
};
-extern void unroll_and_peel_loops PARAMS ((struct loops *, int));
+extern void unroll_and_peel_loops (struct loops *, int);
diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c
index af7d8127cf4..be5b82effcf 100644
--- a/gcc/cfgloopanal.c
+++ b/gcc/cfgloopanal.c
@@ -1,5 +1,5 @@
/* Natural loop analysis code for GNU compiler.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -30,33 +30,27 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "output.h"
struct unmark_altered_insn_data;
-static void unmark_altered PARAMS ((rtx, rtx, regset));
-static void blocks_invariant_registers PARAMS ((basic_block *, int, regset));
-static void unmark_altered_insn PARAMS ((rtx, rtx, struct unmark_altered_insn_data *));
-static void blocks_single_set_registers PARAMS ((basic_block *, int, rtx *));
-static int invariant_rtx_wrto_regs_p_helper PARAMS ((rtx *, regset));
-static bool invariant_rtx_wrto_regs_p PARAMS ((rtx, regset));
-static rtx test_for_iteration PARAMS ((struct loop_desc *desc,
- unsigned HOST_WIDE_INT));
-static bool constant_iterations PARAMS ((struct loop_desc *,
- unsigned HOST_WIDE_INT *,
- bool *));
-static bool simple_loop_exit_p PARAMS ((struct loops *, struct loop *,
- edge, regset, rtx *,
- struct loop_desc *));
-static rtx variable_initial_value PARAMS ((rtx, regset, rtx, rtx *));
-static rtx variable_initial_values PARAMS ((edge, rtx));
-static bool simple_condition_p PARAMS ((struct loop *, rtx,
- regset, struct loop_desc *));
-static basic_block simple_increment PARAMS ((struct loops *, struct loop *,
- rtx *, struct loop_desc *));
+static void unmark_altered (rtx, rtx, regset);
+static void blocks_invariant_registers (basic_block *, int, regset);
+static void unmark_altered_insn (rtx, rtx, struct unmark_altered_insn_data *);
+static void blocks_single_set_registers (basic_block *, int, rtx *);
+static int invariant_rtx_wrto_regs_p_helper (rtx *, regset);
+static bool invariant_rtx_wrto_regs_p (rtx, regset);
+static rtx test_for_iteration (struct loop_desc *desc, unsigned HOST_WIDE_INT);
+static bool constant_iterations (struct loop_desc *, unsigned HOST_WIDE_INT *,
+ bool *);
+static bool simple_loop_exit_p (struct loops *, struct loop *, edge, regset,
+ rtx *, struct loop_desc *);
+static rtx variable_initial_value (rtx, regset, rtx, rtx *);
+static rtx variable_initial_values (edge, rtx);
+static bool simple_condition_p (struct loop *, rtx, regset,
+ struct loop_desc *);
+static basic_block simple_increment (struct loops *, struct loop *, rtx *,
+ struct loop_desc *);
/* Checks whether BB is executed exactly once in each LOOP iteration. */
bool
-just_once_each_iteration_p (loops, loop, bb)
- struct loops *loops;
- struct loop *loop;
- basic_block bb;
+just_once_each_iteration_p (struct loops *loops, struct loop *loop, basic_block bb)
{
/* It must be executed at least once each iteration. */
if (!dominated_by_p (loops->cfg.dom, loop->latch, bb))
@@ -76,10 +70,7 @@ just_once_each_iteration_p (loops, loop, bb)
/* Unmarks modified registers; helper to blocks_invariant_registers. */
static void
-unmark_altered (what, by, regs)
- rtx what;
- rtx by ATTRIBUTE_UNUSED;
- regset regs;
+unmark_altered (rtx what, rtx by ATTRIBUTE_UNUSED, regset regs)
{
if (GET_CODE (what) == SUBREG)
what = SUBREG_REG (what);
@@ -90,10 +81,7 @@ unmark_altered (what, by, regs)
/* Marks registers that are invariant inside blocks BBS. */
static void
-blocks_invariant_registers (bbs, nbbs, regs)
- basic_block *bbs;
- int nbbs;
- regset regs;
+blocks_invariant_registers (basic_block *bbs, int nbbs, regset regs)
{
rtx insn;
int i;
@@ -118,10 +106,8 @@ struct unmark_altered_insn_data
};
static void
-unmark_altered_insn (what, by, data)
- rtx what;
- rtx by ATTRIBUTE_UNUSED;
- struct unmark_altered_insn_data *data;
+unmark_altered_insn (rtx what, rtx by ATTRIBUTE_UNUSED,
+ struct unmark_altered_insn_data *data)
{
int rn;
@@ -138,10 +124,7 @@ unmark_altered_insn (what, by, data)
/* Marks registers that have just single simple set in BBS; the relevant
insn is returned in REGS. */
static void
-blocks_single_set_registers (bbs, nbbs, regs)
- basic_block *bbs;
- int nbbs;
- rtx *regs;
+blocks_single_set_registers (basic_block *bbs, int nbbs, rtx *regs)
{
rtx insn;
int i;
@@ -180,9 +163,7 @@ blocks_single_set_registers (bbs, nbbs, regs)
/* Helper for invariant_rtx_wrto_regs_p. */
static int
-invariant_rtx_wrto_regs_p_helper (expr, invariant_regs)
- rtx *expr;
- regset invariant_regs;
+invariant_rtx_wrto_regs_p_helper (rtx *expr, regset invariant_regs)
{
switch (GET_CODE (*expr))
{
@@ -216,9 +197,7 @@ invariant_rtx_wrto_regs_p_helper (expr, invariant_regs)
/* Checks that EXPR is invariant provided that INVARIANT_REGS are invariant. */
static bool
-invariant_rtx_wrto_regs_p (expr, invariant_regs)
- rtx expr;
- regset invariant_regs;
+invariant_rtx_wrto_regs_p (rtx expr, regset invariant_regs)
{
return !for_each_rtx (&expr, (rtx_function) invariant_rtx_wrto_regs_p_helper,
invariant_regs);
@@ -228,11 +207,8 @@ invariant_rtx_wrto_regs_p (expr, invariant_regs)
is register and the other one is invariant in the LOOP. Fills var, lim
and cond fields in DESC. */
static bool
-simple_condition_p (loop, condition, invariant_regs, desc)
- struct loop *loop ATTRIBUTE_UNUSED;
- rtx condition;
- regset invariant_regs;
- struct loop_desc *desc;
+simple_condition_p (struct loop *loop ATTRIBUTE_UNUSED, rtx condition,
+ regset invariant_regs, struct loop_desc *desc)
{
rtx op0, op1;
@@ -262,7 +238,7 @@ simple_condition_p (loop, condition, invariant_regs, desc)
/* One of operands must be a simple register. */
op0 = XEXP (condition, 0);
op1 = XEXP (condition, 1);
-
+
/* One of operands must be invariant. */
if (invariant_rtx_wrto_regs_p (op0, invariant_regs))
{
@@ -296,11 +272,8 @@ simple_condition_p (loop, condition, invariant_regs, desc)
iteration. Fills in DESC->stride and returns block in that DESC->var is
modified. */
static basic_block
-simple_increment (loops, loop, simple_increment_regs, desc)
- struct loops *loops;
- struct loop *loop;
- rtx *simple_increment_regs;
- struct loop_desc *desc;
+simple_increment (struct loops *loops, struct loop *loop,
+ rtx *simple_increment_regs, struct loop_desc *desc)
{
rtx mod_insn, set, set_src, set_add;
basic_block mod_bb;
@@ -344,11 +317,7 @@ simple_increment (loops, loop, simple_increment_regs, desc)
wrto INVARIANT_REGS. If SET_INSN is not NULL, insn in that var is set is
placed here. */
static rtx
-variable_initial_value (insn, invariant_regs, var, set_insn)
- rtx insn;
- regset invariant_regs;
- rtx var;
- rtx *set_insn;
+variable_initial_value (rtx insn, regset invariant_regs, rtx var, rtx *set_insn)
{
basic_block bb;
rtx set;
@@ -373,7 +342,7 @@ variable_initial_value (insn, invariant_regs, var, set_insn)
rtx set_dest;
rtx val;
rtx note;
-
+
set = single_set (insn);
if (!set)
return NULL;
@@ -407,9 +376,7 @@ variable_initial_value (insn, invariant_regs, var, set_insn)
/* Returns list of definitions of initial value of VAR at Edge. */
static rtx
-variable_initial_values (e, var)
- edge e;
- rtx var;
+variable_initial_values (edge e, rtx var)
{
rtx set_insn, list;
regset invariant_regs;
@@ -437,10 +404,8 @@ variable_initial_values (e, var)
/* Counts constant number of iterations of the loop described by DESC;
returns false if impossible. */
static bool
-constant_iterations (desc, niter, may_be_zero)
- struct loop_desc *desc;
- unsigned HOST_WIDE_INT *niter;
- bool *may_be_zero;
+constant_iterations (struct loop_desc *desc, unsigned HOST_WIDE_INT *niter,
+ bool *may_be_zero)
{
rtx test, expr;
rtx ainit, alim;
@@ -485,21 +450,18 @@ constant_iterations (desc, niter, may_be_zero)
/* Return RTX expression representing number of iterations of loop as bounded
by test described by DESC (in the case loop really has multiple exit
- edges, fewer iterations may happen in the practice).
+ edges, fewer iterations may happen in the practice).
Return NULL if it is unknown. Additionally the value may be invalid for
paradoxical loop (lets define paradoxical loops as loops whose test is
failing at -1th iteration, for instance "for (i=5;i<1;i++);").
-
+
These cases needs to be either cared by copying the loop test in the front
of loop or keeping the test in first iteration of loop.
-
+
When INIT/LIM are set, they are used instead of var/lim of DESC. */
rtx
-count_loop_iterations (desc, init, lim)
- struct loop_desc *desc;
- rtx init;
- rtx lim;
+count_loop_iterations (struct loop_desc *desc, rtx init, rtx lim)
{
enum rtx_code cond = desc->cond;
rtx stride = desc->stride;
@@ -618,9 +580,7 @@ count_loop_iterations (desc, init, lim)
described of DESC at given iteration of loop. */
static rtx
-test_for_iteration (desc, iter)
- struct loop_desc *desc;
- unsigned HOST_WIDE_INT iter;
+test_for_iteration (struct loop_desc *desc, unsigned HOST_WIDE_INT iter)
{
enum rtx_code cond = desc->cond;
rtx exp = XEXP (desc->var_alts, 0);
@@ -661,13 +621,9 @@ test_for_iteration (desc, iter)
description joined to it in in DESC. INVARIANT_REGS and SINGLE_SET_REGS
are results of blocks_{invariant,single_set}_regs over BODY. */
static bool
-simple_loop_exit_p (loops, loop, exit_edge, invariant_regs, single_set_regs, desc)
- struct loops *loops;
- struct loop *loop;
- edge exit_edge;
- struct loop_desc *desc;
- regset invariant_regs;
- rtx *single_set_regs;
+simple_loop_exit_p (struct loops *loops, struct loop *loop, edge exit_edge,
+ regset invariant_regs, rtx *single_set_regs,
+ struct loop_desc *desc)
{
basic_block mod_bb, exit_bb;
int fallthru_out;
@@ -729,10 +685,7 @@ simple_loop_exit_p (loops, loop, exit_edge, invariant_regs, single_set_regs, des
/* Tests whether LOOP is simple for loop. Returns simple loop description
in DESC. */
bool
-simple_loop_p (loops, loop, desc)
- struct loops *loops;
- struct loop *loop;
- struct loop_desc *desc;
+simple_loop_p (struct loops *loops, struct loop *loop, struct loop_desc *desc)
{
unsigned i;
basic_block *body;
@@ -743,7 +696,7 @@ simple_loop_p (loops, loop, desc)
regset_head invariant_regs_head;
rtx *single_set_regs;
int n_branches;
-
+
body = get_loop_body (loop);
invariant_regs = INITIALIZE_REG_SET (invariant_regs_head);
@@ -825,8 +778,7 @@ simple_loop_p (loops, loop, desc)
each cycle, we want to mark blocks that belong directly to innermost
loop containing the whole cycle. */
void
-mark_irreducible_loops (loops)
- struct loops *loops;
+mark_irreducible_loops (struct loops *loops)
{
int *dfs_in, *closed, *mr, *mri, *n_edges, *stack;
unsigned i;
@@ -1019,8 +971,7 @@ next:;
/* Counts number of insns inside LOOP. */
int
-num_loop_insns (loop)
- struct loop *loop;
+num_loop_insns (struct loop *loop)
{
basic_block *bbs, bb;
unsigned i, ninsns = 0;
@@ -1036,14 +987,13 @@ num_loop_insns (loop)
ninsns++;
}
free(bbs);
-
+
return ninsns;
}
/* Counts number of insns executed on average per iteration LOOP. */
int
-average_num_loop_insns (loop)
- struct loop *loop;
+average_num_loop_insns (struct loop *loop)
{
basic_block *bbs, bb;
unsigned i, binsns, ninsns, ratio;
@@ -1066,7 +1016,7 @@ average_num_loop_insns (loop)
ninsns += binsns * ratio;
}
free(bbs);
-
+
ninsns /= BB_FREQ_MAX;
if (!ninsns)
ninsns = 1; /* To avoid division by zero. */
@@ -1078,8 +1028,7 @@ average_num_loop_insns (loop)
Compute upper bound on number of iterations in case they do not fit integer
to help loop peeling heuristics. Use exact counts if at all possible. */
unsigned
-expected_loop_iterations (loop)
- const struct loop *loop;
+expected_loop_iterations (const struct loop *loop)
{
edge e;
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index 1e878a5b7d4..fff74f8f2a6 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -29,44 +29,35 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "cfglayout.h"
#include "output.h"
-static struct loop * duplicate_loop PARAMS ((struct loops *,
- struct loop *, struct loop *));
-static void duplicate_subloops PARAMS ((struct loops *, struct loop *,
- struct loop *));
-static void copy_loops_to PARAMS ((struct loops *, struct loop **,
- int, struct loop *));
-static void loop_redirect_edge PARAMS ((edge, basic_block));
-static bool loop_delete_branch_edge PARAMS ((edge, int));
-static void copy_bbs PARAMS ((basic_block *, int, edge,
- edge, basic_block **,
- struct loops *, edge *,
- edge *, int));
-static void remove_bbs PARAMS ((dominance_info, basic_block *,
- int));
-static bool rpe_enum_p PARAMS ((basic_block, void *));
-static int find_path PARAMS ((edge, dominance_info,
- basic_block **));
-static bool alp_enum_p PARAMS ((basic_block, void *));
-static void add_loop PARAMS ((struct loops *, struct loop *));
-static void fix_loop_placements PARAMS ((struct loop *));
-static bool fix_bb_placement PARAMS ((struct loops *, basic_block));
-static void fix_bb_placements PARAMS ((struct loops *, basic_block));
-static void place_new_loop PARAMS ((struct loops *, struct loop *));
-static void scale_loop_frequencies PARAMS ((struct loop *, int, int));
-static void scale_bbs_frequencies PARAMS ((basic_block *, int, int, int));
-static void record_exit_edges PARAMS ((edge, basic_block *, int,
- edge *, unsigned *, int));
-static basic_block create_preheader PARAMS ((struct loop *, dominance_info,
- int));
-static void fix_irreducible_loops PARAMS ((basic_block));
+static struct loop * duplicate_loop (struct loops *, struct loop *,
+ struct loop *);
+static void duplicate_subloops (struct loops *, struct loop *, struct loop *);
+static void copy_loops_to (struct loops *, struct loop **, int,
+ struct loop *);
+static void loop_redirect_edge (edge, basic_block);
+static bool loop_delete_branch_edge (edge, int);
+static void copy_bbs (basic_block *, int, edge, edge, basic_block **,
+ struct loops *, edge *, edge *, int);
+static void remove_bbs (dominance_info, basic_block *, int);
+static bool rpe_enum_p (basic_block, void *);
+static int find_path (edge, dominance_info, basic_block **);
+static bool alp_enum_p (basic_block, void *);
+static void add_loop (struct loops *, struct loop *);
+static void fix_loop_placements (struct loop *);
+static bool fix_bb_placement (struct loops *, basic_block);
+static void fix_bb_placements (struct loops *, basic_block);
+static void place_new_loop (struct loops *, struct loop *);
+static void scale_loop_frequencies (struct loop *, int, int);
+static void scale_bbs_frequencies (basic_block *, int, int, int);
+static void record_exit_edges (edge, basic_block *, int, edge *, unsigned *,
+ int);
+static basic_block create_preheader (struct loop *, dominance_info, int);
+static void fix_irreducible_loops (basic_block);
/* Splits basic block BB after INSN, returns created edge. Updates loops
and dominators. */
edge
-split_loop_bb (loops, bb, insn)
- struct loops *loops;
- basic_block bb;
- rtx insn;
+split_loop_bb (struct loops *loops, basic_block bb, rtx insn)
{
edge e;
basic_block *dom_bbs;
@@ -98,9 +89,7 @@ struct rpe_data
};
static bool
-rpe_enum_p (bb, data)
- basic_block bb;
- void *data;
+rpe_enum_p (basic_block bb, void *data)
{
struct rpe_data *rpe = data;
return dominated_by_p (rpe->doms, bb, rpe->dom);
@@ -109,10 +98,7 @@ rpe_enum_p (bb, data)
/* Remove basic blocks BBS from loop structure and dominance info,
and delete them afterwards. */
static void
-remove_bbs (dom, bbs, nbbs)
- dominance_info dom;
- basic_block *bbs;
- int nbbs;
+remove_bbs (dominance_info dom, basic_block *bbs, int nbbs)
{
int i;
@@ -131,10 +117,7 @@ remove_bbs (dom, bbs, nbbs)
alter anything by this function). The number of basic blocks in the
path is returned. */
static int
-find_path (e, doms, bbs)
- edge e;
- dominance_info doms;
- basic_block **bbs;
+find_path (edge e, dominance_info doms, basic_block **bbs)
{
struct rpe_data rpe;
@@ -157,9 +140,7 @@ find_path (e, doms, bbs)
false if the placement of BB was already correct (provided that placements
of its successors are correct). */
static bool
-fix_bb_placement (loops, bb)
- struct loops *loops;
- basic_block bb;
+fix_bb_placement (struct loops *loops, basic_block bb)
{
edge e;
struct loop *loop = loops->tree_root, *act;
@@ -195,9 +176,7 @@ fix_bb_placement (loops, bb)
to this change; the condition for them is simmilar, except that instead of
successors we consider edges coming out of the loops. */
static void
-fix_bb_placements (loops, from)
- struct loops *loops;
- basic_block from;
+fix_bb_placements (struct loops *loops, basic_block from)
{
sbitmap in_queue;
basic_block *queue, *qtop, *qbeg, *qend;
@@ -257,7 +236,7 @@ fix_bb_placements (loops, from)
if (TEST_BIT (in_queue, pred->index))
continue;
- /* If it is subloop, then it either was not moved, or
+ /* If it is subloop, then it either was not moved, or
the path up the loop tree from base_loop do not contain
it. */
nca = find_common_loop (pred->loop_father, base_loop);
@@ -290,8 +269,7 @@ fix_bb_placements (loops, from)
mo longer be part irreducible loop. Fix it and proceed recursively
for its successors if needed. */
static void
-fix_irreducible_loops (from)
- basic_block from;
+fix_irreducible_loops (basic_block from)
{
basic_block bb;
basic_block *stack;
@@ -334,7 +312,7 @@ fix_irreducible_loops (from)
for (e = bb->succ; e; e = e->succ_next)
edges[n_edges++] = e;
}
-
+
for (i = 0; i < n_edges; i++)
if (e->flags & EDGE_IRREDUCIBLE_LOOP)
{
@@ -343,10 +321,10 @@ fix_irreducible_loops (from)
e->flags &= ~EDGE_IRREDUCIBLE_LOOP;
if (TEST_BIT (on_stack, e->dest->index))
- continue;
+ continue;
SET_BIT (on_stack, e->dest->index);
- stack[stack_top++] = e->dest;
+ stack[stack_top++] = e->dest;
}
free (edges);
}
@@ -360,9 +338,7 @@ fix_irreducible_loops (from)
we were able to remove the path, false otherwise (and nothing is affected
then). */
bool
-remove_path (loops, e)
- struct loops *loops;
- edge e;
+remove_path (struct loops *loops, edge e)
{
edge ae;
basic_block *rem_bbs, *bord_bbs, *dom_bbs, from, bb;
@@ -387,7 +363,7 @@ remove_path (loops, e)
&& dominated_by_p (loops->cfg.dom,
e->src->loop_father->latch, e->dest))
unloop (loops, e->src->loop_father);
-
+
/* Identify the path. */
nrem = find_path (e, loops->cfg.dom, &rem_bbs);
@@ -466,9 +442,7 @@ remove_path (loops, e)
/* Predicate for enumeration in add_loop. */
static bool
-alp_enum_p (bb, alp_header)
- basic_block bb;
- void *alp_header;
+alp_enum_p (basic_block bb, void *alp_header)
{
return bb != (basic_block) alp_header;
}
@@ -476,13 +450,11 @@ alp_enum_p (bb, alp_header)
/* Given LOOP structure with filled header and latch, find the body of the
corresponding loop and add it to LOOPS tree. */
static void
-add_loop (loops, loop)
- struct loops *loops;
- struct loop *loop;
+add_loop (struct loops *loops, struct loop *loop)
{
basic_block *bbs;
int i, n;
-
+
/* Add it to loop structure. */
place_new_loop (loops, loop);
loop->level = 1;
@@ -502,11 +474,7 @@ add_loop (loops, loop)
/* Multiply all frequencies of basic blocks in array BBS of lenght NBBS
by NUM/DEN. */
static void
-scale_bbs_frequencies (bbs, nbbs, num, den)
- basic_block *bbs;
- int nbbs;
- int num;
- int den;
+scale_bbs_frequencies (basic_block *bbs, int nbbs, int num, int den)
{
int i;
edge e;
@@ -522,10 +490,7 @@ scale_bbs_frequencies (bbs, nbbs, num, den)
/* Multiply all frequencies in LOOP by NUM/DEN. */
static void
-scale_loop_frequencies (loop, num, den)
- struct loop *loop;
- int num;
- int den;
+scale_loop_frequencies (struct loop *loop, int num, int den)
{
basic_block *bbs;
@@ -543,11 +508,7 @@ scale_loop_frequencies (loop, num, den)
SWITCH_BB->succ->succ_next to original destination of HEADER_EDGE.
Returns newly created loop. */
struct loop *
-loopify (loops, latch_edge, header_edge, switch_bb)
- struct loops *loops;
- edge latch_edge;
- edge header_edge;
- basic_block switch_bb;
+loopify (struct loops *loops, edge latch_edge, edge header_edge, basic_block switch_bb)
{
basic_block succ_bb = latch_edge->dest;
basic_block pred_bb = header_edge->src;
@@ -634,9 +595,7 @@ loopify (loops, latch_edge, header_edge, switch_bb)
the LOOP was removed. After this function, original loop latch will
have no successor, which caller is expected to fix somehow. */
void
-unloop (loops, loop)
- struct loops *loops;
- struct loop *loop;
+unloop (struct loops *loops, struct loop *loop)
{
basic_block *body;
struct loop *ploop;
@@ -694,8 +653,7 @@ unloop (loops, loop)
FATHER, and set it as outer loop of LOOP. Return 1 if placement of
LOOP changed. */
int
-fix_loop_placement (loop)
- struct loop *loop;
+fix_loop_placement (struct loop *loop)
{
basic_block *body;
unsigned i;
@@ -729,8 +687,7 @@ fix_loop_placement (loop)
It is used in case when we removed some edges coming out of LOOP, which
may cause the right placement of LOOP inside loop tree to change. */
static void
-fix_loop_placements (loop)
- struct loop *loop;
+fix_loop_placements (struct loop *loop)
{
struct loop *outer;
@@ -745,9 +702,7 @@ fix_loop_placements (loop)
/* Creates place for a new LOOP in LOOPS structure. */
static void
-place_new_loop (loops, loop)
- struct loops *loops;
- struct loop *loop;
+place_new_loop (struct loops *loops, struct loop *loop)
{
loops->parray =
xrealloc (loops->parray, (loops->num + 1) * sizeof (struct loop *));
@@ -759,10 +714,7 @@ place_new_loop (loops, loop)
/* Copies copy of LOOP as subloop of TARGET loop, placing newly
created loop into LOOPS structure. */
static struct loop *
-duplicate_loop (loops, loop, target)
- struct loops *loops;
- struct loop *loop;
- struct loop *target;
+duplicate_loop (struct loops *loops, struct loop *loop, struct loop *target)
{
struct loop *cloop;
cloop = xcalloc (1, sizeof (struct loop));
@@ -782,11 +734,8 @@ duplicate_loop (loops, loop, target)
/* Copies structure of subloops of LOOP into TARGET loop, placing
newly created loops into loop tree stored in LOOPS. */
-static void
-duplicate_subloops (loops, loop, target)
- struct loops *loops;
- struct loop *loop;
- struct loop *target;
+static void
+duplicate_subloops (struct loops *loops, struct loop *loop, struct loop *target)
{
struct loop *aloop, *cloop;
@@ -799,12 +748,8 @@ duplicate_subloops (loops, loop, target)
/* Copies structure of subloops of N loops, stored in array COPIED_LOOPS,
into TARGET loop, placing newly created loops into loop tree LOOPS. */
-static void
-copy_loops_to (loops, copied_loops, n, target)
- struct loops *loops;
- struct loop **copied_loops;
- int n;
- struct loop *target;
+static void
+copy_loops_to (struct loops *loops, struct loop **copied_loops, int n, struct loop *target)
{
struct loop *aloop;
int i;
@@ -818,9 +763,7 @@ copy_loops_to (loops, copied_loops, n, target)
/* Redirects edge E to basic block DEST. */
static void
-loop_redirect_edge (e, dest)
- edge e;
- basic_block dest;
+loop_redirect_edge (edge e, basic_block dest)
{
if (e->dest == dest)
return;
@@ -831,9 +774,7 @@ loop_redirect_edge (e, dest)
/* Deletes edge E from a branch if possible. Unless REALLY_DELETE is set,
just test whether it is possible to remove the edge. */
static bool
-loop_delete_branch_edge (e, really_delete)
- edge e;
- int really_delete;
+loop_delete_branch_edge (edge e, int really_delete)
{
basic_block src = e->src;
int irr;
@@ -861,7 +802,7 @@ loop_delete_branch_edge (e, really_delete)
/* Redirecting behaves wrongly wrto this flag. */
irr = snd->flags & EDGE_IRREDUCIBLE_LOOP;
-
+
if (!redirect_edge_and_branch (e, newdest))
return false;
src->succ->flags &= ~EDGE_IRREDUCIBLE_LOOP;
@@ -904,16 +845,9 @@ loop_delete_branch_edge (e, really_delete)
original entry block to first block in peeled copy.
*/
static void
-copy_bbs (bbs, n, entry, latch_edge, new_bbs, loops, header_edge, copy_header_edge, add_irreducible_flag)
- basic_block *bbs;
- int n;
- edge entry;
- edge latch_edge;
- basic_block **new_bbs;
- struct loops *loops;
- edge *header_edge;
- edge *copy_header_edge;
- int add_irreducible_flag;
+copy_bbs (basic_block *bbs, int n, edge entry, edge latch_edge,
+ basic_block **new_bbs, struct loops *loops, edge *header_edge,
+ edge *copy_header_edge, int add_irreducible_flag)
{
int i;
basic_block bb, new_bb, header = entry->dest, dom_bb;
@@ -975,7 +909,7 @@ copy_bbs (bbs, n, entry, latch_edge, new_bbs, loops, header_edge, copy_header_ed
basic_block src = e->src;
e_pred = e->pred_next;
-
+
if (!RBI (src)->duplicated)
continue;
@@ -1007,8 +941,7 @@ copy_bbs (bbs, n, entry, latch_edge, new_bbs, loops, header_edge, copy_header_ed
/* Check whether LOOP's body can be duplicated. */
bool
-can_duplicate_loop_p (loop)
- struct loop *loop;
+can_duplicate_loop_p (struct loop *loop)
{
basic_block *bbs;
unsigned i;
@@ -1047,13 +980,8 @@ can_duplicate_loop_p (loop)
into TO_REMOVE array that must be large enough to hold them all; their
number is returned in N_TO_REMOVE. */
static void
-record_exit_edges (orig, bbs, nbbs, to_remove, n_to_remove, is_orig)
- edge orig;
- basic_block *bbs;
- int nbbs;
- edge *to_remove;
- unsigned *n_to_remove;
- int is_orig;
+record_exit_edges (edge orig, basic_block *bbs, int nbbs, edge *to_remove,
+ unsigned int *n_to_remove, int is_orig)
{
sbitmap my_blocks;
int i;
@@ -1106,17 +1034,10 @@ record_exit_edges (orig, bbs, nbbs, to_remove, n_to_remove, is_orig)
other copies are numbered in order given by control flow through them)
into TO_REMOVE array. Returns false if duplication is impossible. */
int
-duplicate_loop_to_header_edge (loop, e, loops, ndupl, wont_exit, orig,
- to_remove, n_to_remove, flags)
- struct loop *loop;
- edge e;
- struct loops *loops;
- unsigned ndupl;
- sbitmap wont_exit;
- edge orig;
- edge *to_remove;
- unsigned *n_to_remove;
- int flags;
+duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops,
+ unsigned int ndupl, sbitmap wont_exit,
+ edge orig, edge *to_remove,
+ unsigned int *n_to_remove, int flags)
{
struct loop *target, *aloop;
struct loop **orig_loops;
@@ -1184,7 +1105,7 @@ duplicate_loop_to_header_edge (loop, e, loops, ndupl, wont_exit, orig,
scale_step = xmalloc (ndupl * sizeof (int));
for (i = 1; i <= ndupl; i++)
- scale_step[i - 1] = TEST_BIT (wont_exit, i)
+ scale_step[i - 1] = TEST_BIT (wont_exit, i)
? prob_pass_wont_exit
: prob_pass_thru;
@@ -1230,7 +1151,7 @@ duplicate_loop_to_header_edge (loop, e, loops, ndupl, wont_exit, orig,
orig_loops[i] = aloop;
loop->copy = target;
-
+
/* Original basic blocks. */
n = loop->num_nodes;
@@ -1244,7 +1165,7 @@ duplicate_loop_to_header_edge (loop, e, loops, ndupl, wont_exit, orig,
/* Record exit edges in original loop body. */
if (TEST_BIT (wont_exit, 0))
record_exit_edges (orig, bbs, n, to_remove, n_to_remove, true);
-
+
for (j = 0; j < ndupl; j++)
{
/* Copy loops. */
@@ -1259,7 +1180,7 @@ duplicate_loop_to_header_edge (loop, e, loops, ndupl, wont_exit, orig,
/* Record exit edges in this copy. */
if (TEST_BIT (wont_exit, j + 1))
record_exit_edges (orig, new_bbs, n, to_remove, n_to_remove, false);
-
+
/* Set counts and frequencies. */
for (i = 0; i < n; i++)
{
@@ -1270,7 +1191,7 @@ duplicate_loop_to_header_edge (loop, e, loops, ndupl, wont_exit, orig,
{
new_bb->count = RDIV (scale_act * bb->count, REG_BR_PROB_BASE);
new_bb->frequency = RDIV (scale_act * bb->frequency,
- REG_BR_PROB_BASE);
+ REG_BR_PROB_BASE);
}
else
{
@@ -1279,7 +1200,7 @@ duplicate_loop_to_header_edge (loop, e, loops, ndupl, wont_exit, orig,
}
for (ae = new_bb->succ; ae; ae = ae->succ_next)
- ae->count = RDIV (new_bb->count * ae->probability,
+ ae->count = RDIV (new_bb->count * ae->probability,
REG_BR_PROB_BASE);
}
if (flags & DLTHE_FLAG_UPDATE_FREQ)
@@ -1290,7 +1211,7 @@ duplicate_loop_to_header_edge (loop, e, loops, ndupl, wont_exit, orig,
memcpy (first_active, new_bbs, n * sizeof (basic_block));
first_active_latch = RBI (latch)->copy;
}
-
+
free (new_bbs);
/* Original loop header is dominated by latch copy
@@ -1306,7 +1227,7 @@ duplicate_loop_to_header_edge (loop, e, loops, ndupl, wont_exit, orig,
}
}
/* Now handle original loop. */
-
+
/* Update edge counts. */
if (flags & DLTHE_FLAG_UPDATE_FREQ)
{
@@ -1353,10 +1274,7 @@ duplicate_loop_to_header_edge (loop, e, loops, ndupl, wont_exit, orig,
entry; otherwise we also force preheader block to have only one successor.
The function also updates dominators stored in DOM. */
static basic_block
-create_preheader (loop, dom, flags)
- struct loop *loop;
- dominance_info dom;
- int flags;
+create_preheader (struct loop *loop, dominance_info dom, int flags)
{
edge e, fallthru;
basic_block dummy;
@@ -1404,7 +1322,7 @@ create_preheader (loop, dom, flags)
ploop->latch = fallthru->dest;
add_to_dominance_info (dom, fallthru->dest);
-
+
/* Redirect edges. */
for (e = dummy->pred; e; e = e->pred_next)
{
@@ -1442,9 +1360,7 @@ create_preheader (loop, dom, flags)
/* Create preheaders for each loop from loop tree stored in LOOPS; for meaning
of FLAGS see create_preheader. */
void
-create_preheaders (loops, flags)
- struct loops *loops;
- int flags;
+create_preheaders (struct loops *loops, int flags)
{
unsigned i;
for (i = 1; i < loops->num; i++)
@@ -1455,8 +1371,7 @@ create_preheaders (loops, flags)
/* Forces all loop latches of loops from loop tree LOOPS to have only single
successor. */
void
-force_single_succ_latches (loops)
- struct loops *loops;
+force_single_succ_latches (struct loops *loops)
{
unsigned i;
struct loop *loop;
@@ -1467,7 +1382,7 @@ force_single_succ_latches (loops)
loop = loops->parray[i];
if (!loop->latch->succ->succ_next)
continue;
-
+
for (e = loop->header->pred; e->src != loop->latch; e = e->pred_next)
continue;
@@ -1481,15 +1396,12 @@ force_single_succ_latches (loops)
be ok after this function. The created block is placed on correct place
in LOOPS structure and its dominator is set. */
basic_block
-loop_split_edge_with (e, insns, loops)
- edge e;
- rtx insns;
- struct loops *loops;
+loop_split_edge_with (edge e, rtx insns, struct loops *loops)
{
basic_block src, dest, new_bb;
struct loop *loop_c;
edge new_e;
-
+
src = e->src;
dest = e->dest;
@@ -1531,6 +1443,6 @@ loop_split_edge_with (e, insns, loops)
if (dest->loop_father->latch == src)
dest->loop_father->latch = new_bb;
-
+
return new_bb;
}
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 35757cd5475..a08d29f3da9 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -1,6 +1,6 @@
/* Control flow graph manipulation code for GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -56,6 +56,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "obstack.h"
#include "insn-config.h"
#include "cfglayout.h"
+#include "expr.h"
/* Stubs in case we don't have a return insn. */
#ifndef HAVE_return
@@ -69,32 +70,32 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
rtx label_value_list;
rtx tail_recursion_label_list;
-static int can_delete_note_p PARAMS ((rtx));
-static int can_delete_label_p PARAMS ((rtx));
-static void commit_one_edge_insertion PARAMS ((edge, int));
-static bool try_redirect_by_replacing_jump PARAMS ((edge, basic_block));
-static rtx last_loop_beg_note PARAMS ((rtx));
-static bool back_edge_of_syntactic_loop_p PARAMS ((basic_block, basic_block));
-basic_block force_nonfallthru_and_redirect PARAMS ((edge, basic_block));
-static basic_block rtl_split_edge PARAMS ((edge));
-static int rtl_verify_flow_info PARAMS ((void));
-static edge cfg_layout_split_block PARAMS ((basic_block, void *));
-static bool cfg_layout_redirect_edge_and_branch PARAMS ((edge, basic_block));
-static basic_block cfg_layout_redirect_edge_and_branch_force PARAMS ((edge, basic_block));
-static void cfg_layout_delete_block PARAMS ((basic_block));
-static void rtl_delete_block PARAMS ((basic_block));
-static basic_block rtl_redirect_edge_and_branch_force PARAMS ((edge, basic_block));
-static bool rtl_redirect_edge_and_branch PARAMS ((edge, basic_block));
-static edge rtl_split_block PARAMS ((basic_block, void *));
-static void rtl_dump_bb PARAMS ((basic_block, FILE *));
-static int rtl_verify_flow_info_1 PARAMS ((void));
+static int can_delete_note_p (rtx);
+static int can_delete_label_p (rtx);
+static void commit_one_edge_insertion (edge, int);
+static bool try_redirect_by_replacing_jump (edge, basic_block);
+static rtx last_loop_beg_note (rtx);
+static bool back_edge_of_syntactic_loop_p (basic_block, basic_block);
+basic_block force_nonfallthru_and_redirect (edge, basic_block);
+static basic_block rtl_split_edge (edge);
+static int rtl_verify_flow_info (void);
+static edge cfg_layout_split_block (basic_block, void *);
+static bool cfg_layout_redirect_edge_and_branch (edge, basic_block);
+static basic_block cfg_layout_redirect_edge_and_branch_force (edge, basic_block);
+static void cfg_layout_delete_block (basic_block);
+static void rtl_delete_block (basic_block);
+static basic_block rtl_redirect_edge_and_branch_force (edge, basic_block);
+static bool rtl_redirect_edge_and_branch (edge, basic_block);
+static edge rtl_split_block (basic_block, void *);
+static void rtl_dump_bb (basic_block, FILE *);
+static int rtl_verify_flow_info_1 (void);
+static void mark_killed_regs (rtx, rtx, void *);
/* Return true if NOTE is not one of the ones that must be kept paired,
so that we may simply delete it. */
static int
-can_delete_note_p (note)
- rtx note;
+can_delete_note_p (rtx note)
{
return (NOTE_LINE_NUMBER (note) == NOTE_INSN_DELETED
|| NOTE_LINE_NUMBER (note) == NOTE_INSN_BASIC_BLOCK
@@ -104,8 +105,7 @@ can_delete_note_p (note)
/* True if a given label can be deleted. */
static int
-can_delete_label_p (label)
- rtx label;
+can_delete_label_p (rtx label)
{
return (!LABEL_PRESERVE_P (label)
/* User declared labels must be preserved. */
@@ -117,8 +117,7 @@ can_delete_label_p (label)
/* Delete INSN by patching it out. Return the next insn. */
rtx
-delete_insn (insn)
- rtx insn;
+delete_insn (rtx insn)
{
rtx next = NEXT_INSN (insn);
rtx note;
@@ -189,8 +188,7 @@ delete_insn (insn)
/* Like delete_insn but also purge dead edges from BB. */
rtx
-delete_insn_and_edges (insn)
- rtx insn;
+delete_insn_and_edges (rtx insn)
{
rtx x;
bool purge = false;
@@ -209,8 +207,7 @@ delete_insn_and_edges (insn)
that must be paired. */
void
-delete_insn_chain (start, finish)
- rtx start, finish;
+delete_insn_chain (rtx start, rtx finish)
{
rtx next;
@@ -233,8 +230,7 @@ delete_insn_chain (start, finish)
/* Like delete_insn but also purge dead edges from BB. */
void
-delete_insn_chain_and_edges (first, last)
- rtx first, last;
+delete_insn_chain_and_edges (rtx first, rtx last)
{
bool purge = false;
@@ -256,9 +252,7 @@ delete_insn_chain_and_edges (first, last)
AFTER is the basic block we should be put after. */
basic_block
-create_basic_block_structure (head, end, bb_note, after)
- rtx head, end, bb_note;
- basic_block after;
+create_basic_block_structure (rtx head, rtx end, rtx bb_note, basic_block after)
{
basic_block bb;
@@ -333,9 +327,7 @@ create_basic_block_structure (head, end, bb_note, after)
create basic block at the end of INSN chain. */
basic_block
-create_basic_block (head, end, after)
- rtx head, end;
- basic_block after;
+create_basic_block (rtx head, rtx end, basic_block after)
{
basic_block bb;
@@ -358,8 +350,7 @@ create_basic_block (head, end, after)
to post-process the stream to remove empty blocks, loops, ranges, etc. */
static void
-rtl_delete_block (b)
- basic_block b;
+rtl_delete_block (basic_block b)
{
rtx insn, end, tmp;
@@ -420,7 +411,7 @@ rtl_delete_block (b)
/* Records the basic block struct in BLOCK_FOR_INSN for every insn. */
void
-compute_bb_for_insn ()
+compute_bb_for_insn (void)
{
basic_block bb;
@@ -441,7 +432,7 @@ compute_bb_for_insn ()
/* Release the basic_block_for_insn array. */
void
-free_bb_for_insn ()
+free_bb_for_insn (void)
{
rtx insn;
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
@@ -452,8 +443,7 @@ free_bb_for_insn ()
/* Update insns block within BB. */
void
-update_bb_for_insn (bb)
- basic_block bb;
+update_bb_for_insn (basic_block bb)
{
rtx insn;
@@ -472,9 +462,7 @@ update_bb_for_insn (bb)
one has a number one greater than the block split. */
static edge
-rtl_split_block (bb, insnp)
- basic_block bb;
- void *insnp;
+rtl_split_block (basic_block bb, void *insnp)
{
basic_block new_bb;
edge new_edge;
@@ -533,8 +521,7 @@ rtl_split_block (bb, insnp)
are already contiguous, hence `nomove'. */
void
-merge_blocks_nomove (a, b)
- basic_block a, b;
+merge_blocks_nomove (basic_block a, basic_block b)
{
rtx b_head = b->head, b_end = b->end, a_end = a->end;
rtx del_first = NULL_RTX, del_last = NULL_RTX;
@@ -641,8 +628,7 @@ merge_blocks_nomove (a, b)
exist. */
rtx
-block_label (block)
- basic_block block;
+block_label (basic_block block)
{
if (block == EXIT_BLOCK_PTR)
return NULL_RTX;
@@ -661,9 +647,7 @@ block_label (block)
return values are equivalent to redirect_edge_and_branch. */
static bool
-try_redirect_by_replacing_jump (e, target)
- edge e;
- basic_block target;
+try_redirect_by_replacing_jump (edge e, basic_block target)
{
basic_block src = e->src;
rtx insn = src->end, kill_from;
@@ -785,8 +769,7 @@ try_redirect_by_replacing_jump (e, target)
test. */
static rtx
-last_loop_beg_note (insn)
- rtx insn;
+last_loop_beg_note (rtx insn)
{
rtx last = insn;
@@ -810,9 +793,7 @@ last_loop_beg_note (insn)
stream. */
static bool
-rtl_redirect_edge_and_branch (e, target)
- edge e;
- basic_block target;
+rtl_redirect_edge_and_branch (edge e, basic_block target)
{
rtx tmp;
rtx old_label = e->dest->head;
@@ -911,9 +892,7 @@ rtl_redirect_edge_and_branch (e, target)
Used by redirect_edge_and_branch_force. */
basic_block
-force_nonfallthru_and_redirect (e, target)
- edge e;
- basic_block target;
+force_nonfallthru_and_redirect (edge e, basic_block target)
{
basic_block jump_block, new_bb = NULL, src = e->src;
rtx note;
@@ -922,7 +901,7 @@ force_nonfallthru_and_redirect (e, target)
/* In the case the last instruction is conditional jump to the next
instruction, first redirect the jump itself and then continue
- by creating an basic block afterwards to redirect fallthru edge. */
+ by creating a basic block afterwards to redirect fallthru edge. */
if (e->src != ENTRY_BLOCK_PTR && e->dest != EXIT_BLOCK_PTR
&& any_condjump_p (e->src->end)
/* When called from cfglayout, fallthru edges do not
@@ -956,7 +935,7 @@ force_nonfallthru_and_redirect (e, target)
/* Irritating special case - fallthru edge to the same block as abnormal
edge.
We can't redirect abnormal edge, but we still can split the fallthru
- one and create separate abnormal edge to original destination.
+ one and create separate abnormal edge to original destination.
This allows bb-reorder to make such edge non-fallthru. */
if (e->dest != target)
abort ();
@@ -1064,8 +1043,7 @@ force_nonfallthru_and_redirect (e, target)
Return newly created BB or NULL if none. */
basic_block
-force_nonfallthru (e)
- edge e;
+force_nonfallthru (edge e)
{
return force_nonfallthru_and_redirect (e, e->dest);
}
@@ -1075,9 +1053,7 @@ force_nonfallthru (e)
Abort if conversion is impossible. */
static basic_block
-rtl_redirect_edge_and_branch_force (e, target)
- edge e;
- basic_block target;
+rtl_redirect_edge_and_branch_force (edge e, basic_block target)
{
if (redirect_edge_and_branch (e, target)
|| e->dest == target)
@@ -1092,9 +1068,7 @@ rtl_redirect_edge_and_branch_force (e, target)
fact true, delete the jump and barriers that are in the way. */
void
-tidy_fallthru_edge (e, b, c)
- edge e;
- basic_block b, c;
+tidy_fallthru_edge (edge e, basic_block b, basic_block c)
{
rtx q;
@@ -1149,7 +1123,7 @@ tidy_fallthru_edge (e, b, c)
is how find_basic_blocks created them. */
void
-tidy_fallthru_edges ()
+tidy_fallthru_edges (void)
{
basic_block b, c;
@@ -1189,8 +1163,7 @@ tidy_fallthru_edges ()
is back edge of syntactic loop. */
static bool
-back_edge_of_syntactic_loop_p (bb1, bb2)
- basic_block bb1, bb2;
+back_edge_of_syntactic_loop_p (basic_block bb1, basic_block bb2)
{
rtx insn;
int count = 0;
@@ -1228,8 +1201,7 @@ back_edge_of_syntactic_loop_p (bb1, bb2)
block with multiple predecessors is not handled optimally. */
basic_block
-rtl_split_edge (edge_in)
- edge edge_in;
+rtl_split_edge (edge edge_in)
{
basic_block bb;
rtx before;
@@ -1317,9 +1289,7 @@ rtl_split_edge (edge_in)
CFG until commit_edge_insertions is called. */
void
-insert_insn_on_edge (pattern, e)
- rtx pattern;
- edge e;
+insert_insn_on_edge (rtx pattern, edge e)
{
/* We cannot insert instructions on an abnormal critical edge.
It will be easier to find the culprit if we die now. */
@@ -1337,12 +1307,105 @@ insert_insn_on_edge (pattern, e)
end_sequence ();
}
+/* Called from safe_insert_insn_on_edge through note_stores, marks live
+ registers that are killed by the store. */
+static void
+mark_killed_regs (rtx reg, rtx set ATTRIBUTE_UNUSED, void *data)
+{
+ regset killed = data;
+ int regno, i;
+
+ if (GET_CODE (reg) == SUBREG)
+ reg = SUBREG_REG (reg);
+ if (!REG_P (reg))
+ return;
+ regno = REGNO (reg);
+ if (regno >= FIRST_PSEUDO_REGISTER)
+ SET_REGNO_REG_SET (killed, regno);
+ else
+ {
+ for (i = 0; i < HARD_REGNO_NREGS (regno, GET_MODE (reg)); i++)
+ SET_REGNO_REG_SET (killed, regno + i);
+ }
+}
+
+/* Similar to insert_insn_on_edge, tries to put INSN to edge E. Additionally
+ it checks whether this will not clobber the registers that are live on the
+ edge (i.e. it requieres liveness information to be up-to-date) and if there
+ are some, then it tries to save and restore them. Returns true if
+ succesful. */
+bool
+safe_insert_insn_on_edge (rtx insn, edge e)
+{
+ rtx x;
+ regset_head killed_head;
+ regset killed = INITIALIZE_REG_SET (killed_head);
+ rtx save_regs = NULL_RTX;
+ int regno, noccmode;
+ enum machine_mode mode;
+
+#ifdef AVOID_CCMODE_COPIES
+ noccmode = true;
+#else
+ noccmode = false;
+#endif
+
+ for (x = insn; x; x = NEXT_INSN (x))
+ if (INSN_P (x))
+ note_stores (PATTERN (x), mark_killed_regs, killed);
+ bitmap_operation (killed, killed, e->dest->global_live_at_start,
+ BITMAP_AND);
+
+ EXECUTE_IF_SET_IN_REG_SET (killed, 0, regno,
+ {
+ mode = regno < FIRST_PSEUDO_REGISTER
+ ? reg_raw_mode[regno]
+ : GET_MODE (regno_reg_rtx[regno]);
+ if (mode == VOIDmode)
+ return false;
+
+ if (noccmode && mode == CCmode)
+ return false;
+
+ save_regs = alloc_EXPR_LIST (0,
+ alloc_EXPR_LIST (0,
+ gen_reg_rtx (mode),
+ gen_raw_REG (mode, regno)),
+ save_regs);
+ });
+
+ if (save_regs)
+ {
+ rtx from, to;
+
+ start_sequence ();
+ for (x = save_regs; x; x = XEXP (x, 1))
+ {
+ from = XEXP (XEXP (x, 0), 1);
+ to = XEXP (XEXP (x, 0), 0);
+ emit_move_insn (to, from);
+ }
+ emit_insn (insn);
+ for (x = save_regs; x; x = XEXP (x, 1))
+ {
+ from = XEXP (XEXP (x, 0), 0);
+ to = XEXP (XEXP (x, 0), 1);
+ emit_move_insn (to, from);
+ }
+ insn = get_insns ();
+ end_sequence ();
+ free_EXPR_LIST_list (&save_regs);
+ }
+ insert_insn_on_edge (insn, e);
+
+ FREE_REG_SET (killed);
+ return true;
+}
+
/* Update the CFG for the instructions queued on edge E. */
static void
-commit_one_edge_insertion (e, watch_calls)
- edge e;
- int watch_calls;
+commit_one_edge_insertion (edge e, int watch_calls)
{
rtx before = NULL_RTX, after = NULL_RTX, insns, tmp, last;
basic_block bb = NULL;
@@ -1467,7 +1530,7 @@ commit_one_edge_insertion (e, watch_calls)
/* Update the CFG for all queued instructions. */
void
-commit_edge_insertions ()
+commit_edge_insertions (void)
{
basic_block bb;
sbitmap blocks;
@@ -1515,7 +1578,7 @@ commit_edge_insertions ()
code on edges between call and storing its return value. */
void
-commit_edge_insertions_watch_calls ()
+commit_edge_insertions_watch_calls (void)
{
basic_block bb;
sbitmap blocks;
@@ -1562,9 +1625,7 @@ commit_edge_insertions_watch_calls ()
/* Print out one basic block with live information at start and end. */
static void
-rtl_dump_bb (bb, outf)
- basic_block bb;
- FILE *outf;
+rtl_dump_bb (basic_block bb, FILE *outf)
{
rtx insn;
rtx last;
@@ -1586,9 +1647,7 @@ rtl_dump_bb (bb, outf)
basic block. */
void
-print_rtl_with_bb (outf, rtx_first)
- FILE *outf;
- rtx rtx_first;
+print_rtl_with_bb (FILE *outf, rtx rtx_first)
{
rtx tmp_rtx;
@@ -1674,8 +1733,7 @@ print_rtl_with_bb (outf, rtx_first)
}
void
-update_br_prob_note (bb)
- basic_block bb;
+update_br_prob_note (basic_block bb)
{
rtx note;
if (GET_CODE (bb->end) != JUMP_INSN)
@@ -1701,7 +1759,7 @@ update_br_prob_note (bb)
In future it can be extended check a lot of other stuff as well
(reachability of basic blocks, life information, etc. etc.). */
static int
-rtl_verify_flow_info_1 ()
+rtl_verify_flow_info_1 (void)
{
const int max_uid = get_max_uid ();
rtx last_head = get_last_insn ();
@@ -1920,7 +1978,7 @@ rtl_verify_flow_info_1 ()
- check that all returns are followed by barriers
- check that all fallthru edge points to the adjacent blocks. */
static int
-rtl_verify_flow_info ()
+rtl_verify_flow_info (void)
{
basic_block bb;
int err = rtl_verify_flow_info_1 ();
@@ -2044,8 +2102,7 @@ rtl_verify_flow_info ()
Return true if any edges are eliminated. */
bool
-purge_dead_edges (bb)
- basic_block bb;
+purge_dead_edges (basic_block bb)
{
edge e, next;
rtx insn = bb->end, note;
@@ -2227,8 +2284,7 @@ purge_dead_edges (bb)
true if some edge has been eliminated. */
bool
-purge_all_dead_edges (update_life_p)
- int update_life_p;
+purge_all_dead_edges (int update_life_p)
{
int purged = false;
sbitmap blocks = 0;
@@ -2261,9 +2317,7 @@ purge_all_dead_edges (update_life_p)
/* Same as split_block but update cfg_layout structures. */
static edge
-cfg_layout_split_block (bb, insnp)
- basic_block bb;
- void *insnp;
+cfg_layout_split_block (basic_block bb, void *insnp)
{
rtx insn = insnp;
@@ -2278,9 +2332,7 @@ cfg_layout_split_block (bb, insnp)
/* Redirect Edge to DEST. */
static bool
-cfg_layout_redirect_edge_and_branch (e, dest)
- edge e;
- basic_block dest;
+cfg_layout_redirect_edge_and_branch (edge e, basic_block dest)
{
basic_block src = e->src;
basic_block old_next_bb = src->next_bb;
@@ -2332,9 +2384,7 @@ cfg_layout_redirect_edge_and_branch (e, dest)
/* Simple wrapper as we always can redirect fallthru edges. */
static basic_block
-cfg_layout_redirect_edge_and_branch_force (e, dest)
- edge e;
- basic_block dest;
+cfg_layout_redirect_edge_and_branch_force (edge e, basic_block dest)
{
if (!cfg_layout_redirect_edge_and_branch (e, dest))
abort ();
@@ -2343,8 +2393,7 @@ cfg_layout_redirect_edge_and_branch_force (e, dest)
/* Same as flow_delete_block but update cfg_layout structures. */
static void
-cfg_layout_delete_block (bb)
- basic_block bb;
+cfg_layout_delete_block (basic_block bb)
{
rtx insn, next, prev = PREV_INSN (bb->head), *to, remaints;
@@ -2384,11 +2433,11 @@ cfg_layout_delete_block (bb)
if (prev)
prev = NEXT_INSN (prev);
- else
+ else
prev = get_insns ();
if (next)
next = PREV_INSN (next);
- else
+ else
next = get_last_insn ();
if (next && NEXT_INSN (next) != prev)
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index fd77f663bba..ffc33123028 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -24,7 +24,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
-#include "tree-inline.h"
#include "langhooks.h"
#include "hashtab.h"
#include "toplev.h"
@@ -34,13 +33,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "target.h"
#include "cgraph.h"
#include "varray.h"
+#include "output.h"
/* The known declarations must not get garbage collected. Callgraph
datastructures should not get saved via PCH code since this would
make it difficult to extend into intra-module optimizer later. So
we store only the references into the array to prevent gabrage
collector from deleting live data. */
-static GTY(()) varray_type known_fns;
+static GTY(()) varray_type known_decls;
/* Hash table used to convert declarations into nodes. */
static htab_t cgraph_hash = 0;
@@ -48,23 +48,35 @@ static htab_t cgraph_hash = 0;
/* The linked list of cgraph nodes. */
struct cgraph_node *cgraph_nodes;
+/* Queue of cgraph nodes scheduled to be lowered. */
+struct cgraph_node *cgraph_nodes_queue;
+
/* Number of nodes in existence. */
int cgraph_n_nodes;
/* Set when whole unit has been analyzed so we can access global info. */
bool cgraph_global_info_ready = false;
+/* Hash table used to convert declarations into nodes. */
+static htab_t cgraph_varpool_hash = 0;
+
+/* Queue of cgraph nodes scheduled to be lowered and output. */
+struct cgraph_varpool_node *cgraph_varpool_nodes_queue;
+
+/* Number of nodes in existence. */
+int cgraph_varpool_n_nodes;
+
static struct cgraph_edge *create_edge PARAMS ((struct cgraph_node *,
struct cgraph_node *));
static void cgraph_remove_edge PARAMS ((struct cgraph_node *, struct cgraph_node *));
-static hashval_t hash_node PARAMS ((const PTR));
-static int eq_node PARAMS ((const PTR, const PTR));
+static hashval_t hash_node PARAMS ((const void *));
+static int eq_node PARAMS ((const void *, const void *));
/* Returns a hash code for P. */
static hashval_t
hash_node (p)
- const PTR p;
+ const void *p;
{
return (hashval_t)
htab_hash_pointer (DECL_ASSEMBLER_NAME
@@ -75,11 +87,11 @@ hash_node (p)
static int
eq_node (p1, p2)
- const PTR p1;
- const PTR p2;
+ const void *p1;
+ const void *p2;
{
return ((DECL_ASSEMBLER_NAME (((struct cgraph_node *) p1)->decl)) ==
- DECL_ASSEMBLER_NAME ((tree) p2));
+ (tree) p2);
}
/* Return cgraph node assigned to DECL. Create new one when needed. */
@@ -96,11 +108,13 @@ cgraph_node (decl)
if (!cgraph_hash)
{
cgraph_hash = htab_create (10, hash_node, eq_node, NULL);
- VARRAY_TREE_INIT (known_fns, 32, "known_fns");
+ if (!known_decls)
+ VARRAY_TREE_INIT (known_decls, 32, "known_decls");
}
slot =
- (struct cgraph_node **) htab_find_slot_with_hash (cgraph_hash, decl,
+ (struct cgraph_node **) htab_find_slot_with_hash (cgraph_hash,
+ DECL_ASSEMBLER_NAME (decl),
htab_hash_pointer
(DECL_ASSEMBLER_NAME
(decl)), 1);
@@ -121,10 +135,31 @@ cgraph_node (decl)
node->next_nested = node->origin->nested;
node->origin->nested = node;
}
- VARRAY_PUSH_TREE (known_fns, decl);
+ VARRAY_PUSH_TREE (known_decls, decl);
return node;
}
+/* Try to find existing function for identifier ID. */
+struct cgraph_node *
+cgraph_node_for_identifier (id)
+ tree id;
+{
+ struct cgraph_node **slot;
+
+ if (TREE_CODE (id) != IDENTIFIER_NODE)
+ abort ();
+
+ if (!cgraph_hash)
+ return NULL;
+
+ slot =
+ (struct cgraph_node **) htab_find_slot_with_hash (cgraph_hash, id,
+ htab_hash_pointer (id), 0);
+ if (!slot)
+ return NULL;
+ return *slot;
+}
+
/* Create edge from CALLER to CALLEE in the cgraph. */
static struct cgraph_edge *
@@ -194,6 +229,28 @@ cgraph_remove_node (node)
/* Do not free the structure itself so the walk over chain can continue. */
}
+/* Notify finalize_compilation_unit that given node is reachable
+ or needed. */
+void
+cgraph_mark_needed_node (node, needed)
+ struct cgraph_node *node;
+ int needed;
+{
+ if (needed)
+ {
+ node->needed = 1;
+ }
+ if (!node->reachable)
+ {
+ node->reachable = 1;
+ if (DECL_SAVED_TREE (node->decl))
+ {
+ node->aux = cgraph_nodes_queue;
+ cgraph_nodes_queue = node;
+ }
+ }
+}
+
/* Record call from CALLER to CALLEE */
@@ -306,4 +363,136 @@ dump_cgraph (f)
}
}
+/* Returns a hash code for P. */
+
+static hashval_t
+cgraph_varpool_hash_node (const PTR p)
+{
+ return (hashval_t)
+ htab_hash_pointer (DECL_ASSEMBLER_NAME
+ (((struct cgraph_varpool_node *) p)->decl));
+}
+
+/* Returns non-zero if P1 and P2 are equal. */
+
+static int
+eq_cgraph_varpool_node (const PTR p1, const PTR p2)
+{
+ return ((DECL_ASSEMBLER_NAME (((struct cgraph_varpool_node *) p1)->decl)) ==
+ (tree) p2);
+}
+
+/* Return cgraph_varpool node assigned to DECL. Create new one when needed. */
+struct cgraph_varpool_node *
+cgraph_varpool_node (tree decl)
+{
+ struct cgraph_varpool_node *node;
+ struct cgraph_varpool_node **slot;
+
+ if (!DECL_P (decl) || TREE_CODE (decl) == FUNCTION_DECL)
+ abort ();
+
+ if (!cgraph_varpool_hash)
+ {
+ cgraph_varpool_hash = htab_create (10, cgraph_varpool_hash_node, eq_cgraph_varpool_node, NULL);
+ if (!known_decls)
+ VARRAY_TREE_INIT (known_decls, 32, "known_decls");
+ }
+
+ slot =
+ (struct cgraph_varpool_node **) htab_find_slot_with_hash (cgraph_varpool_hash,
+ DECL_ASSEMBLER_NAME (decl),
+ htab_hash_pointer
+ (DECL_ASSEMBLER_NAME
+ (decl)), 1);
+ if (*slot)
+ return *slot;
+ node = xcalloc (sizeof (*node), 1);
+ node->decl = decl;
+ cgraph_varpool_n_nodes++;
+ *slot = node;
+ VARRAY_PUSH_TREE (known_decls, decl);
+ return node;
+}
+
+/* Try to find existing function for identifier ID. */
+struct cgraph_varpool_node *
+cgraph_varpool_node_for_identifier (tree id)
+{
+ struct cgraph_varpool_node **slot;
+
+ if (TREE_CODE (id) != IDENTIFIER_NODE)
+ abort ();
+
+ if (!cgraph_varpool_hash)
+ return NULL;
+
+ slot =
+ (struct cgraph_varpool_node **) htab_find_slot_with_hash (cgraph_varpool_hash, id,
+ htab_hash_pointer (id), 0);
+ if (!slot)
+ return NULL;
+ return *slot;
+}
+
+/* Notify finalize_compilation_unit that given node is reachable
+ or needed. */
+void
+cgraph_varpool_mark_needed_node (struct cgraph_varpool_node *node)
+{
+ if (!node->needed && node->finalized)
+ {
+ node->aux = cgraph_varpool_nodes_queue;
+ cgraph_varpool_nodes_queue = node;
+ }
+ node->needed = 1;
+}
+
+void
+cgraph_varpool_finalize_decl (tree decl)
+{
+ struct cgraph_varpool_node *node = cgraph_varpool_node (decl);
+
+ if (node->needed && !node->finalized)
+ {
+ node->aux = cgraph_varpool_nodes_queue;
+ cgraph_varpool_nodes_queue = node;
+ }
+ node->finalized = true;
+
+ if (/* Externally visible variables must be output. The exception are
+ COMDAT functions that must be output only when they are needed. */
+ (TREE_PUBLIC (decl) && !DECL_COMDAT (decl))
+ /* Function whose name is output to the assembler file must be produced.
+ It is possible to assemble the name later after finalizing the function
+ and the fact is noticed in assemble_name then. */
+ || (DECL_ASSEMBLER_NAME_SET_P (decl)
+ && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
+ {
+ cgraph_varpool_mark_needed_node (node);
+ }
+}
+
+bool
+cgraph_varpool_assemble_pending_decls ()
+{
+ bool changed = false;
+
+ while (cgraph_varpool_nodes_queue)
+ {
+ tree decl = cgraph_varpool_nodes_queue->decl;
+ struct cgraph_varpool_node *node = cgraph_varpool_nodes_queue;
+
+ cgraph_varpool_nodes_queue = cgraph_varpool_nodes_queue->aux;
+ if (!TREE_ASM_WRITTEN (decl))
+ {
+ assemble_variable (decl, 0, 1, 0);
+ changed = true;
+ }
+ node->aux = NULL;
+ }
+ return changed;
+}
+
+
#include "gt-cgraph.h"
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index b785e172665..de35a0dbbdc 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -97,9 +97,31 @@ struct cgraph_edge
struct cgraph_edge *next_callee;
};
+/* The cgraph_varpool data strutcture.
+ Each static variable decl has assigned cgraph_varpool_node. */
+
+struct cgraph_varpool_node
+{
+ tree decl;
+ void *aux;
+
+ /* Set when function must be output - it is externally visible
+ or it's address is taken. */
+ bool needed;
+ /* Set once it has been finalized so we consider it to be output. */
+ bool finalized;
+ /* Set when function is scheduled to be assembled. */
+ bool output;
+};
+
extern struct cgraph_node *cgraph_nodes;
extern int cgraph_n_nodes;
extern bool cgraph_global_info_ready;
+extern struct cgraph_node *cgraph_nodes_queue;
+
+extern int cgraph_varpool_n_nodes;
+extern struct cgraph_varpool_node *cgraph_varpool_nodes_queue;
+
/* In cgraph.c */
void dump_cgraph PARAMS ((FILE *));
@@ -107,11 +129,18 @@ void cgraph_remove_call PARAMS ((tree, tree));
void cgraph_remove_node PARAMS ((struct cgraph_node *));
struct cgraph_edge *cgraph_record_call PARAMS ((tree, tree));
struct cgraph_node *cgraph_node PARAMS ((tree decl));
+struct cgraph_node *cgraph_node_for_identifier PARAMS ((tree id));
bool cgraph_calls_p PARAMS ((tree, tree));
struct cgraph_local_info *cgraph_local_info PARAMS ((tree));
struct cgraph_global_info *cgraph_global_info PARAMS ((tree));
struct cgraph_rtl_info *cgraph_rtl_info PARAMS ((tree));
+struct cgraph_varpool_node *cgraph_varpool_node (tree decl);
+struct cgraph_varpool_node *cgraph_varpool_node_for_identifier (tree id);
+void cgraph_varpool_mark_needed_node (struct cgraph_varpool_node *);
+void cgraph_varpool_finalize_decl (tree);
+bool cgraph_varpool_assemble_pending_decls (void);
+
/* In cgraphunit.c */
void cgraph_finalize_function PARAMS ((tree, tree));
void cgraph_finalize_compilation_unit PARAMS ((void));
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index a306908ac8e..47390b970c4 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -55,7 +55,29 @@ cgraph_finalize_function (decl, body)
node->decl = decl;
- node->local.can_inline_once = tree_inlinable_function_p (decl, 1);
+ if (/* Externally visible functions must be output. The exception are
+ COMDAT functions that must be output only when they are needed.
+ Similarly are handled defered functions and
+ external functions (GCC extension "extern inline") */
+ (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
+ /* ??? Constructors and destructors not called otherwise can be inlined
+ into single construction/destruction function per section to save some
+ resources. For now just mark it as reachable. */
+ || DECL_STATIC_CONSTRUCTOR (decl)
+ || DECL_STATIC_DESTRUCTOR (decl)
+ /* Function whose name is output to the assembler file must be produced.
+ It is possible to assemble the name later after finalizing the function
+ and the fact is noticed in assemble_name then. */
+ || (DECL_ASSEMBLER_NAME_SET_P (decl)
+ && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
+ {
+ cgraph_mark_needed_node (node, 1);
+ }
+
+ if (!node->needed && !DECL_COMDAT (node->decl))
+ node->local.can_inline_once = tree_inlinable_function_p (decl, 1);
+ else
+ node->local.can_inline_once = 0;
if (flag_inline_trees)
node->local.inline_many = tree_inlinable_function_p (decl, 0);
else
@@ -64,33 +86,6 @@ cgraph_finalize_function (decl, body)
(*debug_hooks->deferred_inline_function) (decl);
}
-static struct cgraph_node *queue = NULL;
-
-/* Notify finalize_compilation_unit that given node is reachable
- or needed. */
-
-void
-cgraph_mark_needed_node (node, needed)
- struct cgraph_node *node;
- int needed;
-{
- if (needed)
- {
- if (DECL_SAVED_TREE (node->decl))
- announce_function (node->decl);
- node->needed = 1;
- }
- if (!node->reachable)
- {
- node->reachable = 1;
- if (DECL_SAVED_TREE (node->decl))
- {
- node->aux = queue;
- queue = node;
- }
- }
-}
-
/* Walk tree and record all calls. Called via walk_tree. */
static tree
record_call_1 (tp, walk_subtrees, data)
@@ -98,9 +93,11 @@ record_call_1 (tp, walk_subtrees, data)
int *walk_subtrees;
void *data;
{
+ if (TREE_CODE (*tp) == VAR_DECL && TREE_STATIC (*tp))
+ cgraph_varpool_mark_needed_node (cgraph_varpool_node (*tp));
/* Record dereferences to the functions. This makes the functions
reachable unconditionally. */
- if (TREE_CODE (*tp) == ADDR_EXPR)
+ else if (TREE_CODE (*tp) == ADDR_EXPR)
{
tree decl = TREE_OPERAND (*tp, 0);
if (TREE_CODE (decl) == FUNCTION_DECL)
@@ -108,15 +105,8 @@ record_call_1 (tp, walk_subtrees, data)
}
else if (TREE_CODE (*tp) == CALL_EXPR)
{
- /* We cannot use get_callee_fndecl here because it actually tries
- too hard to get the function declaration, looking for indirect
- references and stripping NOPS. As a result, get_callee_fndecl
- finds calls that shouldn't be in the call graph. */
-
- tree decl = TREE_OPERAND (*tp, 0);
- if (TREE_CODE (decl) == ADDR_EXPR)
- decl = TREE_OPERAND (decl, 0);
- if (TREE_CODE (decl) == FUNCTION_DECL)
+ tree decl = get_callee_fndecl (*tp);
+ if (decl && TREE_CODE (decl) == FUNCTION_DECL)
{
if (DECL_BUILT_IN (decl))
return NULL;
@@ -156,40 +146,33 @@ cgraph_finalize_compilation_unit ()
struct cgraph_node *node;
struct cgraph_edge *edge;
- /* Collect entry points to the unit. */
+ cgraph_varpool_assemble_pending_decls ();
if (!quiet_flag)
- fprintf (stderr, "\n\nUnit entry points:");
-
- for (node = cgraph_nodes; node; node = node->next)
{
- tree decl = node->decl;
-
- if (!DECL_SAVED_TREE (decl))
- continue;
- if ((TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
- || (DECL_ASSEMBLER_NAME_SET_P (decl)
- && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
- {
- /* This function can be called from outside this compliation
- unit, so it most definitely is needed. */
- cgraph_mark_needed_node (node, 1);
- }
+ fprintf (stderr, "\n\nInitial entry points:");
+ for (node = cgraph_nodes; node; node = node->next)
+ if (node->needed && DECL_SAVED_TREE (node->decl))
+ announce_function (node->decl);
}
/* Propagate reachability flag and lower representation of all reachable
functions. In the future, lowering will introduce new functions and
new entry points on the way (by template instantiation and virtual
method table generation for instance). */
- while (queue)
+ while (cgraph_nodes_queue)
{
- tree decl = queue->decl;
+ tree decl = cgraph_nodes_queue->decl;
+
+ node = cgraph_nodes_queue;
+ cgraph_nodes_queue = cgraph_nodes_queue->aux;
- node = queue;
- queue = queue->aux;
if (node->lowered || !node->reachable || !DECL_SAVED_TREE (decl))
abort ();
+ if (lang_hooks.callgraph.lower_function)
+ (*lang_hooks.callgraph.lower_function) (decl);
+
/* At the moment frontend automatically emits all nested functions. */
if (node->nested)
{
@@ -200,9 +183,6 @@ cgraph_finalize_compilation_unit ()
cgraph_mark_needed_node (node2, 0);
}
- if (lang_hooks.callgraph.lower_function)
- (*lang_hooks.callgraph.lower_function) (decl);
-
/* First kill forward declaration so reverse inling works properly. */
cgraph_create_edges (decl, DECL_SAVED_TREE (decl));
@@ -212,6 +192,16 @@ cgraph_finalize_compilation_unit ()
cgraph_mark_needed_node (edge->callee, 0);
}
node->lowered = true;
+ cgraph_varpool_assemble_pending_decls ();
+ }
+ /* Collect entry points to the unit. */
+
+ if (!quiet_flag)
+ {
+ fprintf (stderr, "\n\nUnit entry points:");
+ for (node = cgraph_nodes; node; node = node->next)
+ if (node->needed && DECL_SAVED_TREE (node->decl))
+ announce_function (node->decl);
}
if (!quiet_flag)
@@ -248,7 +238,8 @@ cgraph_mark_functions_to_output ()
&& (node->needed
|| (!node->local.inline_many && !node->global.inline_once
&& node->reachable)
- || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
+ || (DECL_ASSEMBLER_NAME_SET_P (decl)
+ && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
&& !TREE_ASM_WRITTEN (decl) && !node->origin
&& !DECL_EXTERNAL (decl))
node->output = 1;
@@ -331,7 +322,7 @@ cgraph_expand_functions ()
for (node = cgraph_nodes; node; node = node->next)
node->aux = NULL;
for (node = cgraph_nodes; node; node = node->next)
- if (node->output && !node->aux)
+ if (!node->aux)
{
node2 = node;
if (!node->callers)
@@ -400,6 +391,7 @@ cgraph_mark_local_functions ()
{
node->local.local = (!node->needed
&& DECL_SAVED_TREE (node->decl)
+ && !DECL_COMDAT (node->decl)
&& !TREE_PUBLIC (node->decl));
if (node->local.local)
announce_function (node->decl);
diff --git a/gcc/common.opt b/gcc/common.opt
index 6c936210ae5..347b59f2483 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -18,32 +18,16 @@
; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
; 02111-1307, USA.
-
-; This file is processed by the script opts.sh. It is a database of
-; command line options, with each record separated by a blank line,
-; and each field appearing on its own line. The first field is the
-; command-line switch with the leading "-" removed. All options
-; beginning with "f" or "W" are implicitly assumed to take a "no-"
-; form; this form should not be listed. If you do not want this
-; negative form and you want it to be automatically rejected, add
-; RejectNegative to the second field.
-
-; The second field should contain "Common". If the switch takes an
-; argument, then you should also specify "Joined" and/or "Separate" to
-; indicate where the argument can appear.
-
-; Comments can appear on their own line anwhere in the file, preceded
-; by a semicolon. Whitespace is permitted before the semicolon.
-
-; For each switch XXX below, an enumeration constant is created by the
-; script opts.sh spelt OPT_XXX, but with all non-alphanumeric
-; characters replaced with an underscore.
+; See c.opt for a description of this file's format.
; Please try to keep this file in ASCII collating order.
-help
Common
+-param
+Common Separate
+
-target-help
Common
@@ -51,7 +35,91 @@ Common
Common
G
-Common Joined Separate
+Common Joined Separate UInteger
+
+O
+Common JoinedOrMissing
+
+Os
+Common
+
+W
+Common RejectNegative
+
+Waggregate-return
+Common
+
+Wcast-align
+Common
+
+Wdeprecated-declarations
+Common
+
+Wdisabled-optimization
+Common
+
+Werror
+Common
+
+Wextra
+Common
+
+Winline
+Common
+
+Wlarger-than-
+Common RejectNegative Joined UInteger
+
+Wmissing-noreturn
+Common
+
+Wpacked
+Common
+
+Wpadded
+Common
+
+Wshadow
+Common
+
+Wstrict-aliasing
+Common
+
+Wswitch
+Common
+
+Wswitch-default
+Common
+
+Wswitch-enum
+Common
+
+Wsystem-headers
+Common
+
+Wuninitialized
+Common
+
+Wunreachable-code
+Common
+
+Wunused
+Common
+
+Wunused-function
+Common
+
+Wunused-label
+Common
+
+Wunused-parameter
+Common
+
+Wunused-value
+Common
+
+Wunused-variable
+Common
aux-info
Common Separate
@@ -71,6 +139,420 @@ Common Joined
dumpbase
Common Separate
+fPIC
+Common
+
+fPIE
+Common
+
+falign-functions
+Common
+
+falign-functions=
+Common RejectNegative Joined UInteger
+
+falign-jumps
+Common
+
+falign-jumps=
+Common RejectNegative Joined UInteger
+
+falign-labels
+Common
+
+falign-labels=
+Common RejectNegative Joined UInteger
+
+falign-loops
+Common
+
+falign-loops=
+Common RejectNegative Joined UInteger
+
+fargument-alias
+Common
+
+fargument-noalias
+Common
+
+fargument-noalias-global
+Common
+
+fasynchronous-unwind-tables
+Common
+
+fbounds-check
+Common
+
+fbranch-count-reg
+Common
+
+fbranch-probabilities
+Common
+
+fbranch-target-load-optimize
+Common
+
+fbranch-target-load-optimize2
+Common
+
+fcall-saved-
+Common Joined RejectNegative
+
+fcall-used-
+Common Joined RejectNegative
+
+fcaller-saves
+Common
+
+fcommon
+Common
+
+fcprop-registers
+Common
+
+fcrossjumping
+Common
+
+fcse-follow-jumps
+Common
+
+fcse-skip-blocks
+Common
+
+fdata-sections
+Common
+
+fdefer-pop
+Common
+
+fdelayed-branch
+Common
+
+fdelete-null-pointer-checks
+Common
+
+fdiagnostics-show-location=
+Common Joined RejectNegative
+
+fdump-unnumbered
+Common
+
+feliminate-dwarf2-dups
+Common
+
+feliminate-unused-debug-symbols
+Common
+
+feliminate-unused-debug-types
+Common
+
+fexceptions
+Common
+
+fexpensive-optimizations
+Common
+
+ffast-math
+Common
+
+ffinite-math-only
+Common
+
+ffixed-
+Common Joined RejectNegative
+
+ffloat-store
+Common
+
+fforce-addr
+Common
+
+fforce-mem
+Common
+
+ffunction-cse
+Common
+
+ffunction-sections
+Common
+
+fgcse
+Common
+
+fgcse-lm
+Common
+
+fgcse-sm
+Common
+
+fgnu-linker
+Common
+
+fguess-branch-probability
+Common
+
+fident
+Common
+
+fif-conversion
+Common
+
+fif-conversion2
+Common
+
+finhibit-size-directive
+Common
+
+finline
+Common
+
+finline-functions
+Common
+
+finline-limit-
+Common RejectNegative Joined UInteger
+
+finline-limit=
+Common RejectNegative Joined UInteger
+
+finstrument-functions
+Common
+
+fkeep-inline-functions
+Common
+
+fkeep-static-consts
+Common
+
+fleading-underscore
+Common
+
+floop-optimize
+Common
+
+fmath-errno
+Common
+
+fmem-report
+Common
+
+fmerge-all-constants
+Common
+
+fmerge-constants
+Common
+
+fmessage-length=
+Common RejectNegative Joined UInteger
+
+fmove-all-movables
+Common
+
+fnew-ra
+Common
+
+fnon-call-exceptions
+Common
+
+fold-unroll-loops
+Common
+
+fold-unroll-all-loops
+Common
+
+fomit-frame-pointer
+Common
+
+foptimize-register-move
+Common
+
+foptimize-sibling-calls
+Common
+
+fpack-struct
+Common
+
+fpcc-struct-return
+Common
+
+fpeel-loops
+Common
+
+fpeephole
+Common
+
+fpeephole2
+Common
+
+fpic
+Common
+
+fpie
+Common
+
+fprefetch-loop-arrays
+Common
+
+fprofile
+Common
+
+fprofile-arcs
+Common
+
+frandom-seed
+Common
+
+frandom-seed=
+Common Joined RejectNegative
+
+freduce-all-givs
+Common
+
+freg-struct-return
+Common
+
+fregmove
+Common
+
+frename-registers
+Common
+
+freorder-blocks
+Common
+
+freorder-functions
+Common
+
+frerun-cse-after-loop
+Common
+
+frerun-loop-opt
+Common
+
+fsched-interblock
+Common
+
+fsched-spec
+Common
+
+fsched-spec-load
+Common
+
+fsched-spec-load-dangerous
+Common
+
+fsched-verbose=
+Common RejectNegative Joined
+
+fsched2-use-superblocks
+Common
+
+fsched2-use-traces
+Common
+
+fschedule-insns
+Common
+
+fschedule-insns2
+Common
+
+fshared-data
+Common
+
+fsignaling-nans
+Common
+
+fsingle-precision-constant
+Common
+
+fssa
+Common
+
+fssa-ccp
+Common
+
+fssa-dce
+Common
+
+fstack-check
+Common
+
+fstack-limit
+Common
+
+fstack-limit-register=
+Common RejectNegative Joined
+
+fstack-limit-symbol=
+Common RejectNegative Joined
+
+fstrength-reduce
+Common
+
+fstrict-aliasing
+Common
+
+fsyntax-only
+Common
+
+ftest-coverage
+Common
+
+fthread-jumps
+Common
+
+ftime-report
+Common
+
+ftls-model=
+Common Joined RejectNegative
+
+ftracer
+Common
+
+ftrapping-math
+Common
+
+ftrapv
+Common
+
+funit-at-a-time
+Common
+
+funroll-loops
+Common
+
+funroll-all-loops
+Common
+
+funsafe-math-optimizations
+Common
+
+funswitch-loops
+Common
+
+funwind-tables
+Common
+
+fverbose-asm
+Common
+
+fwrapv
+Common
+
+fwritable-strings
+Common
+
+fzero-initialized-in-bss
+Common
+
+g
+Common JoinedOrMissing
+
+m
+Common Joined
+
o
Common Joined Separate
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 21a3a8fcfca..f9c8e41d5e4 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -281,12 +281,14 @@ strongarm*-*-*)
;;
arm*-*-*)
cpu_type=arm
+ extra_headers="mmintrin.h"
;;
ep9312*-*-*)
cpu_type=arm
;;
xscale-*-*)
cpu_type=arm
+ extra_headers="mmintrin.h"
;;
i[34567]86-*-*)
cpu_type=i386
@@ -415,7 +417,7 @@ case $machine in
fi
;;
*-*-netbsd*)
- tmake_file="t-slibgcc-elf-ver t-libc-ok t-netbsd"
+ tmake_file="t-slibgcc-elf-ver t-libc-ok t-netbsd t-libgcc-pic"
gas=yes
gnu_ld=yes
@@ -1273,6 +1275,7 @@ ia64*-*-hpux*)
cxx_target_objs="ia64-c.o"
;;
ip2k-*-elf)
+ tm_file="elfos.h ${tm_file}"
;;
m32r-*-elf*)
tm_file="dbxelf.h elfos.h svr4.h ${tm_file}"
@@ -1805,7 +1808,7 @@ sh-*-rtemself*)
;;
sh-*-rtems*)
tmake_file="sh/t-sh t-rtems"
- tm_file="${tm_file} sh/coff.h sh/rtems.h rtems.h"
+ tm_file="${tm_file} dbxcoff.h sh/coff.h sh/rtems.h rtems.h"
if test x$enable_threads = xyes; then
thread_file='rtems'
fi
@@ -1873,7 +1876,7 @@ sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
esac
;;
sh-*-*)
- tm_file="${tm_file} sh/coff.h"
+ tm_file="${tm_file} dbxcoff.h sh/coff.h"
;;
sparc-tti-*)
tm_file="${tm_file} sparc/pbd.h"
@@ -2302,7 +2305,7 @@ then
| xarm920t | xarm940t | xarm9e | xarm10tdmi \
| xarm7100 | xarm7500 | xarm7500fe | xarm810 \
| xarm1020t \
- | xxscale \
+ | xxscale | xiwmmxt \
| xep9312 \
| xstrongarm | xstrongarm110 | xstrongarm11[01]0)
# OK
diff --git a/gcc/config.in b/gcc/config.in
index 76b29200d46..fbda6ada4fa 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -1,4 +1,4 @@
-/* config.in. Generated automatically from configure.in by autoheader 2.13. */
+/* config.in. Generated automatically from configure.in by autoheader. */
/* Define if using alloca.c. */
#undef C_ALLOCA
@@ -23,9 +23,6 @@
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
-/* Define if you have the ANSI # stringizing operator in cpp. */
-#undef HAVE_STRINGIZE
-
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
@@ -300,12 +297,6 @@
/* Define to enable the use of a default assembler. */
#undef DEFAULT_ASSEMBLER
-/* Define if your compiler understands volatile. */
-#undef HAVE_VOLATILE
-
-/* Define if your compiler supports the `long double' type. */
-#undef HAVE_LONG_DOUBLE
-
/* Define if your compiler supports the `long long' type. */
#undef HAVE_LONG_LONG
@@ -330,9 +321,6 @@
/* The number of bytes in type __int64 */
#undef SIZEOF___INT64
-/* Define if the host execution character set is EBCDIC. */
-#undef HOST_EBCDIC
-
/* Define if you want more run-time sanity checks. This one gets a grab
bag of miscellaneous but relatively cheap checks. */
#undef ENABLE_CHECKING
diff --git a/gcc/config/alpha/alpha-protos.h b/gcc/config/alpha/alpha-protos.h
index 460207b6b5d..0e14e6b2da3 100644
--- a/gcc/config/alpha/alpha-protos.h
+++ b/gcc/config/alpha/alpha-protos.h
@@ -20,165 +20,157 @@ Boston, MA 02111-1307, USA. */
extern int alpha_next_sequence_number;
-extern void literal_section PARAMS ((void));
-extern void override_options PARAMS ((void));
-extern int zap_mask PARAMS ((HOST_WIDE_INT));
-extern int direct_return PARAMS ((void));
-
-extern int alpha_sa_size PARAMS ((void));
-extern HOST_WIDE_INT alpha_initial_elimination_offset PARAMS ((unsigned int,
- unsigned int));
-extern int alpha_pv_save_size PARAMS ((void));
-extern int alpha_using_fp PARAMS ((void));
-extern void alpha_write_verstamp PARAMS ((FILE *));
-extern void alpha_expand_prologue PARAMS ((void));
-extern void alpha_expand_epilogue PARAMS ((void));
-extern void alpha_output_filename PARAMS ((FILE *, const char *));
-extern void alpha_output_lineno PARAMS ((FILE *, int));
-
-extern int reg_or_0_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_6bit_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_8bit_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_const_int_operand PARAMS ((rtx, enum machine_mode));
-extern int cint8_operand PARAMS ((rtx, enum machine_mode));
-extern int add_operand PARAMS ((rtx, enum machine_mode));
-extern int sext_add_operand PARAMS ((rtx, enum machine_mode));
-extern int const48_operand PARAMS ((rtx, enum machine_mode));
-extern int and_operand PARAMS ((rtx, enum machine_mode));
-extern int or_operand PARAMS ((rtx, enum machine_mode));
-extern int mode_width_operand PARAMS ((rtx, enum machine_mode));
-extern int mode_mask_operand PARAMS ((rtx, enum machine_mode));
-extern int mul8_operand PARAMS ((rtx, enum machine_mode));
-extern int const0_operand PARAMS ((rtx, enum machine_mode));
-extern int hard_fp_register_operand PARAMS ((rtx, enum machine_mode));
-extern int hard_int_register_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_cint_operand PARAMS ((rtx, enum machine_mode));
-extern int some_operand PARAMS ((rtx, enum machine_mode));
-extern int some_ni_operand PARAMS ((rtx, enum machine_mode));
-extern int input_operand PARAMS ((rtx, enum machine_mode));
-extern int samegp_function_operand PARAMS ((rtx, enum machine_mode));
-extern int direct_call_operand PARAMS ((rtx, enum machine_mode));
-extern int local_symbolic_operand PARAMS ((rtx, enum machine_mode));
-extern int small_symbolic_operand PARAMS ((rtx, enum machine_mode));
-extern int some_small_symbolic_operand PARAMS ((rtx, enum machine_mode));
-extern int global_symbolic_operand PARAMS ((rtx, enum machine_mode));
-extern int dtp16_symbolic_operand PARAMS ((rtx, enum machine_mode));
-extern int dtp32_symbolic_operand PARAMS ((rtx, enum machine_mode));
-extern int gotdtp_symbolic_operand PARAMS ((rtx, enum machine_mode));
-extern int tp16_symbolic_operand PARAMS ((rtx, enum machine_mode));
-extern int tp32_symbolic_operand PARAMS ((rtx, enum machine_mode));
-extern int gottp_symbolic_operand PARAMS ((rtx, enum machine_mode));
-extern int call_operand PARAMS ((rtx, enum machine_mode));
-extern int symbolic_operand PARAMS ((rtx, enum machine_mode));
-extern int alpha_comparison_operator PARAMS ((rtx, enum machine_mode));
-extern int alpha_zero_comparison_operator PARAMS ((rtx, enum machine_mode));
-extern int alpha_swapped_comparison_operator PARAMS ((rtx, enum machine_mode));
-extern int signed_comparison_operator PARAMS ((rtx, enum machine_mode));
-extern int alpha_fp_comparison_operator PARAMS ((rtx, enum machine_mode));
-extern int divmod_operator PARAMS ((rtx, enum machine_mode));
-extern int aligned_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int unaligned_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_unaligned_mem_operand PARAMS ((rtx, enum machine_mode));
-extern int any_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_not_elim_operand PARAMS ((rtx, enum machine_mode));
-extern int normal_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_no_subreg_operand PARAMS ((rtx, enum machine_mode));
-extern int addition_operation PARAMS ((rtx, enum machine_mode));
-
-extern bool alpha_const_ok_for_letter_p PARAMS ((HOST_WIDE_INT, int));
-extern bool alpha_const_double_ok_for_letter_p PARAMS ((rtx, int));
-extern bool alpha_extra_constraint PARAMS ((rtx, int));
-
-extern rtx alpha_tablejump_addr_vec PARAMS ((rtx));
-extern rtx alpha_tablejump_best_label PARAMS ((rtx));
-
-extern bool alpha_legitimate_address_p PARAMS ((enum machine_mode, rtx, int));
-extern rtx alpha_legitimize_address PARAMS ((rtx, rtx, enum machine_mode));
-extern rtx alpha_legitimize_reload_address PARAMS ((rtx, enum machine_mode,
- int, int, int));
-
-extern rtx split_small_symbolic_operand PARAMS ((rtx));
-
-extern void get_aligned_mem PARAMS ((rtx, rtx *, rtx *));
-extern rtx get_unaligned_address PARAMS ((rtx, int));
-extern enum reg_class alpha_preferred_reload_class PARAMS ((rtx,
- enum reg_class));
-extern enum reg_class secondary_reload_class PARAMS ((enum reg_class,
- enum machine_mode,
- rtx, int));
-
-extern void alpha_set_memflags PARAMS ((rtx, rtx));
-extern rtx alpha_emit_set_const PARAMS ((rtx, enum machine_mode,
- HOST_WIDE_INT, int));
-extern rtx alpha_emit_set_long_const PARAMS ((rtx, HOST_WIDE_INT,
- HOST_WIDE_INT));
-extern bool alpha_expand_mov PARAMS ((enum machine_mode, rtx *));
-extern bool alpha_expand_mov_nobwx PARAMS ((enum machine_mode, rtx *));
-extern void alpha_emit_floatuns PARAMS ((rtx[]));
-extern rtx alpha_emit_conditional_move PARAMS ((rtx, enum machine_mode));
-extern void alpha_split_tfmode_pair PARAMS ((rtx[]));
-extern void alpha_split_tfmode_frobsign PARAMS ((rtx[],
- rtx (*)(rtx, rtx, rtx)));
-extern void alpha_expand_unaligned_load PARAMS ((rtx, rtx, HOST_WIDE_INT,
- HOST_WIDE_INT, int));
-extern void alpha_expand_unaligned_store PARAMS ((rtx, rtx, HOST_WIDE_INT,
- HOST_WIDE_INT));
-extern int alpha_expand_block_move PARAMS ((rtx []));
-extern int alpha_expand_block_clear PARAMS ((rtx []));
-extern rtx alpha_expand_zap_mask PARAMS ((HOST_WIDE_INT));
-extern void alpha_expand_builtin_vector_binop PARAMS ((rtx (*)(rtx, rtx, rtx),
- enum machine_mode,
- rtx, rtx, rtx));
-extern rtx alpha_return_addr PARAMS ((int, rtx));
-extern rtx alpha_gp_save_rtx PARAMS ((void));
-extern void print_operand PARAMS ((FILE *, rtx, int));
-extern void print_operand_address PARAMS ((FILE *, rtx));
-extern void alpha_initialize_trampoline PARAMS ((rtx, rtx, rtx, int, int, int));
-
-extern tree alpha_build_va_list PARAMS ((void));
-extern void alpha_setup_incoming_varargs
- PARAMS ((CUMULATIVE_ARGS, enum machine_mode, tree, int *, int));
-extern void alpha_va_start PARAMS ((tree, rtx));
-extern rtx alpha_va_arg PARAMS ((tree, tree));
-extern rtx function_arg PARAMS ((CUMULATIVE_ARGS, enum machine_mode,
- tree, int));
-extern void alpha_start_function PARAMS ((FILE *, const char *, tree));
-extern void alpha_end_function PARAMS ((FILE *, const char *, tree));
-
-extern int alpha_find_lo_sum_using_gp PARAMS ((rtx));
+extern void literal_section (void);
+extern void override_options (void);
+extern int zap_mask (HOST_WIDE_INT);
+extern int direct_return (void);
+
+extern int alpha_sa_size (void);
+extern HOST_WIDE_INT alpha_initial_elimination_offset (unsigned int,
+ unsigned int);
+extern int alpha_pv_save_size (void);
+extern int alpha_using_fp (void);
+extern void alpha_expand_prologue (void);
+extern void alpha_expand_epilogue (void);
+extern void alpha_output_filename (FILE *, const char *);
+extern void alpha_output_lineno (FILE *, int);
+
+extern int reg_or_0_operand (rtx, enum machine_mode);
+extern int reg_or_6bit_operand (rtx, enum machine_mode);
+extern int reg_or_8bit_operand (rtx, enum machine_mode);
+extern int reg_or_const_int_operand (rtx, enum machine_mode);
+extern int cint8_operand (rtx, enum machine_mode);
+extern int add_operand (rtx, enum machine_mode);
+extern int sext_add_operand (rtx, enum machine_mode);
+extern int const48_operand (rtx, enum machine_mode);
+extern int and_operand (rtx, enum machine_mode);
+extern int or_operand (rtx, enum machine_mode);
+extern int mode_width_operand (rtx, enum machine_mode);
+extern int mode_mask_operand (rtx, enum machine_mode);
+extern int mul8_operand (rtx, enum machine_mode);
+extern int const0_operand (rtx, enum machine_mode);
+extern int hard_fp_register_operand (rtx, enum machine_mode);
+extern int hard_int_register_operand (rtx, enum machine_mode);
+extern int reg_or_cint_operand (rtx, enum machine_mode);
+extern int some_operand (rtx, enum machine_mode);
+extern int some_ni_operand (rtx, enum machine_mode);
+extern int input_operand (rtx, enum machine_mode);
+extern int samegp_function_operand (rtx, enum machine_mode);
+extern int direct_call_operand (rtx, enum machine_mode);
+extern int local_symbolic_operand (rtx, enum machine_mode);
+extern int small_symbolic_operand (rtx, enum machine_mode);
+extern int some_small_symbolic_operand (rtx, enum machine_mode);
+extern int global_symbolic_operand (rtx, enum machine_mode);
+extern int dtp16_symbolic_operand (rtx, enum machine_mode);
+extern int dtp32_symbolic_operand (rtx, enum machine_mode);
+extern int gotdtp_symbolic_operand (rtx, enum machine_mode);
+extern int tp16_symbolic_operand (rtx, enum machine_mode);
+extern int tp32_symbolic_operand (rtx, enum machine_mode);
+extern int gottp_symbolic_operand (rtx, enum machine_mode);
+extern int call_operand (rtx, enum machine_mode);
+extern int symbolic_operand (rtx, enum machine_mode);
+extern int alpha_comparison_operator (rtx, enum machine_mode);
+extern int alpha_zero_comparison_operator (rtx, enum machine_mode);
+extern int alpha_swapped_comparison_operator (rtx, enum machine_mode);
+extern int signed_comparison_operator (rtx, enum machine_mode);
+extern int alpha_fp_comparison_operator (rtx, enum machine_mode);
+extern int divmod_operator (rtx, enum machine_mode);
+extern int aligned_memory_operand (rtx, enum machine_mode);
+extern int unaligned_memory_operand (rtx, enum machine_mode);
+extern int reg_or_unaligned_mem_operand (rtx, enum machine_mode);
+extern int any_memory_operand (rtx, enum machine_mode);
+extern int reg_not_elim_operand (rtx, enum machine_mode);
+extern int normal_memory_operand (rtx, enum machine_mode);
+extern int reg_no_subreg_operand (rtx, enum machine_mode);
+extern int addition_operation (rtx, enum machine_mode);
+
+extern bool alpha_const_ok_for_letter_p (HOST_WIDE_INT, int);
+extern bool alpha_const_double_ok_for_letter_p (rtx, int);
+extern bool alpha_extra_constraint (rtx, int);
+
+extern rtx alpha_tablejump_addr_vec (rtx);
+extern rtx alpha_tablejump_best_label (rtx);
+
+extern bool alpha_legitimate_address_p (enum machine_mode, rtx, int);
+extern rtx alpha_legitimize_address (rtx, rtx, enum machine_mode);
+extern rtx alpha_legitimize_reload_address (rtx, enum machine_mode,
+ int, int, int);
+
+extern rtx split_small_symbolic_operand (rtx);
+
+extern void get_aligned_mem (rtx, rtx *, rtx *);
+extern rtx get_unaligned_address (rtx, int);
+extern enum reg_class alpha_preferred_reload_class (rtx, enum reg_class);
+extern enum reg_class secondary_reload_class (enum reg_class,
+ enum machine_mode, rtx, int);
+
+extern void alpha_set_memflags (rtx, rtx);
+extern rtx alpha_emit_set_const (rtx, enum machine_mode, HOST_WIDE_INT, int);
+extern rtx alpha_emit_set_long_const (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
+extern bool alpha_expand_mov (enum machine_mode, rtx *);
+extern bool alpha_expand_mov_nobwx (enum machine_mode, rtx *);
+extern void alpha_emit_floatuns (rtx[]);
+extern rtx alpha_emit_conditional_move (rtx, enum machine_mode);
+extern void alpha_split_tfmode_pair (rtx[]);
+extern void alpha_split_tfmode_frobsign (rtx[], rtx (*)(rtx, rtx, rtx));
+extern void alpha_expand_unaligned_load (rtx, rtx, HOST_WIDE_INT,
+ HOST_WIDE_INT, int);
+extern void alpha_expand_unaligned_store (rtx, rtx, HOST_WIDE_INT,
+ HOST_WIDE_INT);
+extern int alpha_expand_block_move (rtx []);
+extern int alpha_expand_block_clear (rtx []);
+extern rtx alpha_expand_zap_mask (HOST_WIDE_INT);
+extern void alpha_expand_builtin_vector_binop (rtx (*)(rtx, rtx, rtx),
+ enum machine_mode,
+ rtx, rtx, rtx);
+extern rtx alpha_return_addr (int, rtx);
+extern rtx alpha_gp_save_rtx (void);
+extern void print_operand (FILE *, rtx, int);
+extern void print_operand_address (FILE *, rtx);
+extern void alpha_initialize_trampoline (rtx, rtx, rtx, int, int, int);
+
+extern tree alpha_build_va_list (void);
+extern void alpha_setup_incoming_varargs (CUMULATIVE_ARGS, enum machine_mode,
+ tree, int *, int);
+extern void alpha_va_start (tree, rtx);
+extern rtx alpha_va_arg (tree, tree);
+extern rtx function_arg (CUMULATIVE_ARGS, enum machine_mode, tree, int);
+extern rtx function_value (tree, tree, enum machine_mode);
+extern bool return_in_memory (tree, enum machine_mode);
+
+extern void alpha_start_function (FILE *, const char *, tree);
+extern void alpha_end_function (FILE *, const char *, tree);
+
+extern int alpha_find_lo_sum_using_gp (rtx);
#ifdef REAL_VALUE_TYPE
-extern int check_float_value PARAMS ((enum machine_mode,
- REAL_VALUE_TYPE *, int));
+extern int check_float_value (enum machine_mode, REAL_VALUE_TYPE *, int);
#endif
#ifdef RTX_CODE
-extern rtx alpha_emit_conditional_branch PARAMS ((enum rtx_code));
-extern rtx alpha_emit_setcc PARAMS ((enum rtx_code));
-extern int alpha_split_conditional_move PARAMS ((enum rtx_code, rtx, rtx,
- rtx, rtx));
-extern void alpha_emit_xfloating_arith PARAMS ((enum rtx_code, rtx[]));
-extern void alpha_emit_xfloating_cvt PARAMS ((enum rtx_code, rtx[]));
+extern rtx alpha_emit_conditional_branch (enum rtx_code);
+extern rtx alpha_emit_setcc (enum rtx_code);
+extern int alpha_split_conditional_move (enum rtx_code, rtx, rtx, rtx, rtx);
+extern void alpha_emit_xfloating_arith (enum rtx_code, rtx[]);
+extern void alpha_emit_xfloating_cvt (enum rtx_code, rtx[]);
#endif
-extern rtx alpha_need_linkage PARAMS ((const char *, int));
-extern rtx alpha_use_linkage PARAMS ((rtx, tree, int, int));
+extern rtx alpha_need_linkage (const char *, int);
+extern rtx alpha_use_linkage (rtx, tree, int, int);
#if TARGET_ABI_OPEN_VMS
-#ifdef HAVE_MACHINE_MODES
-extern enum avms_arg_type alpha_arg_type PARAMS ((enum machine_mode));
+extern enum avms_arg_type alpha_arg_type (enum machine_mode);
+extern rtx alpha_arg_info_reg_val (CUMULATIVE_ARGS);
#endif
-extern rtx alpha_arg_info_reg_val PARAMS ((CUMULATIVE_ARGS));
-#endif /* TARGET_ABI_OPEN_VMS */
-extern rtx unicosmk_add_call_info_word PARAMS ((rtx));
+extern rtx unicosmk_add_call_info_word (rtx);
#if TARGET_ABI_UNICOSMK
-extern void unicosmk_defer_case_vector PARAMS ((rtx, rtx));
-extern void unicosmk_add_extern PARAMS ((const char *));
-extern void unicosmk_output_align PARAMS ((FILE *, int));
-extern char * unicosmk_text_section PARAMS ((void));
-extern char * unicosmk_data_section PARAMS ((void));
-extern void unicosmk_asm_file_start PARAMS ((FILE *));
-extern void unicosmk_output_common PARAMS ((FILE *, const char *, int, int));
-#endif /* TARGET_ABI_UNICOSMK */
+extern void unicosmk_defer_case_vector (rtx, rtx);
+extern void unicosmk_add_extern (const char *);
+extern void unicosmk_output_align (FILE *, int);
+extern char * unicosmk_text_section (void);
+extern char * unicosmk_data_section (void);
+extern void unicosmk_output_common (FILE *, const char *, int, int);
+extern int unicosmk_initial_elimination_offset (int, int);
+#endif
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 144686bea62..d1b884fa780 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -51,6 +51,7 @@ Boston, MA 02111-1307, USA. */
#include "debug.h"
#include "langhooks.h"
#include <splay-tree.h>
+#include "cfglayout.h"
/* Specify which cpu to schedule for. */
@@ -171,108 +172,6 @@ static struct alpha_rtx_cost_data const alpha_rtx_cost_data[PROCESSOR_MAX] =
},
};
-/* Declarations of static functions. */
-static bool alpha_function_ok_for_sibcall
- PARAMS ((tree, tree));
-static int tls_symbolic_operand_1
- PARAMS ((rtx, enum machine_mode, int, int));
-static enum tls_model tls_symbolic_operand_type
- PARAMS ((rtx));
-static bool decl_has_samegp
- PARAMS ((tree));
-static bool alpha_in_small_data_p
- PARAMS ((tree));
-static rtx get_tls_get_addr
- PARAMS ((void));
-static int some_small_symbolic_operand_1
- PARAMS ((rtx *, void *));
-static int split_small_symbolic_operand_1
- PARAMS ((rtx *, void *));
-static bool alpha_cannot_copy_insn_p
- PARAMS ((rtx));
-static bool alpha_rtx_costs
- PARAMS ((rtx, int, int, int *));
-static void alpha_set_memflags_1
- PARAMS ((rtx, int, int, int));
-static rtx alpha_emit_set_const_1
- PARAMS ((rtx, enum machine_mode, HOST_WIDE_INT, int));
-static void alpha_expand_unaligned_load_words
- PARAMS ((rtx *out_regs, rtx smem, HOST_WIDE_INT words, HOST_WIDE_INT ofs));
-static void alpha_expand_unaligned_store_words
- PARAMS ((rtx *out_regs, rtx smem, HOST_WIDE_INT words, HOST_WIDE_INT ofs));
-static void alpha_init_builtins
- PARAMS ((void));
-static rtx alpha_expand_builtin
- PARAMS ((tree, rtx, rtx, enum machine_mode, int));
-static void alpha_sa_mask
- PARAMS ((unsigned long *imaskP, unsigned long *fmaskP));
-static int find_lo_sum_using_gp
- PARAMS ((rtx *, void *));
-static int alpha_does_function_need_gp
- PARAMS ((void));
-static int alpha_ra_ever_killed
- PARAMS ((void));
-static const char *get_trap_mode_suffix
- PARAMS ((void));
-static const char *get_round_mode_suffix
- PARAMS ((void));
-static const char *get_some_local_dynamic_name
- PARAMS ((void));
-static int get_some_local_dynamic_name_1
- PARAMS ((rtx *, void *));
-static rtx set_frame_related_p
- PARAMS ((void));
-static const char *alpha_lookup_xfloating_lib_func
- PARAMS ((enum rtx_code));
-static int alpha_compute_xfloating_mode_arg
- PARAMS ((enum rtx_code, enum alpha_fp_rounding_mode));
-static void alpha_emit_xfloating_libcall
- PARAMS ((const char *, rtx, rtx[], int, rtx));
-static rtx alpha_emit_xfloating_compare
- PARAMS ((enum rtx_code, rtx, rtx));
-static void alpha_output_function_end_prologue
- PARAMS ((FILE *));
-static int alpha_adjust_cost
- PARAMS ((rtx, rtx, rtx, int));
-static int alpha_issue_rate
- PARAMS ((void));
-static int alpha_use_dfa_pipeline_interface
- PARAMS ((void));
-static int alpha_multipass_dfa_lookahead
- PARAMS ((void));
-static void alpha_reorg
- PARAMS ((void));
-
-#ifdef OBJECT_FORMAT_ELF
-static void alpha_elf_select_rtx_section
- PARAMS ((enum machine_mode, rtx, unsigned HOST_WIDE_INT));
-#endif
-
-#if TARGET_ABI_OPEN_VMS
-static bool alpha_linkage_symbol_p
- PARAMS ((const char *symname));
-static int alpha_write_one_linkage
- PARAMS ((splay_tree_node, void *));
-static void alpha_write_linkage
- PARAMS ((FILE *, const char *, tree));
-#endif
-
-#if TARGET_ABI_OSF
-static void alpha_output_mi_thunk_osf
- PARAMS ((FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
-#endif
-
-static struct machine_function * alpha_init_machine_status
- PARAMS ((void));
-
-static void unicosmk_output_deferred_case_vectors PARAMS ((FILE *));
-static void unicosmk_gen_dsib PARAMS ((unsigned long *imaskP));
-static void unicosmk_output_ssib PARAMS ((FILE *, const char *));
-static int unicosmk_need_dex PARAMS ((rtx));
-#if TARGET_ABI_UNICOSMK
-static void unicosmk_file_end PARAMS ((void));
-#endif
-
/* Get the number of args of a function in one of two ways. */
#if TARGET_ABI_OPEN_VMS || TARGET_ABI_UNICOSMK
#define NUM_ARGS current_function_args_info.num_args
@@ -282,108 +181,24 @@ static void unicosmk_file_end PARAMS ((void));
#define REG_PV 27
#define REG_RA 26
-
-/* Initialize the GCC target structure. */
-#if TARGET_ABI_OPEN_VMS
-const struct attribute_spec vms_attribute_table[];
-static unsigned int vms_section_type_flags PARAMS ((tree, const char *, int));
-static void vms_asm_named_section PARAMS ((const char *, unsigned int));
-static void vms_asm_out_constructor PARAMS ((rtx, int));
-static void vms_asm_out_destructor PARAMS ((rtx, int));
-# undef TARGET_ATTRIBUTE_TABLE
-# define TARGET_ATTRIBUTE_TABLE vms_attribute_table
-# undef TARGET_SECTION_TYPE_FLAGS
-# define TARGET_SECTION_TYPE_FLAGS vms_section_type_flags
-#endif
-
-#undef TARGET_IN_SMALL_DATA_P
-#define TARGET_IN_SMALL_DATA_P alpha_in_small_data_p
-
-#if TARGET_ABI_UNICOSMK
-static void unicosmk_asm_named_section PARAMS ((const char *, unsigned int));
-static void unicosmk_insert_attributes PARAMS ((tree, tree *));
-static unsigned int unicosmk_section_type_flags PARAMS ((tree, const char *,
- int));
-static void unicosmk_unique_section PARAMS ((tree, int));
-# undef TARGET_INSERT_ATTRIBUTES
-# define TARGET_INSERT_ATTRIBUTES unicosmk_insert_attributes
-# undef TARGET_SECTION_TYPE_FLAGS
-# define TARGET_SECTION_TYPE_FLAGS unicosmk_section_type_flags
-# undef TARGET_ASM_UNIQUE_SECTION
-# define TARGET_ASM_UNIQUE_SECTION unicosmk_unique_section
-# undef TARGET_ASM_GLOBALIZE_LABEL
-# define TARGET_ASM_GLOBALIZE_LABEL hook_void_FILEptr_constcharptr
-#endif
-
-#undef TARGET_ASM_ALIGNED_HI_OP
-#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
-#undef TARGET_ASM_ALIGNED_DI_OP
-#define TARGET_ASM_ALIGNED_DI_OP "\t.quad\t"
-
-/* Default unaligned ops are provided for ELF systems. To get unaligned
- data for non-ELF systems, we have to turn off auto alignment. */
-#ifndef OBJECT_FORMAT_ELF
-#undef TARGET_ASM_UNALIGNED_HI_OP
-#define TARGET_ASM_UNALIGNED_HI_OP "\t.align 0\n\t.word\t"
-#undef TARGET_ASM_UNALIGNED_SI_OP
-#define TARGET_ASM_UNALIGNED_SI_OP "\t.align 0\n\t.long\t"
-#undef TARGET_ASM_UNALIGNED_DI_OP
-#define TARGET_ASM_UNALIGNED_DI_OP "\t.align 0\n\t.quad\t"
-#endif
-
-#ifdef OBJECT_FORMAT_ELF
-#undef TARGET_ASM_SELECT_RTX_SECTION
-#define TARGET_ASM_SELECT_RTX_SECTION alpha_elf_select_rtx_section
-#endif
-
-#undef TARGET_ASM_FUNCTION_END_PROLOGUE
-#define TARGET_ASM_FUNCTION_END_PROLOGUE alpha_output_function_end_prologue
-
-#undef TARGET_SCHED_ADJUST_COST
-#define TARGET_SCHED_ADJUST_COST alpha_adjust_cost
-#undef TARGET_SCHED_ISSUE_RATE
-#define TARGET_SCHED_ISSUE_RATE alpha_issue_rate
-#undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
-#define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE \
- alpha_use_dfa_pipeline_interface
-#undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
-#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD \
- alpha_multipass_dfa_lookahead
-
-#undef TARGET_HAVE_TLS
-#define TARGET_HAVE_TLS HAVE_AS_TLS
-
-#undef TARGET_INIT_BUILTINS
-#define TARGET_INIT_BUILTINS alpha_init_builtins
-#undef TARGET_EXPAND_BUILTIN
-#define TARGET_EXPAND_BUILTIN alpha_expand_builtin
-#undef TARGET_FUNCTION_OK_FOR_SIBCALL
-#define TARGET_FUNCTION_OK_FOR_SIBCALL alpha_function_ok_for_sibcall
-#undef TARGET_CANNOT_COPY_INSN_P
-#define TARGET_CANNOT_COPY_INSN_P alpha_cannot_copy_insn_p
+/* Declarations of static functions. */
+static struct machine_function *alpha_init_machine_status (void);
+static rtx alpha_emit_xfloating_compare (enum rtx_code, rtx, rtx);
-#if TARGET_ABI_OSF
-#undef TARGET_ASM_OUTPUT_MI_THUNK
-#define TARGET_ASM_OUTPUT_MI_THUNK alpha_output_mi_thunk_osf
-#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
-#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true
+#if TARGET_ABI_OPEN_VMS
+static void alpha_write_linkage (FILE *, const char *, tree);
#endif
-#undef TARGET_RTX_COSTS
-#define TARGET_RTX_COSTS alpha_rtx_costs
-#undef TARGET_ADDRESS_COST
-#define TARGET_ADDRESS_COST hook_int_rtx_0
-
-#undef TARGET_MACHINE_DEPENDENT_REORG
-#define TARGET_MACHINE_DEPENDENT_REORG alpha_reorg
-
-struct gcc_target targetm = TARGET_INITIALIZER;
+static void unicosmk_output_deferred_case_vectors (FILE *);
+static void unicosmk_gen_dsib (unsigned long *);
+static void unicosmk_output_ssib (FILE *, const char *);
+static int unicosmk_need_dex (rtx);
/* Parse target option strings. */
void
-override_options ()
+override_options (void)
{
int i;
static const struct cpu_table {
@@ -666,8 +481,7 @@ override_options ()
/* Returns 1 if VALUE is a mask that contains full bytes of zero or ones. */
int
-zap_mask (value)
- HOST_WIDE_INT value;
+zap_mask (HOST_WIDE_INT value)
{
int i;
@@ -683,9 +497,7 @@ zap_mask (value)
register, it must be in the proper mode unless MODE is VOIDmode. */
int
-reg_or_0_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+reg_or_0_operand (rtx op, enum machine_mode mode)
{
return op == CONST0_RTX (mode) || register_operand (op, mode);
}
@@ -694,9 +506,7 @@ reg_or_0_operand (op, mode)
any register. */
int
-reg_or_6bit_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+reg_or_6bit_operand (rtx op, enum machine_mode mode)
{
return ((GET_CODE (op) == CONST_INT
&& (unsigned HOST_WIDE_INT) INTVAL (op) < 64)
@@ -707,9 +517,7 @@ reg_or_6bit_operand (op, mode)
/* Return 1 if OP is an 8-bit constant or any register. */
int
-reg_or_8bit_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+reg_or_8bit_operand (rtx op, enum machine_mode mode)
{
return ((GET_CODE (op) == CONST_INT
&& (unsigned HOST_WIDE_INT) INTVAL (op) < 0x100)
@@ -719,9 +527,7 @@ reg_or_8bit_operand (op, mode)
/* Return 1 if OP is a constant or any register. */
int
-reg_or_const_int_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+reg_or_const_int_operand (rtx op, enum machine_mode mode)
{
return GET_CODE (op) == CONST_INT || register_operand (op, mode);
}
@@ -729,9 +535,7 @@ reg_or_const_int_operand (op, mode)
/* Return 1 if OP is an 8-bit constant. */
int
-cint8_operand (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+cint8_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return ((GET_CODE (op) == CONST_INT
&& (unsigned HOST_WIDE_INT) INTVAL (op) < 0x100));
@@ -740,9 +544,7 @@ cint8_operand (op, mode)
/* Return 1 if the operand is a valid second operand to an add insn. */
int
-add_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+add_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == CONST_INT)
/* Constraints I, J, O and P are covered by K. */
@@ -756,9 +558,7 @@ add_operand (op, mode)
add insn. */
int
-sext_add_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+sext_add_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == CONST_INT)
return (CONST_OK_FOR_LETTER_P (INTVAL (op), 'I')
@@ -770,9 +570,7 @@ sext_add_operand (op, mode)
/* Return 1 if OP is the constant 4 or 8. */
int
-const48_operand (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+const48_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT
&& (INTVAL (op) == 4 || INTVAL (op) == 8));
@@ -781,9 +579,7 @@ const48_operand (op, mode)
/* Return 1 if OP is a valid first operand to an AND insn. */
int
-and_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+and_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == CONST_DOUBLE && GET_MODE (op) == VOIDmode)
return (zap_mask (CONST_DOUBLE_LOW (op))
@@ -800,9 +596,7 @@ and_operand (op, mode)
/* Return 1 if OP is a valid first operand to an IOR or XOR insn. */
int
-or_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+or_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == CONST_INT)
return ((unsigned HOST_WIDE_INT) INTVAL (op) < 0x100
@@ -815,9 +609,7 @@ or_operand (op, mode)
mode smaller than DImode. */
int
-mode_width_operand (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+mode_width_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT
&& (INTVAL (op) == 8 || INTVAL (op) == 16
@@ -828,9 +620,7 @@ mode_width_operand (op, mode)
smaller than an integer. */
int
-mode_mask_operand (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+mode_mask_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) == CONST_INT)
{
@@ -857,9 +647,7 @@ mode_mask_operand (op, mode)
/* Return 1 if OP is a multiple of 8 less than 64. */
int
-mul8_operand (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+mul8_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT
&& (unsigned HOST_WIDE_INT) INTVAL (op) < 64
@@ -869,9 +657,7 @@ mul8_operand (op, mode)
/* Return 1 if OP is the zero constant for MODE. */
int
-const0_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+const0_operand (rtx op, enum machine_mode mode)
{
return op == CONST0_RTX (mode);
}
@@ -879,9 +665,7 @@ const0_operand (op, mode)
/* Return 1 if OP is a hard floating-point register. */
int
-hard_fp_register_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+hard_fp_register_operand (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op))
return 0;
@@ -894,9 +678,7 @@ hard_fp_register_operand (op, mode)
/* Return 1 if OP is a hard general register. */
int
-hard_int_register_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+hard_int_register_operand (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op))
return 0;
@@ -910,9 +692,7 @@ hard_int_register_operand (op, mode)
int
-reg_or_cint_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+reg_or_cint_operand (rtx op, enum machine_mode mode)
{
return (GET_CODE (op) == CONST_INT
|| register_operand (op, mode));
@@ -922,9 +702,7 @@ reg_or_cint_operand (op, mode)
if it is a MEM, it need not be valid. */
int
-some_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+some_operand (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op))
return 0;
@@ -955,9 +733,7 @@ some_operand (op, mode)
/* Likewise, but don't accept constants. */
int
-some_ni_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+some_ni_operand (rtx op, enum machine_mode mode)
{
if (GET_MODE (op) != mode && mode != VOIDmode)
return 0;
@@ -971,9 +747,7 @@ some_ni_operand (op, mode)
/* Return 1 if OP is a valid operand for the source of a move insn. */
int
-input_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+input_operand (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op))
return 0;
@@ -1038,9 +812,7 @@ input_operand (op, mode)
file, and in the same section as the current function. */
int
-samegp_function_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+samegp_function_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != SYMBOL_REF)
return false;
@@ -1069,9 +841,7 @@ samegp_function_operand (op, mode)
/* Return 1 if OP is a SYMBOL_REF for which we can make a call via bsr. */
int
-direct_call_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+direct_call_operand (rtx op, enum machine_mode mode)
{
tree op_decl, cfun_sec, op_sec;
@@ -1123,9 +893,7 @@ direct_call_operand (op, mode)
a (non-tls) variable known to be defined in this file. */
int
-local_symbolic_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+local_symbolic_operand (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op))
return 0;
@@ -1148,9 +916,7 @@ local_symbolic_operand (op, mode)
known to be defined in this file in the small data area. */
int
-small_symbolic_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+small_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (! TARGET_SMALL_DATA)
return 0;
@@ -1180,9 +946,7 @@ small_symbolic_operand (op, mode)
not known (or known not) to be defined in this file. */
int
-global_symbolic_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+global_symbolic_operand (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op))
return 0;
@@ -1201,9 +965,7 @@ global_symbolic_operand (op, mode)
/* Return 1 if OP is a valid operand for the MEM of a CALL insn. */
int
-call_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+call_operand (rtx op, enum machine_mode mode)
{
if (mode != Pmode)
return 0;
@@ -1232,9 +994,7 @@ call_operand (op, mode)
possibly with an offset. */
int
-symbolic_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+symbolic_operand (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op))
return 0;
@@ -1251,10 +1011,7 @@ symbolic_operand (op, mode)
/* Return true if OP is valid for a particular TLS relocation. */
static int
-tls_symbolic_operand_1 (op, mode, size, unspec)
- rtx op;
- enum machine_mode mode;
- int size, unspec;
+tls_symbolic_operand_1 (rtx op, enum machine_mode mode, int size, int unspec)
{
if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op))
return 0;
@@ -1297,9 +1054,7 @@ tls_symbolic_operand_1 (op, mode, size, unspec)
/* Return true if OP is valid for 16-bit DTP relative relocations. */
int
-dtp16_symbolic_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+dtp16_symbolic_operand (rtx op, enum machine_mode mode)
{
return tls_symbolic_operand_1 (op, mode, 16, UNSPEC_DTPREL);
}
@@ -1307,9 +1062,7 @@ dtp16_symbolic_operand (op, mode)
/* Return true if OP is valid for 32-bit DTP relative relocations. */
int
-dtp32_symbolic_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+dtp32_symbolic_operand (rtx op, enum machine_mode mode)
{
return tls_symbolic_operand_1 (op, mode, 32, UNSPEC_DTPREL);
}
@@ -1317,9 +1070,7 @@ dtp32_symbolic_operand (op, mode)
/* Return true if OP is valid for 64-bit DTP relative relocations. */
int
-gotdtp_symbolic_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+gotdtp_symbolic_operand (rtx op, enum machine_mode mode)
{
return tls_symbolic_operand_1 (op, mode, 64, UNSPEC_DTPREL);
}
@@ -1327,9 +1078,7 @@ gotdtp_symbolic_operand (op, mode)
/* Return true if OP is valid for 16-bit TP relative relocations. */
int
-tp16_symbolic_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+tp16_symbolic_operand (rtx op, enum machine_mode mode)
{
return tls_symbolic_operand_1 (op, mode, 16, UNSPEC_TPREL);
}
@@ -1337,9 +1086,7 @@ tp16_symbolic_operand (op, mode)
/* Return true if OP is valid for 32-bit TP relative relocations. */
int
-tp32_symbolic_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+tp32_symbolic_operand (rtx op, enum machine_mode mode)
{
return tls_symbolic_operand_1 (op, mode, 32, UNSPEC_TPREL);
}
@@ -1347,9 +1094,7 @@ tp32_symbolic_operand (op, mode)
/* Return true if OP is valid for 64-bit TP relative relocations. */
int
-gottp_symbolic_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+gottp_symbolic_operand (rtx op, enum machine_mode mode)
{
return tls_symbolic_operand_1 (op, mode, 64, UNSPEC_TPREL);
}
@@ -1358,9 +1103,7 @@ gottp_symbolic_operand (op, mode)
comparisons are valid in which insn. */
int
-alpha_comparison_operator (op, mode)
- register rtx op;
- enum machine_mode mode;
+alpha_comparison_operator (rtx op, enum machine_mode mode)
{
enum rtx_code code = GET_CODE (op);
@@ -1375,9 +1118,7 @@ alpha_comparison_operator (op, mode)
Here we know which comparisons are valid in which insn. */
int
-alpha_zero_comparison_operator (op, mode)
- register rtx op;
- enum machine_mode mode;
+alpha_zero_comparison_operator (rtx op, enum machine_mode mode)
{
enum rtx_code code = GET_CODE (op);
@@ -1391,9 +1132,7 @@ alpha_zero_comparison_operator (op, mode)
/* Return 1 if OP is a valid Alpha swapped comparison operator. */
int
-alpha_swapped_comparison_operator (op, mode)
- register rtx op;
- enum machine_mode mode;
+alpha_swapped_comparison_operator (rtx op, enum machine_mode mode)
{
enum rtx_code code = GET_CODE (op);
@@ -1409,9 +1148,7 @@ alpha_swapped_comparison_operator (op, mode)
/* Return 1 if OP is a signed comparison operation. */
int
-signed_comparison_operator (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+signed_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (op);
@@ -1427,9 +1164,7 @@ signed_comparison_operator (op, mode)
Here we know which comparisons are valid in which insn. */
int
-alpha_fp_comparison_operator (op, mode)
- register rtx op;
- enum machine_mode mode;
+alpha_fp_comparison_operator (rtx op, enum machine_mode mode)
{
enum rtx_code code = GET_CODE (op);
@@ -1442,9 +1177,7 @@ alpha_fp_comparison_operator (op, mode)
/* Return 1 if this is a divide or modulus operator. */
int
-divmod_operator (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+divmod_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (op))
{
@@ -1465,9 +1198,7 @@ divmod_operator (op, mode)
Take into account what reload will do. */
int
-aligned_memory_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+aligned_memory_operand (rtx op, enum machine_mode mode)
{
rtx base;
@@ -1509,9 +1240,7 @@ aligned_memory_operand (op, mode)
/* Similar, but return 1 if OP is a MEM which is not alignable. */
int
-unaligned_memory_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+unaligned_memory_operand (rtx op, enum machine_mode mode)
{
rtx base;
@@ -1553,9 +1282,7 @@ unaligned_memory_operand (op, mode)
/* Return 1 if OP is either a register or an unaligned memory location. */
int
-reg_or_unaligned_mem_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_unaligned_mem_operand (rtx op, enum machine_mode mode)
{
return register_operand (op, mode) || unaligned_memory_operand (op, mode);
}
@@ -1563,9 +1290,7 @@ reg_or_unaligned_mem_operand (op, mode)
/* Return 1 if OP is any memory location. During reload a pseudo matches. */
int
-any_memory_operand (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+any_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == MEM
|| (GET_CODE (op) == SUBREG && GET_CODE (SUBREG_REG (op)) == REG)
@@ -1588,9 +1313,7 @@ any_memory_operand (op, mode)
preventing combine from making the optimization. */
int
-reg_not_elim_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+reg_not_elim_operand (rtx op, enum machine_mode mode)
{
rtx inner = op;
if (GET_CODE (op) == SUBREG)
@@ -1606,9 +1329,7 @@ reg_not_elim_operand (op, mode)
will do. */
int
-normal_memory_operand (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+normal_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (reload_in_progress)
{
@@ -1635,9 +1356,7 @@ normal_memory_operand (op, mode)
int->fp conversion. */
int
-reg_no_subreg_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+reg_no_subreg_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) != REG)
return 0;
@@ -1649,9 +1368,7 @@ reg_no_subreg_operand (op, mode)
elimination. */
int
-addition_operation (op, mode)
- register rtx op;
- enum machine_mode mode;
+addition_operation (rtx op, enum machine_mode mode)
{
if (GET_MODE (op) != mode && mode != VOIDmode)
return 0;
@@ -1667,9 +1384,7 @@ addition_operation (op, mode)
the range defined for C in [I-P]. */
bool
-alpha_const_ok_for_letter_p (value, c)
- HOST_WIDE_INT value;
- int c;
+alpha_const_ok_for_letter_p (HOST_WIDE_INT value, int c)
{
switch (c)
{
@@ -1708,9 +1423,7 @@ alpha_const_ok_for_letter_p (value, c)
matches for C in [GH]. */
bool
-alpha_const_double_ok_for_letter_p (value, c)
- rtx value;
- int c;
+alpha_const_double_ok_for_letter_p (rtx value, int c)
{
switch (c)
{
@@ -1734,9 +1447,7 @@ alpha_const_double_ok_for_letter_p (value, c)
matches for C. */
bool
-alpha_extra_constraint (value, c)
- rtx value;
- int c;
+alpha_extra_constraint (rtx value, int c)
{
switch (c)
{
@@ -1762,7 +1473,7 @@ alpha_extra_constraint (value, c)
/* Return 1 if this function can directly return via $26. */
int
-direct_return ()
+direct_return (void)
{
return (! TARGET_ABI_OPEN_VMS && ! TARGET_ABI_UNICOSMK
&& reload_completed
@@ -1775,8 +1486,7 @@ direct_return ()
/* Return the ADDR_VEC associated with a tablejump insn. */
rtx
-alpha_tablejump_addr_vec (insn)
- rtx insn;
+alpha_tablejump_addr_vec (rtx insn)
{
rtx tmp;
@@ -1795,8 +1505,7 @@ alpha_tablejump_addr_vec (insn)
/* Return the label of the predicted edge, or CONST0_RTX if we don't know. */
rtx
-alpha_tablejump_best_label (insn)
- rtx insn;
+alpha_tablejump_best_label (rtx insn)
{
rtx jump_table = alpha_tablejump_addr_vec (insn);
rtx best_label = NULL_RTX;
@@ -1830,8 +1539,7 @@ alpha_tablejump_best_label (insn)
/* Return the TLS model to use for SYMBOL. */
static enum tls_model
-tls_symbolic_operand_type (symbol)
- rtx symbol;
+tls_symbolic_operand_type (rtx symbol)
{
enum tls_model model;
@@ -1850,8 +1558,7 @@ tls_symbolic_operand_type (symbol)
function in the current unit of translation. */
static bool
-decl_has_samegp (decl)
- tree decl;
+decl_has_samegp (tree decl)
{
/* Functions that are not local can be overridden, and thus may
not share the same gp. */
@@ -1874,8 +1581,7 @@ decl_has_samegp (decl)
/* Return true if EXP should be placed in the small data section. */
static bool
-alpha_in_small_data_p (exp)
- tree exp;
+alpha_in_small_data_p (tree exp)
{
/* We want to merge strings, so we never consider them small data. */
if (TREE_CODE (exp) == STRING_CST)
@@ -1903,8 +1609,7 @@ alpha_in_small_data_p (exp)
#if TARGET_ABI_OPEN_VMS
static bool
-alpha_linkage_symbol_p (symname)
- const char *symname;
+alpha_linkage_symbol_p (const char *symname)
{
int symlen = strlen (symname);
@@ -1933,10 +1638,7 @@ alpha_linkage_symbol_p (symname)
low-order three bits; this is an "unaligned" access. */
bool
-alpha_legitimate_address_p (mode, x, strict)
- enum machine_mode mode;
- rtx x;
- int strict;
+alpha_legitimate_address_p (enum machine_mode mode, rtx x, int strict)
{
/* If this is an ldq_u type address, discard the outer AND. */
if (mode == DImode
@@ -2037,7 +1739,7 @@ alpha_legitimate_address_p (mode, x, strict)
static GTY(()) rtx tls_get_addr_libfunc;
static rtx
-get_tls_get_addr ()
+get_tls_get_addr (void)
{
if (!tls_get_addr_libfunc)
tls_get_addr_libfunc = init_one_libfunc ("__tls_get_addr");
@@ -2048,10 +1750,8 @@ get_tls_get_addr ()
to be legitimate. If we find one, return the new, valid address. */
rtx
-alpha_legitimize_address (x, scratch, mode)
- rtx x;
- rtx scratch;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+alpha_legitimize_address (rtx x, rtx scratch,
+ enum machine_mode mode ATTRIBUTE_UNUSED)
{
HOST_WIDE_INT addend;
@@ -2240,9 +1940,7 @@ alpha_legitimize_address (x, scratch, mode)
into a sibcall. */
static bool
-alpha_function_ok_for_sibcall (decl, exp)
- tree decl;
- tree exp ATTRIBUTE_UNUSED;
+alpha_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
{
/* Can't do indirect tail calls, since we don't know if the target
uses the same GP. */
@@ -2259,18 +1957,8 @@ alpha_function_ok_for_sibcall (decl, exp)
to replace (mem (symbol_ref)) with (mem (lo_sum $29 symbol_ref))
so that sched2 has the proper dependency information. */
-int
-some_small_symbolic_operand (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
-{
- return for_each_rtx (&x, some_small_symbolic_operand_1, NULL);
-}
-
static int
-some_small_symbolic_operand_1 (px, data)
- rtx *px;
- void *data ATTRIBUTE_UNUSED;
+some_small_symbolic_operand_1 (rtx *px, void *data ATTRIBUTE_UNUSED)
{
rtx x = *px;
@@ -2281,19 +1969,14 @@ some_small_symbolic_operand_1 (px, data)
return small_symbolic_operand (x, Pmode) != 0;
}
-rtx
-split_small_symbolic_operand (x)
- rtx x;
+int
+some_small_symbolic_operand (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
- x = copy_insn (x);
- for_each_rtx (&x, split_small_symbolic_operand_1, NULL);
- return x;
+ return for_each_rtx (&x, some_small_symbolic_operand_1, NULL);
}
static int
-split_small_symbolic_operand_1 (px, data)
- rtx *px;
- void *data ATTRIBUTE_UNUSED;
+split_small_symbolic_operand_1 (rtx *px, void *data ATTRIBUTE_UNUSED)
{
rtx x = *px;
@@ -2311,6 +1994,14 @@ split_small_symbolic_operand_1 (px, data)
return 0;
}
+rtx
+split_small_symbolic_operand (rtx x)
+{
+ x = copy_insn (x);
+ for_each_rtx (&x, split_small_symbolic_operand_1, NULL);
+ return x;
+}
+
/* Indicate that INSN cannot be duplicated. This is true for any insn
that we've marked with gpdisp relocs, since those have to stay in
1-1 correspondence with one another.
@@ -2321,8 +2012,7 @@ split_small_symbolic_operand_1 (px, data)
from sched-ebb could move one of the pair of insns to a different block. */
static bool
-alpha_cannot_copy_insn_p (insn)
- rtx insn;
+alpha_cannot_copy_insn_p (rtx insn)
{
rtx pat;
@@ -2358,12 +2048,10 @@ alpha_cannot_copy_insn_p (insn)
operand. If we find one, push the reload and return the new rtx. */
rtx
-alpha_legitimize_reload_address (x, mode, opnum, type, ind_levels)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
- int opnum;
- int type;
- int ind_levels ATTRIBUTE_UNUSED;
+alpha_legitimize_reload_address (rtx x,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ int opnum, int type,
+ int ind_levels ATTRIBUTE_UNUSED)
{
/* We must recognize output that we have already generated ourselves. */
if (GET_CODE (x) == PLUS
@@ -2417,10 +2105,7 @@ alpha_legitimize_reload_address (x, mode, opnum, type, ind_levels)
scanned. In either case, *TOTAL contains the cost result. */
static bool
-alpha_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code;
- int *total;
+alpha_rtx_costs (rtx x, int code, int outer_code, int *total)
{
enum machine_mode mode = GET_MODE (x);
bool float_mode_p = FLOAT_MODE_P (mode);
@@ -2562,9 +2247,7 @@ alpha_rtx_costs (x, code, outer_code, total)
of range stack slots. */
void
-get_aligned_mem (ref, paligned_mem, pbitnum)
- rtx ref;
- rtx *paligned_mem, *pbitnum;
+get_aligned_mem (rtx ref, rtx *paligned_mem, rtx *pbitnum)
{
rtx base;
HOST_WIDE_INT offset = 0;
@@ -2602,9 +2285,7 @@ get_aligned_mem (ref, paligned_mem, pbitnum)
Add EXTRA_OFFSET to the address we return. */
rtx
-get_unaligned_address (ref, extra_offset)
- rtx ref;
- int extra_offset;
+get_unaligned_address (rtx ref, int extra_offset)
{
rtx base;
HOST_WIDE_INT offset = 0;
@@ -2637,9 +2318,7 @@ get_unaligned_address (ref, extra_offset)
symbolic constants cannot be dropped to memory. */
enum reg_class
-alpha_preferred_reload_class(x, class)
- rtx x;
- enum reg_class class;
+alpha_preferred_reload_class(rtx x, enum reg_class class)
{
/* Zero is present in any register class. */
if (x == CONST0_RTX (GET_MODE (x)))
@@ -2676,11 +2355,8 @@ alpha_preferred_reload_class(x, class)
from register elimination into a DImode fp register. */
enum reg_class
-secondary_reload_class (class, mode, x, in)
- enum reg_class class;
- enum machine_mode mode;
- rtx x;
- int in;
+secondary_reload_class (enum reg_class class, enum machine_mode mode,
+ rtx x, int in)
{
if ((mode == QImode || mode == HImode) && ! TARGET_BWX)
{
@@ -2718,9 +2394,7 @@ secondary_reload_class (class, mode, x, in)
found in part of X. */
static void
-alpha_set_memflags_1 (x, in_struct_p, volatile_p, unchanging_p)
- rtx x;
- int in_struct_p, volatile_p, unchanging_p;
+alpha_set_memflags_1 (rtx x, int in_struct_p, int volatile_p, int unchanging_p)
{
int i;
@@ -2770,9 +2444,7 @@ alpha_set_memflags_1 (x, in_struct_p, volatile_p, unchanging_p)
a MEM, don't do anything. */
void
-alpha_set_memflags (insn, ref)
- rtx insn;
- rtx ref;
+alpha_set_memflags (rtx insn, rtx ref)
{
int in_struct_p, volatile_p, unchanging_p;
@@ -2792,62 +2464,11 @@ alpha_set_memflags (insn, ref)
alpha_set_memflags_1 (insn, in_struct_p, volatile_p, unchanging_p);
}
-/* Try to output insns to set TARGET equal to the constant C if it can be
- done in less than N insns. Do all computations in MODE. Returns the place
- where the output has been placed if it can be done and the insns have been
- emitted. If it would take more than N insns, zero is returned and no
- insns and emitted. */
-
-rtx
-alpha_emit_set_const (target, mode, c, n)
- rtx target;
- enum machine_mode mode;
- HOST_WIDE_INT c;
- int n;
-{
- rtx result = 0;
- rtx orig_target = target;
- int i;
-
- /* If we can't make any pseudos, TARGET is an SImode hard register, we
- can't load this constant in one insn, do this in DImode. */
- if (no_new_pseudos && mode == SImode
- && GET_CODE (target) == REG && REGNO (target) < FIRST_PSEUDO_REGISTER
- && (result = alpha_emit_set_const_1 (target, mode, c, 1)) == 0)
- {
- target = gen_lowpart (DImode, target);
- mode = DImode;
- }
-
- /* Try 1 insn, then 2, then up to N. */
- for (i = 1; i <= n; i++)
- {
- result = alpha_emit_set_const_1 (target, mode, c, i);
- if (result)
- {
- rtx insn = get_last_insn ();
- rtx set = single_set (insn);
- if (! CONSTANT_P (SET_SRC (set)))
- set_unique_reg_note (get_last_insn (), REG_EQUAL, GEN_INT (c));
- break;
- }
- }
-
- /* Allow for the case where we changed the mode of TARGET. */
- if (result == target)
- result = orig_target;
-
- return result;
-}
-
-/* Internal routine for the above to check for N or below insns. */
+/* Internal routine for alpha_emit_set_const to check for N or below insns. */
static rtx
-alpha_emit_set_const_1 (target, mode, c, n)
- rtx target;
- enum machine_mode mode;
- HOST_WIDE_INT c;
- int n;
+alpha_emit_set_const_1 (rtx target, enum machine_mode mode,
+ HOST_WIDE_INT c, int n)
{
HOST_WIDE_INT new;
int i, bits;
@@ -3029,15 +2650,58 @@ alpha_emit_set_const_1 (target, mode, c, n)
return 0;
}
+/* Try to output insns to set TARGET equal to the constant C if it can be
+ done in less than N insns. Do all computations in MODE. Returns the place
+ where the output has been placed if it can be done and the insns have been
+ emitted. If it would take more than N insns, zero is returned and no
+ insns and emitted. */
+
+rtx
+alpha_emit_set_const (rtx target, enum machine_mode mode,
+ HOST_WIDE_INT c, int n)
+{
+ rtx result = 0;
+ rtx orig_target = target;
+ int i;
+
+ /* If we can't make any pseudos, TARGET is an SImode hard register, we
+ can't load this constant in one insn, do this in DImode. */
+ if (no_new_pseudos && mode == SImode
+ && GET_CODE (target) == REG && REGNO (target) < FIRST_PSEUDO_REGISTER
+ && (result = alpha_emit_set_const_1 (target, mode, c, 1)) == 0)
+ {
+ target = gen_lowpart (DImode, target);
+ mode = DImode;
+ }
+
+ /* Try 1 insn, then 2, then up to N. */
+ for (i = 1; i <= n; i++)
+ {
+ result = alpha_emit_set_const_1 (target, mode, c, i);
+ if (result)
+ {
+ rtx insn = get_last_insn ();
+ rtx set = single_set (insn);
+ if (! CONSTANT_P (SET_SRC (set)))
+ set_unique_reg_note (get_last_insn (), REG_EQUAL, GEN_INT (c));
+ break;
+ }
+ }
+
+ /* Allow for the case where we changed the mode of TARGET. */
+ if (result == target)
+ result = orig_target;
+
+ return result;
+}
+
/* Having failed to find a 3 insn sequence in alpha_emit_set_const,
fall back to a straight forward decomposition. We do this to avoid
exponential run times encountered when looking for longer sequences
with alpha_emit_set_const. */
rtx
-alpha_emit_set_long_const (target, c1, c2)
- rtx target;
- HOST_WIDE_INT c1, c2;
+alpha_emit_set_long_const (rtx target, HOST_WIDE_INT c1, HOST_WIDE_INT c2)
{
HOST_WIDE_INT d1, d2, d3, d4;
@@ -3094,9 +2758,7 @@ alpha_emit_set_long_const (target, c1, c2)
We don't handle non-bwx subword loads here. */
bool
-alpha_expand_mov (mode, operands)
- enum machine_mode mode;
- rtx *operands;
+alpha_expand_mov (enum machine_mode mode, rtx *operands)
{
/* If the output is not a register, the input must be. */
if (GET_CODE (operands[0]) == MEM
@@ -3194,9 +2856,7 @@ alpha_expand_mov (mode, operands)
return true if all work is done. */
bool
-alpha_expand_mov_nobwx (mode, operands)
- enum machine_mode mode;
- rtx *operands;
+alpha_expand_mov_nobwx (enum machine_mode mode, rtx *operands)
{
/* If the output is not a register, the input must be. */
if (GET_CODE (operands[0]) == MEM)
@@ -3349,8 +3009,7 @@ alpha_expand_mov_nobwx (mode, operands)
much lower minimum execution time. */
void
-alpha_emit_floatuns (operands)
- rtx operands[2];
+alpha_emit_floatuns (rtx operands[2])
{
rtx neglab, donelab, i0, i1, f0, in, out;
enum machine_mode mode;
@@ -3384,8 +3043,7 @@ alpha_emit_floatuns (operands)
/* Generate the comparison for a conditional branch. */
rtx
-alpha_emit_conditional_branch (code)
- enum rtx_code code;
+alpha_emit_conditional_branch (enum rtx_code code)
{
enum rtx_code cmp_code, branch_code;
enum machine_mode cmp_mode, branch_mode = VOIDmode;
@@ -3541,8 +3199,7 @@ alpha_emit_conditional_branch (code)
valid. Return the final comparison, or NULL if we can't work. */
rtx
-alpha_emit_setcc (code)
- enum rtx_code code;
+alpha_emit_setcc (enum rtx_code code)
{
enum rtx_code cmp_code;
rtx op0 = alpha_compare.op0, op1 = alpha_compare.op1;
@@ -3653,10 +3310,9 @@ alpha_emit_setcc (code)
If both of the operands that set cc0 are nonzero we must emit
an insn to perform the compare (it can't be done within
the conditional move). */
+
rtx
-alpha_emit_conditional_move (cmp, mode)
- rtx cmp;
- enum machine_mode mode;
+alpha_emit_conditional_move (rtx cmp, enum machine_mode mode)
{
enum rtx_code code = GET_CODE (cmp);
enum rtx_code cmov_code = NE;
@@ -3791,9 +3447,8 @@ alpha_emit_conditional_move (cmp, mode)
cases we wouldn't have before cse. */
int
-alpha_split_conditional_move (code, dest, cond, t_rtx, f_rtx)
- enum rtx_code code;
- rtx dest, cond, t_rtx, f_rtx;
+alpha_split_conditional_move (enum rtx_code code, rtx dest, rtx cond,
+ rtx t_rtx, rtx f_rtx)
{
HOST_WIDE_INT t, f, diff;
enum machine_mode mode;
@@ -3878,8 +3533,7 @@ alpha_split_conditional_move (code, dest, cond, t_rtx, f_rtx)
given operation. */
static const char *
-alpha_lookup_xfloating_lib_func (code)
- enum rtx_code code;
+alpha_lookup_xfloating_lib_func (enum rtx_code code)
{
struct xfloating_op
{
@@ -3965,9 +3619,8 @@ alpha_lookup_xfloating_lib_func (code)
Compute that here. */
static int
-alpha_compute_xfloating_mode_arg (code, round)
- enum rtx_code code;
- enum alpha_fp_rounding_mode round;
+alpha_compute_xfloating_mode_arg (enum rtx_code code,
+ enum alpha_fp_rounding_mode round)
{
int mode;
@@ -4011,12 +3664,8 @@ alpha_compute_xfloating_mode_arg (code, round)
*/
static void
-alpha_emit_xfloating_libcall (func, target, operands, noperands, equiv)
- const char *func;
- rtx target;
- rtx operands[];
- int noperands;
- rtx equiv;
+alpha_emit_xfloating_libcall (const char *func, rtx target, rtx operands[],
+ int noperands, rtx equiv)
{
rtx usage = NULL_RTX, tmp, reg;
int regno = 16, i;
@@ -4083,9 +3732,7 @@ alpha_emit_xfloating_libcall (func, target, operands, noperands, equiv)
/* Emit an X_floating library function call for arithmetic (+,-,*,/). */
void
-alpha_emit_xfloating_arith (code, operands)
- enum rtx_code code;
- rtx operands[];
+alpha_emit_xfloating_arith (enum rtx_code code, rtx operands[])
{
const char *func;
int mode;
@@ -4105,9 +3752,7 @@ alpha_emit_xfloating_arith (code, operands)
/* Emit an X_floating library function call for a comparison. */
static rtx
-alpha_emit_xfloating_compare (code, op0, op1)
- enum rtx_code code;
- rtx op0, op1;
+alpha_emit_xfloating_compare (enum rtx_code code, rtx op0, rtx op1)
{
const char *func;
rtx out, operands[2];
@@ -4129,9 +3774,7 @@ alpha_emit_xfloating_compare (code, op0, op1)
/* Emit an X_floating library function call for a conversion. */
void
-alpha_emit_xfloating_cvt (code, operands)
- enum rtx_code code;
- rtx operands[];
+alpha_emit_xfloating_cvt (enum rtx_code code, rtx operands[])
{
int noperands = 1, mode;
rtx out_operands[2];
@@ -4167,8 +3810,7 @@ alpha_emit_xfloating_cvt (code, operands)
little-endian. */
void
-alpha_split_tfmode_pair (operands)
- rtx operands[4];
+alpha_split_tfmode_pair (rtx operands[4])
{
if (GET_CODE (operands[1]) == REG)
{
@@ -4204,9 +3846,7 @@ alpha_split_tfmode_pair (operands)
logical operation to be performed. */
void
-alpha_split_tfmode_frobsign (operands, operation)
- rtx operands[3];
- rtx (*operation) PARAMS ((rtx, rtx, rtx));
+alpha_split_tfmode_frobsign (rtx operands[3], rtx (*operation) (rtx, rtx, rtx))
{
rtx high_bit = operands[2];
rtx scratch;
@@ -4273,10 +3913,8 @@ alpha_split_tfmode_frobsign (operands, operation)
*/
void
-alpha_expand_unaligned_load (tgt, mem, size, ofs, sign)
- rtx tgt, mem;
- HOST_WIDE_INT size, ofs;
- int sign;
+alpha_expand_unaligned_load (rtx tgt, rtx mem, HOST_WIDE_INT size,
+ HOST_WIDE_INT ofs, int sign)
{
rtx meml, memh, addr, extl, exth, tmp, mema;
enum machine_mode mode;
@@ -4399,9 +4037,8 @@ alpha_expand_unaligned_load (tgt, mem, size, ofs, sign)
/* Similarly, use ins and msk instructions to perform unaligned stores. */
void
-alpha_expand_unaligned_store (dst, src, size, ofs)
- rtx dst, src;
- HOST_WIDE_INT size, ofs;
+alpha_expand_unaligned_store (rtx dst, rtx src,
+ HOST_WIDE_INT size, HOST_WIDE_INT ofs)
{
rtx dstl, dsth, addr, insl, insh, meml, memh, dsta;
@@ -4544,10 +4181,8 @@ alpha_expand_unaligned_store (dst, src, size, ofs)
/* Load an integral number of consecutive unaligned quadwords. */
static void
-alpha_expand_unaligned_load_words (out_regs, smem, words, ofs)
- rtx *out_regs;
- rtx smem;
- HOST_WIDE_INT words, ofs;
+alpha_expand_unaligned_load_words (rtx *out_regs, rtx smem,
+ HOST_WIDE_INT words, HOST_WIDE_INT ofs)
{
rtx const im8 = GEN_INT (-8);
rtx const i64 = GEN_INT (64);
@@ -4628,10 +4263,8 @@ alpha_expand_unaligned_load_words (out_regs, smem, words, ofs)
may be NULL to store zeros. */
static void
-alpha_expand_unaligned_store_words (data_regs, dmem, words, ofs)
- rtx *data_regs;
- rtx dmem;
- HOST_WIDE_INT words, ofs;
+alpha_expand_unaligned_store_words (rtx *data_regs, rtx dmem,
+ HOST_WIDE_INT words, HOST_WIDE_INT ofs)
{
rtx const im8 = GEN_INT (-8);
rtx const i64 = GEN_INT (64);
@@ -4745,8 +4378,7 @@ alpha_expand_unaligned_store_words (data_regs, dmem, words, ofs)
operands[3] is the alignment. */
int
-alpha_expand_block_move (operands)
- rtx operands[];
+alpha_expand_block_move (rtx operands[])
{
rtx bytes_rtx = operands[2];
rtx align_rtx = operands[3];
@@ -5082,8 +4714,7 @@ alpha_expand_block_move (operands)
}
int
-alpha_expand_block_clear (operands)
- rtx operands[];
+alpha_expand_block_clear (rtx operands[])
{
rtx bytes_rtx = operands[1];
rtx align_rtx = operands[2];
@@ -5373,8 +5004,7 @@ alpha_expand_block_clear (operands)
/* Returns a mask so that zap(x, value) == x & mask. */
rtx
-alpha_expand_zap_mask (value)
- HOST_WIDE_INT value;
+alpha_expand_zap_mask (HOST_WIDE_INT value)
{
rtx result;
int i;
@@ -5419,10 +5049,9 @@ alpha_expand_zap_mask (value)
}
void
-alpha_expand_builtin_vector_binop (gen, mode, op0, op1, op2)
- rtx (*gen) PARAMS ((rtx, rtx, rtx));
- enum machine_mode mode;
- rtx op0, op1, op2;
+alpha_expand_builtin_vector_binop (rtx (*gen) (rtx, rtx, rtx),
+ enum machine_mode mode,
+ rtx op0, rtx op1, rtx op2)
{
op0 = gen_lowpart (mode, op0);
@@ -5443,11 +5072,7 @@ alpha_expand_builtin_vector_binop (gen, mode, op0, op1, op2)
a dependency LINK or INSN on DEP_INSN. COST is the current cost. */
static int
-alpha_adjust_cost (insn, link, dep_insn, cost)
- rtx insn;
- rtx link;
- rtx dep_insn;
- int cost;
+alpha_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost)
{
enum attr_type insn_type, dep_insn_type;
@@ -5478,13 +5103,13 @@ alpha_adjust_cost (insn, link, dep_insn, cost)
/* The number of instructions that can be issued per cycle. */
static int
-alpha_issue_rate ()
+alpha_issue_rate (void)
{
return (alpha_cpu == PROCESSOR_EV4 ? 2 : 4);
}
static int
-alpha_use_dfa_pipeline_interface ()
+alpha_use_dfa_pipeline_interface (void)
{
return true;
}
@@ -5498,7 +5123,7 @@ alpha_use_dfa_pipeline_interface ()
FA/FM. For EV6, an arithmatic insn can be issued to U0/U1/L0/L1. */
static int
-alpha_multipass_dfa_lookahead ()
+alpha_multipass_dfa_lookahead (void)
{
return (alpha_cpu == PROCESSOR_EV6 ? 4 : 2);
}
@@ -5523,7 +5148,7 @@ struct machine_function GTY(())
/* How to allocate a 'struct machine_function'. */
static struct machine_function *
-alpha_init_machine_status ()
+alpha_init_machine_status (void)
{
return ((struct machine_function *)
ggc_alloc_cleared (sizeof (struct machine_function)));
@@ -5534,9 +5159,7 @@ alpha_init_machine_status ()
/* Start the ball rolling with RETURN_ADDR_RTX. */
rtx
-alpha_return_addr (count, frame)
- int count;
- rtx frame ATTRIBUTE_UNUSED;
+alpha_return_addr (int count, rtx frame ATTRIBUTE_UNUSED)
{
if (count != 0)
return const0_rtx;
@@ -5548,7 +5171,7 @@ alpha_return_addr (count, frame)
function. Needed only if TARGET_LD_BUGGY_LDGP. */
rtx
-alpha_gp_save_rtx ()
+alpha_gp_save_rtx (void)
{
rtx r = get_hard_reg_initial_val (DImode, 29);
if (GET_CODE (r) != MEM)
@@ -5557,7 +5180,7 @@ alpha_gp_save_rtx ()
}
static int
-alpha_ra_ever_killed ()
+alpha_ra_ever_killed (void)
{
rtx top;
@@ -5576,7 +5199,7 @@ alpha_ra_ever_killed ()
instruction, or NULL. */
static const char *
-get_trap_mode_suffix ()
+get_trap_mode_suffix (void)
{
enum attr_trap_suffix s = get_attr_trap_suffix (current_output_insn);
@@ -5643,7 +5266,7 @@ get_trap_mode_suffix ()
instruction, or NULL. */
static const char *
-get_round_mode_suffix ()
+get_round_mode_suffix (void)
{
enum attr_round_suffix s = get_attr_round_suffix (current_output_insn);
@@ -5674,8 +5297,23 @@ get_round_mode_suffix ()
/* Locate some local-dynamic symbol still in use by this function
so that we can print its name in some movdi_er_tlsldm pattern. */
+static int
+get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED)
+{
+ rtx x = *px;
+
+ if (GET_CODE (x) == SYMBOL_REF
+ && SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_DYNAMIC)
+ {
+ cfun->machine->some_ld_name = XSTR (x, 0);
+ return 1;
+ }
+
+ return 0;
+}
+
static const char *
-get_some_local_dynamic_name ()
+get_some_local_dynamic_name (void)
{
rtx insn;
@@ -5690,30 +5328,10 @@ get_some_local_dynamic_name ()
abort ();
}
-static int
-get_some_local_dynamic_name_1 (px, data)
- rtx *px;
- void *data ATTRIBUTE_UNUSED;
-{
- rtx x = *px;
-
- if (GET_CODE (x) == SYMBOL_REF
- && SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_DYNAMIC)
- {
- cfun->machine->some_ld_name = XSTR (x, 0);
- return 1;
- }
-
- return 0;
-}
-
/* Print an operand. Recognize special options, documented below. */
void
-print_operand (file, x, code)
- FILE *file;
- rtx x;
- int code;
+print_operand (FILE *file, rtx x, int code)
{
int i;
@@ -6065,9 +5683,7 @@ print_operand (file, x, code)
}
void
-print_operand_address (file, addr)
- FILE *file;
- rtx addr;
+print_operand_address (FILE *file, rtx addr)
{
int basereg = 31;
HOST_WIDE_INT offset = 0;
@@ -6176,9 +5792,8 @@ print_operand_address (file, addr)
Note that the hint field is PC (new) + 4 * bits 13:0. */
void
-alpha_initialize_trampoline (tramp, fnaddr, cxt, fnofs, cxtofs, jmpofs)
- rtx tramp, fnaddr, cxt;
- int fnofs, cxtofs, jmpofs;
+alpha_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt,
+ int fnofs, int cxtofs, int jmpofs)
{
rtx temp, temp1, addr;
/* VMS really uses DImode pointers in memory at this point. */
@@ -6243,23 +5858,31 @@ alpha_initialize_trampoline (tramp, fnaddr, cxt, fnofs, cxtofs, jmpofs)
and the rest are pushed. */
rtx
-function_arg (cum, mode, type, named)
- CUMULATIVE_ARGS cum;
- enum machine_mode mode;
- tree type;
- int named ATTRIBUTE_UNUSED;
+function_arg (CUMULATIVE_ARGS cum, enum machine_mode mode, tree type,
+ int named ATTRIBUTE_UNUSED)
{
int basereg;
int num_args;
- /* Set up defaults for FP operands passed in FP registers, and
- integral operands passed in integer registers. */
- if (TARGET_FPREGS
- && (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
- || GET_MODE_CLASS (mode) == MODE_FLOAT))
- basereg = 32 + 16;
- else
+ /* Don't get confused and pass small structures in FP registers. */
+ if (type && AGGREGATE_TYPE_P (type))
basereg = 16;
+ else
+ {
+#ifdef ENABLE_CHECKING
+ /* With SPLIT_COMPLEX_ARGS, we shouldn't see any raw complex
+ values here. */
+ if (COMPLEX_MODE_P (mode))
+ abort ();
+#endif
+
+ /* Set up defaults for FP operands passed in FP registers, and
+ integral operands passed in integer registers. */
+ if (TARGET_FPREGS && GET_MODE_CLASS (mode) == MODE_FLOAT)
+ basereg = 32 + 16;
+ else
+ basereg = 16;
+ }
/* ??? Irritatingly, the definition of CUMULATIVE_ARGS is different for
the three platforms, so we can't avoid conditional compilation. */
@@ -6272,8 +5895,7 @@ function_arg (cum, mode, type, named)
if (num_args >= 6 || MUST_PASS_IN_STACK (mode, type))
return NULL_RTX;
}
-#else
-#if TARGET_ABI_UNICOSMK
+#elif TARGET_ABI_UNICOSMK
{
int size;
@@ -6337,7 +5959,7 @@ function_arg (cum, mode, type, named)
}
}
}
-#else
+#elif TARGET_ABI_OSF
{
if (cum >= 6)
return NULL_RTX;
@@ -6351,14 +5973,121 @@ function_arg (cum, mode, type, named)
else if (FUNCTION_ARG_PASS_BY_REFERENCE (cum, mode, type, named))
basereg = 16;
}
-#endif /* TARGET_ABI_UNICOSMK */
-#endif /* TARGET_ABI_OPEN_VMS */
+#else
+#error Unhandled ABI
+#endif
return gen_rtx_REG (mode, num_args + basereg);
}
+/* Return true if TYPE must be returned in memory, instead of in registers. */
+
+bool
+return_in_memory (tree type, enum machine_mode mode)
+{
+ int size;
+
+ if (type)
+ {
+ mode = TYPE_MODE (type);
+
+ /* All aggregates are returned in memory. */
+ if (AGGREGATE_TYPE_P (type))
+ return true;
+ }
+
+ size = GET_MODE_SIZE (mode);
+ switch (GET_MODE_CLASS (mode))
+ {
+ case MODE_VECTOR_FLOAT:
+ /* Pass all float vectors in memory, like an aggregate. */
+ return true;
+
+ case MODE_COMPLEX_FLOAT:
+ /* We judge complex floats on the size of their element,
+ not the size of the whole type. */
+ size = GET_MODE_UNIT_SIZE (mode);
+ break;
+
+ case MODE_INT:
+ case MODE_FLOAT:
+ case MODE_COMPLEX_INT:
+ case MODE_VECTOR_INT:
+ break;
+
+ default:
+ /* ??? We get called on all sorts of random stuff from
+ aggregate_value_p. We can't abort, but it's not clear
+ what's safe to return. Pretend it's a struct I guess. */
+ return true;
+ }
+
+ /* Otherwise types must fit in one register. */
+ return size > UNITS_PER_WORD;
+}
+
+/* Define how to find the value returned by a function. 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.
+ MODE is set instead of VALTYPE for libcalls.
+
+ On Alpha the value is found in $0 for integer functions and
+ $f0 for floating-point functions. */
+
+rtx
+function_value (tree valtype, tree func ATTRIBUTE_UNUSED,
+ enum machine_mode mode)
+{
+ unsigned int regnum;
+ enum mode_class class;
+
+#ifdef ENABLE_CHECKING
+ if (return_in_memory (valtype, mode))
+ abort ();
+#endif
+
+ if (valtype)
+ mode = TYPE_MODE (valtype);
+
+ class = GET_MODE_CLASS (mode);
+ switch (class)
+ {
+ case MODE_INT:
+ /* Do the same thing as PROMOTE_MODE. */
+ mode = DImode;
+ /* FALLTHRU */
+
+ case MODE_COMPLEX_INT:
+ case MODE_VECTOR_INT:
+ regnum = 0;
+ break;
+
+ case MODE_FLOAT:
+ regnum = 32;
+ break;
+
+ case MODE_COMPLEX_FLOAT:
+ {
+ enum machine_mode cmode = GET_MODE_INNER (mode);
+
+ return gen_rtx_PARALLEL
+ (VOIDmode,
+ gen_rtvec (2,
+ gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_REG (cmode, 32),
+ GEN_INT (0)),
+ gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_REG (cmode, 33),
+ GEN_INT (GET_MODE_SIZE (cmode)))));
+ }
+
+ default:
+ abort ();
+ }
+
+ return gen_rtx_REG (mode, regnum);
+}
+
tree
-alpha_build_va_list ()
+alpha_build_va_list (void)
{
tree base, ofs, record, type_decl;
@@ -6404,12 +6133,10 @@ alpha_build_va_list ()
#if TARGET_ABI_OSF
void
-alpha_setup_incoming_varargs(cum, mode, type, pretend_size, no_rtl)
- CUMULATIVE_ARGS cum;
- enum machine_mode mode ATTRIBUTE_UNUSED;
- tree type ATTRIBUTE_UNUSED;
- int *pretend_size;
- int no_rtl;
+alpha_setup_incoming_varargs(CUMULATIVE_ARGS cum,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ tree type ATTRIBUTE_UNUSED,
+ int *pretend_size, int no_rtl)
{
if (cum >= 6)
return;
@@ -6437,9 +6164,7 @@ alpha_setup_incoming_varargs(cum, mode, type, pretend_size, no_rtl)
#endif
void
-alpha_va_start (valist, nextarg)
- tree valist;
- rtx nextarg ATTRIBUTE_UNUSED;
+alpha_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
{
HOST_WIDE_INT offset;
tree t, offset_field, base_field;
@@ -6501,8 +6226,7 @@ alpha_va_start (valist, nextarg)
}
rtx
-alpha_va_arg (valist, type)
- tree valist, type;
+alpha_va_arg (tree valist, tree type)
{
rtx addr;
tree t, type_size, rounded_size;
@@ -6555,7 +6279,27 @@ alpha_va_arg (valist, type)
indirect = 1;
rounded_size = size_int (UNITS_PER_WORD);
}
- else if (FLOAT_TYPE_P (type))
+ else if (TREE_CODE (type) == COMPLEX_TYPE)
+ {
+ rtx real_part, imag_part, value, tmp;
+
+ real_part = alpha_va_arg (valist, TREE_TYPE (type));
+ imag_part = alpha_va_arg (valist, TREE_TYPE (type));
+
+ /* ??? Most irritatingly, we're not returning the value here,
+ but the address. Since real_part and imag_part are not
+ necessarily contiguous, we must copy to local storage. */
+
+ real_part = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (type)), real_part);
+ imag_part = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (type)), imag_part);
+ value = gen_rtx_CONCAT (TYPE_MODE (type), real_part, imag_part);
+
+ tmp = assign_temp (type, 0, 1, 0);
+ emit_move_insn (tmp, value);
+
+ return XEXP (tmp, 0);
+ }
+ else if (TREE_CODE (type) == REAL_TYPE)
{
tree fpaddend, cond;
@@ -6762,7 +6506,7 @@ static struct alpha_builtin_def const two_arg_builtins[] = {
};
static void
-alpha_init_builtins ()
+alpha_init_builtins (void)
{
const struct alpha_builtin_def *p;
tree ftype;
@@ -6813,12 +6557,10 @@ alpha_init_builtins ()
IGNORE is nonzero if the value is to be ignored. */
static rtx
-alpha_expand_builtin (exp, target, subtarget, mode, ignore)
- tree exp;
- rtx target;
- rtx subtarget ATTRIBUTE_UNUSED;
- enum machine_mode mode ATTRIBUTE_UNUSED;
- int ignore ATTRIBUTE_UNUSED;
+alpha_expand_builtin (tree exp, rtx target,
+ rtx subtarget ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ int ignore ATTRIBUTE_UNUSED)
{
#define MAX_ARGS 2
@@ -6922,9 +6664,7 @@ static int vms_base_regno;
/* Compute register masks for saved registers. */
static void
-alpha_sa_mask (imaskP, fmaskP)
- unsigned long *imaskP;
- unsigned long *fmaskP;
+alpha_sa_mask (unsigned long *imaskP, unsigned long *fmaskP)
{
unsigned long imask = 0;
unsigned long fmask = 0;
@@ -6979,7 +6719,7 @@ alpha_sa_mask (imaskP, fmaskP)
}
int
-alpha_sa_size ()
+alpha_sa_size (void)
{
unsigned long mask[2];
int sa_size = 0;
@@ -7085,8 +6825,8 @@ alpha_sa_size ()
and the other its replacement, at the start of a routine. */
HOST_WIDE_INT
-alpha_initial_elimination_offset (from, to)
- unsigned int from, to ATTRIBUTE_UNUSED;
+alpha_initial_elimination_offset (unsigned int from,
+ unsigned int to ATTRIBUTE_UNUSED)
{
HOST_WIDE_INT ret;
@@ -7106,14 +6846,14 @@ alpha_initial_elimination_offset (from, to)
}
int
-alpha_pv_save_size ()
+alpha_pv_save_size (void)
{
alpha_sa_size ();
return alpha_procedure_type == PT_STACK ? 8 : 0;
}
int
-alpha_using_fp ()
+alpha_using_fp (void)
{
alpha_sa_size ();
return vms_unwind_regno == HARD_FRAME_POINTER_REGNUM;
@@ -7133,22 +6873,19 @@ const struct attribute_spec vms_attribute_table[] =
#endif
static int
-find_lo_sum_using_gp (px, data)
- rtx *px;
- void *data ATTRIBUTE_UNUSED;
+find_lo_sum_using_gp (rtx *px, void *data ATTRIBUTE_UNUSED)
{
return GET_CODE (*px) == LO_SUM && XEXP (*px, 0) == pic_offset_table_rtx;
}
int
-alpha_find_lo_sum_using_gp (insn)
- rtx insn;
+alpha_find_lo_sum_using_gp (rtx insn)
{
return for_each_rtx (&PATTERN (insn), find_lo_sum_using_gp, NULL) > 0;
}
static int
-alpha_does_function_need_gp ()
+alpha_does_function_need_gp (void)
{
rtx insn;
@@ -7180,27 +6917,12 @@ alpha_does_function_need_gp ()
return 0;
}
-/* Write a version stamp. Don't write anything if we are running as a
- cross-compiler. Otherwise, use the versions in /usr/include/stamp.h. */
-
-#ifdef HAVE_STAMP_H
-#include <stamp.h>
-#endif
-
-void
-alpha_write_verstamp (file)
- FILE *file ATTRIBUTE_UNUSED;
-{
-#ifdef MS_STAMP
- fprintf (file, "\t.verstamp %d %d\n", MS_STAMP, LS_STAMP);
-#endif
-}
/* Helper function to set RTX_FRAME_RELATED_P on instructions, including
sequences. */
static rtx
-set_frame_related_p ()
+set_frame_related_p (void)
{
rtx seq = get_insns ();
rtx insn;
@@ -7248,7 +6970,7 @@ set_frame_related_p ()
simply allocate stack without saving registers. */
void
-alpha_expand_prologue ()
+alpha_expand_prologue (void)
{
/* Registers to save. */
unsigned long imask = 0;
@@ -7567,10 +7289,8 @@ alpha_expand_prologue ()
/* Output the textual info surrounding the prologue. */
void
-alpha_start_function (file, fnname, decl)
- FILE *file;
- const char *fnname;
- tree decl ATTRIBUTE_UNUSED;
+alpha_start_function (FILE *file, const char *fnname,
+ tree decl ATTRIBUTE_UNUSED)
{
unsigned long imask = 0;
unsigned long fmask = 0;
@@ -7635,7 +7355,7 @@ alpha_start_function (file, fnname, decl)
#ifdef ASM_OUTPUT_SOURCE_LINE
if (debug_info_level != DINFO_LEVEL_TERSE)
ASM_OUTPUT_SOURCE_LINE (file,
- DECL_SOURCE_LINE (current_function_decl));
+ DECL_SOURCE_LINE (current_function_decl), 0);
#endif
}
@@ -7752,8 +7472,7 @@ alpha_start_function (file, fnname, decl)
/* Emit the .prologue note at the scheduled end of the prologue. */
static void
-alpha_output_function_end_prologue (file)
- FILE *file;
+alpha_output_function_end_prologue (FILE *file)
{
if (TARGET_ABI_UNICOSMK)
;
@@ -7775,7 +7494,7 @@ alpha_output_function_end_prologue (file)
#define FRP(exp) exp
void
-alpha_expand_epilogue ()
+alpha_expand_epilogue (void)
{
/* Registers to save. */
unsigned long imask = 0;
@@ -8033,10 +7752,7 @@ alpha_expand_epilogue ()
/* Output the rest of the textual info surrounding the epilogue. */
void
-alpha_end_function (file, fnname, decl)
- FILE *file;
- const char *fnname;
- tree decl ATTRIBUTE_UNUSED;
+alpha_end_function (FILE *file, const char *fnname, tree decl ATTRIBUTE_UNUSED)
{
/* End the function. */
if (!TARGET_ABI_UNICOSMK && !flag_inhibit_size_directive)
@@ -8070,19 +7786,16 @@ alpha_end_function (file, fnname, decl)
Not sure why this idea hasn't been explored before... */
static void
-alpha_output_mi_thunk_osf (file, thunk_fndecl, delta, vcall_offset, function)
- FILE *file;
- tree thunk_fndecl ATTRIBUTE_UNUSED;
- HOST_WIDE_INT delta;
- HOST_WIDE_INT vcall_offset;
- tree function;
+alpha_output_mi_thunk_osf (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
+ tree function)
{
HOST_WIDE_INT hi, lo;
rtx this, insn, funexp;
/* We always require a valid GP. */
emit_insn (gen_prologue_ldgp ());
- emit_note (NULL, NOTE_INSN_PROLOGUE_END);
+ emit_note (NOTE_INSN_PROLOGUE_END);
/* Find the "this" pointer. If the function returns a structure,
the structure return pointer is in $16. */
@@ -8193,9 +7906,7 @@ long alpha_auto_offset;
/* Emit a new filename to a stream. */
void
-alpha_output_filename (stream, name)
- FILE *stream;
- const char *name;
+alpha_output_filename (FILE *stream, const char *name)
{
static int first_time = TRUE;
char ltext_label_name[100];
@@ -8236,13 +7947,11 @@ alpha_output_filename (stream, name)
fprintf (stream, "\n");
}
}
-
+
/* Emit a linenumber to a stream. */
void
-alpha_output_lineno (stream, line)
- FILE *stream;
- int line;
+alpha_output_lineno (FILE *stream, int line)
{
if (write_symbols == DBX_DEBUG)
{
@@ -8266,18 +7975,12 @@ struct shadow_summary
} used, defd;
};
-static void summarize_insn PARAMS ((rtx, struct shadow_summary *, int));
-static void alpha_handle_trap_shadows PARAMS ((void));
-
/* Summary the effects of expression X on the machine. Update SUM, a pointer
to the summary structure. SET is nonzero if the insn is setting the
object, otherwise zero. */
static void
-summarize_insn (x, sum, set)
- rtx x;
- struct shadow_summary *sum;
- int set;
+summarize_insn (rtx x, struct shadow_summary *sum, int set)
{
const char *format_ptr;
int i, j;
@@ -8431,7 +8134,7 @@ summarize_insn (x, sum, set)
(d) The trap shadow may not include any branch instructions. */
static void
-alpha_handle_trap_shadows ()
+alpha_handle_trap_shadows (void)
{
struct shadow_summary shadow;
int trap_pending, exception_nesting;
@@ -8584,19 +8287,8 @@ enum alphaev5_pipe {
EV5_FM = 64
};
-static enum alphaev4_pipe alphaev4_insn_pipe PARAMS ((rtx));
-static enum alphaev5_pipe alphaev5_insn_pipe PARAMS ((rtx));
-static rtx alphaev4_next_group PARAMS ((rtx, int *, int *));
-static rtx alphaev5_next_group PARAMS ((rtx, int *, int *));
-static rtx alphaev4_next_nop PARAMS ((int *));
-static rtx alphaev5_next_nop PARAMS ((int *));
-
-static void alpha_align_insns
- PARAMS ((unsigned int, rtx (*)(rtx, int *, int *), rtx (*)(int *)));
-
static enum alphaev4_pipe
-alphaev4_insn_pipe (insn)
- rtx insn;
+alphaev4_insn_pipe (rtx insn)
{
if (recog_memoized (insn) < 0)
return EV4_STOP;
@@ -8638,8 +8330,7 @@ alphaev4_insn_pipe (insn)
}
static enum alphaev5_pipe
-alphaev5_insn_pipe (insn)
- rtx insn;
+alphaev5_insn_pipe (rtx insn)
{
if (recog_memoized (insn) < 0)
return EV5_STOP;
@@ -8694,9 +8385,7 @@ alphaev5_insn_pipe (insn)
LEN is, of course, the length of the group in bytes. */
static rtx
-alphaev4_next_group (insn, pin_use, plen)
- rtx insn;
- int *pin_use, *plen;
+alphaev4_next_group (rtx insn, int *pin_use, int *plen)
{
int len, in_use;
@@ -8794,9 +8483,7 @@ alphaev4_next_group (insn, pin_use, plen)
LEN is, of course, the length of the group in bytes. */
static rtx
-alphaev5_next_group (insn, pin_use, plen)
- rtx insn;
- int *pin_use, *plen;
+alphaev5_next_group (rtx insn, int *pin_use, int *plen)
{
int len, in_use;
@@ -8921,8 +8608,7 @@ alphaev5_next_group (insn, pin_use, plen)
}
static rtx
-alphaev4_next_nop (pin_use)
- int *pin_use;
+alphaev4_next_nop (int *pin_use)
{
int in_use = *pin_use;
rtx nop;
@@ -8950,8 +8636,7 @@ alphaev4_next_nop (pin_use)
}
static rtx
-alphaev5_next_nop (pin_use)
- int *pin_use;
+alphaev5_next_nop (int *pin_use)
{
int in_use = *pin_use;
rtx nop;
@@ -8981,10 +8666,9 @@ alphaev5_next_nop (pin_use)
/* The instruction group alignment main loop. */
static void
-alpha_align_insns (max_align, next_group, next_nop)
- unsigned int max_align;
- rtx (*next_group) PARAMS ((rtx, int *, int *));
- rtx (*next_nop) PARAMS ((int *));
+alpha_align_insns (unsigned int max_align,
+ rtx (*next_group) (rtx, int *, int *),
+ rtx (*next_nop) (int *))
{
/* ALIGN is the known alignment for the insn group. */
unsigned int align;
@@ -9107,7 +8791,7 @@ alpha_align_insns (max_align, next_group, next_nop)
/* Machine dependent reorg pass. */
static void
-alpha_reorg ()
+alpha_reorg (void)
{
if (alpha_tp != ALPHA_TP_PROG || flag_exceptions)
alpha_handle_trap_shadows ();
@@ -9126,16 +8810,51 @@ alpha_reorg ()
}
}
+#if !TARGET_ABI_UNICOSMK
+
+#ifdef HAVE_STAMP_H
+#include <stamp.h>
+#endif
+
+static void
+alpha_file_start (void)
+{
+#ifdef OBJECT_FORMAT_ELF
+ /* If emitting dwarf2 debug information, we cannot generate a .file
+ directive to start the file, as it will conflict with dwarf2out
+ file numbers. So it's only useful when emitting mdebug output. */
+ targetm.file_start_file_directive = (write_symbols == DBX_DEBUG);
+#endif
+
+ default_file_start ();
+#ifdef MS_STAMP
+ fprintf (asm_out_file, "\t.verstamp %d %d\n", MS_STAMP, LS_STAMP);
+#endif
+
+ fputs ("\t.set noreorder\n", asm_out_file);
+ fputs ("\t.set volatile\n", asm_out_file);
+ if (!TARGET_ABI_OPEN_VMS)
+ fputs ("\t.set noat\n", asm_out_file);
+ if (TARGET_EXPLICIT_RELOCS)
+ fputs ("\t.set nomacro\n", asm_out_file);
+ if (TARGET_SUPPORT_ARCH | TARGET_BWX | TARGET_MAX | TARGET_FIX | TARGET_CIX)
+ fprintf (asm_out_file,
+ "\t.arch %s\n",
+ TARGET_CPU_EV6 ? "ev6"
+ : (TARGET_CPU_EV5
+ ? (TARGET_MAX ? "pca56" : TARGET_BWX ? "ev56" : "ev5")
+ : "ev4"));
+}
+#endif
+
#ifdef OBJECT_FORMAT_ELF
/* Switch to the section to which we should output X. The only thing
special we do here is to honor small data. */
static void
-alpha_elf_select_rtx_section (mode, x, align)
- enum machine_mode mode;
- rtx x;
- unsigned HOST_WIDE_INT align;
+alpha_elf_select_rtx_section (enum machine_mode mode, rtx x,
+ unsigned HOST_WIDE_INT align)
{
if (TARGET_SMALL_DATA && GET_MODE_SIZE (mode) <= g_switch_value)
/* ??? Consider using mergable sdata sections. */
@@ -9179,8 +8898,7 @@ static GTY(()) int alpha_funcs_num;
/* Return the VMS argument type corresponding to MODE. */
enum avms_arg_type
-alpha_arg_type (mode)
- enum machine_mode mode;
+alpha_arg_type (enum machine_mode mode)
{
switch (mode)
{
@@ -9197,8 +8915,7 @@ alpha_arg_type (mode)
register value. */
rtx
-alpha_arg_info_reg_val (cum)
- CUMULATIVE_ARGS cum;
+alpha_arg_info_reg_val (CUMULATIVE_ARGS cum)
{
unsigned HOST_WIDE_INT regval = cum.num_args;
int i;
@@ -9216,9 +8933,7 @@ alpha_arg_info_reg_val (cum)
Return an SYMBOL_REF rtx for the linkage. */
rtx
-alpha_need_linkage (name, is_local)
- const char *name;
- int is_local;
+alpha_need_linkage (const char *name, int is_local)
{
splay_tree_node node;
struct alpha_links *al;
@@ -9297,11 +9012,7 @@ alpha_need_linkage (name, is_local)
}
rtx
-alpha_use_linkage (linkage, cfundecl, lflag, rflag)
- rtx linkage;
- tree cfundecl;
- int lflag;
- int rflag;
+alpha_use_linkage (rtx linkage, tree cfundecl, int lflag, int rflag)
{
splay_tree_node cfunnode;
struct alpha_funcs *cfaf;
@@ -9375,9 +9086,7 @@ alpha_use_linkage (linkage, cfundecl, lflag, rflag)
}
static int
-alpha_write_one_linkage (node, data)
- splay_tree_node node;
- void *data;
+alpha_write_one_linkage (splay_tree_node node, void *data)
{
const char *const name = (const char *) node->key;
struct alpha_links *link = (struct alpha_links *) node->value;
@@ -9416,10 +9125,7 @@ alpha_write_one_linkage (node, data)
}
static void
-alpha_write_linkage (stream, funname, fundecl)
- FILE *stream;
- const char *funname;
- tree fundecl;
+alpha_write_linkage (FILE *stream, const char *funname, tree fundecl)
{
splay_tree_node node;
struct alpha_funcs *func;
@@ -9454,10 +9160,7 @@ alpha_write_linkage (stream, funname, fundecl)
#define SECTION_VMS_INITIALIZE (SECTION_VMS_GLOBAL << 1)
static unsigned int
-vms_section_type_flags (decl, name, reloc)
- tree decl;
- const char *name;
- int reloc;
+vms_section_type_flags (tree decl, const char *name, int reloc)
{
unsigned int flags = default_section_type_flags (decl, name, reloc);
@@ -9479,9 +9182,7 @@ vms_section_type_flags (decl, name, reloc)
the section; 0 if the default should be used. */
static void
-vms_asm_named_section (name, flags)
- const char *name;
- unsigned int flags;
+vms_asm_named_section (const char *name, unsigned int flags)
{
fputc ('\n', asm_out_file);
fprintf (asm_out_file, ".section\t%s", name);
@@ -9507,9 +9208,7 @@ vms_asm_named_section (name, flags)
used by a normal pointer. */
static void
-vms_asm_out_constructor (symbol, priority)
- rtx symbol;
- int priority ATTRIBUTE_UNUSED;
+vms_asm_out_constructor (rtx symbol, int priority ATTRIBUTE_UNUSED)
{
ctors_section ();
assemble_align (BITS_PER_WORD);
@@ -9517,9 +9216,7 @@ vms_asm_out_constructor (symbol, priority)
}
static void
-vms_asm_out_destructor (symbol, priority)
- rtx symbol;
- int priority ATTRIBUTE_UNUSED;
+vms_asm_out_destructor (rtx symbol, int priority ATTRIBUTE_UNUSED)
{
dtors_section ();
assemble_align (BITS_PER_WORD);
@@ -9528,19 +9225,17 @@ vms_asm_out_destructor (symbol, priority)
#else
rtx
-alpha_need_linkage (name, is_local)
- const char *name ATTRIBUTE_UNUSED;
- int is_local ATTRIBUTE_UNUSED;
+alpha_need_linkage (const char *name ATTRIBUTE_UNUSED,
+ int is_local ATTRIBUTE_UNUSED)
{
return NULL_RTX;
}
rtx
-alpha_use_linkage (linkage, cfundecl, lflag, rflag)
- rtx linkage ATTRIBUTE_UNUSED;
- tree cfundecl ATTRIBUTE_UNUSED;
- int lflag ATTRIBUTE_UNUSED;
- int rflag ATTRIBUTE_UNUSED;
+alpha_use_linkage (rtx linkage ATTRIBUTE_UNUSED,
+ tree cfundecl ATTRIBUTE_UNUSED,
+ int lflag ATTRIBUTE_UNUSED,
+ int rflag ATTRIBUTE_UNUSED)
{
return NULL_RTX;
}
@@ -9549,21 +9244,11 @@ alpha_use_linkage (linkage, cfundecl, lflag, rflag)
#if TARGET_ABI_UNICOSMK
-static void unicosmk_output_module_name PARAMS ((FILE *));
-static void unicosmk_output_default_externs PARAMS ((FILE *));
-static void unicosmk_output_dex PARAMS ((FILE *));
-static void unicosmk_output_externs PARAMS ((FILE *));
-static void unicosmk_output_addr_vec PARAMS ((FILE *, rtx));
-static const char *unicosmk_ssib_name PARAMS ((void));
-static int unicosmk_special_name PARAMS ((const char *));
-
/* Define the offset between two registers, one to be eliminated, and the
other its replacement, at the start of a routine. */
int
-unicosmk_initial_elimination_offset (from, to)
- int from;
- int to;
+unicosmk_initial_elimination_offset (int from, int to)
{
int fixed_size;
@@ -9591,8 +9276,7 @@ unicosmk_initial_elimination_offset (from, to)
or '$'. */
static void
-unicosmk_output_module_name (file)
- FILE *file;
+unicosmk_output_module_name (FILE *file)
{
const char *name;
@@ -9612,90 +9296,10 @@ unicosmk_output_module_name (file)
output_clean_symbol_name (file, name);
}
-/* Output text that to appear at the beginning of an assembler file. */
-
-void
-unicosmk_asm_file_start (file)
- FILE *file;
-{
- int i;
-
- fputs ("\t.ident\t", file);
- unicosmk_output_module_name (file);
- fputs ("\n\n", file);
-
- /* The Unicos/Mk assembler uses different register names. Instead of trying
- to support them, we simply use micro definitions. */
-
- /* CAM has different register names: rN for the integer register N and fN
- for the floating-point register N. Instead of trying to use these in
- alpha.md, we define the symbols $N and $fN to refer to the appropriate
- register. */
-
- for (i = 0; i < 32; ++i)
- fprintf (file, "$%d <- r%d\n", i, i);
-
- for (i = 0; i < 32; ++i)
- fprintf (file, "$f%d <- f%d\n", i, i);
-
- putc ('\n', file);
-
- /* The .align directive fill unused space with zeroes which does not work
- in code sections. We define the macro 'gcc@code@align' which uses nops
- instead. Note that it assumes that code sections always have the
- biggest possible alignment since . refers to the current offset from
- the beginning of the section. */
-
- fputs ("\t.macro gcc@code@align n\n", file);
- fputs ("gcc@n@bytes = 1 << n\n", file);
- fputs ("gcc@here = . % gcc@n@bytes\n", file);
- fputs ("\t.if ne, gcc@here, 0\n", file);
- fputs ("\t.repeat (gcc@n@bytes - gcc@here) / 4\n", file);
- fputs ("\tbis r31,r31,r31\n", file);
- fputs ("\t.endr\n", file);
- fputs ("\t.endif\n", file);
- fputs ("\t.endm gcc@code@align\n\n", file);
-
- /* Output extern declarations which should always be visible. */
- unicosmk_output_default_externs (file);
-
- /* Open a dummy section. We always need to be inside a section for the
- section-switching code to work correctly.
- ??? This should be a module id or something like that. I still have to
- figure out what the rules for those are. */
- fputs ("\n\t.psect\t$SG00000,data\n", file);
-}
-
-/* Output text to appear at the end of an assembler file. This includes all
- pending extern declarations and DEX expressions. */
-
-static void
-unicosmk_file_end ()
-{
- fputs ("\t.endp\n\n", asm_out_file);
-
- /* Output all pending externs. */
-
- unicosmk_output_externs (asm_out_file);
-
- /* Output dex definitions used for functions whose names conflict with
- register names. */
-
- unicosmk_output_dex (asm_out_file);
-
- fputs ("\t.end\t", asm_out_file);
- unicosmk_output_module_name (asm_out_file);
- putc ('\n', asm_out_file);
-}
-
/* Output the definition of a common variable. */
void
-unicosmk_output_common (file, name, size, align)
- FILE *file;
- const char *name;
- int size;
- int align;
+unicosmk_output_common (FILE *file, const char *name, int size, int align)
{
tree name_tree;
printf ("T3E__: common %s\n", name);
@@ -9716,10 +9320,8 @@ unicosmk_output_common (file, name, size, align)
static int current_section_align;
static unsigned int
-unicosmk_section_type_flags (decl, name, reloc)
- tree decl;
- const char *name;
- int reloc ATTRIBUTE_UNUSED;
+unicosmk_section_type_flags (tree decl, const char *name,
+ int reloc ATTRIBUTE_UNUSED)
{
unsigned int flags = default_section_type_flags (decl, name, reloc);
@@ -9748,9 +9350,7 @@ unicosmk_section_type_flags (decl, name, reloc)
declaration. */
static void
-unicosmk_unique_section (decl, reloc)
- tree decl;
- int reloc ATTRIBUTE_UNUSED;
+unicosmk_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED)
{
const char *name;
int len;
@@ -9791,9 +9391,7 @@ unicosmk_unique_section (decl, reloc)
the section; 0 if the default should be used. */
static void
-unicosmk_asm_named_section (name, flags)
- const char *name;
- unsigned int flags;
+unicosmk_asm_named_section (const char *name, unsigned int flags)
{
const char *kind;
@@ -9821,9 +9419,7 @@ unicosmk_asm_named_section (name, flags)
}
static void
-unicosmk_insert_attributes (decl, attr_ptr)
- tree decl;
- tree *attr_ptr ATTRIBUTE_UNUSED;
+unicosmk_insert_attributes (tree decl, tree *attr_ptr ATTRIBUTE_UNUSED)
{
if (DECL_P (decl)
&& (TREE_PUBLIC (decl) || TREE_CODE (decl) == FUNCTION_DECL))
@@ -9834,9 +9430,7 @@ unicosmk_insert_attributes (decl, attr_ptr)
in code sections because .align fill unused space with zeroes. */
void
-unicosmk_output_align (file, align)
- FILE *file;
- int align;
+unicosmk_output_align (FILE *file, int align)
{
if (inside_function)
fprintf (file, "\tgcc@code@align\t%d\n", align);
@@ -9849,9 +9443,7 @@ unicosmk_output_align (file, align)
does not allow data definitions in code sections. */
void
-unicosmk_defer_case_vector (lab, vec)
- rtx lab;
- rtx vec;
+unicosmk_defer_case_vector (rtx lab, rtx vec)
{
struct machine_function *machine = cfun->machine;
@@ -9863,9 +9455,7 @@ unicosmk_defer_case_vector (lab, vec)
/* Output a case vector. */
static void
-unicosmk_output_addr_vec (file, vec)
- FILE *file;
- rtx vec;
+unicosmk_output_addr_vec (FILE *file, rtx vec)
{
rtx lab = XEXP (vec, 0);
rtx body = XEXP (vec, 1);
@@ -9884,8 +9474,7 @@ unicosmk_output_addr_vec (file, vec)
/* Output current function's deferred case vectors. */
static void
-unicosmk_output_deferred_case_vectors (file)
- FILE *file;
+unicosmk_output_deferred_case_vectors (FILE *file)
{
struct machine_function *machine = cfun->machine;
rtx t;
@@ -9898,13 +9487,48 @@ unicosmk_output_deferred_case_vectors (file)
unicosmk_output_addr_vec (file, XEXP (t, 0));
}
+/* Generate the name of the SSIB section for the current function. */
+
+#define SSIB_PREFIX "__SSIB_"
+#define SSIB_PREFIX_LEN 7
+
+static const char *
+unicosmk_ssib_name (void)
+{
+ /* This is ok since CAM won't be able to deal with names longer than that
+ anyway. */
+
+ static char name[256];
+
+ rtx x;
+ const char *fnname;
+ int len;
+
+ x = DECL_RTL (cfun->decl);
+ if (GET_CODE (x) != MEM)
+ abort ();
+ x = XEXP (x, 0);
+ if (GET_CODE (x) != SYMBOL_REF)
+ abort ();
+ fnname = XSTR (x, 0);
+
+ len = strlen (fnname);
+ if (len + SSIB_PREFIX_LEN > 255)
+ len = 255 - SSIB_PREFIX_LEN;
+
+ strcpy (name, SSIB_PREFIX);
+ strncpy (name + SSIB_PREFIX_LEN, fnname, len);
+ name[len + SSIB_PREFIX_LEN] = 0;
+
+ return name;
+}
+
/* Set up the dynamic subprogram information block (DSIB) and update the
frame pointer register ($15) for subroutines which have a frame. If the
subroutine doesn't have a frame, simply increment $15. */
static void
-unicosmk_gen_dsib (imaskP)
- unsigned long * imaskP;
+unicosmk_gen_dsib (unsigned long *imaskP)
{
if (alpha_procedure_type == PT_STACK)
{
@@ -9967,49 +9591,11 @@ unicosmk_gen_dsib (imaskP)
}
}
-#define SSIB_PREFIX "__SSIB_"
-#define SSIB_PREFIX_LEN 7
-
-/* Generate the name of the SSIB section for the current function. */
-
-static const char *
-unicosmk_ssib_name ()
-{
- /* This is ok since CAM won't be able to deal with names longer than that
- anyway. */
-
- static char name[256];
-
- rtx x;
- const char *fnname;
- int len;
-
- x = DECL_RTL (cfun->decl);
- if (GET_CODE (x) != MEM)
- abort ();
- x = XEXP (x, 0);
- if (GET_CODE (x) != SYMBOL_REF)
- abort ();
- fnname = XSTR (x, 0);
-
- len = strlen (fnname);
- if (len + SSIB_PREFIX_LEN > 255)
- len = 255 - SSIB_PREFIX_LEN;
-
- strcpy (name, SSIB_PREFIX);
- strncpy (name + SSIB_PREFIX_LEN, fnname, len);
- name[len + SSIB_PREFIX_LEN] = 0;
-
- return name;
-}
-
/* Output the static subroutine information block for the current
function. */
static void
-unicosmk_output_ssib (file, fnname)
- FILE *file;
- const char *fnname;
+unicosmk_output_ssib (FILE *file, const char *fnname)
{
int len;
int i;
@@ -10071,8 +9657,7 @@ unicosmk_output_ssib (file, fnname)
X is a CONST_INT or CONST_DOUBLE representing the CIW. */
rtx
-unicosmk_add_call_info_word (x)
- rtx x;
+unicosmk_add_call_info_word (rtx x)
{
rtx node;
struct machine_function *machine = cfun->machine;
@@ -10093,7 +9678,7 @@ unicosmk_add_call_info_word (x)
static char unicosmk_section_buf[100];
char *
-unicosmk_text_section ()
+unicosmk_text_section (void)
{
static int count = 0;
sprintf (unicosmk_section_buf, "\t.endp\n\n\t.psect\tgcc@text___%d,code",
@@ -10102,7 +9687,7 @@ unicosmk_text_section ()
}
char *
-unicosmk_data_section ()
+unicosmk_data_section (void)
{
static int count = 1;
sprintf (unicosmk_section_buf, "\t.endp\n\n\t.psect\tgcc@data___%d,data",
@@ -10131,8 +9716,7 @@ static struct unicosmk_extern_list *unicosmk_extern_head = 0;
/* Output extern declarations which are required for every asm file. */
static void
-unicosmk_output_default_externs (file)
- FILE *file;
+unicosmk_output_default_externs (FILE *file)
{
static const char *const externs[] =
{ "__T3E_MISMATCH" };
@@ -10150,8 +9734,7 @@ unicosmk_output_default_externs (file)
referenced but not defined. */
static void
-unicosmk_output_externs (file)
- FILE *file;
+unicosmk_output_externs (FILE *file)
{
struct unicosmk_extern_list *p;
const char *real_name;
@@ -10183,8 +9766,7 @@ unicosmk_output_externs (file)
/* Record an extern. */
void
-unicosmk_add_extern (name)
- const char *name;
+unicosmk_add_extern (const char *name)
{
struct unicosmk_extern_list *p;
@@ -10220,8 +9802,7 @@ static int unicosmk_dex_count = 0;
/* Check if NAME must be replaced by a DEX expression. */
static int
-unicosmk_special_name (name)
- const char *name;
+unicosmk_special_name (const char *name)
{
if (name[0] == '*')
++name;
@@ -10250,8 +9831,7 @@ unicosmk_special_name (name)
otherwise. */
static int
-unicosmk_need_dex (x)
- rtx x;
+unicosmk_need_dex (rtx x)
{
struct unicosmk_dex *dex;
const char *name;
@@ -10284,8 +9864,7 @@ unicosmk_need_dex (x)
/* Output the DEX definitions for this file. */
static void
-unicosmk_output_dex (file)
- FILE *file;
+unicosmk_output_dex (FILE *file)
{
struct unicosmk_dex *dex;
int i;
@@ -10307,39 +9886,210 @@ unicosmk_output_dex (file)
fprintf (file, "\t.dexend\n");
}
+/* Output text that to appear at the beginning of an assembler file. */
+
+static void
+unicosmk_file_start (void)
+{
+ int i;
+
+ fputs ("\t.ident\t", asm_out_file);
+ unicosmk_output_module_name (asm_out_file);
+ fputs ("\n\n", asm_out_file);
+
+ /* The Unicos/Mk assembler uses different register names. Instead of trying
+ to support them, we simply use micro definitions. */
+
+ /* CAM has different register names: rN for the integer register N and fN
+ for the floating-point register N. Instead of trying to use these in
+ alpha.md, we define the symbols $N and $fN to refer to the appropriate
+ register. */
+
+ for (i = 0; i < 32; ++i)
+ fprintf (asm_out_file, "$%d <- r%d\n", i, i);
+
+ for (i = 0; i < 32; ++i)
+ fprintf (asm_out_file, "$f%d <- f%d\n", i, i);
+
+ putc ('\n', asm_out_file);
+
+ /* The .align directive fill unused space with zeroes which does not work
+ in code sections. We define the macro 'gcc@code@align' which uses nops
+ instead. Note that it assumes that code sections always have the
+ biggest possible alignment since . refers to the current offset from
+ the beginning of the section. */
+
+ fputs ("\t.macro gcc@code@align n\n", asm_out_file);
+ fputs ("gcc@n@bytes = 1 << n\n", asm_out_file);
+ fputs ("gcc@here = . % gcc@n@bytes\n", asm_out_file);
+ fputs ("\t.if ne, gcc@here, 0\n", asm_out_file);
+ fputs ("\t.repeat (gcc@n@bytes - gcc@here) / 4\n", asm_out_file);
+ fputs ("\tbis r31,r31,r31\n", asm_out_file);
+ fputs ("\t.endr\n", asm_out_file);
+ fputs ("\t.endif\n", asm_out_file);
+ fputs ("\t.endm gcc@code@align\n\n", asm_out_file);
+
+ /* Output extern declarations which should always be visible. */
+ unicosmk_output_default_externs (asm_out_file);
+
+ /* Open a dummy section. We always need to be inside a section for the
+ section-switching code to work correctly.
+ ??? This should be a module id or something like that. I still have to
+ figure out what the rules for those are. */
+ fputs ("\n\t.psect\t$SG00000,data\n", asm_out_file);
+}
+
+/* Output text to appear at the end of an assembler file. This includes all
+ pending extern declarations and DEX expressions. */
+
+static void
+unicosmk_file_end (void)
+{
+ fputs ("\t.endp\n\n", asm_out_file);
+
+ /* Output all pending externs. */
+
+ unicosmk_output_externs (asm_out_file);
+
+ /* Output dex definitions used for functions whose names conflict with
+ register names. */
+
+ unicosmk_output_dex (asm_out_file);
+
+ fputs ("\t.end\t", asm_out_file);
+ unicosmk_output_module_name (asm_out_file);
+ putc ('\n', asm_out_file);
+}
+
#else
static void
-unicosmk_output_deferred_case_vectors (file)
- FILE *file ATTRIBUTE_UNUSED;
+unicosmk_output_deferred_case_vectors (FILE *file ATTRIBUTE_UNUSED)
{}
static void
-unicosmk_gen_dsib (imaskP)
- unsigned long * imaskP ATTRIBUTE_UNUSED;
+unicosmk_gen_dsib (unsigned long *imaskP ATTRIBUTE_UNUSED)
{}
static void
-unicosmk_output_ssib (file, fnname)
- FILE * file ATTRIBUTE_UNUSED;
- const char * fnname ATTRIBUTE_UNUSED;
+unicosmk_output_ssib (FILE * file ATTRIBUTE_UNUSED,
+ const char * fnname ATTRIBUTE_UNUSED)
{}
rtx
-unicosmk_add_call_info_word (x)
- rtx x ATTRIBUTE_UNUSED;
+unicosmk_add_call_info_word (rtx x ATTRIBUTE_UNUSED)
{
return NULL_RTX;
}
static int
-unicosmk_need_dex (x)
- rtx x ATTRIBUTE_UNUSED;
+unicosmk_need_dex (rtx x ATTRIBUTE_UNUSED)
{
return 0;
}
#endif /* TARGET_ABI_UNICOSMK */
+
+/* Initialize the GCC target structure. */
+#if TARGET_ABI_OPEN_VMS
+# undef TARGET_ATTRIBUTE_TABLE
+# define TARGET_ATTRIBUTE_TABLE vms_attribute_table
+# undef TARGET_SECTION_TYPE_FLAGS
+# define TARGET_SECTION_TYPE_FLAGS vms_section_type_flags
+#endif
+
+#undef TARGET_IN_SMALL_DATA_P
+#define TARGET_IN_SMALL_DATA_P alpha_in_small_data_p
+
+#if TARGET_ABI_UNICOSMK
+# undef TARGET_INSERT_ATTRIBUTES
+# define TARGET_INSERT_ATTRIBUTES unicosmk_insert_attributes
+# undef TARGET_SECTION_TYPE_FLAGS
+# define TARGET_SECTION_TYPE_FLAGS unicosmk_section_type_flags
+# undef TARGET_ASM_UNIQUE_SECTION
+# define TARGET_ASM_UNIQUE_SECTION unicosmk_unique_section
+# undef TARGET_ASM_GLOBALIZE_LABEL
+# define TARGET_ASM_GLOBALIZE_LABEL hook_void_FILEptr_constcharptr
+#endif
+
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
+#undef TARGET_ASM_ALIGNED_DI_OP
+#define TARGET_ASM_ALIGNED_DI_OP "\t.quad\t"
+
+/* Default unaligned ops are provided for ELF systems. To get unaligned
+ data for non-ELF systems, we have to turn off auto alignment. */
+#ifndef OBJECT_FORMAT_ELF
+#undef TARGET_ASM_UNALIGNED_HI_OP
+#define TARGET_ASM_UNALIGNED_HI_OP "\t.align 0\n\t.word\t"
+#undef TARGET_ASM_UNALIGNED_SI_OP
+#define TARGET_ASM_UNALIGNED_SI_OP "\t.align 0\n\t.long\t"
+#undef TARGET_ASM_UNALIGNED_DI_OP
+#define TARGET_ASM_UNALIGNED_DI_OP "\t.align 0\n\t.quad\t"
+#endif
+
+#ifdef OBJECT_FORMAT_ELF
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define TARGET_ASM_SELECT_RTX_SECTION alpha_elf_select_rtx_section
+#endif
+
+#undef TARGET_ASM_FUNCTION_END_PROLOGUE
+#define TARGET_ASM_FUNCTION_END_PROLOGUE alpha_output_function_end_prologue
+
+#if TARGET_ABI_UNICOSMK
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START unicosmk_file_start
+#undef TARGET_ASM_FILE_END
+#define TARGET_ASM_FILE_END unicosmk_file_end
+#else
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START alpha_file_start
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+#endif
+
+#undef TARGET_SCHED_ADJUST_COST
+#define TARGET_SCHED_ADJUST_COST alpha_adjust_cost
+#undef TARGET_SCHED_ISSUE_RATE
+#define TARGET_SCHED_ISSUE_RATE alpha_issue_rate
+#undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
+#define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE \
+ alpha_use_dfa_pipeline_interface
+#undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
+#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD \
+ alpha_multipass_dfa_lookahead
+
+#undef TARGET_HAVE_TLS
+#define TARGET_HAVE_TLS HAVE_AS_TLS
+
+#undef TARGET_INIT_BUILTINS
+#define TARGET_INIT_BUILTINS alpha_init_builtins
+#undef TARGET_EXPAND_BUILTIN
+#define TARGET_EXPAND_BUILTIN alpha_expand_builtin
+
+#undef TARGET_FUNCTION_OK_FOR_SIBCALL
+#define TARGET_FUNCTION_OK_FOR_SIBCALL alpha_function_ok_for_sibcall
+#undef TARGET_CANNOT_COPY_INSN_P
+#define TARGET_CANNOT_COPY_INSN_P alpha_cannot_copy_insn_p
+
+#if TARGET_ABI_OSF
+#undef TARGET_ASM_OUTPUT_MI_THUNK
+#define TARGET_ASM_OUTPUT_MI_THUNK alpha_output_mi_thunk_osf
+#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
+#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true
+#endif
+
+#undef TARGET_RTX_COSTS
+#define TARGET_RTX_COSTS alpha_rtx_costs
+#undef TARGET_ADDRESS_COST
+#define TARGET_ADDRESS_COST hook_int_rtx_0
+
+#undef TARGET_MACHINE_DEPENDENT_REORG
+#define TARGET_MACHINE_DEPENDENT_REORG alpha_reorg
+
+struct gcc_target targetm = TARGET_INITIALIZER;
+
+
#include "gt-alpha.h"
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index b8bcba915b6..267d292a17d 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -994,25 +994,14 @@ extern int alpha_memory_latency;
On Alpha the value is found in $0 for integer functions and
$f0 for floating-point functions. */
-#define FUNCTION_VALUE(VALTYPE, FUNC) \
- 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 FUNCTION_VALUE(VALTYPE, FUNC) \
+ function_value (VALTYPE, FUNC, VOIDmode)
/* 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))
+#define LIBCALL_VALUE(MODE) \
+ function_value (NULL, NULL, MODE)
/* The definition of this macro implies that there are cases where
a scalar value cannot be returned in registers.
@@ -1021,10 +1010,7 @@ extern int alpha_memory_latency;
are integers whose size is larger than 64 bits. */
#define RETURN_IN_MEMORY(TYPE) \
- (TYPE_MODE (TYPE) == BLKmode \
- || TYPE_MODE (TYPE) == TFmode \
- || TYPE_MODE (TYPE) == TCmode \
- || (TREE_CODE (TYPE) == INTEGER_TYPE && TYPE_PRECISION (TYPE) > 64))
+ return_in_memory (TYPE, VOIDmode)
/* 1 if N is a possible register number for a function value
as seen by the caller. */
@@ -1778,7 +1764,7 @@ extern long alpha_auto_offset;
#define DEBUGGER_ARG_OFFSET(OFFSET, X) (OFFSET + alpha_arg_offset)
-#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE, COUNTER) \
alpha_output_lineno (STREAM, LINE)
#define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) \
@@ -1889,3 +1875,6 @@ do { \
/* Generate calls to memcpy, etc., not bcopy, etc. */
#define TARGET_MEM_FUNCTIONS 1
+
+/* Pass complex arguments independently. */
+#define SPLIT_COMPLEX_ARGS 1
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index 9ddeb9e7df1..48d01e0cee9 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -2897,7 +2897,7 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
[(set (match_operand:DF 0 "register_operand" "=f")
(sqrt:DF (match_operand:DF 1 "reg_or_0_operand" "fG")))]
"TARGET_FP && TARGET_FIX"
- "sqrt%-%/ %1,%0"
+ "sqrt%-%/ %R1,%0"
[(set_attr "type" "fsqrt")
(set_attr "trap" "yes")
(set_attr "round_suffix" "normal")
diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h
index 2ee0f071b4a..8fdfc3e9d16 100644
--- a/gcc/config/alpha/elf.h
+++ b/gcc/config/alpha/elf.h
@@ -49,27 +49,6 @@ Boston, MA 02111-1307, USA. */
#undef ASM_SPEC
#define ASM_SPEC "%{G*} %{relax:-relax} %{!gstabs*:-no-mdebug}%{gstabs*:-mdebug}"
-/* Output at beginning of assembler file. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-do { \
- if (write_symbols == DBX_DEBUG) \
- { \
- alpha_write_verstamp (FILE); \
- output_file_directive (FILE, main_input_filename); \
- } \
- fprintf (FILE, "\t.set noat\n"); \
- fprintf (FILE, "\t.set noreorder\n"); \
- if (TARGET_EXPLICIT_RELOCS) \
- fprintf (FILE, "\t.set nomacro\n"); \
- if (TARGET_BWX | TARGET_MAX | TARGET_FIX | TARGET_CIX) \
- { \
- fprintf (FILE, "\t.arch %s\n", \
- (TARGET_CPU_EV6 ? "ev6" \
- : TARGET_MAX ? "pca56" : "ev56")); \
- } \
-} while (0)
-
#undef IDENT_ASM_OP
#define IDENT_ASM_OP "\t.ident\t"
@@ -231,8 +210,8 @@ do { \
SECTION_FUNCTION_TEMPLATE(sbss_section, in_sbss, SBSS_SECTION_ASM_OP) \
SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP)
-extern void sbss_section PARAMS ((void));
-extern void sdata_section PARAMS ((void));
+extern void sbss_section (void);
+extern void sdata_section (void);
#undef SECTION_FUNCTION_TEMPLATE
#define SECTION_FUNCTION_TEMPLATE(FN, ENUM, OP) \
diff --git a/gcc/config/alpha/openbsd.h b/gcc/config/alpha/openbsd.h
index 0bab68b66f4..f574e8da1f7 100644
--- a/gcc/config/alpha/openbsd.h
+++ b/gcc/config/alpha/openbsd.h
@@ -88,29 +88,6 @@ Boston, MA 02111-1307, USA. */
#define DWARF2_UNWIND_INFO 0
#endif
-/* Assembler format: file framework. */
-
-/* Taken from alpha/osf.h. This used to be common to all alpha
- configurations, but elf has departed from it.
- Check alpha/alpha.h, alpha/osf.h for it when egcs is upgraded. */
-#ifndef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-{ \
- alpha_write_verstamp (FILE); \
- fprintf (FILE, "\t.set noreorder\n"); \
- fprintf (FILE, "\t.set volatile\n"); \
- fprintf (FILE, "\t.set noat\n"); \
- if (TARGET_SUPPORT_ARCH) \
- fprintf (FILE, "\t.arch %s\n", \
- TARGET_CPU_EV6 ? "ev6" \
- : (TARGET_CPU_EV5 \
- ? (TARGET_MAX ? "pca56" : TARGET_BWX ? "ev56" : "ev5") \
- : "ev4")); \
- \
- ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
-}
-#endif
-
/* Assembler format: label output. */
#define ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,VALUE) \
diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf.h
index 2be2a424d35..3d7936ef015 100644
--- a/gcc/config/alpha/osf.h
+++ b/gcc/config/alpha/osf.h
@@ -84,22 +84,6 @@ Boston, MA 02111-1307, USA. */
#define MD_STARTFILE_PREFIX "/usr/lib/cmplrs/cc/"
-#define ASM_FILE_START(FILE) \
-{ \
- alpha_write_verstamp (FILE); \
- fprintf (FILE, "\t.set noreorder\n"); \
- fprintf (FILE, "\t.set volatile\n"); \
- fprintf (FILE, "\t.set noat\n"); \
- if (TARGET_SUPPORT_ARCH) \
- fprintf (FILE, "\t.arch %s\n", \
- TARGET_CPU_EV6 ? "ev6" \
- : (TARGET_CPU_EV5 \
- ? (TARGET_MAX ? "pca56" : TARGET_BWX ? "ev56" : "ev5") \
- : "ev4")); \
- \
- ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
-}
-
/* Tru64 UNIX V5.1 requires a special as flag. Empty by default. */
#define ASM_OLDAS_SPEC ""
@@ -155,13 +139,10 @@ Boston, MA 02111-1307, USA. */
/* Attempt to turn on access permissions for the stack. */
#define TRANSFER_FROM_TRAMPOLINE \
-extern void __enable_execute_stack PARAMS ((void *)); \
- \
void \
-__enable_execute_stack (addr) \
- void *addr; \
+__enable_execute_stack (void *addr) \
{ \
- extern int mprotect PARAMS ((const void *, size_t, int)); \
+ extern int mprotect (const void *, size_t, int); \
long size = getpagesize (); \
long mask = ~(size-1); \
char *page = (char *) (((long) addr) & mask); \
diff --git a/gcc/config/alpha/osf5.h b/gcc/config/alpha/osf5.h
index e483124691e..b57e5e6f08e 100644
--- a/gcc/config/alpha/osf5.h
+++ b/gcc/config/alpha/osf5.h
@@ -49,3 +49,8 @@
linked. */
#undef TARGET_LD_BUGGY_LDGP
#define TARGET_LD_BUGGY_LDGP 1
+
+/* Tru64 v5.1 has the float and long double forms of math functions. */
+#undef TARGET_C99_FUNCTIONS
+#define TARGET_C99_FUNCTIONS 1
+
diff --git a/gcc/config/alpha/unicosmk.h b/gcc/config/alpha/unicosmk.h
index fc0a9703d92..8b186f6258d 100644
--- a/gcc/config/alpha/unicosmk.h
+++ b/gcc/config/alpha/unicosmk.h
@@ -102,8 +102,6 @@ Boston, MA 02111-1307, USA. */
other its replacement, at the start of a routine. This is somewhat
complicated on the T3E which is why we use a function. */
-extern int unicosmk_initial_elimination_offset PARAMS ((int, int));
-
#undef INITIAL_ELIMINATION_OFFSET
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
do { \
@@ -319,7 +317,7 @@ do { fprintf (FILE, "\tbr $1,0\n"); \
COMMON_SECTION \
SSIB_SECTION
-extern void common_section PARAMS ((void));
+extern void common_section (void);
#define COMMON_SECTION \
void \
common_section () \
@@ -327,7 +325,7 @@ common_section () \
in_section = in_common; \
}
-extern void ssib_section PARAMS ((void));
+extern void ssib_section (void);
#define SSIB_SECTION \
void \
ssib_section () \
@@ -335,16 +333,7 @@ ssib_section () \
in_section = in_ssib; \
}
-/* This outputs text to go at the start of an assembler file. */
-
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) unicosmk_asm_file_start (FILE)
-
-/* This outputs text to go at the end of an assembler file. */
-
-#define TARGET_ASM_FILE_END unicosmk_file_end
-
-/* We take care of that in ASM_FILE_START. */
+/* We take care of this in unicosmk_file_start. */
#undef ASM_OUTPUT_SOURCE_FILENAME
diff --git a/gcc/config/alpha/vms-cc.c b/gcc/config/alpha/vms-cc.c
index 07b668f983d..faf98dde3b8 100644
--- a/gcc/config/alpha/vms-cc.c
+++ b/gcc/config/alpha/vms-cc.c
@@ -1,5 +1,5 @@
/* VMS DEC C wrapper.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003 Free Software Foundation, Inc.
Contributed by Douglas B. Rupp (rupp@gnat.com).
This file is part of GNU CC.
@@ -34,50 +34,47 @@ Boston, MA 02111-1307, USA. */
#define PATH_SEPARATOR_STR ","
/* These can be set by command line arguments */
-int verbose = 0;
-int save_temps = 0;
+static int verbose = 0;
+static int save_temps = 0;
-int comp_arg_max = -1;
-const char **comp_args = 0;
-int comp_arg_index = -1;
-char *objfilename = 0;
+static int comp_arg_max = -1;
+static const char **comp_args = 0;
+static int comp_arg_index = -1;
+static char *objfilename = 0;
-char *system_search_dirs = (char *) "";
-char *search_dirs;
+static char *system_search_dirs = (char *) "";
+static char *search_dirs;
-char *default_defines = (char *) "";
-char *defines;
+static char *default_defines = (char *) "";
+static char *defines;
/* Translate a Unix syntax directory specification into VMS syntax.
If indicators of VMS syntax found, return input string. */
-static char *to_host_dir_spec PARAMS ((char *));
+static char *to_host_dir_spec (char *);
/* Translate a Unix syntax file specification into VMS syntax.
If indicators of VMS syntax found, return input string. */
-static char *to_host_file_spec PARAMS ((char *));
+static char *to_host_file_spec (char *);
/* Add a translated arg to the list to be passed to DEC CC */
-static void addarg PARAMS ((const char *));
+static void addarg (const char *);
/* Preprocess the number of args in P_ARGC and contained in ARGV.
Look for special flags, etc. that must be handled first. */
-static void preprocess_args PARAMS ((int *, char **));
+static void preprocess_args (int *, char **);
/* Process the number of args in P_ARGC and contained in ARGV. Look
for special flags, etc. that must be handled for the VMS compiler. */
-static void process_args PARAMS ((int *, char **));
+static void process_args (int *, char **);
/* Action routine called by decc$to_vms */
-static int translate_unix PARAMS ((char *, int));
-
-int main PARAMS ((int, char **));
+static int translate_unix (char *, int);
/* Add the argument contained in STR to the list of arguments to pass to the
compiler. */
static void
-addarg (str)
- const char *str;
+addarg (const char *str)
{
int i;
@@ -100,9 +97,7 @@ addarg (str)
}
static void
-preprocess_args (p_argc, argv)
- int *p_argc;
- char *argv[];
+preprocess_args (int *p_argc, char *argv[])
{
int i;
@@ -122,9 +117,7 @@ preprocess_args (p_argc, argv)
}
static void
-process_args (p_argc, argv)
- int *p_argc;
- char *argv[];
+process_args (int *p_argc, char *argv[])
{
int i;
@@ -185,9 +178,7 @@ process_args (p_argc, argv)
typedef struct dsc {unsigned short len, mbz; char *adr; } Descr;
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int i;
char cwdev [128], *devptr;
@@ -320,17 +311,14 @@ static char new_host_dirspec [255];
static char filename_buff [256];
static int
-translate_unix (name, type)
- char *name;
- int type ATTRIBUTE_UNUSED;
+translate_unix (char *name, int type ATTRIBUTE_UNUSED)
{
strcpy (filename_buff, name);
return 0;
}
static char *
-to_host_dir_spec (dirspec)
- char *dirspec;
+to_host_dir_spec (char *dirspec)
{
int len = strlen (dirspec);
@@ -353,8 +341,7 @@ to_host_dir_spec (dirspec)
}
static char *
-to_host_file_spec (filespec)
- char *filespec;
+to_host_file_spec (char *filespec)
{
strcpy (new_host_filespec, "");
if (strchr (filespec, ']') || strchr (filespec, ':'))
diff --git a/gcc/config/alpha/vms-ld.c b/gcc/config/alpha/vms-ld.c
index 60e01d8ddd6..6ddfe5ad62a 100644
--- a/gcc/config/alpha/vms-ld.c
+++ b/gcc/config/alpha/vms-ld.c
@@ -1,5 +1,5 @@
/* VMS linker wrapper.
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Contributed by Douglas B. Rupp (rupp@gnat.com).
@@ -89,39 +89,38 @@ static char *search_dirs;
/* Add STR to the list of arguments to pass to the linker. Expand the list as
necessary to accommodate. */
-static void addarg PARAMS ((const char *));
+static void addarg (const char *);
/* Check to see if NAME is a regular file, i.e. not a directory */
-static int is_regular_file PARAMS ((char *));
+static int is_regular_file (char *);
/* Translate a Unix syntax file specification FILESPEC into VMS syntax.
If indicators of VMS syntax found, return input string. */
-static char *to_host_file_spec PARAMS ((char *));
+static char *to_host_file_spec (char *);
/* Locate the library named LIB_NAME in the set of paths PATH_VAL. */
-static char *locate_lib PARAMS ((char *, char *));
+static char *locate_lib (char *, char *);
/* Given a library name NAME, i.e. foo, Look for libfoo.lib and then
libfoo.a in the set of directories we are allowed to search in. */
-static const char *expand_lib PARAMS ((char *));
+static const char *expand_lib (char *);
/* Preprocess the number of args P_ARGC in ARGV.
Look for special flags, etc. that must be handled first. */
-static void preprocess_args PARAMS ((int *, char **));
+static void preprocess_args (int *, char **);
/* Preprocess the number of args P_ARGC in ARGV. Look for
special flags, etc. that must be handled for the VMS linker. */
-static void process_args PARAMS ((int *, char **));
+static void process_args (int *, char **);
/* Action routine called by decc$to_vms. NAME is a file name or
directory name. TYPE is unused. */
-static int translate_unix PARAMS ((char *, int));
+static int translate_unix (char *, int);
-int main PARAMS ((int, char **));
+int main (int, char **);
static void
-addarg (str)
- const char *str;
+addarg (const char *str)
{
int i;
@@ -144,9 +143,7 @@ addarg (str)
}
static char *
-locate_lib (lib_name, path_val)
- char *lib_name;
- char *path_val;
+locate_lib (char *lib_name, char *path_val)
{
int lib_len = strlen (lib_name);
char *eptr, *sptr;
@@ -206,8 +203,7 @@ locate_lib (lib_name, path_val)
}
static const char *
-expand_lib (name)
- char *name;
+expand_lib (char *name)
{
char *lib, *lib_path;
@@ -240,8 +236,7 @@ expand_lib (name)
}
static int
-is_regular_file (name)
- char *name;
+is_regular_file (char *name)
{
int ret;
struct stat statbuf;
@@ -251,9 +246,7 @@ is_regular_file (name)
}
static void
-preprocess_args (p_argc, argv)
- int *p_argc;
- char **argv;
+preprocess_args (int *p_argc, char **argv)
{
int i;
@@ -305,9 +298,7 @@ preprocess_args (p_argc, argv)
}
static void
-process_args (p_argc, argv)
- int *p_argc;
- char **argv;
+process_args (int *p_argc, char **argv)
{
int i;
@@ -381,9 +372,7 @@ process_args (p_argc, argv)
and args to be what the VMS linker wants. */
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int i;
char cwdev [128], *devptr;
@@ -753,17 +742,14 @@ static char new_host_filespec [255];
static char filename_buff [256];
static int
-translate_unix (name, type)
- char *name;
- int type ATTRIBUTE_UNUSED;
+translate_unix (char *name, int type ATTRIBUTE_UNUSED)
{
strcpy (filename_buff, name);
return 0;
}
static char *
-to_host_file_spec (filespec)
- char *filespec;
+to_host_file_spec (char *filespec)
{
strcpy (new_host_filespec, "");
if (strchr (filespec, ']') || strchr (filespec, ':'))
diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h
index 698e24941ae..f02e1992e43 100644
--- a/gcc/config/alpha/vms.h
+++ b/gcc/config/alpha/vms.h
@@ -242,21 +242,6 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info;
#undef STACK_CHECK_BUILTIN
#define STACK_CHECK_BUILTIN 0
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-{ \
- alpha_write_verstamp (FILE); \
- fprintf (FILE, "\t.set noreorder\n"); \
- fprintf (FILE, "\t.set volatile\n"); \
- if (TARGET_BWX | TARGET_MAX | TARGET_FIX | TARGET_CIX) \
- { \
- fprintf (FILE, "\t.arch %s\n", \
- (TARGET_CPU_EV6 ? "ev6" \
- : TARGET_MAX ? "pca56" : "ev56")); \
- } \
- ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
-}
-
#define LINK_SECTION_ASM_OP "\t.link"
#define READONLY_DATA_SECTION_ASM_OP "\t.rdata"
#define LITERALS_SECTION_ASM_OP "\t.literals"
@@ -287,8 +272,8 @@ literals_section () \
} \
}
-extern void link_section PARAMS ((void));
-extern void literals_section PARAMS ((void));
+extern void link_section (void);
+extern void literals_section (void);
#undef ASM_OUTPUT_ADDR_DIFF_ELT
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) abort ()
diff --git a/gcc/config/arc/arc-protos.h b/gcc/config/arc/arc-protos.h
index 717845eca0d..f5579892e7b 100644
--- a/gcc/config/arc/arc-protos.h
+++ b/gcc/config/arc/arc-protos.h
@@ -66,7 +66,6 @@ extern void arc_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *,
extern void arc_init PARAMS ((void));
-extern void arc_asm_file_start PARAMS ((FILE *));
extern unsigned int arc_compute_frame_size PARAMS ((int));
extern void arc_save_restore PARAMS ((FILE *, const char *, unsigned int,
unsigned int, const char *));
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 7673f6f4ccc..67e1b739f22 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -94,6 +94,7 @@ static tree arc_handle_interrupt_attribute PARAMS ((tree *, tree, tree, int, boo
static bool arc_assemble_integer PARAMS ((rtx, unsigned int, int));
static void arc_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void arc_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
+static void arc_file_start PARAMS ((void));
static void arc_internal_label PARAMS ((FILE *, const char *, unsigned long));
static bool arc_rtx_costs PARAMS ((rtx, int, int, int *));
static int arc_address_cost PARAMS ((rtx));
@@ -110,6 +111,8 @@ static int arc_address_cost PARAMS ((rtx));
#define TARGET_ASM_FUNCTION_PROLOGUE arc_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE arc_output_function_epilogue
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START arc_file_start
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE arc_attribute_table
#undef TARGET_ASM_INTERNAL_LABEL
@@ -1657,11 +1660,11 @@ arc_initialize_trampoline (tramp, fnaddr, cxt)
/* Set the cpu type and print out other fancy things,
at the top of the file. */
-void
-arc_asm_file_start (file)
- FILE *file;
+static void
+arc_file_start ()
{
- fprintf (file, "\t.cpu %s\n", arc_cpu_string);
+ default_file_start ();
+ fprintf (asm_out_file, "\t.cpu %s\n", arc_cpu_string);
}
/* Print operand X (an rtx) in assembler syntax to file FILE.
diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index 7bb9231d67b..16d6d7108cf 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -1110,10 +1110,6 @@ extern const char *arc_text_section, *arc_data_section, *arc_rodata_section;
/* Control the assembler format that we output. */
-/* Output at beginning of assembler file. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) arc_asm_file_start (FILE)
-
/* A C string constant describing how to begin a comment in the target
assembler language. The compiler assumes that the comment will
end at the end of the line. */
diff --git a/gcc/config/arm/aof.h b/gcc/config/arm/aof.h
index 82749ffff81..2650a0eedd2 100644
--- a/gcc/config/arm/aof.h
+++ b/gcc/config/arm/aof.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler, for Advanced RISC Machines
ARM compilation, AOF Assembler.
- Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 2000, 2003 Free Software Foundation, Inc.
Contributed by Richard Earnshaw (rearnsha@armltd.co.uk)
This file is part of GCC.
@@ -59,64 +59,70 @@
#define EXTRA_SECTIONS in_zero_init, in_common
#define EXTRA_SECTION_FUNCTIONS \
-ZERO_INIT_SECTION \
-COMMON_SECTION
+ ZERO_INIT_SECTION \
+ COMMON_SECTION
#define ZERO_INIT_SECTION \
-void \
-zero_init_section () \
-{ \
- static int zero_init_count = 1; \
- if (in_section != in_zero_init) \
- { \
- fprintf (asm_out_file, "\tAREA |C$$zidata%d|,NOINIT\n", \
- zero_init_count++); \
- in_section = in_zero_init; \
- } \
-}
+ void \
+ zero_init_section () \
+ { \
+ static int zero_init_count = 1; \
+ \
+ if (in_section != in_zero_init) \
+ { \
+ fprintf (asm_out_file, "\tAREA |C$$zidata%d|,NOINIT\n", \
+ zero_init_count++); \
+ in_section = in_zero_init; \
+ } \
+ }
/* Used by ASM_OUTPUT_COMMON (below) to tell varasm.c that we've
changed areas. */
#define COMMON_SECTION \
-void \
-common_section () \
-{ \
- if (in_section != in_common) \
- { \
+ void \
+ common_section () \
+ { \
+ if (in_section != in_common) \
in_section = in_common; \
- } \
-}
-#define CTOR_LIST_BEGIN \
-asm (CTORS_SECTION_ASM_OP); \
-extern func_ptr __CTOR_END__[1]; \
-func_ptr __CTOR_LIST__[1] = {__CTOR_END__};
+ }
-#define CTOR_LIST_END \
-asm (CTORS_SECTION_ASM_OP); \
-func_ptr __CTOR_END__[1] = { (func_ptr) 0 };
+#define CTOR_LIST_BEGIN \
+ asm (CTORS_SECTION_ASM_OP); \
+ extern func_ptr __CTOR_END__[1]; \
+ func_ptr __CTOR_LIST__[1] = {__CTOR_END__};
-#define DO_GLOBAL_CTORS_BODY \
-do { \
- func_ptr *ptr = __CTOR_LIST__ + 1; \
- while (*ptr) \
- (*ptr++) (); \
-} while (0)
+#define CTOR_LIST_END \
+ asm (CTORS_SECTION_ASM_OP); \
+ func_ptr __CTOR_END__[1] = { (func_ptr) 0 };
-#define DTOR_LIST_BEGIN \
-asm (DTORS_SECTION_ASM_OP); \
-extern func_ptr __DTOR_END__[1]; \
-func_ptr __DTOR_LIST__[1] = {__DTOR_END__};
+#define DO_GLOBAL_CTORS_BODY \
+ do \
+ { \
+ func_ptr *ptr = __CTOR_LIST__ + 1; \
+ \
+ while (*ptr) \
+ (*ptr++) (); \
+ } \
+ while (0)
-#define DTOR_LIST_END \
-asm (DTORS_SECTION_ASM_OP); \
-func_ptr __DTOR_END__[1] = { (func_ptr) 0 };
+#define DTOR_LIST_BEGIN \
+ asm (DTORS_SECTION_ASM_OP); \
+ extern func_ptr __DTOR_END__[1]; \
+ func_ptr __DTOR_LIST__[1] = {__DTOR_END__};
-#define DO_GLOBAL_DTORS_BODY \
-do { \
- func_ptr *ptr = __DTOR_LIST__ + 1; \
- while (*ptr) \
- (*ptr++) (); \
-} while (0)
+#define DTOR_LIST_END \
+ asm (DTORS_SECTION_ASM_OP); \
+ func_ptr __DTOR_END__[1] = { (func_ptr) 0 };
+
+#define DO_GLOBAL_DTORS_BODY \
+ do \
+ { \
+ func_ptr *ptr = __DTOR_LIST__ + 1; \
+ \
+ while (*ptr) \
+ (*ptr++) (); \
+ } \
+ while (0)
/* We really want to put Thumb tables in a read-only data section, but
switching to another section during function output is not
@@ -124,45 +130,6 @@ do { \
whole table generation until the end of the function. */
#define JUMP_TABLES_IN_TEXT_SECTION 1
-#ifndef ARM_OS_NAME
-#define ARM_OS_NAME "(generic)"
-#endif
-
-/* For the AOF linker, we need to reference __main to force the standard
- library to get linked in. */
-
-#define ASM_FILE_START(STREAM) \
-{ \
- fprintf ((STREAM), "%s Generated by gcc %s for ARM/%s\n", \
- ASM_COMMENT_START, version_string, ARM_OS_NAME); \
- fprintf ((STREAM), "__r0\tRN\t0\n"); \
- fprintf ((STREAM), "__a1\tRN\t0\n"); \
- fprintf ((STREAM), "__a2\tRN\t1\n"); \
- fprintf ((STREAM), "__a3\tRN\t2\n"); \
- fprintf ((STREAM), "__a4\tRN\t3\n"); \
- fprintf ((STREAM), "__v1\tRN\t4\n"); \
- fprintf ((STREAM), "__v2\tRN\t5\n"); \
- fprintf ((STREAM), "__v3\tRN\t6\n"); \
- fprintf ((STREAM), "__v4\tRN\t7\n"); \
- fprintf ((STREAM), "__v5\tRN\t8\n"); \
- fprintf ((STREAM), "__v6\tRN\t9\n"); \
- fprintf ((STREAM), "__sl\tRN\t10\n"); \
- fprintf ((STREAM), "__fp\tRN\t11\n"); \
- fprintf ((STREAM), "__ip\tRN\t12\n"); \
- fprintf ((STREAM), "__sp\tRN\t13\n"); \
- fprintf ((STREAM), "__lr\tRN\t14\n"); \
- fprintf ((STREAM), "__pc\tRN\t15\n"); \
- fprintf ((STREAM), "__f0\tFN\t0\n"); \
- fprintf ((STREAM), "__f1\tFN\t1\n"); \
- fprintf ((STREAM), "__f2\tFN\t2\n"); \
- fprintf ((STREAM), "__f3\tFN\t3\n"); \
- fprintf ((STREAM), "__f4\tFN\t4\n"); \
- fprintf ((STREAM), "__f5\tFN\t5\n"); \
- fprintf ((STREAM), "__f6\tFN\t6\n"); \
- fprintf ((STREAM), "__f7\tFN\t7\n"); \
- text_section (); \
-}
-
/* Some systems use __main in a way incompatible with its use in gcc, in these
cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to
give the same symbol without quotes for an alternative entry point. You
@@ -171,12 +138,10 @@ do { \
#define SYMBOL__MAIN __gccmain
#define ASM_COMMENT_START ";"
+#define ASM_APP_ON ""
+#define ASM_APP_OFF ""
-#define ASM_APP_ON ""
-
-#define ASM_APP_OFF ""
-
-#define ASM_OUTPUT_ASCII(STREAM,PTR,LEN) \
+#define ASM_OUTPUT_ASCII(STREAM, PTR, LEN) \
{ \
int i; \
const char *ptr = (PTR); \
@@ -184,23 +149,23 @@ do { \
for (i = 0; i < (long)(LEN); i++) \
fprintf ((STREAM), " &%02x%s", \
(unsigned ) *(ptr++), \
- (i + 1 < (long)(LEN) \
+ (i + 1 < (long)(LEN) \
? ((i & 3) == 3 ? "\n\tDCB" : ",") \
: "\n")); \
}
#define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == '\n')
-/* Output of Uninitialized Variables */
+/* Output of Uninitialized Variables. */
-#define ASM_OUTPUT_COMMON(STREAM,NAME,SIZE,ROUNDED) \
+#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
(common_section (), \
fprintf ((STREAM), "\tAREA "), \
assemble_name ((STREAM), (NAME)), \
fprintf ((STREAM), ", DATA, COMMON\n\t%% %d\t%s size=%d\n", \
(int)(ROUNDED), ASM_COMMENT_START, (int)(SIZE)))
-#define ASM_OUTPUT_LOCAL(STREAM,NAME,SIZE,ROUNDED) \
+#define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED) \
(zero_init_section (), \
assemble_name ((STREAM), (NAME)), \
fprintf ((STREAM), "\n"), \
@@ -208,7 +173,6 @@ do { \
(int)(ROUNDED), ASM_COMMENT_START, (int)(SIZE)))
/* Output and Generation of Labels */
-
extern int arm_main_function;
/* Globalizing directive for a label. */
@@ -258,22 +222,31 @@ do { \
#define ASM_GENERATE_INTERNAL_LABEL(STRING,PREFIX,NUM) \
sprintf ((STRING), "*|%s..%ld|", (PREFIX), (long)(NUM))
-/* How initialization functions are handled */
+/* How initialization functions are handled. */
#define CTORS_SECTION_ASM_OP "\tAREA\t|C$$gnu_ctorsvec|, DATA, READONLY"
#define DTORS_SECTION_ASM_OP "\tAREA\t|C$$gnu_dtorsvec|, DATA, READONLY"
-/* Output of Assembler Instructions */
-
-#define REGISTER_NAMES \
-{ \
- "a1", "a2", "a3", "a4", \
- "v1", "v2", "v3", "v4", \
- "v5", "v6", "sl", "fp", \
- "ip", "sp", "lr", "pc", \
- "f0", "f1", "f2", "f3", \
- "f4", "f5", "f6", "f7", \
- "cc", "sfp", "afp" \
+/* Output of Assembler Instructions. */
+
+#define REGISTER_NAMES \
+{ \
+ "a1", "a2", "a3", "a4", \
+ "v1", "v2", "v3", "v4", \
+ "v5", "v6", "sl", "fp", \
+ "ip", "sp", "lr", "pc", \
+ "f0", "f1", "f2", "f3", \
+ "f4", "f5", "f6", "f7", \
+ "cc", "sfp", "afp", \
+ "mv0", "mv1", "mv2", "mv3", \
+ "mv4", "mv5", "mv6", "mv7", \
+ "mv8", "mv9", "mv10", "mv11", \
+ "mv12", "mv13", "mv14", "mv15", \
+ "wcgr0", "wcgr1", "wcgr2", "wcgr3", \
+ "wr0", "wr1", "wr2", "wr3", \
+ "wr4", "wr5", "wr6", "wr7", \
+ "wr8", "wr9", "wr10", "wr11", \
+ "wr12", "wr13", "wr14", "wr15" \
}
#define ADDITIONAL_REGISTER_NAMES \
@@ -303,37 +276,40 @@ do { \
/* AOF does not prefix user function names with an underscore. */
#define ARM_MCOUNT_NAME "_mcount"
-/* Output of Dispatch Tables */
-
-#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM,BODY,VALUE,REL) \
- do { \
- if (TARGET_ARM) \
- fprintf ((STREAM), "\tb\t|L..%d|\n", (VALUE)); \
- else \
- fprintf ((STREAM), "\tDCD\t|L..%d| - |L..%d|\n", (VALUE), (REL)); \
- } while (0)
-
-#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM,VALUE) \
+/* Output of Dispatch Tables. */
+#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
+ do \
+ { \
+ if (TARGET_ARM) \
+ fprintf ((STREAM), "\tb\t|L..%d|\n", (VALUE)); \
+ else \
+ fprintf ((STREAM), "\tDCD\t|L..%d| - |L..%d|\n", (VALUE), (REL)); \
+ } \
+ while (0)
+
+#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
fprintf ((STREAM), "\tDCD\t|L..%d|\n", (VALUE))
/* A label marking the start of a jump table is a data label. */
-#define ASM_OUTPUT_CASE_LABEL(STREAM,PREFIX,NUM,TABLE) \
+#define ASM_OUTPUT_CASE_LABEL(STREAM, PREFIX, NUM, TABLE) \
fprintf ((STREAM), "\tALIGN\n|%s..%d|\n", (PREFIX), (NUM))
-/* Assembler Commands for Alignment */
-
-#define ASM_OUTPUT_SKIP(STREAM,NBYTES) \
- fprintf ((STREAM), "\t%%\t%d\n", (int)(NBYTES))
-
-#define ASM_OUTPUT_ALIGN(STREAM,POWER) \
-do { \
- register int amount = 1 << (POWER); \
- if (amount == 2) \
- fprintf ((STREAM), "\tALIGN 2\n"); \
- else if (amount == 4) \
- fprintf ((STREAM), "\tALIGN\n"); \
- else \
- fprintf ((STREAM), "\tALIGN %d\n", amount); \
-} while (0)
+/* Assembler Commands for Alignment. */
+#define ASM_OUTPUT_SKIP(STREAM, NBYTES) \
+ fprintf ((STREAM), "\t%%\t%d\n", (int) (NBYTES))
+
+#define ASM_OUTPUT_ALIGN(STREAM, POWER) \
+ do \
+ { \
+ int amount = 1 << (POWER); \
+ \
+ if (amount == 2) \
+ fprintf ((STREAM), "\tALIGN 2\n"); \
+ else if (amount == 4) \
+ fprintf ((STREAM), "\tALIGN\n"); \
+ else \
+ fprintf ((STREAM), "\tALIGN %d\n", amount); \
+ } \
+ while (0)
#undef DBX_DEBUGGING_INFO
diff --git a/gcc/config/arm/aout.h b/gcc/config/arm/aout.h
index 71fa43b4964..1f060fafc7b 100644
--- a/gcc/config/arm/aout.h
+++ b/gcc/config/arm/aout.h
@@ -20,24 +20,6 @@
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef ARM_OS_NAME
-#define ARM_OS_NAME "(generic)"
-#endif
-
-/* The text to go at the start of the assembler file. */
-#ifndef ASM_FILE_START
-#define ASM_FILE_START(STREAM) \
-{ \
- asm_fprintf (STREAM,"%Rrfp\t.req\t%Rr9\n"); \
- asm_fprintf (STREAM,"%Rsl\t.req\t%Rr10\n"); \
- asm_fprintf (STREAM,"%Rfp\t.req\t%Rr11\n"); \
- asm_fprintf (STREAM,"%Rip\t.req\t%Rr12\n"); \
- asm_fprintf (STREAM,"%Rsp\t.req\t%Rr13\n"); \
- asm_fprintf (STREAM,"%Rlr\t.req\t%Rr14\n"); \
- asm_fprintf (STREAM,"%Rpc\t.req\t%Rr15\n"); \
-}
-#endif
-
#ifndef ASM_APP_ON
#define ASM_APP_ON ""
#endif
@@ -65,7 +47,6 @@
#define LOCAL_LABEL_PREFIX ""
#endif
-
/* The assembler's names for the registers. */
#ifndef REGISTER_NAMES
#define REGISTER_NAMES \
@@ -74,9 +55,15 @@
"r8", "r9", "sl", "fp", "ip", "sp", "lr", "pc", \
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
"cc", "sfp", "afp", \
- "mv0", "mv1", "mv2", "mv3", "mv4", "mv5", \
- "mv6", "mv7", "mv8", "mv9", "mv10", "mv11",\
- "mv12", "mv13", "mv14", "mv15" \
+ "mv0", "mv1", "mv2", "mv3", \
+ "mv4", "mv5", "mv6", "mv7", \
+ "mv8", "mv9", "mv10", "mv11", \
+ "mv12", "mv13", "mv14", "mv15", \
+ "wcgr0", "wcgr1", "wcgr2", "wcgr3", \
+ "wr0", "wr1", "wr2", "wr3", \
+ "wr4", "wr5", "wr6", "wr7", \
+ "wr8", "wr9", "wr10", "wr11", \
+ "wr12", "wr13", "wr14", "wr15" \
}
#endif
@@ -235,12 +222,12 @@
#undef ASM_OUTPUT_ASCII
#define ASM_OUTPUT_ASCII(STREAM, PTR, LEN) \
- output_ascii_pseudo_op (STREAM, (const unsigned char *)(PTR), LEN)
+ output_ascii_pseudo_op (STREAM, (const unsigned char *) (PTR), LEN)
/* Output a gap. In fact we fill it with nulls. */
#undef ASM_OUTPUT_SKIP
#define ASM_OUTPUT_SKIP(STREAM, NBYTES) \
- fprintf (STREAM, "\t.space\t%d\n", (int)(NBYTES))
+ fprintf (STREAM, "\t.space\t%d\n", (int) (NBYTES))
/* Align output to a power of two. Horrible /bin/as. */
#ifndef ASM_OUTPUT_ALIGN
@@ -291,9 +278,6 @@
#define ASM_OUTPUT_ALIGNED_BSS(STREAM, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (STREAM, DECL, NAME, SIZE, ALIGN)
#endif
-
-/* Output a source line for the debugger. */
-/* #define ASM_OUTPUT_SOURCE_LINE(STREAM,LINE) */
/* Output a #ident directive. */
#ifndef ASM_OUTPUT_IDENT
diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index 62674bc0a2d..fe424d7c22e 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -135,6 +135,8 @@ extern void arm_final_prescan_insn (rtx);
extern int arm_go_if_legitimate_address (enum machine_mode, rtx);
extern int arm_debugger_arg_offset (int, rtx);
extern int arm_is_longcall_p (rtx, int, int);
+extern int arm_emit_vector_const (FILE *, rtx);
+extern const char * arm_output_load_gr (rtx *);
#if defined TREE_CODE
extern rtx arm_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index cd2b149ea3f..c0ee99ed8c3 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -55,12 +55,6 @@
typedef struct minipool_node Mnode;
typedef struct minipool_fixup Mfix;
-const char extra_reg_names1[][16] =
-{ "mv0", "mv1", "mv2", "mv3", "mv4", "mv5", "mv6", "mv7",
- "mv8", "mv9", "mv10", "mv11", "mv12", "mv13", "mv14", "mv15"
-};
-#define extra_reg_names1 bogus1_regnames
-
const struct attribute_spec arm_attribute_table[];
/* Forward function declarations. */
@@ -135,6 +129,14 @@ static int arm_address_cost (rtx);
static bool arm_memory_load_p (rtx);
static bool arm_cirrus_insn_p (rtx);
static void cirrus_reorg (rtx);
+static void arm_init_builtins (void);
+static rtx arm_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
+static void arm_init_iwmmxt_builtins (void);
+static rtx safe_vector_operand (rtx, enum machine_mode);
+static rtx arm_expand_binop_builtin (enum insn_code, tree, rtx);
+static rtx arm_expand_unop_builtin (enum insn_code, tree, rtx, int);
+static rtx arm_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
+
#ifdef OBJECT_FORMAT_ELF
static void arm_elf_asm_named_section (const char *, unsigned int);
#endif
@@ -145,6 +147,7 @@ static void arm_encode_section_info (tree, rtx, int);
static void aof_globalize_label (FILE *, const char *);
static void aof_dump_imports (FILE *);
static void aof_dump_pic_table (FILE *);
+static void aof_file_start (void);
static void aof_file_end (void);
#endif
@@ -167,6 +170,8 @@ static void aof_file_end (void);
#define TARGET_ASM_ALIGNED_SI_OP "\tDCD\t"
#undef TARGET_ASM_GLOBALIZE_LABEL
#define TARGET_ASM_GLOBALIZE_LABEL aof_globalize_label
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START aof_file_start
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END aof_file_end
#else
@@ -201,28 +206,33 @@ static void aof_file_end (void);
#define TARGET_ENCODE_SECTION_INFO arm_encode_section_info
#endif
-#undef TARGET_STRIP_NAME_ENCODING
+#undef TARGET_STRIP_NAME_ENCODING
#define TARGET_STRIP_NAME_ENCODING arm_strip_name_encoding
-#undef TARGET_ASM_INTERNAL_LABEL
+#undef TARGET_ASM_INTERNAL_LABEL
#define TARGET_ASM_INTERNAL_LABEL arm_internal_label
-#undef TARGET_FUNCTION_OK_FOR_SIBCALL
+#undef TARGET_FUNCTION_OK_FOR_SIBCALL
#define TARGET_FUNCTION_OK_FOR_SIBCALL arm_function_ok_for_sibcall
-#undef TARGET_ASM_OUTPUT_MI_THUNK
+#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK arm_output_mi_thunk
-#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
+#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall
-#undef TARGET_RTX_COSTS
+#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS arm_rtx_costs
-#undef TARGET_ADDRESS_COST
+#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST arm_address_cost
-#undef TARGET_MACHINE_DEPENDENT_REORG
+#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG arm_reorg
+#undef TARGET_INIT_BUILTINS
+#define TARGET_INIT_BUILTINS arm_init_builtins
+#undef TARGET_EXPAND_BUILTIN
+#define TARGET_EXPAND_BUILTIN arm_expand_builtin
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Obstack for minipool constant handling. */
@@ -271,6 +281,7 @@ int arm_structure_size_boundary = DEFAULT_STRUCTURE_SIZE_BOUNDARY;
#define FL_ARCH5E (1 << 9) /* DSP extensions to v5 */
#define FL_XSCALE (1 << 10) /* XScale */
#define FL_CIRRUS (1 << 11) /* Cirrus/DSP. */
+#define FL_IWMMXT (1 << 29) /* XScale v2 or "Intel Wireless MMX technology". */
/* The bits in this mask specify which
instructions we are allowed to generate. */
@@ -303,6 +314,9 @@ int arm_ld_sched = 0;
/* Nonzero if this chip is a StrongARM. */
int arm_is_strong = 0;
+/* Nonzero if this chip supports Intel Wireless MMX technology. */
+int arm_arch_iwmmxt = 0;
+
/* Nonzero if this chip is an XScale. */
int arm_arch_xscale = 0;
@@ -413,6 +427,7 @@ static const struct processors all_cores[] =
{"arm10tdmi", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5 },
{"arm1020t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5 },
{"xscale", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE },
+ {"iwmmxt", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT },
{NULL, 0}
};
@@ -433,6 +448,7 @@ static const struct processors all_architectures[] =
{ "armv5t", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 },
{ "armv5te", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E },
{ "ep9312", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_CIRRUS },
+ {"iwmmxt", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT },
{ NULL, 0 }
};
@@ -530,6 +546,7 @@ arm_override_options (void)
{ TARGET_CPU_strongarm, "strongarm" },
{ TARGET_CPU_xscale, "xscale" },
{ TARGET_CPU_ep9312, "ep9312" },
+ { TARGET_CPU_iwmmxt, "iwmmxt" },
{ TARGET_CPU_generic, "arm" },
{ 0, 0 }
};
@@ -730,6 +747,10 @@ arm_override_options (void)
&& !(tune_flags & FL_ARCH4))) != 0;
arm_tune_xscale = (tune_flags & FL_XSCALE) != 0;
arm_is_cirrus = (tune_flags & FL_CIRRUS) != 0;
+ arm_arch_iwmmxt = (insn_flags & FL_IWMMXT) != 0;
+
+ if (TARGET_IWMMXT && (! TARGET_ATPCS))
+ target_flags |= ARM_FLAG_ATPCS;
if (arm_is_cirrus)
{
@@ -888,7 +909,7 @@ arm_isr_value (tree argument)
arg = TREE_STRING_POINTER (TREE_VALUE (argument));
/* Check it against the list of known arguments. */
- for (ptr = isr_attribute_args; ptr->arg != NULL; ptr ++)
+ for (ptr = isr_attribute_args; ptr->arg != NULL; ptr++)
if (streq (arg, ptr->arg))
return ptr->return_value;
@@ -1020,6 +1041,11 @@ use_return_insn (int iscond)
if (regs_ever_live[regno] && !call_used_regs[regno])
return 0;
+ if (TARGET_REALLY_IWMMXT)
+ for (regno = FIRST_IWMMXT_REGNUM; regno <= LAST_IWMMXT_REGNUM; regno++)
+ if (regs_ever_live[regno] && ! call_used_regs [regno])
+ return 0;
+
return 1;
}
@@ -1943,6 +1969,7 @@ arm_init_cumulative_args (CUMULATIVE_ARGS *pcum, tree fntype,
{
/* On the ARM, the offset starts at 0. */
pcum->nregs = ((fntype && aggregate_value_p (TREE_TYPE (fntype))) ? 1 : 0);
+ pcum->iwmmxt_nregs = 0;
pcum->call_cookie = CALL_NORMAL;
@@ -1958,6 +1985,24 @@ arm_init_cumulative_args (CUMULATIVE_ARGS *pcum, tree fntype,
else if (lookup_attribute ("long_call", TYPE_ATTRIBUTES (fntype)))
pcum->call_cookie = CALL_LONG;
}
+
+ /* Varargs vectors are treated the same as long long.
+ named_count avoids having to change the way arm handles 'named' */
+ pcum->named_count = 0;
+ pcum->nargs = 0;
+
+ if (TARGET_REALLY_IWMMXT && fntype)
+ {
+ tree fn_arg;
+
+ for (fn_arg = TYPE_ARG_TYPES (fntype);
+ fn_arg;
+ fn_arg = TREE_CHAIN (fn_arg))
+ pcum->named_count += 1;
+
+ if (! pcum->named_count)
+ pcum->named_count = INT_MAX;
+ }
}
/* Determine where to put an argument to a function.
@@ -1977,6 +2022,30 @@ rtx
arm_function_arg (CUMULATIVE_ARGS *pcum, enum machine_mode mode,
tree type ATTRIBUTE_UNUSED, int named)
{
+ if (TARGET_REALLY_IWMMXT)
+ {
+ if (VECTOR_MODE_SUPPORTED_P (mode))
+ {
+ /* varargs vectors are treated the same as long long.
+ named_count avoids having to change the way arm handles 'named' */
+ if (pcum->named_count <= pcum->nargs + 1)
+ {
+ if (pcum->nregs == 1)
+ pcum->nregs += 1;
+ if (pcum->nregs <= 2)
+ return gen_rtx_REG (mode, pcum->nregs);
+ else
+ return NULL_RTX;
+ }
+ else if (pcum->iwmmxt_nregs <= 9)
+ return gen_rtx_REG (mode, pcum->iwmmxt_nregs + FIRST_IWMMXT_REGNUM);
+ else
+ return NULL_RTX;
+ }
+ else if ((mode == DImode || mode == DFmode) && pcum->nregs & 1)
+ pcum->nregs += 1;
+ }
+
if (mode == VOIDmode)
/* Compute operand 2 of the call insn. */
return GEN_INT (pcum->call_cookie);
@@ -2010,6 +2079,26 @@ arm_va_arg (tree valist, tree type)
return gen_rtx_MEM (ptr_mode, force_reg (Pmode, addr));
}
+ if (FUNCTION_ARG_BOUNDARY (TYPE_MODE (type), NULL) == IWMMXT_ALIGNMENT)
+ {
+ tree minus_eight;
+ tree t;
+
+ /* Maintain 64-bit alignment of the valist pointer by
+ contructing: valist = ((valist + (8 - 1)) & -8). */
+ minus_eight = build_int_2 (- (IWMMXT_ALIGNMENT / BITS_PER_UNIT), -1);
+ t = build_int_2 ((IWMMXT_ALIGNMENT / BITS_PER_UNIT) - 1, 0);
+ t = build (PLUS_EXPR, TREE_TYPE (valist), valist, t);
+ t = build (BIT_AND_EXPR, TREE_TYPE (t), t, minus_eight);
+ t = build (MODIFY_EXPR, TREE_TYPE (valist), valist, t);
+ TREE_SIDE_EFFECTS (t) = 1;
+ expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
+
+ /* This is to stop the combine pass optimising
+ away the alignment adjustment. */
+ mark_reg_pointer (arg_pointer_rtx, PARM_BOUNDARY);
+ }
+
return std_expand_builtin_va_arg (valist, type);
}
@@ -2316,6 +2405,9 @@ arm_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
{
int call_type = TARGET_LONG_CALLS ? CALL_LONG : CALL_NORMAL;
+ if (cfun->machine->sibcall_blocked)
+ return false;
+
/* Never tailcall something for which we have no decl, or if we
are in Thumb mode. */
if (decl == NULL || TARGET_THUMB)
@@ -2661,6 +2753,11 @@ arm_legitimate_index_p (enum machine_mode mode, rtx index, int strict_p)
&& GET_MODE_SIZE (mode) <= 4)
return 1;
+ if (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (mode))
+ return (code == CONST_INT
+ && INTVAL (index) < 256
+ && INTVAL (index) > -256);
+
/* XXX What about ldrsb? */
if (GET_MODE_SIZE (mode) <= 4 && code == MULT
&& (!arm_arch4 || (mode) != HImode))
@@ -3298,6 +3395,13 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer)
case SImode:
return (1 + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
+ case V8QImode:
+ case V4HImode:
+ case V2SImode:
+ case V4QImode:
+ case V2HImode:
+ return 1;
+
default:
break;
}
@@ -5820,6 +5924,21 @@ arm_print_value (FILE *f, rtx x)
fprintf (f, "<0x%lx,0x%lx>", (long)XWINT (x, 2), (long)XWINT (x, 3));
return;
+ case CONST_VECTOR:
+ {
+ int i;
+
+ fprintf (f, "<");
+ for (i = 0; i < CONST_VECTOR_NUNITS (x); i++)
+ {
+ fprintf (f, HOST_WIDE_INT_PRINT_HEX, INTVAL (CONST_VECTOR_ELT (x, i)));
+ if (i < (CONST_VECTOR_NUNITS (x) - 1))
+ fputc (',', f);
+ }
+ fprintf (f, ">");
+ }
+ return;
+
case CONST_STRING:
fprintf (f, "\"%s\"", XSTR (x, 0));
return;
@@ -5940,6 +6059,8 @@ struct minipool_node
rtx value;
/* The mode of value. */
enum machine_mode mode;
+ /* The size of the value. With iWMMXt enabled
+ sizes > 4 also imply an alignment of 8-bytes. */
int fix_size;
};
@@ -6115,6 +6236,19 @@ add_minipool_forward_ref (Mfix *fix)
if (max_mp == NULL
&& mp->max_address > max_address)
max_mp = mp;
+
+ /* If we are inserting an 8-bytes aligned quantity and
+ we have not already found an insertion point, then
+ make sure that all such 8-byte aligned quantities are
+ placed at the start of the pool. */
+ if (TARGET_REALLY_IWMMXT
+ && max_mp == NULL
+ && fix->fix_size == 8
+ && mp->fix_size != 8)
+ {
+ max_mp = mp;
+ max_address = mp->max_address;
+ }
}
/* The value is not currently in the minipool, so we need to create
@@ -6288,7 +6422,14 @@ add_minipool_backward_ref (Mfix *fix)
{
/* Note the insertion point if necessary. */
if (mp->min_address < min_address)
- min_mp = mp;
+ {
+ /* For now, we do not allow the insertion of 8-byte alignment
+ requiring nodes anywhere but at the start of the pool. */
+ if (TARGET_REALLY_IWMMXT && fix->fix_size == 8 && mp->fix_size != 8)
+ return NULL;
+ else
+ min_mp = mp;
+ }
else if (mp->max_address
< minipool_barrier->address + mp->offset + fix->fix_size)
{
@@ -6299,6 +6440,18 @@ add_minipool_backward_ref (Mfix *fix)
min_mp = mp;
min_address = mp->min_address + fix->fix_size;
}
+ /* If we are inserting an 8-bytes aligned quantity and
+ we have not already found an insertion point, then
+ make sure that all such 8-byte aligned quantities are
+ placed at the start of the pool. */
+ else if (TARGET_REALLY_IWMMXT
+ && min_mp == NULL
+ && fix->fix_size == 8
+ && mp->fix_size < 8)
+ {
+ min_mp = mp;
+ min_address = mp->min_address + fix->fix_size;
+ }
}
}
@@ -6385,16 +6538,25 @@ assign_minipool_offsets (Mfix *barrier)
static void
dump_minipool (rtx scan)
{
- Mnode *mp;
- Mnode *nmp;
+ Mnode * mp;
+ Mnode * nmp;
+ int align64 = 0;
+
+ if (TARGET_REALLY_IWMMXT)
+ for (mp = minipool_vector_head; mp != NULL; mp = mp->next)
+ if (mp->refcount > 0 && mp->fix_size == 8)
+ {
+ align64 = 1;
+ break;
+ }
if (rtl_dump_file)
fprintf (rtl_dump_file,
- ";; Emitting minipool after insn %u; address %ld\n",
- INSN_UID (scan), (unsigned long) minipool_barrier->address);
+ ";; Emitting minipool after insn %u; address %ld; align %d (bytes)\n",
+ INSN_UID (scan), (unsigned long) minipool_barrier->address, align64 ? 8 : 4);
scan = emit_label_after (gen_label_rtx (), scan);
- scan = emit_insn_after (gen_align_4 (), scan);
+ scan = emit_insn_after (align64 ? gen_align_8 () : gen_align_4 (), scan);
scan = emit_label_after (minipool_vector_label, scan);
for (mp = minipool_vector_head; mp != NULL; mp = nmp)
@@ -6622,6 +6784,13 @@ push_minipool_fix (rtx insn, HOST_WIDE_INT address, rtx *loc,
if (fix->forwards == 0 && fix->backwards == 0)
abort ();
+ /* With iWMMXt enabled, the pool is aligned to an 8-byte boundary.
+ So there might be an empty word before the start of the pool.
+ Hence we reduce the forward range by 4 to allow for this
+ possibility. */
+ if (TARGET_REALLY_IWMMXT && fix->fix_size == 8)
+ fix->forwards -= 4;
+
if (rtl_dump_file)
{
fprintf (rtl_dump_file,
@@ -7137,6 +7306,105 @@ output_move_double (rtx *operands)
else
output_asm_insn ("mov%?\t%R0, %R1\n\tmov%?\t%Q0, %Q1", operands);
}
+ else if (code1 == CONST_VECTOR)
+ {
+ HOST_WIDE_INT hint = 0;
+
+ switch (GET_MODE (operands[1]))
+ {
+ case V2SImode:
+ otherops[1] = GEN_INT (INTVAL (CONST_VECTOR_ELT (operands[1], 1)));
+ operands[1] = GEN_INT (INTVAL (CONST_VECTOR_ELT (operands[1], 0)));
+ break;
+
+ case V4HImode:
+ if (BYTES_BIG_ENDIAN)
+ {
+ hint = INTVAL (CONST_VECTOR_ELT (operands[1], 2));
+ hint <<= 16;
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 3));
+ }
+ else
+ {
+ hint = INTVAL (CONST_VECTOR_ELT (operands[1], 3));
+ hint <<= 16;
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 2));
+ }
+
+ otherops[1] = GEN_INT (hint);
+ hint = 0;
+
+ if (BYTES_BIG_ENDIAN)
+ {
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 0));
+ hint <<= 16;
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 1));
+ }
+ else
+ {
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 1));
+ hint <<= 16;
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 0));
+ }
+
+ operands[1] = GEN_INT (hint);
+ break;
+
+ case V8QImode:
+ if (BYTES_BIG_ENDIAN)
+ {
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 4));
+ hint <<= 8;
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 5));
+ hint <<= 8;
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 6));
+ hint <<= 8;
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 7));
+ }
+ else
+ {
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 7));
+ hint <<= 8;
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 6));
+ hint <<= 8;
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 5));
+ hint <<= 8;
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 4));
+ }
+
+ otherops[1] = GEN_INT (hint);
+ hint = 0;
+
+ if (BYTES_BIG_ENDIAN)
+ {
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 0));
+ hint <<= 8;
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 1));
+ hint <<= 8;
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 2));
+ hint <<= 8;
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 3));
+ }
+ else
+ {
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 3));
+ hint <<= 8;
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 2));
+ hint <<= 8;
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 1));
+ hint <<= 8;
+ hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 0));
+ }
+
+ operands[1] = GEN_INT (hint);
+ break;
+
+ default:
+ abort ();
+ }
+ output_mov_immediate (operands);
+ output_mov_immediate (otherops);
+ }
else if (code1 == CONST_DOUBLE)
{
if (GET_MODE (operands[1]) == DFmode)
@@ -7367,9 +7635,9 @@ output_mov_immediate (rtx *operands)
int i;
/* If all else fails, make it out of ORRs or BICs as appropriate. */
- for (i = 0; i < 32; i ++)
+ for (i = 0; i < 32; i++)
if (n & 1 << i)
- n_ones ++;
+ n_ones++;
if (n_ones > 16) /* Shorter to use MVN with BIC in this case. */
output_multi_immediate (operands, "mvn%?\t%0, %1", "bic%?\t%0, %0, %1", 1, ~ n);
@@ -7751,6 +8019,34 @@ arm_compute_save_reg_mask (void)
if (cfun->machine->lr_save_eliminated)
save_reg_mask &= ~ (1 << LR_REGNUM);
+ if (TARGET_REALLY_IWMMXT
+ && ((bit_count (save_reg_mask)
+ + ARM_NUM_INTS (current_function_pretend_args_size)) % 2) != 0)
+ {
+ unsigned int reg;
+
+ /* The total number of registers that are going to be pushed
+ onto the stack is odd. We need to ensure that the stack
+ is 64-bit aligned before we start to save iWMMXt registers,
+ and also before we start to create locals. (A local variable
+ might be a double or long long which we will load/store using
+ an iWMMXt instruction). Therefore we need to push another
+ ARM register, so that the stack will be 64-bit aligned. We
+ try to avoid using the arg registers (r0 -r3) as they might be
+ used to pass values in a tail call. */
+ for (reg = 4; reg <= 12; reg++)
+ if ((save_reg_mask & (1 << reg)) == 0)
+ break;
+
+ if (reg <= 12)
+ save_reg_mask |= (1 << reg);
+ else
+ {
+ cfun->machine->sibcall_blocked = 1;
+ save_reg_mask |= (1 << 3);
+ }
+ }
+
return save_reg_mask;
}
@@ -8068,6 +8364,7 @@ arm_output_epilogue (int really_return)
int frame_size = arm_get_frame_size ();
FILE * f = asm_out_file;
rtx eh_ofs = cfun->machine->eh_epilogue_sp_ofs;
+ unsigned int lrm_count = 0;
/* If we have already generated the return instruction
then it is futile to generate anything else. */
@@ -8099,12 +8396,15 @@ arm_output_epilogue (int really_return)
abort ();
saved_regs_mask = arm_compute_save_reg_mask ();
-
+
+ if (TARGET_IWMMXT)
+ lrm_count = bit_count (saved_regs_mask);
+
/* XXX We should adjust floats_offset for any anonymous args, and then
re-adjust vfp_offset below to compensate. */
/* Compute how far away the floats will be. */
- for (reg = 0; reg <= LAST_ARM_REGNUM; reg ++)
+ for (reg = 0; reg <= LAST_ARM_REGNUM; reg++)
if (saved_regs_mask & (1 << reg))
floats_offset += 4;
@@ -8157,6 +8457,26 @@ arm_output_epilogue (int really_return)
FP_REGNUM, floats_offset - vfp_offset);
}
+ if (TARGET_IWMMXT)
+ {
+ /* The frame pointer is guaranteed to be non-double-word aligned.
+ This is because it is set to (old_stack_pointer - 4) and the
+ old_stack_pointer was double word aligned. Thus the offset to
+ the iWMMXt registers to be loaded must also be non-double-word
+ sized, so that the resultant address *is* double-word aligned.
+ We can ignore floats_offset since that was already included in
+ the live_regs_mask. */
+ lrm_count += (lrm_count % 2 ? 2 : 1);
+
+ for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++)
+ if (regs_ever_live[reg] && !call_used_regs[reg])
+ {
+ asm_fprintf (f, "\twldrd\t%r, [%r, #-%d]\n",
+ reg, FP_REGNUM, lrm_count * 4);
+ lrm_count += 2;
+ }
+ }
+
/* saved_regs_mask should contain the IP, which at the time of stack
frame generation actually contains the old stack pointer. So a
quick way to unwind the stack is just pop the IP register directly
@@ -8234,6 +8554,11 @@ arm_output_epilogue (int really_return)
start_reg, reg - start_reg, SP_REGNUM);
}
+ if (TARGET_IWMMXT)
+ for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++)
+ if (regs_ever_live[reg] && !call_used_regs[reg])
+ asm_fprintf (f, "\twldrd\t%r, [%r, #+8]!\n", reg, SP_REGNUM);
+
/* If we can, restore the LR into the PC. */
if (ARM_FUNC_TYPE (func_type) == ARM_FT_NORMAL
&& really_return
@@ -8602,34 +8927,32 @@ arm_compute_initial_elimination_offset (unsigned int from, unsigned int to)
/* Make sure that we compute which registers will be saved
on the stack using the same algorithm that is used by
- arm_compute_save_reg_mask(). */
- reg_mask = arm_compute_save_reg0_reg12_mask ();
+ the prologue creation code. */
+ reg_mask = arm_compute_save_reg_mask ();
/* Now count the number of bits set in save_reg_mask.
- For each set bit we need 4 bytes of stack space. */
- while (reg_mask)
- {
- call_saved_registers += 4;
- reg_mask = reg_mask & ~ (reg_mask & - reg_mask);
- }
-
- if ((regs_ever_live[LR_REGNUM]
- /* If optimizing for size, then we save the link register if
- any other integer register is saved. This gives a smaller
- return sequence. */
- || (optimize_size && call_saved_registers > 0))
- /* But if a stack frame is going to be created, the LR will
- be saved as part of that, so we do not need to allow for
- it here. */
- && ! frame_pointer_needed)
- call_saved_registers += 4;
+ If we have already counted the registers in the stack
+ frame, do not count them again. Non call-saved registers
+ might be saved in the call-save area of the stack, if
+ doing so will preserve the stack's alignment. Hence we
+ must count them here. For each set bit we need 4 bytes
+ of stack space. */
+ if (frame_pointer_needed)
+ reg_mask &= 0x07ff;
+ call_saved_registers += 4 * bit_count (reg_mask);
/* If the hard floating point registers are going to be
used then they must be saved on the stack as well.
Each register occupies 12 bytes of stack space. */
- for (reg = FIRST_ARM_FP_REGNUM; reg <= LAST_ARM_FP_REGNUM; reg ++)
+ for (reg = FIRST_ARM_FP_REGNUM; reg <= LAST_ARM_FP_REGNUM; reg++)
if (regs_ever_live[reg] && ! call_used_regs[reg])
call_saved_registers += 12;
+
+ if (TARGET_REALLY_IWMMXT)
+ /* Check for the call-saved iWMMXt registers. */
+ for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++)
+ if (regs_ever_live[reg] && ! call_used_regs [reg])
+ call_saved_registers += 8;
}
/* The stack frame contains 4 registers - the old frame pointer,
@@ -8771,6 +9094,14 @@ arm_get_frame_size (void)
entry_size += 12;
}
+ if (TARGET_REALLY_IWMMXT)
+ {
+ /* Check for the call-saved iWMMXt registers. */
+ for (regno = FIRST_IWMMXT_REGNUM; regno <= LAST_IWMMXT_REGNUM; regno++)
+ if (regs_ever_live [regno] && ! call_used_regs [regno])
+ entry_size += 8;
+ }
+
if ((entry_size + base_size + current_function_outgoing_args_size) & 7)
base_size += 4;
if ((entry_size + base_size + current_function_outgoing_args_size) & 7)
@@ -8942,6 +9273,17 @@ arm_expand_prologue (void)
RTX_FRAME_RELATED_P (insn) = 1;
}
+ if (TARGET_IWMMXT)
+ for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++)
+ if (regs_ever_live[reg] && ! call_used_regs [reg])
+ {
+ insn = gen_rtx_PRE_DEC (V2SImode, stack_pointer_rtx);
+ insn = gen_rtx_MEM (V2SImode, insn);
+ insn = emit_insn (gen_rtx_SET (VOIDmode, insn,
+ gen_rtx_REG (V2SImode, reg)));
+ RTX_FRAME_RELATED_P (insn) = 1;
+ }
+
if (! IS_VOLATILE (func_type))
{
/* Save any floating point call-saved registers used by this
@@ -9248,7 +9590,6 @@ arm_print_operand (FILE *stream, rtx x, int code)
fputs (thumb_condition_code (x, 1), stream);
return;
-
/* Cirrus registers can be accessed in a variety of ways:
single floating point (f)
double floating point (d)
@@ -9285,6 +9626,37 @@ arm_print_operand (FILE *stream, rtx x, int code)
return;
}
+ case 'U':
+ if (GET_CODE (x) != REG
+ || REGNO (x) < FIRST_IWMMXT_GR_REGNUM
+ || REGNO (x) > LAST_IWMMXT_GR_REGNUM)
+ /* Bad value for wCG register number. */
+ abort ();
+ else
+ fprintf (stream, "%d", REGNO (x) - FIRST_IWMMXT_GR_REGNUM);
+ return;
+
+ /* Print an iWMMXt control register name. */
+ case 'w':
+ if (GET_CODE (x) != CONST_INT
+ || INTVAL (x) < 0
+ || INTVAL (x) >= 16)
+ /* Bad value for wC register number. */
+ abort ();
+ else
+ {
+ static const char * wc_reg_names [16] =
+ {
+ "wCID", "wCon", "wCSSF", "wCASF",
+ "wC4", "wC5", "wC6", "wC7",
+ "wCGR0", "wCGR1", "wCGR2", "wCGR3",
+ "wC12", "wC13", "wC14", "wC15"
+ };
+
+ fprintf (stream, wc_reg_names [INTVAL (x)]);
+ }
+ return;
+
default:
if (x == 0)
abort ();
@@ -9337,6 +9709,36 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p)
return true;
}
+ if (VECTOR_MODE_SUPPORTED_P (GET_MODE (x)))
+ {
+ int i, units;
+
+ if (GET_CODE (x) != CONST_VECTOR)
+ abort ();
+
+ units = CONST_VECTOR_NUNITS (x);
+
+ switch (GET_MODE (x))
+ {
+ case V2SImode: size = 4; break;
+ case V4HImode: size = 2; break;
+ case V8QImode: size = 1; break;
+ default:
+ abort ();
+ }
+
+ for (i = 0; i < units; i++)
+ {
+ rtx elt;
+
+ elt = CONST_VECTOR_ELT (x, i);
+ assemble_integer
+ (elt, size, i == 0 ? BIGGEST_ALIGNMENT : size * BITS_PER_UNIT, 1);
+ }
+
+ return true;
+ }
+
return default_assemble_integer (x, size, aligned_p);
}
#endif
@@ -9869,6 +10271,12 @@ arm_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode)
get sign extended to 64bits-- aldyh. */
return (GET_MODE_CLASS (mode) == MODE_FLOAT) || (mode == DImode);
+ if (IS_IWMMXT_GR_REGNUM (regno))
+ return mode == SImode;
+
+ if (IS_IWMMXT_REGNUM (regno))
+ return VALID_IWMMXT_REG_MODE (mode);
+
if (regno <= LAST_ARM_REGNUM)
/* We allow any value to be stored in the general regisetrs. */
return 1;
@@ -9910,6 +10318,9 @@ arm_regno_class (int regno)
if (IS_CIRRUS_REGNUM (regno))
return CIRRUS_REGS;
+ if (IS_IWMMXT_REGNUM (regno))
+ return IWMMXT_REGS;
+
return FPA_REGS;
}
@@ -9996,6 +10407,796 @@ arm_debugger_arg_offset (int value, rtx addr)
return value;
}
+#define def_mbuiltin(MASK, NAME, TYPE, CODE) \
+ do \
+ { \
+ if ((MASK) & insn_flags) \
+ builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, NULL, NULL_TREE); \
+ } \
+ while (0)
+
+struct builtin_description
+{
+ const unsigned int mask;
+ const enum insn_code icode;
+ const char * const name;
+ const enum arm_builtins code;
+ const enum rtx_code comparison;
+ const unsigned int flag;
+};
+
+static const struct builtin_description bdesc_2arg[] =
+{
+#define IWMMXT_BUILTIN(code, string, builtin) \
+ { FL_IWMMXT, CODE_FOR_##code, "__builtin_arm_" string, \
+ ARM_BUILTIN_##builtin, 0, 0 },
+
+ IWMMXT_BUILTIN (addv8qi3, "waddb", WADDB)
+ IWMMXT_BUILTIN (addv4hi3, "waddh", WADDH)
+ IWMMXT_BUILTIN (addv2si3, "waddw", WADDW)
+ IWMMXT_BUILTIN (subv8qi3, "wsubb", WSUBB)
+ IWMMXT_BUILTIN (subv4hi3, "wsubh", WSUBH)
+ IWMMXT_BUILTIN (subv2si3, "wsubw", WSUBW)
+ IWMMXT_BUILTIN (ssaddv8qi3, "waddbss", WADDSSB)
+ IWMMXT_BUILTIN (ssaddv4hi3, "waddhss", WADDSSH)
+ IWMMXT_BUILTIN (ssaddv2si3, "waddwss", WADDSSW)
+ IWMMXT_BUILTIN (sssubv8qi3, "wsubbss", WSUBSSB)
+ IWMMXT_BUILTIN (sssubv4hi3, "wsubhss", WSUBSSH)
+ IWMMXT_BUILTIN (sssubv2si3, "wsubwss", WSUBSSW)
+ IWMMXT_BUILTIN (usaddv8qi3, "waddbus", WADDUSB)
+ IWMMXT_BUILTIN (usaddv4hi3, "waddhus", WADDUSH)
+ IWMMXT_BUILTIN (usaddv2si3, "waddwus", WADDUSW)
+ IWMMXT_BUILTIN (ussubv8qi3, "wsubbus", WSUBUSB)
+ IWMMXT_BUILTIN (ussubv4hi3, "wsubhus", WSUBUSH)
+ IWMMXT_BUILTIN (ussubv2si3, "wsubwus", WSUBUSW)
+ IWMMXT_BUILTIN (mulv4hi3, "wmulul", WMULUL)
+ IWMMXT_BUILTIN (smulv4hi3_highpart, "wmulsh", WMULSH)
+ IWMMXT_BUILTIN (umulv4hi3_highpart, "wmuluh", WMULUH)
+ IWMMXT_BUILTIN (eqv8qi3, "wcmpeqb", WCMPEQB)
+ IWMMXT_BUILTIN (eqv4hi3, "wcmpeqh", WCMPEQH)
+ IWMMXT_BUILTIN (eqv2si3, "wcmpeqw", WCMPEQW)
+ IWMMXT_BUILTIN (gtuv8qi3, "wcmpgtub", WCMPGTUB)
+ IWMMXT_BUILTIN (gtuv4hi3, "wcmpgtuh", WCMPGTUH)
+ IWMMXT_BUILTIN (gtuv2si3, "wcmpgtuw", WCMPGTUW)
+ IWMMXT_BUILTIN (gtv8qi3, "wcmpgtsb", WCMPGTSB)
+ IWMMXT_BUILTIN (gtv4hi3, "wcmpgtsh", WCMPGTSH)
+ IWMMXT_BUILTIN (gtv2si3, "wcmpgtsw", WCMPGTSW)
+ IWMMXT_BUILTIN (umaxv8qi3, "wmaxub", WMAXUB)
+ IWMMXT_BUILTIN (smaxv8qi3, "wmaxsb", WMAXSB)
+ IWMMXT_BUILTIN (umaxv4hi3, "wmaxuh", WMAXUH)
+ IWMMXT_BUILTIN (smaxv4hi3, "wmaxsh", WMAXSH)
+ IWMMXT_BUILTIN (umaxv2si3, "wmaxuw", WMAXUW)
+ IWMMXT_BUILTIN (smaxv2si3, "wmaxsw", WMAXSW)
+ IWMMXT_BUILTIN (uminv8qi3, "wminub", WMINUB)
+ IWMMXT_BUILTIN (sminv8qi3, "wminsb", WMINSB)
+ IWMMXT_BUILTIN (uminv4hi3, "wminuh", WMINUH)
+ IWMMXT_BUILTIN (sminv4hi3, "wminsh", WMINSH)
+ IWMMXT_BUILTIN (uminv2si3, "wminuw", WMINUW)
+ IWMMXT_BUILTIN (sminv2si3, "wminsw", WMINSW)
+ IWMMXT_BUILTIN (iwmmxt_anddi3, "wand", WAND)
+ IWMMXT_BUILTIN (iwmmxt_nanddi3, "wandn", WANDN)
+ IWMMXT_BUILTIN (iwmmxt_iordi3, "wor", WOR)
+ IWMMXT_BUILTIN (iwmmxt_xordi3, "wxor", WXOR)
+ IWMMXT_BUILTIN (iwmmxt_uavgv8qi3, "wavg2b", WAVG2B)
+ IWMMXT_BUILTIN (iwmmxt_uavgv4hi3, "wavg2h", WAVG2H)
+ IWMMXT_BUILTIN (iwmmxt_uavgrndv8qi3, "wavg2br", WAVG2BR)
+ IWMMXT_BUILTIN (iwmmxt_uavgrndv4hi3, "wavg2hr", WAVG2HR)
+ IWMMXT_BUILTIN (iwmmxt_wunpckilb, "wunpckilb", WUNPCKILB)
+ IWMMXT_BUILTIN (iwmmxt_wunpckilh, "wunpckilh", WUNPCKILH)
+ IWMMXT_BUILTIN (iwmmxt_wunpckilw, "wunpckilw", WUNPCKILW)
+ IWMMXT_BUILTIN (iwmmxt_wunpckihb, "wunpckihb", WUNPCKIHB)
+ IWMMXT_BUILTIN (iwmmxt_wunpckihh, "wunpckihh", WUNPCKIHH)
+ IWMMXT_BUILTIN (iwmmxt_wunpckihw, "wunpckihw", WUNPCKIHW)
+ IWMMXT_BUILTIN (iwmmxt_wmadds, "wmadds", WMADDS)
+ IWMMXT_BUILTIN (iwmmxt_wmaddu, "wmaddu", WMADDU)
+
+#define IWMMXT_BUILTIN2(code, builtin) \
+ { FL_IWMMXT, CODE_FOR_##code, NULL, ARM_BUILTIN_##builtin, 0, 0 },
+
+ IWMMXT_BUILTIN2 (iwmmxt_wpackhss, WPACKHSS)
+ IWMMXT_BUILTIN2 (iwmmxt_wpackwss, WPACKWSS)
+ IWMMXT_BUILTIN2 (iwmmxt_wpackdss, WPACKDSS)
+ IWMMXT_BUILTIN2 (iwmmxt_wpackhus, WPACKHUS)
+ IWMMXT_BUILTIN2 (iwmmxt_wpackwus, WPACKWUS)
+ IWMMXT_BUILTIN2 (iwmmxt_wpackdus, WPACKDUS)
+ IWMMXT_BUILTIN2 (ashlv4hi3_di, WSLLH)
+ IWMMXT_BUILTIN2 (ashlv4hi3, WSLLHI)
+ IWMMXT_BUILTIN2 (ashlv2si3_di, WSLLW)
+ IWMMXT_BUILTIN2 (ashlv2si3, WSLLWI)
+ IWMMXT_BUILTIN2 (ashldi3_di, WSLLD)
+ IWMMXT_BUILTIN2 (ashldi3_iwmmxt, WSLLDI)
+ IWMMXT_BUILTIN2 (lshrv4hi3_di, WSRLH)
+ IWMMXT_BUILTIN2 (lshrv4hi3, WSRLHI)
+ IWMMXT_BUILTIN2 (lshrv2si3_di, WSRLW)
+ IWMMXT_BUILTIN2 (lshrv2si3, WSRLWI)
+ IWMMXT_BUILTIN2 (lshrdi3_di, WSRLD)
+ IWMMXT_BUILTIN2 (lshrdi3, WSRLDI)
+ IWMMXT_BUILTIN2 (ashrv4hi3_di, WSRAH)
+ IWMMXT_BUILTIN2 (ashrv4hi3, WSRAHI)
+ IWMMXT_BUILTIN2 (ashrv2si3_di, WSRAW)
+ IWMMXT_BUILTIN2 (ashrv2si3, WSRAWI)
+ IWMMXT_BUILTIN2 (ashrdi3_di, WSRAD)
+ IWMMXT_BUILTIN2 (ashrdi3, WSRADI)
+ IWMMXT_BUILTIN2 (rorv4hi3_di, WRORH)
+ IWMMXT_BUILTIN2 (rorv4hi3, WRORHI)
+ IWMMXT_BUILTIN2 (rorv2si3_di, WRORW)
+ IWMMXT_BUILTIN2 (rorv2si3, WRORWI)
+ IWMMXT_BUILTIN2 (rordi3_di, WRORD)
+ IWMMXT_BUILTIN2 (rordi3, WRORDI)
+ IWMMXT_BUILTIN2 (iwmmxt_wmacuz, WMACUZ)
+ IWMMXT_BUILTIN2 (iwmmxt_wmacsz, WMACSZ)
+};
+
+static const struct builtin_description bdesc_1arg[] =
+{
+ IWMMXT_BUILTIN (iwmmxt_tmovmskb, "tmovmskb", TMOVMSKB)
+ IWMMXT_BUILTIN (iwmmxt_tmovmskh, "tmovmskh", TMOVMSKH)
+ IWMMXT_BUILTIN (iwmmxt_tmovmskw, "tmovmskw", TMOVMSKW)
+ IWMMXT_BUILTIN (iwmmxt_waccb, "waccb", WACCB)
+ IWMMXT_BUILTIN (iwmmxt_wacch, "wacch", WACCH)
+ IWMMXT_BUILTIN (iwmmxt_waccw, "waccw", WACCW)
+ IWMMXT_BUILTIN (iwmmxt_wunpckehub, "wunpckehub", WUNPCKEHUB)
+ IWMMXT_BUILTIN (iwmmxt_wunpckehuh, "wunpckehuh", WUNPCKEHUH)
+ IWMMXT_BUILTIN (iwmmxt_wunpckehuw, "wunpckehuw", WUNPCKEHUW)
+ IWMMXT_BUILTIN (iwmmxt_wunpckehsb, "wunpckehsb", WUNPCKEHSB)
+ IWMMXT_BUILTIN (iwmmxt_wunpckehsh, "wunpckehsh", WUNPCKEHSH)
+ IWMMXT_BUILTIN (iwmmxt_wunpckehsw, "wunpckehsw", WUNPCKEHSW)
+ IWMMXT_BUILTIN (iwmmxt_wunpckelub, "wunpckelub", WUNPCKELUB)
+ IWMMXT_BUILTIN (iwmmxt_wunpckeluh, "wunpckeluh", WUNPCKELUH)
+ IWMMXT_BUILTIN (iwmmxt_wunpckeluw, "wunpckeluw", WUNPCKELUW)
+ IWMMXT_BUILTIN (iwmmxt_wunpckelsb, "wunpckelsb", WUNPCKELSB)
+ IWMMXT_BUILTIN (iwmmxt_wunpckelsh, "wunpckelsh", WUNPCKELSH)
+ IWMMXT_BUILTIN (iwmmxt_wunpckelsw, "wunpckelsw", WUNPCKELSW)
+};
+
+/* Set up all the iWMMXt builtins. This is
+ not called if TARGET_IWMMXT is zero. */
+
+static void
+arm_init_iwmmxt_builtins (void)
+{
+ const struct builtin_description * d;
+ size_t i;
+ tree endlink = void_list_node;
+
+ tree int_ftype_int
+ = build_function_type (integer_type_node,
+ tree_cons (NULL_TREE, integer_type_node, endlink));
+ tree v8qi_ftype_v8qi_v8qi_int
+ = build_function_type (V8QI_type_node,
+ tree_cons (NULL_TREE, V8QI_type_node,
+ tree_cons (NULL_TREE, V8QI_type_node,
+ tree_cons (NULL_TREE,
+ integer_type_node,
+ endlink))));
+ tree v4hi_ftype_v4hi_int
+ = build_function_type (V4HI_type_node,
+ tree_cons (NULL_TREE, V4HI_type_node,
+ tree_cons (NULL_TREE, integer_type_node,
+ endlink)));
+ tree v2si_ftype_v2si_int
+ = build_function_type (V2SI_type_node,
+ tree_cons (NULL_TREE, V2SI_type_node,
+ tree_cons (NULL_TREE, integer_type_node,
+ endlink)));
+ tree v2si_ftype_di_di
+ = build_function_type (V2SI_type_node,
+ tree_cons (NULL_TREE, long_long_integer_type_node,
+ tree_cons (NULL_TREE, long_long_integer_type_node,
+ endlink)));
+ tree di_ftype_di_int
+ = build_function_type (long_long_integer_type_node,
+ tree_cons (NULL_TREE, long_long_integer_type_node,
+ tree_cons (NULL_TREE, integer_type_node,
+ endlink)));
+ tree di_ftype_di_int_int
+ = build_function_type (long_long_integer_type_node,
+ tree_cons (NULL_TREE, long_long_integer_type_node,
+ tree_cons (NULL_TREE, integer_type_node,
+ tree_cons (NULL_TREE,
+ integer_type_node,
+ endlink))));
+ tree int_ftype_v8qi
+ = build_function_type (integer_type_node,
+ tree_cons (NULL_TREE, V8QI_type_node,
+ endlink));
+ tree int_ftype_v4hi
+ = build_function_type (integer_type_node,
+ tree_cons (NULL_TREE, V4HI_type_node,
+ endlink));
+ tree int_ftype_v2si
+ = build_function_type (integer_type_node,
+ tree_cons (NULL_TREE, V2SI_type_node,
+ endlink));
+ tree int_ftype_v8qi_int
+ = build_function_type (integer_type_node,
+ tree_cons (NULL_TREE, V8QI_type_node,
+ tree_cons (NULL_TREE, integer_type_node,
+ endlink)));
+ tree int_ftype_v4hi_int
+ = build_function_type (integer_type_node,
+ tree_cons (NULL_TREE, V4HI_type_node,
+ tree_cons (NULL_TREE, integer_type_node,
+ endlink)));
+ tree int_ftype_v2si_int
+ = build_function_type (integer_type_node,
+ tree_cons (NULL_TREE, V2SI_type_node,
+ tree_cons (NULL_TREE, integer_type_node,
+ endlink)));
+ tree v8qi_ftype_v8qi_int_int
+ = build_function_type (V8QI_type_node,
+ tree_cons (NULL_TREE, V8QI_type_node,
+ tree_cons (NULL_TREE, integer_type_node,
+ tree_cons (NULL_TREE,
+ integer_type_node,
+ endlink))));
+ tree v4hi_ftype_v4hi_int_int
+ = build_function_type (V4HI_type_node,
+ tree_cons (NULL_TREE, V4HI_type_node,
+ tree_cons (NULL_TREE, integer_type_node,
+ tree_cons (NULL_TREE,
+ integer_type_node,
+ endlink))));
+ tree v2si_ftype_v2si_int_int
+ = build_function_type (V2SI_type_node,
+ tree_cons (NULL_TREE, V2SI_type_node,
+ tree_cons (NULL_TREE, integer_type_node,
+ tree_cons (NULL_TREE,
+ integer_type_node,
+ endlink))));
+ /* Miscellaneous. */
+ tree v8qi_ftype_v4hi_v4hi
+ = build_function_type (V8QI_type_node,
+ tree_cons (NULL_TREE, V4HI_type_node,
+ tree_cons (NULL_TREE, V4HI_type_node,
+ endlink)));
+ tree v4hi_ftype_v2si_v2si
+ = build_function_type (V4HI_type_node,
+ tree_cons (NULL_TREE, V2SI_type_node,
+ tree_cons (NULL_TREE, V2SI_type_node,
+ endlink)));
+ tree v2si_ftype_v4hi_v4hi
+ = build_function_type (V2SI_type_node,
+ tree_cons (NULL_TREE, V4HI_type_node,
+ tree_cons (NULL_TREE, V4HI_type_node,
+ endlink)));
+ tree v2si_ftype_v8qi_v8qi
+ = build_function_type (V2SI_type_node,
+ tree_cons (NULL_TREE, V8QI_type_node,
+ tree_cons (NULL_TREE, V8QI_type_node,
+ endlink)));
+ tree v4hi_ftype_v4hi_di
+ = build_function_type (V4HI_type_node,
+ tree_cons (NULL_TREE, V4HI_type_node,
+ tree_cons (NULL_TREE,
+ long_long_integer_type_node,
+ endlink)));
+ tree v2si_ftype_v2si_di
+ = build_function_type (V2SI_type_node,
+ tree_cons (NULL_TREE, V2SI_type_node,
+ tree_cons (NULL_TREE,
+ long_long_integer_type_node,
+ endlink)));
+ tree void_ftype_int_int
+ = build_function_type (void_type_node,
+ tree_cons (NULL_TREE, integer_type_node,
+ tree_cons (NULL_TREE, integer_type_node,
+ endlink)));
+ tree di_ftype_void
+ = build_function_type (long_long_unsigned_type_node, endlink);
+ tree di_ftype_v8qi
+ = build_function_type (long_long_integer_type_node,
+ tree_cons (NULL_TREE, V8QI_type_node,
+ endlink));
+ tree di_ftype_v4hi
+ = build_function_type (long_long_integer_type_node,
+ tree_cons (NULL_TREE, V4HI_type_node,
+ endlink));
+ tree di_ftype_v2si
+ = build_function_type (long_long_integer_type_node,
+ tree_cons (NULL_TREE, V2SI_type_node,
+ endlink));
+ tree v2si_ftype_v4hi
+ = build_function_type (V2SI_type_node,
+ tree_cons (NULL_TREE, V4HI_type_node,
+ endlink));
+ tree v4hi_ftype_v8qi
+ = build_function_type (V4HI_type_node,
+ tree_cons (NULL_TREE, V8QI_type_node,
+ endlink));
+
+ tree di_ftype_di_v4hi_v4hi
+ = build_function_type (long_long_unsigned_type_node,
+ tree_cons (NULL_TREE,
+ long_long_unsigned_type_node,
+ tree_cons (NULL_TREE, V4HI_type_node,
+ tree_cons (NULL_TREE,
+ V4HI_type_node,
+ endlink))));
+
+ tree di_ftype_v4hi_v4hi
+ = build_function_type (long_long_unsigned_type_node,
+ tree_cons (NULL_TREE, V4HI_type_node,
+ tree_cons (NULL_TREE, V4HI_type_node,
+ endlink)));
+
+ /* Normal vector binops. */
+ tree v8qi_ftype_v8qi_v8qi
+ = build_function_type (V8QI_type_node,
+ tree_cons (NULL_TREE, V8QI_type_node,
+ tree_cons (NULL_TREE, V8QI_type_node,
+ endlink)));
+ tree v4hi_ftype_v4hi_v4hi
+ = build_function_type (V4HI_type_node,
+ tree_cons (NULL_TREE, V4HI_type_node,
+ tree_cons (NULL_TREE, V4HI_type_node,
+ endlink)));
+ tree v2si_ftype_v2si_v2si
+ = build_function_type (V2SI_type_node,
+ tree_cons (NULL_TREE, V2SI_type_node,
+ tree_cons (NULL_TREE, V2SI_type_node,
+ endlink)));
+ tree di_ftype_di_di
+ = build_function_type (long_long_unsigned_type_node,
+ tree_cons (NULL_TREE, long_long_unsigned_type_node,
+ tree_cons (NULL_TREE,
+ long_long_unsigned_type_node,
+ endlink)));
+
+ /* Add all builtins that are more or less simple operations on two
+ operands. */
+ for (i = 0, d = bdesc_2arg; i < sizeof (bdesc_2arg) / sizeof *d; i++, d++)
+ {
+ /* Use one of the operands; the target can have a different mode for
+ mask-generating compares. */
+ enum machine_mode mode;
+ tree type;
+
+ if (d->name == 0)
+ continue;
+
+ mode = insn_data[d->icode].operand[1].mode;
+
+ switch (mode)
+ {
+ case V8QImode:
+ type = v8qi_ftype_v8qi_v8qi;
+ break;
+ case V4HImode:
+ type = v4hi_ftype_v4hi_v4hi;
+ break;
+ case V2SImode:
+ type = v2si_ftype_v2si_v2si;
+ break;
+ case DImode:
+ type = di_ftype_di_di;
+ break;
+
+ default:
+ abort ();
+ }
+
+ def_mbuiltin (d->mask, d->name, type, d->code);
+ }
+
+ /* Add the remaining MMX insns with somewhat more complicated types. */
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wzero", di_ftype_void, ARM_BUILTIN_WZERO);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_setwcx", void_ftype_int_int, ARM_BUILTIN_SETWCX);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_getwcx", int_ftype_int, ARM_BUILTIN_GETWCX);
+
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsllh", v4hi_ftype_v4hi_di, ARM_BUILTIN_WSLLH);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsllw", v2si_ftype_v2si_di, ARM_BUILTIN_WSLLW);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wslld", di_ftype_di_di, ARM_BUILTIN_WSLLD);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsllhi", v4hi_ftype_v4hi_int, ARM_BUILTIN_WSLLHI);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsllwi", v2si_ftype_v2si_int, ARM_BUILTIN_WSLLWI);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wslldi", di_ftype_di_int, ARM_BUILTIN_WSLLDI);
+
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsrlh", v4hi_ftype_v4hi_di, ARM_BUILTIN_WSRLH);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsrlw", v2si_ftype_v2si_di, ARM_BUILTIN_WSRLW);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsrld", di_ftype_di_di, ARM_BUILTIN_WSRLD);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsrlhi", v4hi_ftype_v4hi_int, ARM_BUILTIN_WSRLHI);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsrlwi", v2si_ftype_v2si_int, ARM_BUILTIN_WSRLWI);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsrldi", di_ftype_di_int, ARM_BUILTIN_WSRLDI);
+
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsrah", v4hi_ftype_v4hi_di, ARM_BUILTIN_WSRAH);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsraw", v2si_ftype_v2si_di, ARM_BUILTIN_WSRAW);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsrad", di_ftype_di_di, ARM_BUILTIN_WSRAD);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsrahi", v4hi_ftype_v4hi_int, ARM_BUILTIN_WSRAHI);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsrawi", v2si_ftype_v2si_int, ARM_BUILTIN_WSRAWI);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsradi", di_ftype_di_int, ARM_BUILTIN_WSRADI);
+
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wrorh", v4hi_ftype_v4hi_di, ARM_BUILTIN_WRORH);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wrorw", v2si_ftype_v2si_di, ARM_BUILTIN_WRORW);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wrord", di_ftype_di_di, ARM_BUILTIN_WRORD);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wrorhi", v4hi_ftype_v4hi_int, ARM_BUILTIN_WRORHI);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wrorwi", v2si_ftype_v2si_int, ARM_BUILTIN_WRORWI);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wrordi", di_ftype_di_int, ARM_BUILTIN_WRORDI);
+
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wshufh", v4hi_ftype_v4hi_int, ARM_BUILTIN_WSHUFH);
+
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsadb", v2si_ftype_v8qi_v8qi, ARM_BUILTIN_WSADB);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsadh", v2si_ftype_v4hi_v4hi, ARM_BUILTIN_WSADH);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsadbz", v2si_ftype_v8qi_v8qi, ARM_BUILTIN_WSADBZ);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wsadhz", v2si_ftype_v4hi_v4hi, ARM_BUILTIN_WSADHZ);
+
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_textrmsb", int_ftype_v8qi_int, ARM_BUILTIN_TEXTRMSB);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_textrmsh", int_ftype_v4hi_int, ARM_BUILTIN_TEXTRMSH);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_textrmsw", int_ftype_v2si_int, ARM_BUILTIN_TEXTRMSW);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_textrmub", int_ftype_v8qi_int, ARM_BUILTIN_TEXTRMUB);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_textrmuh", int_ftype_v4hi_int, ARM_BUILTIN_TEXTRMUH);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_textrmuw", int_ftype_v2si_int, ARM_BUILTIN_TEXTRMUW);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_tinsrb", v8qi_ftype_v8qi_int_int, ARM_BUILTIN_TINSRB);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_tinsrh", v4hi_ftype_v4hi_int_int, ARM_BUILTIN_TINSRH);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_tinsrw", v2si_ftype_v2si_int_int, ARM_BUILTIN_TINSRW);
+
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_waccb", di_ftype_v8qi, ARM_BUILTIN_WACCB);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wacch", di_ftype_v4hi, ARM_BUILTIN_WACCH);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_waccw", di_ftype_v2si, ARM_BUILTIN_WACCW);
+
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_tmovmskb", int_ftype_v8qi, ARM_BUILTIN_TMOVMSKB);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_tmovmskh", int_ftype_v4hi, ARM_BUILTIN_TMOVMSKH);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_tmovmskw", int_ftype_v2si, ARM_BUILTIN_TMOVMSKW);
+
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wpackhss", v8qi_ftype_v4hi_v4hi, ARM_BUILTIN_WPACKHSS);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wpackhus", v8qi_ftype_v4hi_v4hi, ARM_BUILTIN_WPACKHUS);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wpackwus", v4hi_ftype_v2si_v2si, ARM_BUILTIN_WPACKWUS);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wpackwss", v4hi_ftype_v2si_v2si, ARM_BUILTIN_WPACKWSS);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wpackdus", v2si_ftype_di_di, ARM_BUILTIN_WPACKDUS);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wpackdss", v2si_ftype_di_di, ARM_BUILTIN_WPACKDSS);
+
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wunpckehub", v4hi_ftype_v8qi, ARM_BUILTIN_WUNPCKEHUB);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wunpckehuh", v2si_ftype_v4hi, ARM_BUILTIN_WUNPCKEHUH);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wunpckehuw", di_ftype_v2si, ARM_BUILTIN_WUNPCKEHUW);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wunpckehsb", v4hi_ftype_v8qi, ARM_BUILTIN_WUNPCKEHSB);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wunpckehsh", v2si_ftype_v4hi, ARM_BUILTIN_WUNPCKEHSH);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wunpckehsw", di_ftype_v2si, ARM_BUILTIN_WUNPCKEHSW);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wunpckelub", v4hi_ftype_v8qi, ARM_BUILTIN_WUNPCKELUB);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wunpckeluh", v2si_ftype_v4hi, ARM_BUILTIN_WUNPCKELUH);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wunpckeluw", di_ftype_v2si, ARM_BUILTIN_WUNPCKELUW);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wunpckelsb", v4hi_ftype_v8qi, ARM_BUILTIN_WUNPCKELSB);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wunpckelsh", v2si_ftype_v4hi, ARM_BUILTIN_WUNPCKELSH);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wunpckelsw", di_ftype_v2si, ARM_BUILTIN_WUNPCKELSW);
+
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wmacs", di_ftype_di_v4hi_v4hi, ARM_BUILTIN_WMACS);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wmacsz", di_ftype_v4hi_v4hi, ARM_BUILTIN_WMACSZ);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wmacu", di_ftype_di_v4hi_v4hi, ARM_BUILTIN_WMACU);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_wmacuz", di_ftype_v4hi_v4hi, ARM_BUILTIN_WMACUZ);
+
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_walign", v8qi_ftype_v8qi_v8qi_int, ARM_BUILTIN_WALIGN);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_tmia", di_ftype_di_int_int, ARM_BUILTIN_TMIA);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_tmiaph", di_ftype_di_int_int, ARM_BUILTIN_TMIAPH);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_tmiabb", di_ftype_di_int_int, ARM_BUILTIN_TMIABB);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_tmiabt", di_ftype_di_int_int, ARM_BUILTIN_TMIABT);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_tmiatb", di_ftype_di_int_int, ARM_BUILTIN_TMIATB);
+ def_mbuiltin (FL_IWMMXT, "__builtin_arm_tmiatt", di_ftype_di_int_int, ARM_BUILTIN_TMIATT);
+}
+
+static void
+arm_init_builtins (void)
+{
+ if (TARGET_REALLY_IWMMXT)
+ arm_init_iwmmxt_builtins ();
+}
+
+/* Errors in the source file can cause expand_expr to return const0_rtx
+ where we expect a vector. To avoid crashing, use one of the vector
+ clear instructions. */
+
+static rtx
+safe_vector_operand (rtx x, enum machine_mode mode)
+{
+ if (x != const0_rtx)
+ return x;
+ x = gen_reg_rtx (mode);
+
+ emit_insn (gen_iwmmxt_clrdi (mode == DImode ? x
+ : gen_rtx_SUBREG (DImode, x, 0)));
+ return x;
+}
+
+/* Subroutine of arm_expand_builtin to take care of binop insns. */
+
+static rtx
+arm_expand_binop_builtin (enum insn_code icode,
+ tree arglist, rtx target)
+{
+ rtx pat;
+ tree arg0 = TREE_VALUE (arglist);
+ tree arg1 = TREE_VALUE (TREE_CHAIN (arglist));
+ rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
+ rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0);
+ enum machine_mode tmode = insn_data[icode].operand[0].mode;
+ enum machine_mode mode0 = insn_data[icode].operand[1].mode;
+ enum machine_mode mode1 = insn_data[icode].operand[2].mode;
+
+ if (VECTOR_MODE_P (mode0))
+ op0 = safe_vector_operand (op0, mode0);
+ if (VECTOR_MODE_P (mode1))
+ op1 = safe_vector_operand (op1, mode1);
+
+ if (! target
+ || GET_MODE (target) != tmode
+ || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
+ target = gen_reg_rtx (tmode);
+
+ /* In case the insn wants input operands in modes different from
+ the result, abort. */
+ if (GET_MODE (op0) != mode0 || GET_MODE (op1) != mode1)
+ abort ();
+
+ if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
+ op0 = copy_to_mode_reg (mode0, op0);
+ if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
+ op1 = copy_to_mode_reg (mode1, op1);
+
+ pat = GEN_FCN (icode) (target, op0, op1);
+ if (! pat)
+ return 0;
+ emit_insn (pat);
+ return target;
+}
+
+/* Subroutine of arm_expand_builtin to take care of unop insns. */
+
+static rtx
+arm_expand_unop_builtin (enum insn_code icode,
+ tree arglist, rtx target, int do_load)
+{
+ rtx pat;
+ tree arg0 = TREE_VALUE (arglist);
+ rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
+ enum machine_mode tmode = insn_data[icode].operand[0].mode;
+ enum machine_mode mode0 = insn_data[icode].operand[1].mode;
+
+ if (! target
+ || GET_MODE (target) != tmode
+ || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
+ target = gen_reg_rtx (tmode);
+ if (do_load)
+ op0 = gen_rtx_MEM (mode0, copy_to_mode_reg (Pmode, op0));
+ else
+ {
+ if (VECTOR_MODE_P (mode0))
+ op0 = safe_vector_operand (op0, mode0);
+
+ if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
+ op0 = copy_to_mode_reg (mode0, op0);
+ }
+
+ pat = GEN_FCN (icode) (target, op0);
+ if (! pat)
+ return 0;
+ emit_insn (pat);
+ return target;
+}
+
+/* Expand an expression EXP that calls a built-in function,
+ with result going to TARGET if that's convenient
+ (and in mode MODE if that's convenient).
+ SUBTARGET may be used as the target for computing one of EXP's operands.
+ IGNORE is nonzero if the value is to be ignored. */
+
+static rtx
+arm_expand_builtin (tree exp,
+ rtx target,
+ rtx subtarget ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ int ignore ATTRIBUTE_UNUSED)
+{
+ const struct builtin_description * d;
+ enum insn_code icode;
+ tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
+ tree arglist = TREE_OPERAND (exp, 1);
+ tree arg0;
+ tree arg1;
+ tree arg2;
+ rtx op0;
+ rtx op1;
+ rtx op2;
+ rtx pat;
+ int fcode = DECL_FUNCTION_CODE (fndecl);
+ size_t i;
+ enum machine_mode tmode;
+ enum machine_mode mode0;
+ enum machine_mode mode1;
+ enum machine_mode mode2;
+
+ switch (fcode)
+ {
+ case ARM_BUILTIN_TEXTRMSB:
+ case ARM_BUILTIN_TEXTRMUB:
+ case ARM_BUILTIN_TEXTRMSH:
+ case ARM_BUILTIN_TEXTRMUH:
+ case ARM_BUILTIN_TEXTRMSW:
+ case ARM_BUILTIN_TEXTRMUW:
+ icode = (fcode == ARM_BUILTIN_TEXTRMSB ? CODE_FOR_iwmmxt_textrmsb
+ : fcode == ARM_BUILTIN_TEXTRMUB ? CODE_FOR_iwmmxt_textrmub
+ : fcode == ARM_BUILTIN_TEXTRMSH ? CODE_FOR_iwmmxt_textrmsh
+ : fcode == ARM_BUILTIN_TEXTRMUH ? CODE_FOR_iwmmxt_textrmuh
+ : CODE_FOR_iwmmxt_textrmw);
+
+ arg0 = TREE_VALUE (arglist);
+ arg1 = TREE_VALUE (TREE_CHAIN (arglist));
+ op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
+ op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0);
+ tmode = insn_data[icode].operand[0].mode;
+ mode0 = insn_data[icode].operand[1].mode;
+ mode1 = insn_data[icode].operand[2].mode;
+
+ if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
+ op0 = copy_to_mode_reg (mode0, op0);
+ if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
+ {
+ /* @@@ better error message */
+ error ("selector must be an immediate");
+ return gen_reg_rtx (tmode);
+ }
+ if (target == 0
+ || GET_MODE (target) != tmode
+ || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
+ target = gen_reg_rtx (tmode);
+ pat = GEN_FCN (icode) (target, op0, op1);
+ if (! pat)
+ return 0;
+ emit_insn (pat);
+ return target;
+
+ case ARM_BUILTIN_TINSRB:
+ case ARM_BUILTIN_TINSRH:
+ case ARM_BUILTIN_TINSRW:
+ icode = (fcode == ARM_BUILTIN_TINSRB ? CODE_FOR_iwmmxt_tinsrb
+ : fcode == ARM_BUILTIN_TINSRH ? CODE_FOR_iwmmxt_tinsrh
+ : CODE_FOR_iwmmxt_tinsrw);
+ arg0 = TREE_VALUE (arglist);
+ arg1 = TREE_VALUE (TREE_CHAIN (arglist));
+ arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
+ op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
+ op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0);
+ op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0);
+ tmode = insn_data[icode].operand[0].mode;
+ mode0 = insn_data[icode].operand[1].mode;
+ mode1 = insn_data[icode].operand[2].mode;
+ mode2 = insn_data[icode].operand[3].mode;
+
+ if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
+ op0 = copy_to_mode_reg (mode0, op0);
+ if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
+ op1 = copy_to_mode_reg (mode1, op1);
+ if (! (*insn_data[icode].operand[3].predicate) (op2, mode2))
+ {
+ /* @@@ better error message */
+ error ("selector must be an immediate");
+ return const0_rtx;
+ }
+ if (target == 0
+ || GET_MODE (target) != tmode
+ || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
+ target = gen_reg_rtx (tmode);
+ pat = GEN_FCN (icode) (target, op0, op1, op2);
+ if (! pat)
+ return 0;
+ emit_insn (pat);
+ return target;
+
+ case ARM_BUILTIN_SETWCX:
+ arg0 = TREE_VALUE (arglist);
+ arg1 = TREE_VALUE (TREE_CHAIN (arglist));
+ op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
+ op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0);
+ emit_insn (gen_iwmmxt_tmcr (op0, op1));
+ return 0;
+
+ case ARM_BUILTIN_GETWCX:
+ arg0 = TREE_VALUE (arglist);
+ op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
+ target = gen_reg_rtx (SImode);
+ emit_insn (gen_iwmmxt_tmrc (target, op0));
+ return target;
+
+ case ARM_BUILTIN_WSHUFH:
+ icode = CODE_FOR_iwmmxt_wshufh;
+ arg0 = TREE_VALUE (arglist);
+ arg1 = TREE_VALUE (TREE_CHAIN (arglist));
+ op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
+ op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0);
+ tmode = insn_data[icode].operand[0].mode;
+ mode1 = insn_data[icode].operand[1].mode;
+ mode2 = insn_data[icode].operand[2].mode;
+
+ if (! (*insn_data[icode].operand[1].predicate) (op0, mode1))
+ op0 = copy_to_mode_reg (mode1, op0);
+ if (! (*insn_data[icode].operand[2].predicate) (op1, mode2))
+ {
+ /* @@@ better error message */
+ error ("mask must be an immediate");
+ return const0_rtx;
+ }
+ if (target == 0
+ || GET_MODE (target) != tmode
+ || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
+ target = gen_reg_rtx (tmode);
+ pat = GEN_FCN (icode) (target, op0, op1);
+ if (! pat)
+ return 0;
+ emit_insn (pat);
+ return target;
+
+ case ARM_BUILTIN_WSADB:
+ return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadb, arglist, target);
+ case ARM_BUILTIN_WSADH:
+ return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadh, arglist, target);
+ case ARM_BUILTIN_WSADBZ:
+ return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadbz, arglist, target);
+ case ARM_BUILTIN_WSADHZ:
+ return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadhz, arglist, target);
+
+ /* Several three-argument builtins. */
+ case ARM_BUILTIN_WMACS:
+ case ARM_BUILTIN_WMACU:
+ case ARM_BUILTIN_WALIGN:
+ case ARM_BUILTIN_TMIA:
+ case ARM_BUILTIN_TMIAPH:
+ case ARM_BUILTIN_TMIATT:
+ case ARM_BUILTIN_TMIATB:
+ case ARM_BUILTIN_TMIABT:
+ case ARM_BUILTIN_TMIABB:
+ icode = (fcode == ARM_BUILTIN_WMACS ? CODE_FOR_iwmmxt_wmacs
+ : fcode == ARM_BUILTIN_WMACU ? CODE_FOR_iwmmxt_wmacu
+ : fcode == ARM_BUILTIN_TMIA ? CODE_FOR_iwmmxt_tmia
+ : fcode == ARM_BUILTIN_TMIAPH ? CODE_FOR_iwmmxt_tmiaph
+ : fcode == ARM_BUILTIN_TMIABB ? CODE_FOR_iwmmxt_tmiabb
+ : fcode == ARM_BUILTIN_TMIABT ? CODE_FOR_iwmmxt_tmiabt
+ : fcode == ARM_BUILTIN_TMIATB ? CODE_FOR_iwmmxt_tmiatb
+ : fcode == ARM_BUILTIN_TMIATT ? CODE_FOR_iwmmxt_tmiatt
+ : CODE_FOR_iwmmxt_walign);
+ arg0 = TREE_VALUE (arglist);
+ arg1 = TREE_VALUE (TREE_CHAIN (arglist));
+ arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
+ op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
+ op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0);
+ op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0);
+ tmode = insn_data[icode].operand[0].mode;
+ mode0 = insn_data[icode].operand[1].mode;
+ mode1 = insn_data[icode].operand[2].mode;
+ mode2 = insn_data[icode].operand[3].mode;
+
+ if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
+ op0 = copy_to_mode_reg (mode0, op0);
+ if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
+ op1 = copy_to_mode_reg (mode1, op1);
+ if (! (*insn_data[icode].operand[3].predicate) (op2, mode2))
+ op2 = copy_to_mode_reg (mode2, op2);
+ if (target == 0
+ || GET_MODE (target) != tmode
+ || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
+ target = gen_reg_rtx (tmode);
+ pat = GEN_FCN (icode) (target, op0, op1, op2);
+ if (! pat)
+ return 0;
+ emit_insn (pat);
+ return target;
+
+ case ARM_BUILTIN_WZERO:
+ target = gen_reg_rtx (DImode);
+ emit_insn (gen_iwmmxt_clrdi (target));
+ return target;
+
+ default:
+ break;
+ }
+
+ for (i = 0, d = bdesc_2arg; i < sizeof (bdesc_2arg) / sizeof *d; i++, d++)
+ if (d->code == (const enum arm_builtins) fcode)
+ return arm_expand_binop_builtin (d->icode, arglist, target);
+
+ for (i = 0, d = bdesc_1arg; i < sizeof (bdesc_1arg) / sizeof *d; i++, d++)
+ if (d->code == (const enum arm_builtins) fcode)
+ return arm_expand_unop_builtin (d->icode, arglist, target, 0);
+
+ /* @@@ Should really do something sensible here. */
+ return NULL_RTX;
+}
+
/* Recursively search through all of the blocks in a function
checking to see if any of the variables created in that
function match the RTX called 'orig'. If they do then
@@ -11641,6 +12842,37 @@ aof_globalize_label (FILE *stream, const char *name)
}
static void
+aof_file_start ()
+{
+ fputs ("__r0\tRN\t0\n", asm_out_file);
+ fputs ("__a1\tRN\t0\n", asm_out_file);
+ fputs ("__a2\tRN\t1\n", asm_out_file);
+ fputs ("__a3\tRN\t2\n", asm_out_file);
+ fputs ("__a4\tRN\t3\n", asm_out_file);
+ fputs ("__v1\tRN\t4\n", asm_out_file);
+ fputs ("__v2\tRN\t5\n", asm_out_file);
+ fputs ("__v3\tRN\t6\n", asm_out_file);
+ fputs ("__v4\tRN\t7\n", asm_out_file);
+ fputs ("__v5\tRN\t8\n", asm_out_file);
+ fputs ("__v6\tRN\t9\n", asm_out_file);
+ fputs ("__sl\tRN\t10\n", asm_out_file);
+ fputs ("__fp\tRN\t11\n", asm_out_file);
+ fputs ("__ip\tRN\t12\n", asm_out_file);
+ fputs ("__sp\tRN\t13\n", asm_out_file);
+ fputs ("__lr\tRN\t14\n", asm_out_file);
+ fputs ("__pc\tRN\t15\n", asm_out_file);
+ fputs ("__f0\tFN\t0\n", asm_out_file);
+ fputs ("__f1\tFN\t1\n", asm_out_file);
+ fputs ("__f2\tFN\t2\n", asm_out_file);
+ fputs ("__f3\tFN\t3\n", asm_out_file);
+ fputs ("__f4\tFN\t4\n", asm_out_file);
+ fputs ("__f5\tFN\t5\n", asm_out_file);
+ fputs ("__f6\tFN\t6\n", asm_out_file);
+ fputs ("__f7\tFN\t7\n", asm_out_file);
+ text_section ();
+}
+
+static void
aof_file_end (void)
{
if (flag_pic)
@@ -11783,3 +13015,64 @@ arm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
fputs ("(PLT)", file);
fputc ('\n', file);
}
+
+int
+arm_emit_vector_const (file, x)
+ FILE * file;
+ rtx x;
+{
+ int i;
+ const char * pattern;
+
+ if (GET_CODE (x) != CONST_VECTOR)
+ abort ();
+
+ switch (GET_MODE (x))
+ {
+ case V2SImode: pattern = "%08x"; break;
+ case V4HImode: pattern = "%04x"; break;
+ case V8QImode: pattern = "%02x"; break;
+ default: abort ();
+ }
+
+ fprintf (file, "0x");
+ for (i = CONST_VECTOR_NUNITS (x); i--;)
+ {
+ rtx element;
+
+ element = CONST_VECTOR_ELT (x, i);
+ fprintf (file, pattern, INTVAL (element));
+ }
+
+ return 1;
+}
+
+const char *
+arm_output_load_gr (operands)
+ rtx * operands;
+{
+ rtx reg;
+ rtx offset;
+ rtx wcgr;
+ rtx sum;
+
+ if (GET_CODE (operands [1]) != MEM
+ || GET_CODE (sum = XEXP (operands [1], 0)) != PLUS
+ || GET_CODE (reg = XEXP (sum, 0)) != REG
+ || GET_CODE (offset = XEXP (sum, 1)) != CONST_INT
+ || ((INTVAL (offset) < 1024) && (INTVAL (offset) > -1024)))
+ return "wldrw%?\t%0, %1";
+
+ /* Fix up an out-of-range load of a GR register. */
+ output_asm_insn ("str%?\t%0, [sp, #-4]!\t@ Start of GR load expansion", & reg);
+ wcgr = operands[0];
+ operands[0] = reg;
+ output_asm_insn ("ldr%?\t%0, %1", operands);
+
+ operands[0] = wcgr;
+ operands[1] = reg;
+ output_asm_insn ("tmcr%?\t%0, %1", operands);
+ output_asm_insn ("ldr%?\t%0, [sp], #4\t@ End of GR load expansion", & reg);
+
+ return "";
+}
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index c923e01f2c8..14223cee7c7 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -97,6 +97,7 @@
#define TARGET_CPU_arm9tdmi 0x0080
#define TARGET_CPU_xscale 0x0100
#define TARGET_CPU_ep9312 0x0200
+#define TARGET_CPU_iwmmxt 0x0400
/* Configure didn't specify. */
#define TARGET_CPU_generic 0x8000
@@ -265,6 +266,9 @@ Unrecognized value in TARGET_CPU_DEFAULT.
%{mcpu=xscale:-D__XSCALE__} \
%{mcpu=ep9312:-D__ARM_ARCH_4T__} \
%{mcpu=ep9312:-D__MAVERICK__} \
+ %{mcpu=iwmmxt:-D__ARM_ARCH_5TE__} \
+ %{mcpu=iwmmxt:-D__XSCALE__} \
+ %{mcpu=iwmmxt:-D__IWMMXT__} \
%{!mcpu*:%(cpp_cpu_arch_default)}} \
"
@@ -406,6 +410,8 @@ Unrecognized value in TARGET_CPU_DEFAULT.
#define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT)
#define TARGET_CIRRUS (arm_is_cirrus)
#define TARGET_ANY_HARD_FLOAT (TARGET_HARD_FLOAT || TARGET_CIRRUS)
+#define TARGET_IWMMXT (arm_arch_iwmmxt)
+#define TARGET_REALLY_IWMMXT (TARGET_IWMMXT && TARGET_ARM)
#define TARGET_VFP (target_flags & ARM_FLAG_VFP)
#define TARGET_BIG_END (target_flags & ARM_FLAG_BIG_END)
#define TARGET_INTERWORK (target_flags & ARM_FLAG_INTERWORK)
@@ -623,6 +629,9 @@ extern int arm_is_strong;
/* Nonzero if this chip is a Cirrus variant. */
extern int arm_is_cirrus;
+/* Nonzero if this chip supports Intel XScale with Wireless MMX technology. */
+extern int arm_arch_iwmmxt;
+
/* Nonzero if this chip is an XScale. */
extern int arm_arch_xscale;
@@ -729,6 +738,8 @@ extern int arm_is_6_or_7;
#define PARM_BOUNDARY 32
+#define IWMMXT_ALIGNMENT 64
+
#define STACK_BOUNDARY 32
#define PREFERRED_STACK_BOUNDARY (TARGET_ATPCS ? 64 : 32)
@@ -742,13 +753,53 @@ extern int arm_is_6_or_7;
#define EMPTY_FIELD_BOUNDARY 32
-#define BIGGEST_ALIGNMENT 32
+#define BIGGEST_ALIGNMENT (TARGET_REALLY_IWMMXT ? 64 : 32)
+
+#define TYPE_NEEDS_IWMMXT_ALIGNMENT(TYPE) \
+ (TARGET_REALLY_IWMMXT \
+ && ((TREE_CODE (TYPE) == VECTOR_TYPE) || (TYPE_MODE (TYPE) == DImode) || (TYPE_MODE (TYPE) == DFmode)))
+
+/* XXX Blah -- this macro is used directly by libobjc. Since it
+ supports no vector modes, cut out the complexity and fall back
+ on BIGGEST_FIELD_ALIGNMENT. */
+#ifdef IN_TARGET_LIBS
+#define BIGGEST_FIELD_ALIGNMENT BIGGEST_ALIGNMENT
+#else
+/* An expression for the alignment of a structure field FIELD if the
+ alignment computed in the usual way is COMPUTED. GCC uses this
+ value instead of the value in `BIGGEST_ALIGNMENT' or
+ `BIGGEST_FIELD_ALIGNMENT', if defined, for structure fields only. */
+#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
+ (TYPE_NEEDS_IWMMXT_ALIGNMENT (TREE_TYPE (FIELD)) \
+ ? IWMMXT_ALIGNMENT \
+ : (COMPUTED))
+#endif
+
+/* If defined, a C expression to compute the alignment for a static variable.
+ TYPE is the data type, and ALIGN is the alignment that the object
+ would ordinarily have. The value of this macro is used instead of that
+ alignment to align the object.
+
+ If this macro is not defined, then ALIGN is used. */
+#define DATA_ALIGNMENT(TYPE, ALIGN) \
+ (TYPE_NEEDS_IWMMXT_ALIGNMENT (TYPE) ? IWMMXT_ALIGNMENT : ALIGN)
+
+/* If defined, a C expression to compute the alignment for a
+ variables in the local store. TYPE is the data type, and
+ BASIC-ALIGN is the alignment that the object would ordinarily
+ have. The value of this macro is used instead of that alignment
+ to align the object.
+
+ If this macro is not defined, then BASIC-ALIGN is used. */
+#define LOCAL_ALIGNMENT(TYPE, ALIGN) \
+ (TYPE_NEEDS_IWMMXT_ALIGNMENT (TYPE) ? IWMMXT_ALIGNMENT : ALIGN)
/* Make strings word-aligned so strcpy from constants will be faster. */
#define CONSTANT_ALIGNMENT_FACTOR (TARGET_THUMB || ! arm_arch_xscale ? 1 : 2)
#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
- ((TREE_CODE (EXP) == STRING_CST \
+ ((TARGET_REALLY_IWMMXT && TREE_CODE (EXP) == VECTOR_TYPE) ? IWMMXT_ALIGNMENT : \
+ (TREE_CODE (EXP) == STRING_CST \
&& (ALIGN) < BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR) \
? BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR : (ALIGN))
@@ -848,7 +899,10 @@ extern const char * structure_size_string;
0,0,0,0,0,0,0,0, \
1,1,1, \
1,1,1,1,1,1,1,1, \
- 1,1,1,1,1,1,1,1 \
+ 1,1,1,1,1,1,1,1, \
+ 1,1,1,1,1,1,1,1, \
+ 1,1,1,1,1,1,1,1, \
+ 1,1,1,1 \
}
/* 1 for registers not available across function calls.
@@ -866,7 +920,10 @@ extern const char * structure_size_string;
1,1,1,1,0,0,0,0, \
1,1,1, \
1,1,1,1,1,1,1,1, \
- 1,1,1,1,1,1,1,1 \
+ 1,1,1,1,1,1,1,1, \
+ 1,1,1,1,1,1,1,1, \
+ 1,1,1,1,1,1,1,1, \
+ 1,1,1,1 \
}
#ifndef SUBTARGET_CONDITIONAL_REGISTER_USAGE
@@ -897,6 +954,26 @@ extern const char * structure_size_string;
} \
} \
\
+ if (TARGET_REALLY_IWMMXT) \
+ { \
+ regno = FIRST_IWMMXT_GR_REGNUM; \
+ /* The 2002/10/09 revision of the XScale ABI has wCG0 \
+ and wCG1 as call-preserved registers. The 2002/11/21 \
+ revision changed this so that all wCG registers are \
+ scratch registers. */ \
+ for (regno = FIRST_IWMMXT_GR_REGNUM; \
+ regno <= LAST_IWMMXT_GR_REGNUM; ++ regno) \
+ fixed_regs[regno] = call_used_regs[regno] = 0; \
+ /* The XScale ABI has wR0 - wR9 as scratch registers, \
+ the rest as call-preserved registers. */ \
+ for (regno = FIRST_IWMMXT_REGNUM; \
+ regno <= LAST_IWMMXT_REGNUM; ++ regno) \
+ { \
+ fixed_regs[regno] = 0; \
+ call_used_regs[regno] = regno < FIRST_IWMMXT_REGNUM + 10; \
+ } \
+ } \
+ \
if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) \
{ \
fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
@@ -1014,6 +1091,15 @@ extern const char * structure_size_string;
#define FIRST_ARM_FP_REGNUM 16
#define LAST_ARM_FP_REGNUM 23
+#define FIRST_IWMMXT_GR_REGNUM 43
+#define LAST_IWMMXT_GR_REGNUM 46
+#define FIRST_IWMMXT_REGNUM 47
+#define LAST_IWMMXT_REGNUM 62
+#define IS_IWMMXT_REGNUM(REGNUM) \
+ (((REGNUM) >= FIRST_IWMMXT_REGNUM) && ((REGNUM) <= LAST_IWMMXT_REGNUM))
+#define IS_IWMMXT_GR_REGNUM(REGNUM) \
+ (((REGNUM) >= FIRST_IWMMXT_GR_REGNUM) && ((REGNUM) <= LAST_IWMMXT_GR_REGNUM))
+
/* Base register for access to local variables of the function. */
#define FRAME_POINTER_REGNUM 25
@@ -1027,7 +1113,8 @@ extern const char * structure_size_string;
/* The number of hard registers is 16 ARM + 8 FPA + 1 CC + 1 SFP + 1 AFP. */
/* + 16 Cirrus registers take us up to 43. */
-#define FIRST_PSEUDO_REGISTER 43
+/* Intel Wireless MMX Technology registers add 16 + 4 more. */
+#define FIRST_PSEUDO_REGISTER 63
/* Value should be nonzero if functions must have frame pointers.
Zero means the frame pointer need not be set up (and parms may be accessed
@@ -1064,6 +1151,12 @@ extern const char * structure_size_string;
#define MODES_TIEABLE_P(MODE1, MODE2) \
(GET_MODE_CLASS (MODE1) == GET_MODE_CLASS (MODE2))
+#define VECTOR_MODE_SUPPORTED_P(MODE) \
+ ((MODE) == V2SImode || (MODE) == V4HImode || (MODE) == V8QImode)
+
+#define VALID_IWMMXT_REG_MODE(MODE) \
+ (VECTOR_MODE_SUPPORTED_P (MODE) || (MODE) == DImode)
+
/* The order in which register should be allocated. It is good to use ip
since no saving is required (though calls clobber it) and it never contains
function parameters. It is quite good to use lr since other calls may
@@ -1077,6 +1170,9 @@ extern const char * structure_size_string;
16, 17, 18, 19, 20, 21, 22, 23, \
27, 28, 29, 30, 31, 32, 33, 34, \
35, 36, 37, 38, 39, 40, 41, 42, \
+ 43, 44, 45, 46, 47, 48, 49, 50, \
+ 51, 52, 53, 54, 55, 56, 57, 58, \
+ 59, 60, 61, 62, \
24, 25, 26 \
}
@@ -1096,6 +1192,8 @@ enum reg_class
NO_REGS,
FPA_REGS,
CIRRUS_REGS,
+ IWMMXT_GR_REGS,
+ IWMMXT_REGS,
LO_REGS,
STACK_REG,
BASE_REGS,
@@ -1114,6 +1212,8 @@ enum reg_class
"NO_REGS", \
"FPA_REGS", \
"CIRRUS_REGS", \
+ "IWMMXT_GR_REGS", \
+ "IWMMXT_REGS", \
"LO_REGS", \
"STACK_REG", \
"BASE_REGS", \
@@ -1131,13 +1231,15 @@ enum reg_class
{ 0x00000000, 0x0 }, /* NO_REGS */ \
{ 0x00FF0000, 0x0 }, /* FPA_REGS */ \
{ 0xF8000000, 0x000007FF }, /* CIRRUS_REGS */ \
+ { 0x00000000, 0x00007800 }, /* IWMMXT_GR_REGS */\
+ { 0x00000000, 0x7FFF8000 }, /* IWMMXT_REGS */ \
{ 0x000000FF, 0x0 }, /* LO_REGS */ \
{ 0x00002000, 0x0 }, /* STACK_REG */ \
{ 0x000020FF, 0x0 }, /* BASE_REGS */ \
{ 0x0000FF00, 0x0 }, /* HI_REGS */ \
{ 0x01000000, 0x0 }, /* CC_REG */ \
{ 0x0200FFFF, 0x0 }, /* GENERAL_REGS */\
- { 0xFAFFFFFF, 0x000007FF } /* ALL_REGS */ \
+ { 0xFAFFFFFF, 0x7FFFFFFF } /* ALL_REGS */ \
}
/* The same information, inverted:
@@ -1177,6 +1279,8 @@ enum reg_class
#define REG_CLASS_FROM_LETTER(C) \
( (C) == 'f' ? FPA_REGS \
: (C) == 'v' ? CIRRUS_REGS \
+ : (C) == 'y' ? IWMMXT_REGS \
+ : (C) == 'z' ? IWMMXT_GR_REGS \
: (C) == 'l' ? (TARGET_ARM ? GENERAL_REGS : LO_REGS) \
: TARGET_ARM ? NO_REGS \
: (C) == 'h' ? HI_REGS \
@@ -1292,6 +1396,9 @@ enum reg_class
&& (CONSTANT_P (X) || GET_CODE (X) == SYMBOL_REF)) \
? GENERAL_REGS : \
(TARGET_ARM ? \
+ (((CLASS) == IWMMXT_REGS || (CLASS) == IWMMXT_GR_REGS) \
+ && CONSTANT_P (X)) \
+ ? GENERAL_REGS : \
(((MODE) == HImode && ! arm_arch4 && TARGET_MMU_TRAPS \
&& (GET_CODE (X) == MEM \
|| ((GET_CODE (X) == REG || GET_CODE (X) == SUBREG) \
@@ -1359,7 +1466,7 @@ enum reg_class
} \
while (0)
-/* ??? If an HImode FP+large_offset address is converted to an HImode
+/* XXX If an HImode FP+large_offset address is converted to an HImode
SP+large_offset address, then reload won't know how to fix it. It sees
only that SP isn't valid for HImode, and so reloads the SP into an index
register, but the resulting address is still invalid because the offset
@@ -1405,6 +1512,9 @@ enum reg_class
(TARGET_ARM ? \
((FROM) == FPA_REGS && (TO) != FPA_REGS ? 20 : \
(FROM) != FPA_REGS && (TO) == FPA_REGS ? 20 : \
+ (FROM) == IWMMXT_REGS && (TO) != IWMMXT_REGS ? 4 : \
+ (FROM) != IWMMXT_REGS && (TO) == IWMMXT_REGS ? 4 : \
+ (FROM) == IWMMXT_GR_REGS || (TO) == IWMMXT_GR_REGS ? 20 : \
(FROM) == CIRRUS_REGS && (TO) != CIRRUS_REGS ? 20 : \
(FROM) != CIRRUS_REGS && (TO) == CIRRUS_REGS ? 20 : \
2) \
@@ -1461,6 +1571,8 @@ enum reg_class
? gen_rtx_REG (MODE, FIRST_ARM_FP_REGNUM) \
: TARGET_ARM && TARGET_CIRRUS && GET_MODE_CLASS (MODE) == MODE_FLOAT \
? gen_rtx_REG (MODE, FIRST_CIRRUS_FP_REGNUM) \
+ : TARGET_REALLY_IWMMXT && VECTOR_MODE_SUPPORTED_P (MODE) \
+ ? gen_rtx_REG (MODE, FIRST_IWMMXT_REGNUM) \
: gen_rtx_REG (MODE, ARG_REGISTER (1)))
/* Define how to find the value returned by a function.
@@ -1476,6 +1588,7 @@ enum reg_class
#define FUNCTION_VALUE_REGNO_P(REGNO) \
((REGNO) == ARG_REGISTER (1) \
|| (TARGET_ARM && ((REGNO) == FIRST_CIRRUS_FP_REGNUM) && TARGET_CIRRUS) \
+ || (TARGET_ARM && ((REGNO) == FIRST_IWMMXT_REGNUM) && TARGET_IWMMXT) \
|| (TARGET_ARM && ((REGNO) == FIRST_ARM_FP_REGNUM) && TARGET_HARD_FLOAT))
/* How large values are returned */
@@ -1546,6 +1659,9 @@ typedef struct machine_function GTY(())
unsigned long func_type;
/* Record if the function has a variable argument list. */
int uses_anonymous_args;
+ /* Records if sibcalls are blocked because an argument
+ register is needed to preserve stack alignment. */
+ int sibcall_blocked;
}
machine_function;
@@ -1556,6 +1672,10 @@ typedef struct
{
/* This is the number of registers of arguments scanned so far. */
int nregs;
+ /* This is the number of iWMMXt register arguments scanned so far. */
+ int iwmmxt_nregs;
+ int named_count;
+ int nargs;
/* One of CALL_NORMAL, CALL_LONG or CALL_SHORT . */
int call_cookie;
} CUMULATIVE_ARGS;
@@ -1585,7 +1705,8 @@ typedef struct
this is the number of registers used.
For args passed entirely in registers or entirely in memory, zero. */
#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- ( NUM_ARG_REGS > (CUM).nregs \
+ (VECTOR_MODE_SUPPORTED_P (MODE) ? 0 : \
+ NUM_ARG_REGS > (CUM).nregs \
&& (NUM_ARG_REGS < ((CUM).nregs + ARM_NUM_REGS2 (MODE, TYPE))) \
? NUM_ARG_REGS - (CUM).nregs : 0)
@@ -1608,11 +1729,27 @@ typedef struct
of mode MODE and data type TYPE.
(TYPE is null for libcalls where that information may not be available.) */
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
+ (CUM).nargs += 1; \
+ if (VECTOR_MODE_SUPPORTED_P (MODE)) \
+ if ((CUM).named_count <= (CUM).nargs) \
+ (CUM).nregs += 2; \
+ else \
+ (CUM).iwmmxt_nregs += 1; \
+ else \
(CUM).nregs += ARM_NUM_REGS2 (MODE, TYPE)
+/* If defined, a C expression that gives the alignment boundary, in bits, of an
+ argument with the specified mode and type. If it is not defined,
+ `PARM_BOUNDARY' is used for all arguments. */
+#define FUNCTION_ARG_BOUNDARY(MODE,TYPE) \
+ (TARGET_REALLY_IWMMXT && (VALID_IWMMXT_REG_MODE (MODE) || ((MODE) == DFmode)) \
+ ? IWMMXT_ALIGNMENT : PARM_BOUNDARY)
+
/* 1 if N is a possible register number for function argument passing.
On the ARM, r0-r3 are used to pass args. */
-#define FUNCTION_ARG_REGNO_P(REGNO) (IN_RANGE ((REGNO), 0, 3))
+#define FUNCTION_ARG_REGNO_P(REGNO) \
+ (IN_RANGE ((REGNO), 0, 3) \
+ || (TARGET_REALLY_IWMMXT && IN_RANGE ((REGNO), FIRST_IWMMXT_REGNUM, FIRST_IWMMXT_REGNUM + 9)))
/* Implement `va_arg'. */
#define EXPAND_BUILTIN_VA_ARG(valist, type) \
@@ -1817,7 +1954,7 @@ typedef struct
ldr pc, [pc]
.word static chain value
.word function's address
- ??? FIXME: When the trampoline returns, r8 will be clobbered. */
+ XXX FIXME: When the trampoline returns, r8 will be clobbered. */
#define ARM_TRAMPOLINE_TEMPLATE(FILE) \
{ \
asm_fprintf (FILE, "\tldr\t%r, [%r, #0]\n", \
@@ -2333,14 +2470,14 @@ extern int making_const_table;
/* To support -falign-* switches we need to use .p2align so
that alignment directives in code sections will be padded
with no-op instructions, rather than zeroes. */
-#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
+#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \
if ((LOG) != 0) \
{ \
if ((MAX_SKIP) == 0) \
- fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
+ fprintf ((FILE), "\t.p2align %d\n", (int) (LOG)); \
else \
fprintf ((FILE), "\t.p2align %d,,%d\n", \
- (LOG), (MAX_SKIP)); \
+ (int) (LOG), (int) (MAX_SKIP)); \
}
#endif
@@ -2473,6 +2610,8 @@ extern int making_const_table;
asm_fprintf (STREAM, "%r!", REGNO (XEXP (X, 0))); \
else if (GET_CODE (X) == PLUS) \
{ \
+ if (GET_CODE (XEXP (X, 0)) != REG) \
+ abort (); \
if (GET_CODE (XEXP (X, 1)) == CONST_INT) \
asm_fprintf (STREAM, "[%r, #%wd]", \
REGNO (XEXP (X, 0)), \
@@ -2491,7 +2630,12 @@ extern int making_const_table;
ARM_PRINT_OPERAND_ADDRESS (STREAM, X) \
else \
THUMB_PRINT_OPERAND_ADDRESS (STREAM, X)
-
+
+#define OUTPUT_ADDR_CONST_EXTRA(FILE, X, FAIL) \
+ if (GET_CODE (X) != CONST_VECTOR \
+ || ! arm_emit_vector_const (FILE, X)) \
+ goto FAIL;
+
/* A C expression whose value is RTL representing the value of the return
address for the frame COUNT steps up from the current frame. */
@@ -2567,4 +2711,168 @@ extern int making_const_table;
#define SPECIAL_MODE_PREDICATES \
"cc_register", "dominant_cc_register",
+enum arm_builtins
+{
+ ARM_BUILTIN_GETWCX,
+ ARM_BUILTIN_SETWCX,
+
+ ARM_BUILTIN_WZERO,
+
+ ARM_BUILTIN_WAVG2BR,
+ ARM_BUILTIN_WAVG2HR,
+ ARM_BUILTIN_WAVG2B,
+ ARM_BUILTIN_WAVG2H,
+
+ ARM_BUILTIN_WACCB,
+ ARM_BUILTIN_WACCH,
+ ARM_BUILTIN_WACCW,
+
+ ARM_BUILTIN_WMACS,
+ ARM_BUILTIN_WMACSZ,
+ ARM_BUILTIN_WMACU,
+ ARM_BUILTIN_WMACUZ,
+
+ ARM_BUILTIN_WSADB,
+ ARM_BUILTIN_WSADBZ,
+ ARM_BUILTIN_WSADH,
+ ARM_BUILTIN_WSADHZ,
+
+ ARM_BUILTIN_WALIGN,
+
+ ARM_BUILTIN_TMIA,
+ ARM_BUILTIN_TMIAPH,
+ ARM_BUILTIN_TMIABB,
+ ARM_BUILTIN_TMIABT,
+ ARM_BUILTIN_TMIATB,
+ ARM_BUILTIN_TMIATT,
+
+ ARM_BUILTIN_TMOVMSKB,
+ ARM_BUILTIN_TMOVMSKH,
+ ARM_BUILTIN_TMOVMSKW,
+
+ ARM_BUILTIN_TBCSTB,
+ ARM_BUILTIN_TBCSTH,
+ ARM_BUILTIN_TBCSTW,
+
+ ARM_BUILTIN_WMADDS,
+ ARM_BUILTIN_WMADDU,
+
+ ARM_BUILTIN_WPACKHSS,
+ ARM_BUILTIN_WPACKWSS,
+ ARM_BUILTIN_WPACKDSS,
+ ARM_BUILTIN_WPACKHUS,
+ ARM_BUILTIN_WPACKWUS,
+ ARM_BUILTIN_WPACKDUS,
+
+ ARM_BUILTIN_WADDB,
+ ARM_BUILTIN_WADDH,
+ ARM_BUILTIN_WADDW,
+ ARM_BUILTIN_WADDSSB,
+ ARM_BUILTIN_WADDSSH,
+ ARM_BUILTIN_WADDSSW,
+ ARM_BUILTIN_WADDUSB,
+ ARM_BUILTIN_WADDUSH,
+ ARM_BUILTIN_WADDUSW,
+ ARM_BUILTIN_WSUBB,
+ ARM_BUILTIN_WSUBH,
+ ARM_BUILTIN_WSUBW,
+ ARM_BUILTIN_WSUBSSB,
+ ARM_BUILTIN_WSUBSSH,
+ ARM_BUILTIN_WSUBSSW,
+ ARM_BUILTIN_WSUBUSB,
+ ARM_BUILTIN_WSUBUSH,
+ ARM_BUILTIN_WSUBUSW,
+
+ ARM_BUILTIN_WAND,
+ ARM_BUILTIN_WANDN,
+ ARM_BUILTIN_WOR,
+ ARM_BUILTIN_WXOR,
+
+ ARM_BUILTIN_WCMPEQB,
+ ARM_BUILTIN_WCMPEQH,
+ ARM_BUILTIN_WCMPEQW,
+ ARM_BUILTIN_WCMPGTUB,
+ ARM_BUILTIN_WCMPGTUH,
+ ARM_BUILTIN_WCMPGTUW,
+ ARM_BUILTIN_WCMPGTSB,
+ ARM_BUILTIN_WCMPGTSH,
+ ARM_BUILTIN_WCMPGTSW,
+
+ ARM_BUILTIN_TEXTRMSB,
+ ARM_BUILTIN_TEXTRMSH,
+ ARM_BUILTIN_TEXTRMSW,
+ ARM_BUILTIN_TEXTRMUB,
+ ARM_BUILTIN_TEXTRMUH,
+ ARM_BUILTIN_TEXTRMUW,
+ ARM_BUILTIN_TINSRB,
+ ARM_BUILTIN_TINSRH,
+ ARM_BUILTIN_TINSRW,
+
+ ARM_BUILTIN_WMAXSW,
+ ARM_BUILTIN_WMAXSH,
+ ARM_BUILTIN_WMAXSB,
+ ARM_BUILTIN_WMAXUW,
+ ARM_BUILTIN_WMAXUH,
+ ARM_BUILTIN_WMAXUB,
+ ARM_BUILTIN_WMINSW,
+ ARM_BUILTIN_WMINSH,
+ ARM_BUILTIN_WMINSB,
+ ARM_BUILTIN_WMINUW,
+ ARM_BUILTIN_WMINUH,
+ ARM_BUILTIN_WMINUB,
+
+ ARM_BUILTIN_WMULUH,
+ ARM_BUILTIN_WMULSH,
+ ARM_BUILTIN_WMULUL,
+
+ ARM_BUILTIN_PSADBH,
+ ARM_BUILTIN_WSHUFH,
+
+ ARM_BUILTIN_WSLLH,
+ ARM_BUILTIN_WSLLW,
+ ARM_BUILTIN_WSLLD,
+ ARM_BUILTIN_WSRAH,
+ ARM_BUILTIN_WSRAW,
+ ARM_BUILTIN_WSRAD,
+ ARM_BUILTIN_WSRLH,
+ ARM_BUILTIN_WSRLW,
+ ARM_BUILTIN_WSRLD,
+ ARM_BUILTIN_WRORH,
+ ARM_BUILTIN_WRORW,
+ ARM_BUILTIN_WRORD,
+ ARM_BUILTIN_WSLLHI,
+ ARM_BUILTIN_WSLLWI,
+ ARM_BUILTIN_WSLLDI,
+ ARM_BUILTIN_WSRAHI,
+ ARM_BUILTIN_WSRAWI,
+ ARM_BUILTIN_WSRADI,
+ ARM_BUILTIN_WSRLHI,
+ ARM_BUILTIN_WSRLWI,
+ ARM_BUILTIN_WSRLDI,
+ ARM_BUILTIN_WRORHI,
+ ARM_BUILTIN_WRORWI,
+ ARM_BUILTIN_WRORDI,
+
+ ARM_BUILTIN_WUNPCKIHB,
+ ARM_BUILTIN_WUNPCKIHH,
+ ARM_BUILTIN_WUNPCKIHW,
+ ARM_BUILTIN_WUNPCKILB,
+ ARM_BUILTIN_WUNPCKILH,
+ ARM_BUILTIN_WUNPCKILW,
+
+ ARM_BUILTIN_WUNPCKEHSB,
+ ARM_BUILTIN_WUNPCKEHSH,
+ ARM_BUILTIN_WUNPCKEHSW,
+ ARM_BUILTIN_WUNPCKEHUB,
+ ARM_BUILTIN_WUNPCKEHUH,
+ ARM_BUILTIN_WUNPCKEHUW,
+ ARM_BUILTIN_WUNPCKELSB,
+ ARM_BUILTIN_WUNPCKELSH,
+ ARM_BUILTIN_WUNPCKELSW,
+ ARM_BUILTIN_WUNPCKELUB,
+ ARM_BUILTIN_WUNPCKELUH,
+ ARM_BUILTIN_WUNPCKELUW,
+
+ ARM_BUILTIN_MAX
+};
#endif /* ! GCC_ARM_H */
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index d03c193aba9..339763ad627 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -75,6 +75,18 @@
; and stack frame generation. Operand 0 is the
; register to "use".
(UNSPEC_CHECK_ARCH 7); Set CCs to indicate 26-bit or 32-bit mode.
+ (UNSPEC_WSHUFH 8) ; Used by the instrinsic form of the iWMMXt WSHUFH instruction.
+ (UNSPEC_WACC 9) ; Used by the instrinsic form of the iWMMXt WACC instruction.
+ (UNSPEC_TMOVMSK 10) ; Used by the instrinsic form of the iWMMXt TMOVMSK instruction.
+ (UNSPEC_WSAD 11) ; Used by the instrinsic form of the iWMMXt WSAD instruction.
+ (UNSPEC_WSADZ 12) ; Used by the instrinsic form of the iWMMXt WSADZ instruction.
+ (UNSPEC_WMACS 13) ; Used by the instrinsic form of the iWMMXt WMACS instruction.
+ (UNSPEC_WMACU 14) ; Used by the instrinsic form of the iWMMXt WMACU instruction.
+ (UNSPEC_WMACSZ 15) ; Used by the instrinsic form of the iWMMXt WMACSZ instruction.
+ (UNSPEC_WMACUZ 16) ; Used by the instrinsic form of the iWMMXt WMACUZ instruction.
+ (UNSPEC_CLRDI 17) ; Used by the instrinsic form of the iWMMXt CLRDI instruction.
+ (UNSPEC_WMADDS 18) ; Used by the instrinsic form of the iWMMXt WMADDS instruction.
+ (UNSPEC_WMADDU 19) ; Used by the instrinsic form of the iWMMXt WMADDU instruction.
]
)
@@ -99,6 +111,12 @@
; a 32-bit object.
(VUNSPEC_POOL_8 7) ; `pool-entry(8)'. An entry in the constant pool for
; a 64-bit object.
+ (VUNSPEC_TMRC 8) ; Used by the iWMMXt TMRC instruction.
+ (VUNSPEC_TMCR 9) ; Used by the iWMMXt TMCR instruction.
+ (VUNSPEC_ALIGN8 10) ; 8-byte alignment version of VUNSPEC_ALIGN
+ (VUNSPEC_WCMP_EQ 11) ; Used by the iWMMXt WCMPEQ instructions
+ (VUNSPEC_WCMP_GTU 12) ; Used by the iWMMXt WCMPGTU instructions
+ (VUNSPEC_WCMP_GT 13) ; Used by the iwMMXT WCMPGT instructions
]
)
@@ -1369,7 +1387,7 @@
(match_operator:DI 6 "logical_binary_operator"
[(match_operand:DI 1 "s_register_operand" "")
(match_operand:DI 2 "s_register_operand" "")]))]
- "TARGET_ARM && reload_completed"
+ "TARGET_ARM && reload_completed && ! IS_IWMMXT_REGNUM (REGNO (operands[0]))"
[(set (match_dup 0) (match_op_dup:SI 6 [(match_dup 1) (match_dup 2)]))
(set (match_dup 3) (match_op_dup:SI 6 [(match_dup 4) (match_dup 5)]))]
"
@@ -1446,7 +1464,7 @@
[(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
(and:DI (match_operand:DI 1 "s_register_operand" "%0,r")
(match_operand:DI 2 "s_register_operand" "r,r")))]
- "TARGET_ARM"
+ "TARGET_ARM && ! TARGET_IWMMXT"
"#"
[(set_attr "length" "8")]
)
@@ -1800,7 +1818,7 @@
(match_operand:DI 2 "s_register_operand" "0,r")))]
"TARGET_ARM"
"#"
- "TARGET_ARM && reload_completed"
+ "TARGET_ARM && reload_completed && ! IS_IWMMXT_REGNUM (REGNO (operands[0]))"
[(set (match_dup 0) (and:SI (not:SI (match_dup 1)) (match_dup 2)))
(set (match_dup 3) (and:SI (not:SI (match_dup 4)) (match_dup 5)))]
"
@@ -1926,7 +1944,7 @@
[(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
(ior:DI (match_operand:DI 1 "s_register_operand" "%0,r")
(match_operand:DI 2 "s_register_operand" "r,r")))]
- "TARGET_ARM"
+ "TARGET_ARM && ! TARGET_IWMMXT"
"#"
[(set_attr "length" "8")
(set_attr "predicable" "yes")]
@@ -2048,7 +2066,7 @@
[(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
(xor:DI (match_operand:DI 1 "s_register_operand" "%0,r")
(match_operand:DI 2 "s_register_operand" "r,r")))]
- "TARGET_ARM"
+ "TARGET_ARM && !TARGET_IWMMXT"
"#"
[(set_attr "length" "8")
(set_attr "predicable" "yes")]
@@ -2390,7 +2408,7 @@
[(set (match_operand:DI 0 "s_register_operand" "")
(ashift:DI (match_operand:DI 1 "general_operand" "")
(match_operand:SI 2 "general_operand" "")))]
- "TARGET_ARM && (TARGET_CIRRUS)"
+ "TARGET_ARM && (TARGET_IWMMXT || TARGET_CIRRUS)"
"
if (! s_register_operand (operands[1], DImode))
operands[1] = copy_to_mode_reg (DImode, operands[1]);
@@ -3588,7 +3606,7 @@
(define_insn "*arm_movdi"
[(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, o<>")
(match_operand:DI 1 "di_operand" "rIK,mi,r"))]
- "TARGET_ARM && !TARGET_CIRRUS"
+ "TARGET_ARM && !TARGET_CIRRUS && ! TARGET_IWMMXT"
"*
return (output_move_double (operands));
"
@@ -3687,7 +3705,7 @@
(define_insn "*arm_movsi_insn"
[(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r, m")
(match_operand:SI 1 "general_operand" "rI,K,mi,r"))]
- "TARGET_ARM
+ "TARGET_ARM && ! TARGET_IWMMXT
&& ( register_operand (operands[0], SImode)
|| register_operand (operands[1], SImode))"
"@
@@ -4741,6 +4759,28 @@
(set_attr "type" "*,load,store2,load,store2,*")
(set_attr "pool_range" "*,*,*,1020,*,*")]
)
+
+;; Vector Moves
+(define_expand "movv2si"
+ [(set (match_operand:V2SI 0 "nonimmediate_operand" "")
+ (match_operand:V2SI 1 "general_operand" ""))]
+ "TARGET_REALLY_IWMMXT"
+{
+})
+
+(define_expand "movv4hi"
+ [(set (match_operand:V4HI 0 "nonimmediate_operand" "")
+ (match_operand:V4HI 1 "general_operand" ""))]
+ "TARGET_REALLY_IWMMXT"
+{
+})
+
+(define_expand "movv8qi"
+ [(set (match_operand:V8QI 0 "nonimmediate_operand" "")
+ (match_operand:V8QI 1 "general_operand" ""))]
+ "TARGET_REALLY_IWMMXT"
+{
+})
;; load- and store-multiple insns
@@ -5972,7 +6012,7 @@
)
(define_insn "*call_value_indirect"
- [(set (match_operand 0 "" "=l")
+ [(set (match_operand 0 "" "")
(call (mem:SI (match_operand:SI 1 "register_operand" "l*r"))
(match_operand 2 "" "")))
(use (match_operand 3 "" ""))
@@ -6011,8 +6051,8 @@
)
(define_insn "*call_value_reg"
- [(set (match_operand 0 "" "=r,f,v")
- (call (mem:SI (match_operand:SI 1 "s_register_operand" "r,r,r"))
+ [(set (match_operand 0 "" "")
+ (call (mem:SI (match_operand:SI 1 "s_register_operand" "r"))
(match_operand 2 "" "")))
(use (match_operand 3 "" ""))
(clobber (reg:SI LR_REGNUM))]
@@ -6025,8 +6065,8 @@
)
(define_insn "*call_value_mem"
- [(set (match_operand 0 "" "=r,f,v")
- (call (mem:SI (match_operand:SI 1 "memory_operand" "m,m,m"))
+ [(set (match_operand 0 "" "")
+ (call (mem:SI (match_operand:SI 1 "memory_operand" "m"))
(match_operand 2 "" "")))
(use (match_operand 3 "" ""))
(clobber (reg:SI LR_REGNUM))]
@@ -6042,7 +6082,7 @@
;; The 'a' causes the operand to be treated as an address, i.e. no '#' output.
(define_insn "*call_symbol"
- [(call (mem:SI (match_operand:SI 0 "" "X"))
+ [(call (mem:SI (match_operand:SI 0 "" ""))
(match_operand 1 "" ""))
(use (match_operand 2 "" ""))
(clobber (reg:SI LR_REGNUM))]
@@ -6057,8 +6097,8 @@
)
(define_insn "*call_value_symbol"
- [(set (match_operand 0 "s_register_operand" "=r,f,v")
- (call (mem:SI (match_operand:SI 1 "" "X,X,X"))
+ [(set (match_operand 0 "s_register_operand" "")
+ (call (mem:SI (match_operand:SI 1 "" ""))
(match_operand:SI 2 "" "")))
(use (match_operand 3 "" ""))
(clobber (reg:SI LR_REGNUM))]
@@ -6073,7 +6113,7 @@
)
(define_insn "*call_insn"
- [(call (mem:SI (match_operand:SI 0 "" "X"))
+ [(call (mem:SI (match_operand:SI 0 "" ""))
(match_operand:SI 1 "" ""))
(use (match_operand 2 "" ""))
(clobber (reg:SI LR_REGNUM))]
@@ -6086,8 +6126,8 @@
)
(define_insn "*call_value_insn"
- [(set (match_operand 0 "register_operand" "=l")
- (call (mem:SI (match_operand 1 "" "X"))
+ [(set (match_operand 0 "register_operand" "")
+ (call (mem:SI (match_operand 1 "" ""))
(match_operand 2 "" "")))
(use (match_operand 3 "" ""))
(clobber (reg:SI LR_REGNUM))]
@@ -6140,8 +6180,8 @@
)
(define_insn "*sibcall_value_insn"
- [(set (match_operand 0 "s_register_operand" "=r,f,v")
- (call (mem:SI (match_operand:SI 1 "" "X,X,X"))
+ [(set (match_operand 0 "s_register_operand" "")
+ (call (mem:SI (match_operand:SI 1 "" "X"))
(match_operand 2 "" "")))
(return)
(use (match_operand 3 "" ""))]
@@ -6166,6 +6206,7 @@
return output_return_instruction (const_true_rtx, TRUE, FALSE);
}"
[(set_attr "type" "load")
+ (set_attr "length" "12")
(set_attr "predicable" "yes")]
)
@@ -6186,6 +6227,7 @@
return output_return_instruction (operands[0], TRUE, FALSE);
}"
[(set_attr "conds" "use")
+ (set_attr "length" "12")
(set_attr "type" "load")]
)
@@ -8324,7 +8366,10 @@
(match_dup 0)
(match_operand 4 "" "")))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_ARM && reload_completed"
+ ;; Note we have to suppress this split for the iwmmxt because it
+ ;; creates a conditional movsi and the iwmmxt_movsi_insn pattern
+ ;; is not predicable. This sucks.
+ "TARGET_ARM && reload_completed && ! TARGET_IWMMXT"
[(set (match_dup 5) (match_dup 6))
(cond_exec (match_dup 7)
(set (match_dup 0) (match_dup 4)))]
@@ -8352,7 +8397,10 @@
(match_operand 4 "" "")
(match_dup 0)))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_ARM && reload_completed"
+ ;; Note we have to suppress this split for the iwmmxt because it
+ ;; creates a conditional movsi and the iwmmxt_movsi_insn pattern
+ ;; is not predicable. This sucks.
+ "TARGET_ARM && reload_completed && ! TARGET_IWMMXT"
[(set (match_dup 5) (match_dup 6))
(cond_exec (match_op_dup 1 [(match_dup 5) (const_int 0)])
(set (match_dup 0) (match_dup 4)))]
@@ -8373,7 +8421,10 @@
(match_operand 4 "" "")
(match_operand 5 "" "")))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_ARM && reload_completed"
+ ;; Note we have to suppress this split for the iwmmxt because it
+ ;; creates a conditional movsi and the iwmmxt_movsi_insn pattern
+ ;; is not predicable. This sucks.
+ "TARGET_ARM && reload_completed && ! TARGET_IWMMXT"
[(set (match_dup 6) (match_dup 7))
(cond_exec (match_op_dup 1 [(match_dup 6) (const_int 0)])
(set (match_dup 0) (match_dup 4)))
@@ -8405,7 +8456,10 @@
(not:SI
(match_operand:SI 5 "s_register_operand" ""))))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_ARM && reload_completed"
+ ;; Note we have to suppress this split for the iwmmxt because it
+ ;; creates a conditional movsi and the iwmmxt_movsi_insn pattern
+ ;; is not predicable. This sucks.
+ "TARGET_ARM && reload_completed && ! TARGET_IWMMXT"
[(set (match_dup 6) (match_dup 7))
(cond_exec (match_op_dup 1 [(match_dup 6) (const_int 0)])
(set (match_dup 0) (match_dup 4)))
@@ -8559,6 +8613,15 @@
"
)
+(define_insn "align_8"
+ [(unspec_volatile [(const_int 0)] VUNSPEC_ALIGN8)]
+ "TARGET_REALLY_IWMMXT"
+ "*
+ assemble_align (64);
+ return \"\";
+ "
+)
+
(define_insn "consttable_end"
[(unspec_volatile [(const_int 0)] VUNSPEC_POOL_END)]
"TARGET_EITHER"
@@ -8745,3 +8808,5 @@
(include "fpa.md")
;; Load the Maverick co-processor patterns
(include "cirrus.md")
+;; Load the Intel Wireless Multimedia Extension patterns
+(include "iwmmxt.md")
diff --git a/gcc/config/arm/coff.h b/gcc/config/arm/coff.h
index df47bcf3c8b..c4f0932e9ce 100644
--- a/gcc/config/arm/coff.h
+++ b/gcc/config/arm/coff.h
@@ -45,21 +45,7 @@
#include "dbxcoff.h"
-/* A C statement to output assembler commands which will identify the
- object file as having been compiled with GCC (or another GNU
- compiler). */
-
-/* This outputs a lot of .req's to define alias for various registers.
- Let's try to avoid this. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(STREAM) \
- do \
- { \
- fprintf (STREAM, "%s Generated by gcc %s for ARM/coff\n", \
- ASM_COMMENT_START, version_string); \
- fprintf (STREAM, ASM_APP_OFF); \
- } \
- while (0)
+#define TARGET_ASM_FILE_START_APP_OFF true
/* Switch into a generic section. */
#define TARGET_ASM_NAMED_SECTION default_coff_asm_named_section
diff --git a/gcc/config/arm/elf.h b/gcc/config/arm/elf.h
index 89f18f26190..581f7267900 100644
--- a/gcc/config/arm/elf.h
+++ b/gcc/config/arm/elf.h
@@ -114,20 +114,8 @@
{ "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" }
#endif
-
-/* This outputs a lot of .req's to define alias for various registers.
- Let's try to avoid this. */
-#ifndef ASM_FILE_START
-#define ASM_FILE_START(STREAM) \
- do \
- { \
- fprintf (STREAM, "%s Generated by gcc %s for ARM/elf\n", \
- ASM_COMMENT_START, version_string); \
- output_file_directive (STREAM, main_input_filename); \
- fprintf (STREAM, ASM_APP_OFF); \
- } \
- while (0)
-#endif
+#define TARGET_ASM_FILE_START_APP_OFF true
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION arm_elf_asm_named_section
diff --git a/gcc/config/arm/freebsd.h b/gcc/config/arm/freebsd.h
index ef599ad9cc7..fd79f1f3c68 100644
--- a/gcc/config/arm/freebsd.h
+++ b/gcc/config/arm/freebsd.h
@@ -47,8 +47,5 @@
#undef SUBTARGET_CPU_DEFAULT
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_strongarm
-#undef ARM_OS_NAME
-#define ARM_OS_NAME "FreeBSD"
-
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (FreeBSD/StrongARM ELF)");
diff --git a/gcc/config/arm/lib1funcs.asm b/gcc/config/arm/lib1funcs.asm
index 03b71a835ba..f80af2dd60e 100644
--- a/gcc/config/arm/lib1funcs.asm
+++ b/gcc/config/arm/lib1funcs.asm
@@ -158,11 +158,12 @@ divisor .req r1
overdone .req r2
result .req r2
curbit .req r3
+#if 0
ip .req r12
sp .req r13
lr .req r14
pc .req r15
-
+#endif
/* ------------------------------------------------------------------------ */
/* Bodies of the divsion and modulo routines. */
/* ------------------------------------------------------------------------ */
diff --git a/gcc/config/arm/linux-gas.h b/gcc/config/arm/linux-gas.h
index f3ed5f88670..69112841893 100644
--- a/gcc/config/arm/linux-gas.h
+++ b/gcc/config/arm/linux-gas.h
@@ -23,10 +23,6 @@
/* This is how we tell the assembler that a symbol is weak.
GAS always supports weak symbols. */
-/* This is used in ASM_FILE_START. */
-#undef ARM_OS_NAME
-#define ARM_OS_NAME "Linux"
-
/* Unsigned chars produces much better code than signed. */
#define DEFAULT_SIGNED_CHAR 0
diff --git a/gcc/config/arm/netbsd-elf.h b/gcc/config/arm/netbsd-elf.h
index 91ba9cd445c..a8b43f645d3 100644
--- a/gcc/config/arm/netbsd-elf.h
+++ b/gcc/config/arm/netbsd-elf.h
@@ -23,10 +23,6 @@
#undef TARGET_VERSION
#define TARGET_VERSION fputs (" (NetBSD/arm ELF)", stderr);
-/* This is used in ASM_FILE_START. */
-#undef ARM_OS_NAME
-#define ARM_OS_NAME "NetBSD"
-
/* arm.h defaults to ARM6 CPU. */
/* This defaults us to little-endian. */
diff --git a/gcc/config/arm/netbsd.h b/gcc/config/arm/netbsd.h
index d7e6837a254..c1db2df5e26 100644
--- a/gcc/config/arm/netbsd.h
+++ b/gcc/config/arm/netbsd.h
@@ -23,10 +23,6 @@
#undef TARGET_VERSION
#define TARGET_VERSION fputs (" (ARM/NetBSD)", stderr);
-/* This is used in ASM_FILE_START. */
-#undef ARM_OS_NAME
-#define ARM_OS_NAME "NetBSD"
-
/* Unsigned chars produces much better code than signed. */
#define DEFAULT_SIGNED_CHAR 0
diff --git a/gcc/config/arm/pe.h b/gcc/config/arm/pe.h
index a8ca0d47543..bd0b6606247 100644
--- a/gcc/config/arm/pe.h
+++ b/gcc/config/arm/pe.h
@@ -104,17 +104,7 @@
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION default_pe_asm_named_section
-/* This outputs a lot of .req's to define alias for various registers.
- Let's try to avoid this. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(STREAM) \
- do \
- { \
- asm_fprintf (STREAM, "%@ Generated by gcc %s for ARM/pe\n",\
- version_string); \
- output_file_directive ((STREAM), main_input_filename); \
- } \
- while (0)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
/* Output a reference to a label. */
#undef ASM_OUTPUT_LABELREF
diff --git a/gcc/config/arm/t-xscale-elf b/gcc/config/arm/t-xscale-elf
index 0efc1d54778..b72c21ce980 100644
--- a/gcc/config/arm/t-xscale-elf
+++ b/gcc/config/arm/t-xscale-elf
@@ -37,6 +37,10 @@ MULTILIB_EXCEPTIONS += *mhard-float/*mthumb*
MULTILIB_REDUNDANT_DIRS = interwork/thumb=thumb
+MULTILIB_OPTIONS += mcpu=iwmmxt
+MULTILIB_DIRNAMES += iwmmxt
+MULTILIB_REDUNDANT_DIRS += interwork/thumb/iwmmxt=thumb
+
EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
LIBGCC = stmp-multilib
diff --git a/gcc/config/avr/avr-protos.h b/gcc/config/avr/avr-protos.h
index f4953887571..fafd36c83fe 100644
--- a/gcc/config/avr/avr-protos.h
+++ b/gcc/config/avr/avr-protos.h
@@ -22,7 +22,6 @@
extern int function_arg_regno_p PARAMS ((int r));
-extern void asm_file_start PARAMS ((FILE *file));
extern void avr_init_once PARAMS ((void));
extern void avr_override_options PARAMS ((void));
extern void avr_optimization_options PARAMS ((int level, int size));
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index fe883f9d3f9..c8dba17e4ef 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -63,6 +63,7 @@ static tree avr_handle_progmem_attribute PARAMS ((tree *, tree, tree, int, boo
static tree avr_handle_fndecl_attribute PARAMS ((tree *, tree, tree, int, bool *));
const struct attribute_spec avr_attribute_table[];
static bool avr_assemble_integer PARAMS ((rtx, unsigned int, int));
+static void avr_file_start PARAMS ((void));
static void avr_file_end PARAMS ((void));
static void avr_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void avr_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
@@ -219,6 +220,10 @@ int avr_case_values_threshold = 30000;
#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
#undef TARGET_ASM_INTEGER
#define TARGET_ASM_INTEGER avr_assemble_integer
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START avr_file_start
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END avr_file_end
@@ -1448,13 +1453,6 @@ final_prescan_insn (insn, operand, num_operands)
rtx_cost (PATTERN (insn), INSN));
}
last_insn_address = INSN_ADDRESSES (uid);
-
- if (TARGET_RTL_DUMP)
- {
- fprintf (asm_out_file, "/*****************\n");
- print_rtl_single (asm_out_file, insn);
- fprintf (asm_out_file, "*****************/\n");
- }
}
/* Return 0 if undefined, 1 if always true or always false. */
@@ -4888,30 +4886,30 @@ avr_section_type_flags (decl, name, reloc)
return flags;
}
-/* Outputs to the stdio stream FILE some
- appropriate text to go at the start of an assembler file. */
+/* Outputs some appropriate text to go at the start of an assembler
+ file. */
-void
-asm_file_start (file)
- FILE *file;
+static void
+avr_file_start ()
{
if (avr_asm_only_p)
error ("MCU `%s' supported for assembler only", avr_mcu_name);
- output_file_directive (file, main_input_filename);
- fprintf (file, "\t.arch %s\n", avr_mcu_name);
+ default_file_start ();
+
+ fprintf (asm_out_file, "\t.arch %s\n", avr_mcu_name);
fputs ("__SREG__ = 0x3f\n"
"__SP_H__ = 0x3e\n"
- "__SP_L__ = 0x3d\n", file);
+ "__SP_L__ = 0x3d\n", asm_out_file);
fputs ("__tmp_reg__ = 0\n"
- "__zero_reg__ = 1\n", file);
+ "__zero_reg__ = 1\n", asm_out_file);
/* FIXME: output these only if there is anything in the .data / .bss
sections - some code size could be saved by not linking in the
initialization code from libgcc if one or both sections are empty. */
- fputs ("\t.global __do_copy_data\n", file);
- fputs ("\t.global __do_clear_bss\n", file);
+ fputs ("\t.global __do_copy_data\n", asm_out_file);
+ fputs ("\t.global __do_clear_bss\n", asm_out_file);
commands_in_file = 0;
commands_in_prologues = 0;
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index 3d09c00b9c0..8cfe48c913b 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -44,7 +44,6 @@ Boston, MA 02111-1307, USA. */
/* This declaration should be present. */
extern int target_flags;
-#define MASK_RTL_DUMP 0x00000010
#define MASK_ALL_DEBUG 0x00000FE0
#define MASK_ORDER_1 0x00001000
#define MASK_INSN_SIZE_DUMP 0x00002000
@@ -65,11 +64,6 @@ extern int target_flags;
#define TARGET_TINY_STACK (target_flags & MASK_TINY_STACK)
#define TARGET_NO_TABLEJUMP (target_flags & MASK_NO_TABLEJUMP)
#define TARGET_SHORT_CALLS (target_flags & MASK_SHORT_CALLS)
-
-/* Dump each assembler insn's rtl into the output file.
- This is for debugging the compiler itself. */
-
-#define TARGET_RTL_DUMP (target_flags & MASK_RTL_DUMP)
#define TARGET_ALL_DEBUG (target_flags & MASK_ALL_DEBUG)
#define TARGET_SWITCHES { \
@@ -86,7 +80,6 @@ extern int target_flags;
N_("Do not generate tablejump insns") }, \
{ "short-calls", MASK_SHORT_CALLS, \
N_("Use rjmp/rcall (limited range) on >8K devices") }, \
- { "rtl", MASK_RTL_DUMP, NULL }, \
{ "size", MASK_INSN_SIZE_DUMP, \
N_("Output instruction sizes to the asm file") }, \
{ "deb", MASK_ALL_DEBUG, NULL }, \
@@ -1687,18 +1680,6 @@ progmem_section () \
This macro is irrelevant if there is no separate readonly data
section. */
-#define ASM_FILE_START(STREAM) asm_file_start (STREAM)
-/* A C expression which outputs to the stdio stream STREAM some
- appropriate text to go at the start of an assembler file.
-
- Normally this macro is defined to output a line containing
- `#NO_APP', which is a comment that has no effect on most
- assemblers but tells the GNU assembler that it can save time by not
- checking for certain assembler constructs.
-
- On systems that use SDB, it is necessary to output certain
- commands; see `attasm.h'. */
-
#define ASM_COMMENT_START " ; "
/* A C string constant describing how to begin a comment in the target
assembler language. The compiler assumes that the comment will
@@ -1718,7 +1699,8 @@ progmem_section () \
time-saving assumptions that are valid for ordinary compiler
output. */
-#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) fprintf (STREAM,"/* line: %d */\n",LINE)
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE, COUNTER) \
+ fprintf (STREAM,"/* line: %d */\n",LINE)
/* A C statement to output DBX or SDB debugging information before
code for line number LINE of the current source file to the stdio
stream STREAM.
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c
index e708521e509..5d097cc0cda 100644
--- a/gcc/config/c4x/c4x.c
+++ b/gcc/config/c4x/c4x.c
@@ -44,7 +44,6 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "loop.h"
#include "recog.h"
-#include "c-tree.h"
#include "ggc.h"
#include "cpplib.h"
#include "toplev.h"
@@ -186,6 +185,7 @@ static int c4x_valid_operands PARAMS ((enum rtx_code, rtx *,
enum machine_mode, int));
static int c4x_arn_reg_operand PARAMS ((rtx, enum machine_mode, unsigned int));
static int c4x_arn_mem_operand PARAMS ((rtx, enum machine_mode, unsigned int));
+static void c4x_file_start PARAMS ((void));
static void c4x_file_end PARAMS ((void));
static void c4x_check_attribute PARAMS ((const char *, tree, tree, tree *));
static int c4x_r11_set_p PARAMS ((rtx));
@@ -208,6 +208,10 @@ static int c4x_address_cost PARAMS ((rtx));
#define TARGET_ASM_ALIGNED_HI_OP NULL
#undef TARGET_ASM_ALIGNED_SI_OP
#define TARGET_ASM_ALIGNED_SI_OP NULL
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START c4x_file_start
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END c4x_file_end
@@ -4564,6 +4568,26 @@ c4x_external_ref (name)
extern_head = p;
}
+/* We need to have a data section we can identify so that we can set
+ the DP register back to a data pointer in the small memory model.
+ This is only required for ISRs if we are paranoid that someone
+ may have quietly changed this register on the sly. */
+static void
+c4x_file_start ()
+{
+ int dspversion = 0;
+ if (TARGET_C30) dspversion = 30;
+ if (TARGET_C31) dspversion = 31;
+ if (TARGET_C32) dspversion = 32;
+ if (TARGET_C33) dspversion = 33;
+ if (TARGET_C40) dspversion = 40;
+ if (TARGET_C44) dspversion = 44;
+
+ default_file_start ();
+ fprintf (asm_out_file, "\t.version\t%d\n", dspversion);
+ fputs ("\n\t.data\ndata_sec:\n", asm_out_file);
+}
+
static void
c4x_file_end ()
diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h
index bea00ffa1c6..fb3622bb313 100644
--- a/gcc/config/c4x/c4x.h
+++ b/gcc/config/c4x/c4x.h
@@ -1548,35 +1548,6 @@ fini_section () \
/* Overall Framework of an Assembler File. */
-/* We need to have a data section we can identify so that we can set
- the DP register back to a data pointer in the small memory model.
- This is only required for ISRs if we are paranoid that someone
- may have quietly changed this register on the sly. */
-
-#define ASM_FILE_START(FILE) \
-{ \
- int dspversion = 0; \
- if (TARGET_C30) dspversion = 30; \
- if (TARGET_C31) dspversion = 31; \
- if (TARGET_C32) dspversion = 32; \
- if (TARGET_C33) dspversion = 33; \
- if (TARGET_C40) dspversion = 40; \
- if (TARGET_C44) dspversion = 44; \
- fprintf (FILE, "\t.version\t%d\n", dspversion); \
- fprintf (FILE, "\t.file\t"); \
- if (TARGET_TI) \
- { \
- const char *p; \
- const char *after_dir = main_input_filename; \
- for (p = main_input_filename; *p; p++) \
- if (*p == '/') \
- after_dir = p + 1; \
- output_quoted_string (FILE, after_dir); \
- } \
- else \
- output_quoted_string (FILE, main_input_filename); \
- fputs ("\n\t.data\ndata_sec:\n", FILE); \
-}
#define ASM_COMMENT_START ";"
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index bff96df76ef..71366725c6e 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -105,6 +105,8 @@ static void cris_operand_lossage PARAMS ((const char *, rtx));
static void cris_asm_output_mi_thunk
PARAMS ((FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
+static void cris_file_start PARAMS ((void));
+
static bool cris_rtx_costs PARAMS ((rtx, int, int, int *));
static int cris_address_cost PARAMS ((rtx));
@@ -162,6 +164,9 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START cris_file_start
+
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS cris_rtx_costs
#undef TARGET_ADDRESS_COST
@@ -2761,6 +2766,24 @@ cris_asm_output_mi_thunk (stream, thunkdecl, delta, vcall_offset, funcdecl)
}
}
+/* Boilerplate emitted at start of file.
+
+ NO_APP *only at file start* means faster assembly. It also means
+ comments are not allowed. In some cases comments will be output
+ for debugging purposes. Make sure they are allowed then.
+
+ We want a .file directive only if TARGET_ELF. */
+static void
+cris_file_start ()
+{
+ /* These expressions can vary at run time, so we cannot put
+ them into TARGET_INITIALIZER. */
+ targetm.file_start_app_off = !(TARGET_PDEBUG || flag_print_asm_name);
+ targetm.file_start_file_directive = TARGET_ELF;
+
+ default_file_start ();
+}
+
/* The EXPAND_BUILTIN_VA_ARG worker. This is modified from the
"standard" implementation of va_arg: read the value from the current
address and increment by the size of one or two registers. The
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index a517830e103..6517cc5d1db 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -1392,24 +1392,6 @@ call_ ## FUNC (void) \
/* Node: File Framework */
-/* NO_APP *only at file start* means faster assembly.
- It also means comments are not allowed.
- In some cases comments will be output for debugging purposes.
- Make sure they are allowed then. */
-/* Override previous definitions (elfos.h). */
-#undef ASM_FILE_START
-#define ASM_FILE_START(STREAM) \
- do \
- { \
- if (TARGET_PDEBUG || flag_print_asm_name) \
- fprintf ((STREAM), "#APP\n"); \
- else \
- fprintf ((STREAM), "#NO_APP\n"); \
- if (TARGET_ELF) \
- output_file_directive ((STREAM), main_input_filename); \
- } \
- while (0)
-
/* We don't want an .ident for gcc. To avoid that but still support
#ident, we override ASM_OUTPUT_IDENT and, since the gcc .ident is its
only use besides ASM_OUTPUT_IDENT, undef IDENT_ASM_OP from elfos.h. */
diff --git a/gcc/config/d30v/d30v.c b/gcc/config/d30v/d30v.c
index 793e6219e61..4093ab27abf 100644
--- a/gcc/config/d30v/d30v.c
+++ b/gcc/config/d30v/d30v.c
@@ -2891,8 +2891,8 @@ d30v_print_operand (stream, x, letter)
letter = 'T';
/* FALLTHRU */
- case 'F': /* Print an appropriate suffix for a false comparision. */
- case 'T': /* Print an appropriate suffix for a true comparision. */
+ case 'F': /* Print an appropriate suffix for a false comparison. */
+ case 'T': /* Print an appropriate suffix for a true comparison. */
/* Note that the sense of appropriate suffix is for conditional execution
and opposite of what branches want. Branches just use the inverse
operation. */
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index eebb0ee12c6..8a959090c56 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -326,9 +326,8 @@ do { text_section (); \
/* Don't output a .file directive. That is only used by the assembler for
error reporting. */
-
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE)
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE false
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END darwin_file_end
diff --git a/gcc/config/dbxcoff.h b/gcc/config/dbxcoff.h
index 1d54ecf3604..c7f675768c6 100644
--- a/gcc/config/dbxcoff.h
+++ b/gcc/config/dbxcoff.h
@@ -55,23 +55,21 @@ Boston, MA 02111-1307, USA. */
current function. */
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
+#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
{ if (write_symbols == SDB_DEBUG) { \
fprintf ((FILE), "\t.ln\t%d\n", \
((sdb_begin_function_line > -1) \
? (LINE) - sdb_begin_function_line : 1)); \
} else if (write_symbols == DBX_DEBUG) { \
- static int sym_lineno = 1; \
char buffer[256]; \
- ASM_GENERATE_INTERNAL_LABEL (buffer, "LM", sym_lineno); \
+ ASM_GENERATE_INTERNAL_LABEL (buffer, "LM", COUNTER); \
fprintf (FILE, ".stabn 68,0,%d,", LINE); \
assemble_name (FILE, buffer); \
putc ('-', FILE); \
assemble_name (FILE, \
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
putc ('\n', FILE); \
- (*targetm.asm_out.internal_label) (FILE, "LM", sym_lineno); \
- sym_lineno++; \
+ (*targetm.asm_out.internal_label) (FILE, "LM", COUNTER); \
} }
/* When generating stabs debugging, use N_BINCL entries. */
diff --git a/gcc/config/dbxelf.h b/gcc/config/dbxelf.h
index dbc8f347eb3..dc048320e7c 100644
--- a/gcc/config/dbxelf.h
+++ b/gcc/config/dbxelf.h
@@ -57,20 +57,18 @@ Boston, MA 02111-1307, USA. */
current function. */
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
+#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
do \
{ \
- static int sym_lineno = 1; \
char temp[256]; \
- ASM_GENERATE_INTERNAL_LABEL (temp, "LM", sym_lineno); \
+ ASM_GENERATE_INTERNAL_LABEL (temp, "LM", COUNTER); \
fprintf (FILE, "\t.stabn 68,0,%d,", LINE); \
assemble_name (FILE, temp); \
putc ('-', FILE); \
assemble_name (FILE, \
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
putc ('\n', FILE); \
- (*targetm.asm_out.internal_label) (FILE, "LM", sym_lineno); \
- sym_lineno += 1; \
+ (*targetm.asm_out.internal_label) (FILE, "LM", COUNTER); \
} \
while (0)
diff --git a/gcc/config/dsp16xx/dsp16xx-protos.h b/gcc/config/dsp16xx/dsp16xx-protos.h
index 91496d91ee2..7e2683fbb74 100644
--- a/gcc/config/dsp16xx/dsp16xx-protos.h
+++ b/gcc/config/dsp16xx/dsp16xx-protos.h
@@ -77,9 +77,6 @@ extern int initial_frame_pointer_offset PARAMS ((void));
extern void asm_output_common PARAMS ((FILE *, const char *, int, int));
extern void asm_output_local PARAMS ((FILE *, const char *, int, int));
extern void asm_output_float PARAMS ((FILE *, double));
-extern void dsp16xx_file_start PARAMS ((void));
-extern void coff_dsp16xx_file_start PARAMS ((FILE *));
-extern void luxworks_dsp16xx_file_start PARAMS ((FILE *));
extern bool dsp16xx_compare_gen;
extern int hard_regno_mode_ok PARAMS ((int, enum machine_mode));
extern enum reg_class dsp16xx_reg_class_from_letter PARAMS ((int));
diff --git a/gcc/config/dsp16xx/dsp16xx.c b/gcc/config/dsp16xx/dsp16xx.c
index 60b8deb46ce..d858706149f 100644
--- a/gcc/config/dsp16xx/dsp16xx.c
+++ b/gcc/config/dsp16xx/dsp16xx.c
@@ -151,6 +151,7 @@ static const char *const lshift_right_asm_first[] =
static int reg_save_size PARAMS ((void));
static void dsp16xx_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void dsp16xx_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
+static void dsp16xx_file_start PARAMS ((void));
static bool dsp16xx_rtx_costs PARAMS ((rtx, int, int, int *));
static int dsp16xx_address_cost PARAMS ((rtx));
@@ -168,6 +169,9 @@ static int dsp16xx_address_cost PARAMS ((rtx));
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE dsp16xx_output_function_epilogue
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START dsp16xx_file_start
+
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS dsp16xx_rtx_costs
#undef TARGET_ADDRESS_COST
@@ -2373,49 +2377,10 @@ dsp16xx_function_arg_advance (cum, mode, type, named)
}
}
-void
-coff_dsp16xx_file_start (file)
- FILE *file;
-{
- fprintf (file, "#include <%s.h>\n", save_chip_name);
-}
-
-void
-luxworks_dsp16xx_file_start (file)
- FILE *file;
+static void
+dsp16xx_file_start ()
{
- char *temp_filename;
- int len, err_code;
-
-
- fprintf (file, "\t.debug ");
- err_code = (TARGET_DEBUG) ? fprintf (file, "yes, ") : fprintf (file, "no, ");
- err_code = (TARGET_SAVE_TEMPS) ? fprintf (file, "asm, ") : fprintf (file, "temp, ");
- len = strlen (main_input_filename);
- temp_filename = (char *) xmalloc (len + 2);
- strcpy (temp_filename, main_input_filename);
-#ifdef __CYGWIN32__
- p = temp_filename;
- while (*p != '\0') {
- if (*p == '\\')
- *p = '/';
- p++;
- }
-#endif
- fprintf (file, "\"%s\"\n", temp_filename);
-
- fprintf (file, "#include <%s.h>\n", save_chip_name);
-
- /*
- * Add dummy sections, so that they always exist in the
- * object code. These have been created so that the number and
- * type of sections remain consistent with and without -g option. Note
- * that the .data, .text, .const and .bss are always created when -g
- * is provided as an option. */
- fprintf (file, "\t.rsect \".text\" , nodelete\n");
- fprintf (file, "\t.rsect \".data\" , nodelete\n");
- fprintf (file, "\t.rsect \".const\" , nodelete\n");
- fprintf (file, "\t.rsect \".bss\" , nodelete\n");
+ fprintf (asm_out_file, "#include <%s.h>\n", save_chip_name);
}
rtx
diff --git a/gcc/config/dsp16xx/dsp16xx.h b/gcc/config/dsp16xx/dsp16xx.h
index 03e237de293..83df03371ea 100644
--- a/gcc/config/dsp16xx/dsp16xx.h
+++ b/gcc/config/dsp16xx/dsp16xx.h
@@ -1487,9 +1487,6 @@ extern struct dsp16xx_frame_info current_frame_info;
/* THE OVERALL FRAMEWORK OF AN ASSEMBLER FILE */
-/* Output at beginning of assembler file. */
-#define ASM_FILE_START(FILE) coff_dsp16xx_file_start (FILE)
-
/* A C string constant describing how to begin a comment in the target
assembler language. */
#define ASM_COMMENT_START ""
diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h
index 3a04661ea33..880d7a7bca7 100644
--- a/gcc/config/elfos.h
+++ b/gcc/config/elfos.h
@@ -96,16 +96,9 @@ Boston, MA 02111-1307, USA. */
#undef SET_ASM_OP
#define SET_ASM_OP "\t.set\t"
-/* This is how to begin an assembly language file. Most svr4 assemblers want
- at least a .file directive to come first, and some want to see a .version
- directive come right after that. Here we just establish a default
- which generates only the .file directive. If you need a .version
- directive for any specific target, you should override this definition
- in the target-specific file which includes this one. */
-
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- output_file_directive ((FILE), main_input_filename)
+/* Most svr4 assemblers want a .file directive at the beginning of
+ their input file. */
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
/* This is how to allocate empty space in some section. The .zero
pseudo-op is used for this on most svr4 assemblers. */
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index e6640875054..078c7c03b54 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -1689,7 +1689,7 @@ frv_function_epilogue (file, size)
frv_stack_cache = (frv_stack_t *)0;
/* zap last used registers for conditional execution. */
- memset ((PTR) &frv_ifcvt.tmp_reg, 0, sizeof (frv_ifcvt.tmp_reg));
+ memset (&frv_ifcvt.tmp_reg, 0, sizeof (frv_ifcvt.tmp_reg));
/* release the bitmap of created insns. */
BITMAP_XFREE (frv_ifcvt.scratch_insns_bitmap);
@@ -6565,7 +6565,7 @@ frv_ifcvt_modify_tests (ce_info, p_true, p_false)
consider registers that are not preserved across function calls and are
not fixed. However, allow the ICC/ICR temporary registers to be allocated
if we did not need to use them in reloading other registers. */
- memset ((PTR) &tmp_reg->regs, 0, sizeof (tmp_reg->regs));
+ memset (&tmp_reg->regs, 0, sizeof (tmp_reg->regs));
COPY_HARD_REG_SET (tmp_reg->regs, call_used_reg_set);
AND_COMPL_HARD_REG_SET (tmp_reg->regs, fixed_reg_set);
SET_HARD_REG_BIT (tmp_reg->regs, ICC_TEMP);
@@ -8650,7 +8650,7 @@ frv_pack_insns ()
/* Set up the instruction and register states. */
dfa_start ();
frv_state = (state_t) xmalloc (state_size ());
- memset ((PTR) reg_state, REGSTATE_DEAD, sizeof (reg_state));
+ memset (reg_state, REGSTATE_DEAD, sizeof (reg_state));
/* Go through the insns, and repack the insns. */
state_reset (frv_state);
@@ -8783,7 +8783,7 @@ frv_pack_insns ()
}
}
- free ((PTR) frv_state);
+ free (frv_state);
dfa_finish ();
return;
}
diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h
index 4adcabae828..dda5a059e8e 100644
--- a/gcc/config/frv/frv.h
+++ b/gcc/config/frv/frv.h
@@ -2780,8 +2780,6 @@ extern int size_directive_output;
#undef ASM_OUTPUT_ALIGNED_DECL_LOCAL
#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(STREAM, DECL, NAME, SIZE, ALIGN) \
do { \
- extern unsigned HOST_WIDE_INT g_switch_value; \
- \
if ((SIZE) > 0 && (SIZE) <= g_switch_value) \
sbss_section (); \
else \
diff --git a/gcc/config/gofast.h b/gcc/config/gofast.h
index 84e9018784f..3af267c4073 100644
--- a/gcc/config/gofast.h
+++ b/gcc/config/gofast.h
@@ -1,20 +1,20 @@
/* US Software GOFAST floating point library support.
Copyright (C) 1994, 1998, 1999, 2002 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/h8300/elf.h b/gcc/config/h8300/elf.h
index c306993602a..7f67a3a78b1 100644
--- a/gcc/config/h8300/elf.h
+++ b/gcc/config/h8300/elf.h
@@ -31,12 +31,6 @@
%{pg:gcrti.o%s}%{!pg:crti.o%s} \
crtbegin.o%s"
-/* Output at beginning/end of assembler file. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- (output_file_directive ((FILE), main_input_filename), \
- asm_file_start (FILE))
-
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX "_"
diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h
index 025f4231131..d99f0dca0b9 100644
--- a/gcc/config/h8300/h8300-protos.h
+++ b/gcc/config/h8300/h8300-protos.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler.
- Hitachi H8/300 version generating coff
+ Hitachi H8/300 version
Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com),
Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com).
@@ -26,79 +26,81 @@ Boston, MA 02111-1307, USA. */
/* Declarations for functions used in insn-output.c. */
#ifdef RTX_CODE
-extern const char *output_plussi PARAMS ((rtx *));
-extern unsigned int compute_plussi_length PARAMS ((rtx *));
-extern int compute_plussi_cc PARAMS ((rtx *));
-extern const char *output_a_shift PARAMS ((rtx *));
-extern unsigned int compute_a_shift_length PARAMS ((rtx, rtx *));
-extern int compute_a_shift_cc PARAMS ((rtx, rtx *));
-extern const char *emit_a_rotate PARAMS ((enum rtx_code, rtx *));
-extern const char *output_simode_bld PARAMS ((int, rtx[]));
-extern void print_operand_address PARAMS ((FILE *, rtx));
-extern void print_operand PARAMS ((FILE *, rtx, int));
-extern void final_prescan_insn PARAMS ((rtx, rtx *, int));
-extern int do_movsi PARAMS ((rtx[]));
-extern void notice_update_cc PARAMS ((rtx, rtx));
-extern const char *output_logical_op PARAMS ((enum machine_mode, rtx *));
-extern unsigned int compute_logical_op_length PARAMS ((enum machine_mode,
- rtx *));
-extern int compute_logical_op_cc PARAMS ((enum machine_mode, rtx *));
-extern void expand_a_shift PARAMS ((enum machine_mode, int, rtx[]));
-extern int h8300_shift_needs_scratch_p PARAMS ((int, enum machine_mode));
-extern int expand_a_rotate PARAMS ((enum rtx_code, rtx[]));
-extern int fix_bit_operand PARAMS ((rtx *, int, enum rtx_code));
-extern int h8300_adjust_insn_length PARAMS ((rtx, int));
-extern void split_adds_subs PARAMS ((enum machine_mode, rtx[]));
+extern unsigned int compute_mov_length (rtx *);
+extern const char *output_plussi (rtx *);
+extern unsigned int compute_plussi_length (rtx *);
+extern int compute_plussi_cc (rtx *);
+extern const char *output_a_shift (rtx *);
+extern unsigned int compute_a_shift_length (rtx, rtx *);
+extern int compute_a_shift_cc (rtx, rtx *);
+extern const char *output_a_rotate (enum rtx_code, rtx *);
+extern unsigned int compute_a_rotate_length (rtx *);
+extern const char *output_simode_bld (int, rtx[]);
+extern void print_operand_address (FILE *, rtx);
+extern void print_operand (FILE *, rtx, int);
+extern void final_prescan_insn (rtx, rtx *, int);
+extern int do_movsi (rtx[]);
+extern void notice_update_cc (rtx, rtx);
+extern const char *output_logical_op (enum machine_mode, rtx *);
+extern unsigned int compute_logical_op_length (enum machine_mode,
+ rtx *);
+extern int compute_logical_op_cc (enum machine_mode, rtx *);
+extern void expand_a_shift (enum machine_mode, int, rtx[]);
+extern int h8300_shift_needs_scratch_p (int, enum machine_mode);
+extern int expand_a_rotate (enum rtx_code, rtx[]);
+extern int fix_bit_operand (rtx *, int, enum rtx_code);
+extern int h8300_adjust_insn_length (rtx, int);
+extern void split_adds_subs (enum machine_mode, rtx[]);
-extern int general_operand_src PARAMS ((rtx, enum machine_mode));
-extern int general_operand_dst PARAMS ((rtx, enum machine_mode));
-extern int single_one_operand PARAMS ((rtx, enum machine_mode));
-extern int single_zero_operand PARAMS ((rtx, enum machine_mode));
-extern int call_insn_operand PARAMS ((rtx, enum machine_mode));
-extern int two_insn_adds_subs_operand PARAMS ((rtx, enum machine_mode));
-extern int small_call_insn_operand PARAMS ((rtx, enum machine_mode));
-extern int jump_address_operand PARAMS ((rtx, enum machine_mode));
-extern int bit_operand PARAMS ((rtx, enum machine_mode));
-extern int bit_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int stack_pointer_operand PARAMS ((rtx, enum machine_mode));
-extern int const_int_gt_2_operand PARAMS ((rtx, enum machine_mode));
-extern int const_int_ge_8_operand PARAMS ((rtx, enum machine_mode));
-extern int const_int_qi_operand PARAMS ((rtx, enum machine_mode));
-extern int const_int_hi_operand PARAMS ((rtx, enum machine_mode));
-extern int incdec_operand PARAMS ((rtx, enum machine_mode));
-extern int bit_operator PARAMS ((rtx, enum machine_mode));
-extern int nshift_operator PARAMS ((rtx, enum machine_mode));
-extern int eqne_operator PARAMS ((rtx, enum machine_mode));
-extern int gtle_operator PARAMS ((rtx, enum machine_mode));
-extern int gtuleu_operator PARAMS ((rtx, enum machine_mode));
-extern int iorxor_operator PARAMS ((rtx, enum machine_mode));
+extern int general_operand_src (rtx, enum machine_mode);
+extern int general_operand_dst (rtx, enum machine_mode);
+extern int single_one_operand (rtx, enum machine_mode);
+extern int single_zero_operand (rtx, enum machine_mode);
+extern int call_insn_operand (rtx, enum machine_mode);
+extern int two_insn_adds_subs_operand (rtx, enum machine_mode);
+extern int small_call_insn_operand (rtx, enum machine_mode);
+extern int jump_address_operand (rtx, enum machine_mode);
+extern int bit_operand (rtx, enum machine_mode);
+extern int bit_memory_operand (rtx, enum machine_mode);
+extern int stack_pointer_operand (rtx, enum machine_mode);
+extern int const_int_gt_2_operand (rtx, enum machine_mode);
+extern int const_int_ge_8_operand (rtx, enum machine_mode);
+extern int const_int_qi_operand (rtx, enum machine_mode);
+extern int const_int_hi_operand (rtx, enum machine_mode);
+extern int incdec_operand (rtx, enum machine_mode);
+extern int bit_operator (rtx, enum machine_mode);
+extern int nshift_operator (rtx, enum machine_mode);
+extern int eqne_operator (rtx, enum machine_mode);
+extern int gtle_operator (rtx, enum machine_mode);
+extern int gtuleu_operator (rtx, enum machine_mode);
+extern int iorxor_operator (rtx, enum machine_mode);
-extern int h8300_eightbit_constant_address_p PARAMS ((rtx));
-extern int h8300_tiny_constant_address_p PARAMS ((rtx));
-extern int byte_accesses_mergeable_p PARAMS ((rtx, rtx));
+extern int h8300_eightbit_constant_address_p (rtx);
+extern int h8300_tiny_constant_address_p (rtx);
+extern int byte_accesses_mergeable_p (rtx, rtx);
+extern int same_cmp_preceding_p (rtx);
/* Used in builtins.c */
-extern rtx h8300_return_addr_rtx PARAMS ((int, rtx));
+extern rtx h8300_return_addr_rtx (int, rtx);
#endif /* RTX_CODE */
#ifdef TREE_CODE
-extern struct rtx_def *function_arg PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode, tree, int));
-extern int h8300_funcvec_function_p PARAMS ((tree));
-extern int h8300_eightbit_data_p PARAMS ((tree));
-extern int h8300_tiny_data_p PARAMS ((tree));
+extern struct rtx_def *function_arg (CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int);
+extern int h8300_funcvec_function_p (tree);
+extern int h8300_eightbit_data_p (tree);
+extern int h8300_tiny_data_p (tree);
#endif /* TREE_CODE */
-extern void h8300_init_once PARAMS ((void));
-extern int h8300_can_use_return_insn_p PARAMS ((void));
-extern void h8300_expand_prologue PARAMS ((void));
-extern void h8300_expand_epilogue PARAMS ((void));
-extern int h8300_current_function_interrupt_function_p PARAMS ((void));
-extern void asm_file_start PARAMS ((FILE *));
-extern int h8300_initial_elimination_offset PARAMS ((int, int));
+extern void h8300_init_once (void);
+extern int h8300_can_use_return_insn_p (void);
+extern void h8300_expand_prologue (void);
+extern void h8300_expand_epilogue (void);
+extern int h8300_current_function_interrupt_function_p (void);
+extern int h8300_initial_elimination_offset (int, int);
struct cpp_reader;
-extern void h8300_pr_interrupt PARAMS ((struct cpp_reader *));
-extern void h8300_pr_saveall PARAMS ((struct cpp_reader *));
+extern void h8300_pr_interrupt (struct cpp_reader *);
+extern void h8300_pr_saveall (struct cpp_reader *);
#endif /* ! GCC_H8300_PROTOS_H */
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 7e697f4d763..88a739cd9c2 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -46,32 +46,25 @@ Boston, MA 02111-1307, USA. */
#include "target-def.h"
/* Forward declarations. */
-static const char *byte_reg PARAMS ((rtx, int));
-static int h8300_interrupt_function_p PARAMS ((tree));
-static int h8300_monitor_function_p PARAMS ((tree));
-static int h8300_os_task_function_p PARAMS ((tree));
-static void dosize PARAMS ((int, unsigned int));
-static int round_frame_size PARAMS ((int));
-static unsigned int compute_saved_regs PARAMS ((void));
-static void push PARAMS ((int));
-static void pop PARAMS ((int));
-static const char *cond_string PARAMS ((enum rtx_code));
-static unsigned int h8300_asm_insn_count PARAMS ((const char *));
-const struct attribute_spec h8300_attribute_table[];
-static tree h8300_handle_fndecl_attribute PARAMS ((tree *, tree, tree, int, bool *));
-static tree h8300_handle_eightbit_data_attribute PARAMS ((tree *, tree, tree, int, bool *));
-static tree h8300_handle_tiny_data_attribute PARAMS ((tree *, tree, tree, int, bool *));
-static void h8300_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static void h8300_insert_attributes PARAMS ((tree, tree *));
-static void h8300_file_end PARAMS ((void));
+static const char *byte_reg (rtx, int);
+static int h8300_interrupt_function_p (tree);
+static int h8300_monitor_function_p (tree);
+static int h8300_os_task_function_p (tree);
+static void dosize (int, unsigned int);
+static int round_frame_size (int);
+static unsigned int compute_saved_regs (void);
+static void push (int);
+static void pop (int);
+static const char *cond_string (enum rtx_code);
+static unsigned int h8300_asm_insn_count (const char *);
+static tree h8300_handle_fndecl_attribute (tree *, tree, tree, int, bool *);
+static tree h8300_handle_eightbit_data_attribute (tree *, tree, tree, int, bool *);
+static tree h8300_handle_tiny_data_attribute (tree *, tree, tree, int, bool *);
#ifndef OBJECT_FORMAT_ELF
-static void h8300_asm_named_section PARAMS ((const char *, unsigned int));
+static void h8300_asm_named_section (const char *, unsigned int);
#endif
-static void h8300_encode_section_info PARAMS ((tree, rtx, int));
-static int const_costs PARAMS ((rtx, enum rtx_code, enum rtx_code));
-static int h8300_and_costs PARAMS ((rtx));
-static int h8300_shift_costs PARAMS ((rtx));
-static bool h8300_rtx_costs PARAMS ((rtx, int, int, int *));
+static int h8300_and_costs (rtx);
+static int h8300_shift_costs (rtx);
/* CPU_TYPE, says what cpu we're compiling for. */
int cpu_type;
@@ -104,30 +97,6 @@ const char *h8_push_op, *h8_pop_op, *h8_mov_op;
#define SYMBOL_FLAG_EIGHTBIT_DATA (SYMBOL_FLAG_MACH_DEP << 1)
#define SYMBOL_FLAG_TINY_DATA (SYMBOL_FLAG_MACH_DEP << 2)
-/* Initialize the GCC target structure. */
-#undef TARGET_ATTRIBUTE_TABLE
-#define TARGET_ATTRIBUTE_TABLE h8300_attribute_table
-
-#undef TARGET_ASM_ALIGNED_HI_OP
-#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
-
-#undef TARGET_ASM_FUNCTION_EPILOGUE
-#define TARGET_ASM_FUNCTION_EPILOGUE h8300_output_function_epilogue
-
-#undef TARGET_ASM_FILE_END
-#define TARGET_ASM_FILE_END h8300_file_end
-
-#undef TARGET_ENCODE_SECTION_INFO
-#define TARGET_ENCODE_SECTION_INFO h8300_encode_section_info
-
-#undef TARGET_INSERT_ATTRIBUTES
-#define TARGET_INSERT_ATTRIBUTES h8300_insert_attributes
-
-#undef TARGET_RTX_COSTS
-#define TARGET_RTX_COSTS h8300_rtx_costs
-
-struct gcc_target targetm = TARGET_INITIALIZER;
-
/* See below where shifts are handled for explanation of this enum. */
enum shift_alg
@@ -291,7 +260,7 @@ enum h8_cpu
/* Initialize various cpu specific globals at start up. */
void
-h8300_init_once ()
+h8300_init_once (void)
{
static const char *const h8_push_ops[2] = { "push" , "push.l" };
static const char *const h8_pop_ops[2] = { "pop" , "pop.l" };
@@ -360,9 +329,7 @@ h8300_init_once ()
}
static const char *
-byte_reg (x, b)
- rtx x;
- int b;
+byte_reg (rtx x, int b)
{
static const char *const names_small[] = {
"r0l", "r0h", "r1l", "r1h", "r2l", "r2h", "r3l", "r3h",
@@ -428,8 +395,7 @@ dosize (sign, size)
/* Round up frame size SIZE. */
static int
-round_frame_size (size)
- int size;
+round_frame_size (int size)
{
return ((size + STACK_BOUNDARY / BITS_PER_UNIT - 1)
& -STACK_BOUNDARY / BITS_PER_UNIT);
@@ -439,7 +405,7 @@ round_frame_size (size)
Return a bit vector of registers. */
static unsigned int
-compute_saved_regs ()
+compute_saved_regs (void)
{
unsigned int saved_regs = 0;
int regno;
@@ -461,8 +427,7 @@ compute_saved_regs ()
/* Emit an insn to push register RN. */
static void
-push (rn)
- int rn;
+push (int rn)
{
rtx reg = gen_rtx_REG (word_mode, rn);
rtx x;
@@ -478,8 +443,7 @@ push (rn)
/* Emit an insn to pop register RN. */
static void
-pop (rn)
- int rn;
+pop (int rn)
{
rtx reg = gen_rtx_REG (word_mode, rn);
rtx x;
@@ -513,7 +477,7 @@ pop (rn)
/* Generate RTL code for the function prologue. */
void
-h8300_expand_prologue ()
+h8300_expand_prologue (void)
{
int regno;
int saved_regs;
@@ -591,7 +555,7 @@ h8300_expand_prologue ()
}
int
-h8300_can_use_return_insn_p ()
+h8300_can_use_return_insn_p (void)
{
return (reload_completed
&& !frame_pointer_needed
@@ -602,7 +566,7 @@ h8300_can_use_return_insn_p ()
/* Generate RTL code for the function epilogue. */
void
-h8300_expand_epilogue ()
+h8300_expand_epilogue (void)
{
int regno;
int saved_regs;
@@ -673,18 +637,17 @@ h8300_expand_epilogue ()
/* Output assembly language code for the function epilogue. */
static void
-h8300_output_function_epilogue (file, size)
- FILE *file ATTRIBUTE_UNUSED;
- HOST_WIDE_INT size ATTRIBUTE_UNUSED;
+h8300_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
pragma_saveall = 0;
}
-
+
/* Return nonzero if the current function is an interrupt
function. */
int
-h8300_current_function_interrupt_function_p ()
+h8300_current_function_interrupt_function_p (void)
{
return (h8300_interrupt_function_p (current_function_decl)
|| h8300_monitor_function_p (current_function_decl));
@@ -692,36 +655,21 @@ h8300_current_function_interrupt_function_p ()
/* Output assembly code for the start of the file. */
-void
-asm_file_start (file)
- FILE *file;
+static void
+h8300_file_start (void)
{
- fprintf (file, ";\tGCC For the Hitachi H8/300\n");
- fprintf (file, ";\tBy Hitachi America Ltd and Cygnus Support\n");
+ default_file_start ();
- if (optimize_size)
- fprintf (file, "; -Os\n");
- else if (optimize)
- fprintf (file, "; -O%d\n", optimize);
if (TARGET_H8300H)
- if (TARGET_NORMAL_MODE)
- fprintf (file, "\n\t.h8300hn\n");
- else
- fprintf (file, "\n\t.h8300h\n");
+ fputs (TARGET_NORMAL_MODE ? "\t.h8300hn\n" : "\t.h8300h\n", asm_out_file);
else if (TARGET_H8300S)
- if (TARGET_NORMAL_MODE)
- fprintf (file, "\n\t.h8300sn\n");
- else
- fprintf (file, "\n\t.h8300s\n");
- else
- fprintf (file, "\n\n");
- output_file_directive (file, main_input_filename);
+ fputs (TARGET_NORMAL_MODE ? "\t.h8300sn\n" : "\t.h8300s\n", asm_out_file);
}
/* Output assembly language code for the end of file. */
static void
-h8300_file_end ()
+h8300_file_end (void)
{
fputs ("\t.end\n", asm_out_file);
}
@@ -730,9 +678,7 @@ h8300_file_end ()
instruction. */
int
-general_operand_src (op, mode)
- rtx op;
- enum machine_mode mode;
+general_operand_src (rtx op, enum machine_mode mode)
{
if (GET_MODE (op) == mode
&& GET_CODE (op) == MEM
@@ -745,9 +691,7 @@ general_operand_src (op, mode)
instruction. */
int
-general_operand_dst (op, mode)
- rtx op;
- enum machine_mode mode;
+general_operand_dst (rtx op, enum machine_mode mode)
{
if (GET_MODE (op) == mode
&& GET_CODE (op) == MEM
@@ -760,9 +704,7 @@ general_operand_dst (op, mode)
binary representation. */
int
-single_one_operand (operand, mode)
- rtx operand;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+single_one_operand (rtx operand, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (operand) == CONST_INT)
{
@@ -779,9 +721,7 @@ single_one_operand (operand, mode)
binary representation. */
int
-single_zero_operand (operand, mode)
- rtx operand;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+single_zero_operand (rtx operand, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (operand) == CONST_INT)
{
@@ -797,9 +737,7 @@ single_zero_operand (operand, mode)
/* Return true if OP is a valid call operand. */
int
-call_insn_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+call_insn_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) == MEM)
{
@@ -817,9 +755,7 @@ call_insn_operand (op, mode)
straightforward way. Otherwise, return 0. */
int
-two_insn_adds_subs_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+two_insn_adds_subs_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == CONST_INT)
{
@@ -864,9 +800,7 @@ two_insn_adds_subs_operand (op, mode)
instead of adds/subs. */
void
-split_adds_subs (mode, operands)
- enum machine_mode mode;
- rtx *operands;
+split_adds_subs (enum machine_mode mode, rtx *operands)
{
HOST_WIDE_INT val = INTVAL (operands[1]);
rtx reg = operands[0];
@@ -912,9 +846,7 @@ split_adds_subs (mode, operands)
an operand for a small call (4 bytes instead of 6 bytes). */
int
-small_call_insn_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+small_call_insn_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) == MEM)
{
@@ -936,9 +868,7 @@ small_call_insn_operand (op, mode)
/* Return true if OP is a valid jump operand. */
int
-jump_address_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+jump_address_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == REG)
return mode == Pmode;
@@ -959,9 +889,7 @@ jump_address_operand (op, mode)
extern int rtx_equal_function_value_matters;
int
-bit_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+bit_operand (rtx op, enum machine_mode mode)
{
/* We can accept any general operand, except that MEM operands must
be limited to those that use addresses valid for the 'U' constraint. */
@@ -983,9 +911,7 @@ bit_operand (op, mode)
}
int
-bit_memory_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+bit_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == MEM
&& EXTRA_CONSTRAINT (op, 'U'));
@@ -1002,15 +928,13 @@ bit_memory_operand (op, mode)
with this attribute may be safely used in an interrupt vector. */
void
-h8300_pr_interrupt (pfile)
- struct cpp_reader *pfile ATTRIBUTE_UNUSED;
+h8300_pr_interrupt (struct cpp_reader *pfile ATTRIBUTE_UNUSED)
{
pragma_interrupt = 1;
}
void
-h8300_pr_saveall (pfile)
- struct cpp_reader *pfile ATTRIBUTE_UNUSED;
+h8300_pr_saveall (struct cpp_reader *pfile ATTRIBUTE_UNUSED)
{
pragma_saveall = 1;
}
@@ -1021,11 +945,8 @@ h8300_pr_saveall (pfile)
If the argument is to be pushed, NULL_RTX is returned. */
rtx
-function_arg (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named;
+function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int named)
{
static const char *const hand_list[] = {
"__main",
@@ -1090,58 +1011,8 @@ function_arg (cum, mode, type, named)
return result;
}
-/* Return the cost of the rtx R with code CODE. */
-
-static int
-const_costs (r, c, outer_code)
- rtx r;
- enum rtx_code c;
- enum rtx_code outer_code;
-{
- switch (c)
- {
- case CONST_INT:
- {
- HOST_WIDE_INT n = INTVAL (r);
-
- if (-4 <= n || n <= 4)
- {
- switch ((int) n)
- {
- case 0:
- return 0;
- case 1:
- case 2:
- case -1:
- case -2:
- return 0 + (outer_code == SET);
- case 4:
- case -4:
- if (TARGET_H8300H || TARGET_H8300S)
- return 0 + (outer_code == SET);
- else
- return 1;
- }
- }
- return 1;
- }
-
- case CONST:
- case LABEL_REF:
- case SYMBOL_REF:
- return 3;
-
- case CONST_DOUBLE:
- return 20;
-
- default:
- return 4;
- }
-}
-
static int
-h8300_and_costs (x)
- rtx x;
+h8300_and_costs (rtx x)
{
rtx operands[4];
@@ -1160,8 +1031,7 @@ h8300_and_costs (x)
}
static int
-h8300_shift_costs (x)
- rtx x;
+h8300_shift_costs (rtx x)
{
rtx operands[4];
@@ -1178,13 +1048,50 @@ h8300_shift_costs (x)
}
static bool
-h8300_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code;
- int *total;
+h8300_rtx_costs (rtx x, int code, int outer_code, int *total)
{
switch (code)
{
+ case CONST_INT:
+ {
+ HOST_WIDE_INT n = INTVAL (x);
+
+ if (-4 <= n || n <= 4)
+ {
+ switch ((int) n)
+ {
+ case 0:
+ *total = 0;
+ return true;
+ case 1:
+ case 2:
+ case -1:
+ case -2:
+ *total = 0 + (outer_code == SET);
+ return true;
+ case 4:
+ case -4:
+ if (TARGET_H8300H || TARGET_H8300S)
+ *total = 0 + (outer_code == SET);
+ else
+ *total = 1;
+ return true;
+ }
+ }
+ *total = 1;
+ return true;
+ }
+
+ case CONST:
+ case LABEL_REF:
+ case SYMBOL_REF:
+ *total = 3;
+ return true;
+
+ case CONST_DOUBLE:
+ *total = 20;
+ return true;
+
case AND:
*total = COSTS_N_INSNS (h8300_and_costs (x));
return true;
@@ -1215,7 +1122,7 @@ h8300_rtx_costs (x, code, outer_code, total)
return true;
default:
- *total = const_costs (x, code, outer_code);
+ *total = 4;
return true;
}
}
@@ -1253,8 +1160,7 @@ h8300_rtx_costs (x, code, outer_code, total)
/* Return assembly language string which identifies a comparison type. */
static const char *
-cond_string (code)
- enum rtx_code code;
+cond_string (enum rtx_code code)
{
switch (code)
{
@@ -1287,10 +1193,7 @@ cond_string (code)
FILE. */
void
-print_operand (file, x, code)
- FILE *file;
- rtx x;
- int code;
+print_operand (FILE *file, rtx x, int code)
{
/* This is used for communication between codes V,W,Z and Y. */
static int bitint;
@@ -1578,9 +1481,7 @@ print_operand (file, x, code)
/* Output assembly language output for the address ADDR to FILE. */
void
-print_operand_address (file, addr)
- FILE *file;
- rtx addr;
+print_operand_address (FILE *file, rtx addr)
{
switch (GET_CODE (addr))
{
@@ -1641,9 +1542,8 @@ print_operand_address (file, addr)
option. */
void
-final_prescan_insn (insn, operand, num_operands)
- rtx insn, *operand ATTRIBUTE_UNUSED;
- int num_operands ATTRIBUTE_UNUSED;
+final_prescan_insn (rtx insn, rtx *operand ATTRIBUTE_UNUSED,
+ int num_operands ATTRIBUTE_UNUSED)
{
/* This holds the last insn address. */
static int last_insn_address = 0;
@@ -1661,8 +1561,7 @@ final_prescan_insn (insn, operand, num_operands)
/* Prepare for an SI sized move. */
int
-do_movsi (operands)
- rtx operands[];
+do_movsi (rtx operands[])
{
rtx src = operands[1];
rtx dst = operands[0];
@@ -1683,8 +1582,7 @@ do_movsi (operands)
the other its replacement, at the start of a routine. */
int
-h8300_initial_elimination_offset (from, to)
- int from, to;
+h8300_initial_elimination_offset (int from, int to)
{
int offset = 0;
/* The number of bytes that the return address takes on the stack. */
@@ -1716,9 +1614,7 @@ h8300_initial_elimination_offset (from, to)
}
rtx
-h8300_return_addr_rtx (count, frame)
- int count;
- rtx frame;
+h8300_return_addr_rtx (int count, rtx frame)
{
rtx ret;
@@ -1738,9 +1634,7 @@ h8300_return_addr_rtx (count, frame)
/* Update the condition code from the insn. */
void
-notice_update_cc (body, insn)
- rtx body;
- rtx insn;
+notice_update_cc (rtx body, rtx insn)
{
rtx set;
@@ -1807,9 +1701,7 @@ notice_update_cc (body, insn)
/* Return nonzero if X is a stack pointer. */
int
-stack_pointer_operand (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+stack_pointer_operand (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return x == stack_pointer_rtx;
}
@@ -1818,9 +1710,7 @@ stack_pointer_operand (x, mode)
than 2. */
int
-const_int_gt_2_operand (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+const_int_gt_2_operand (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (x) == CONST_INT
&& abs (INTVAL (x)) > 2);
@@ -1830,9 +1720,7 @@ const_int_gt_2_operand (x, mode)
smaller than 8. */
int
-const_int_ge_8_operand (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+const_int_ge_8_operand (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (x) == CONST_INT
&& abs (INTVAL (x)) >= 8);
@@ -1841,9 +1729,7 @@ const_int_ge_8_operand (x, mode)
/* Return nonzero if X is a constant expressible in QImode. */
int
-const_int_qi_operand (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+const_int_qi_operand (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (x) == CONST_INT
&& (INTVAL (x) & 0xff) == INTVAL (x));
@@ -1852,9 +1738,7 @@ const_int_qi_operand (x, mode)
/* Return nonzero if X is a constant expressible in HImode. */
int
-const_int_hi_operand (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+const_int_hi_operand (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (x) == CONST_INT
&& (INTVAL (x) & 0xffff) == INTVAL (x));
@@ -1863,9 +1747,7 @@ const_int_hi_operand (x, mode)
/* Return nonzero if X is a constant suitable for inc/dec. */
int
-incdec_operand (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+incdec_operand (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (x) == CONST_INT
&& (CONST_OK_FOR_M (INTVAL (x))
@@ -1875,9 +1757,7 @@ incdec_operand (x, mode)
/* Return nonzero if X is either EQ or NE. */
int
-eqne_operator (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+eqne_operator (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (x);
@@ -1887,9 +1767,7 @@ eqne_operator (x, mode)
/* Return nonzero if X is GT, LE, GTU, or LEU. */
int
-gtle_operator (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+gtle_operator (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (x);
@@ -1899,9 +1777,7 @@ gtle_operator (x, mode)
/* Return nonzero if X is either GTU or LEU. */
int
-gtuleu_operator (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+gtuleu_operator (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (x);
@@ -1911,9 +1787,7 @@ gtuleu_operator (x, mode)
/* Return nonzero if X is either IOR or XOR. */
int
-iorxor_operator (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+iorxor_operator (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (x);
@@ -1923,9 +1797,7 @@ iorxor_operator (x, mode)
/* Recognize valid operators for bit instructions. */
int
-bit_operator (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+bit_operator (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (x);
@@ -1934,9 +1806,261 @@ bit_operator (x, mode)
|| code == IOR);
}
+/* Return the length of mov instruction. */
+
+unsigned int
+compute_mov_length (rtx *operands)
+{
+ /* If the mov instruction involves a memory operand, we compute the
+ length, assuming the largest addressing mode is used, and then
+ adjust later in the function. Otherwise, we compute and return
+ the exact length in one step. */
+ enum machine_mode mode = GET_MODE (operands[0]);
+ rtx dest = operands[0];
+ rtx src = operands[1];
+ rtx addr;
+
+ if (GET_CODE (src) == MEM)
+ addr = XEXP (src, 0);
+ else if (GET_CODE (dest) == MEM)
+ addr = XEXP (dest, 0);
+ else
+ addr = NULL_RTX;
+
+ if (TARGET_H8300)
+ {
+ unsigned int base_length;
+
+ switch (mode)
+ {
+ case QImode:
+ if (addr == NULL_RTX)
+ return 2;
+
+ /* The eightbit addressing is available only in QImode, so
+ go ahead and take care of it. */
+ if (h8300_eightbit_constant_address_p (addr))
+ return 2;
+
+ base_length = 4;
+ break;
+
+ case HImode:
+ if (addr == NULL_RTX)
+ {
+ if (REG_P (src))
+ return 2;
+
+ if (src == const0_rtx)
+ return 2;
+
+ return 4;
+ }
+
+ base_length = 4;
+ break;
+
+ case SImode:
+ if (addr == NULL_RTX)
+ {
+ if (REG_P (src))
+ return 4;
+
+ if (GET_CODE (src) == CONST_INT)
+ {
+ if (src == const0_rtx)
+ return 4;
+
+ if ((INTVAL (src) & 0xffff) == 0)
+ return 6;
+
+ if ((INTVAL (src) & 0xffff) == 0)
+ return 6;
+
+ if ((INTVAL (src) & 0xffff)
+ == ((INTVAL (src) >> 16) & 0xffff))
+ return 6;
+ }
+ return 8;
+ }
+
+ base_length = 8;
+ break;
+
+ case SFmode:
+ if (addr == NULL_RTX)
+ {
+ if (REG_P (src))
+ return 4;
+
+ if (src == const0_rtx)
+ return 2;
+
+ return 6;
+ }
+
+ base_length = 8;
+ break;
+
+ default:
+ abort ();
+ }
+
+ /* Adjust the length based on the addressing mode used.
+ Specifically, we subtract the difference between the actual
+ length and the longest one, which is @(d:16,Rs). For SImode
+ and SFmode, we double the adjustment because two mov.w are
+ used to do the job. */
+
+ /* @Rs+ and @-Rd are 2 bytes shorter than the longest. */
+ if (GET_CODE (addr) == PRE_DEC
+ || GET_CODE (addr) == POST_INC)
+ {
+ if (mode == QImode || mode == HImode)
+ return base_length - 2;
+ else
+ /* In SImode and SFmode, we use two mov.w instructions, so
+ double the adustment. */
+ return base_length - 4;
+ }
+
+ /* @Rs and @Rd are 2 bytes shorter than the longest. Note that
+ in SImode and SFmode, the second mov.w involves an address
+ with displacement, namely @(2,Rs) or @(2,Rd), so we subtract
+ only 2 bytes. */
+ if (GET_CODE (addr) == REG)
+ return base_length - 2;
+
+ return base_length;
+ }
+ else
+ {
+ unsigned int base_length;
+
+ switch (mode)
+ {
+ case QImode:
+ if (addr == NULL_RTX)
+ return 2;
+
+ /* The eightbit addressing is available only in QImode, so
+ go ahead and take care of it. */
+ if (h8300_eightbit_constant_address_p (addr))
+ return 2;
+
+ base_length = 8;
+ break;
+
+ case HImode:
+ if (addr == NULL_RTX)
+ {
+ if (REG_P (src))
+ return 2;
+
+ if (src == const0_rtx)
+ return 2;
+
+ return 4;
+ }
+
+ base_length = 8;
+ break;
+
+ case SImode:
+ if (addr == NULL_RTX)
+ {
+ if (REG_P (src))
+ {
+ if (REGNO (src) == MAC_REG || REGNO (dest) == MAC_REG)
+ return 4;
+ else
+ return 2;
+ }
+
+ if (GET_CODE (src) == CONST_INT)
+ {
+ int val = INTVAL (src);
+
+ if (val == 0)
+ return 2;
+
+ if (val == (val & 0x00ff) || val == (val & 0xff00))
+ return 4;
+
+ switch (val & 0xffffffff)
+ {
+ case 0xffffffff:
+ case 0xfffffffe:
+ case 0xfffffffc:
+ case 0x0000ffff:
+ case 0x0000fffe:
+ case 0xffff0000:
+ case 0xfffe0000:
+ case 0x00010000:
+ case 0x00020000:
+ return 4;
+ }
+ }
+ return 6;
+ }
+
+ base_length = 10;
+ break;
+
+ case SFmode:
+ if (addr == NULL_RTX)
+ {
+ if (REG_P (src))
+ return 2;
+
+ if (src == const0_rtx)
+ return 2;
+ return 6;
+ }
+
+ base_length = 10;
+ break;
+
+ default:
+ abort ();
+ }
+
+ /* Adjust the length based on the addressing mode used.
+ Specifically, we subtract the difference between the actual
+ length and the longest one, which is @(d:24,ERs). */
+
+ /* @ERs+ and @-ERd are 6 bytes shorter than the longest. */
+ if (GET_CODE (addr) == PRE_DEC
+ || GET_CODE (addr) == POST_INC)
+ return base_length - 6;
+
+ /* @ERs and @ERd are 6 bytes shorter than the longest. */
+ if (GET_CODE (addr) == REG)
+ return base_length - 6;
+
+ /* @(d:16,ERs) and @(d:16,ERd) are 4 bytes shorter than the
+ longest. */
+ if (GET_CODE (addr) == PLUS
+ && GET_CODE (XEXP (addr, 0)) == REG
+ && GET_CODE (XEXP (addr, 1)) == CONST_INT
+ && INTVAL (XEXP (addr, 1)) > -32768
+ && INTVAL (XEXP (addr, 1)) < 32767)
+ return base_length - 4;
+
+ /* @aa:16 is 4 bytes shorter than the longest. */
+ if (h8300_tiny_constant_address_p (addr))
+ return base_length - 4;
+
+ /* @aa:24 is 2 bytes shorter than the longest. */
+ if (CONSTANT_P (addr))
+ return base_length - 2;
+
+ return base_length;
+ }
+}
+
const char *
-output_plussi (operands)
- rtx *operands;
+output_plussi (rtx *operands)
{
enum machine_mode mode = GET_MODE (operands[0]);
@@ -2009,8 +2133,7 @@ output_plussi (operands)
}
unsigned int
-compute_plussi_length (operands)
- rtx *operands;
+compute_plussi_length (rtx *operands)
{
enum machine_mode mode = GET_MODE (operands[0]);
@@ -2078,8 +2201,7 @@ compute_plussi_length (operands)
}
int
-compute_plussi_cc (operands)
- rtx *operands;
+compute_plussi_cc (rtx *operands)
{
enum machine_mode mode = GET_MODE (operands[0]);
@@ -2132,9 +2254,7 @@ compute_plussi_cc (operands)
}
const char *
-output_logical_op (mode, operands)
- enum machine_mode mode;
- rtx *operands;
+output_logical_op (enum machine_mode mode, rtx *operands)
{
/* Figure out the logical op that we need to perform. */
enum rtx_code code = GET_CODE (operands[3]);
@@ -2308,9 +2428,7 @@ output_logical_op (mode, operands)
}
unsigned int
-compute_logical_op_length (mode, operands)
- enum machine_mode mode;
- rtx *operands;
+compute_logical_op_length (enum machine_mode mode, rtx *operands)
{
/* Figure out the logical op that we need to perform. */
enum rtx_code code = GET_CODE (operands[3]);
@@ -2453,9 +2571,7 @@ compute_logical_op_length (mode, operands)
}
int
-compute_logical_op_cc (mode, operands)
- enum machine_mode mode;
- rtx *operands;
+compute_logical_op_cc (enum machine_mode mode, rtx *operands)
{
/* Figure out the logical op that we need to perform. */
enum rtx_code code = GET_CODE (operands[3]);
@@ -2566,9 +2682,7 @@ compute_logical_op_cc (mode, operands)
refer to shift_alg_[qhs]i. */
int
-nshift_operator (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+nshift_operator (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (x))
{
@@ -2585,10 +2699,7 @@ nshift_operator (x, mode)
/* Emit code to do shifts. */
void
-expand_a_shift (mode, code, operands)
- enum machine_mode mode;
- int code;
- rtx operands[];
+expand_a_shift (enum machine_mode mode, int code, rtx operands[])
{
emit_move_insn (operands[0], operands[1]);
@@ -2793,9 +2904,9 @@ struct shift_info {
int cc_special;
};
-static void get_shift_alg PARAMS ((enum shift_type,
- enum shift_mode, unsigned int,
- struct shift_info *));
+static void get_shift_alg (enum shift_type,
+ enum shift_mode, unsigned int,
+ struct shift_info *);
/* Given SHIFT_TYPE, SHIFT_MODE, and shift count COUNT, determine the
best algorithm for doing the shift. The assembler code is stored
@@ -2810,11 +2921,8 @@ static void get_shift_alg PARAMS ((enum shift_type,
result is returned through INFO. */
static void
-get_shift_alg (shift_type, shift_mode, count, info)
- enum shift_type shift_type;
- enum shift_mode shift_mode;
- unsigned int count;
- struct shift_info *info;
+get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode,
+ unsigned int count, struct shift_info *info)
{
enum h8_cpu cpu;
@@ -3259,9 +3367,7 @@ get_shift_alg (shift_type, shift_mode, count, info)
needed for some shift with COUNT and MODE. Return 0 otherwise. */
int
-h8300_shift_needs_scratch_p (count, mode)
- int count;
- enum machine_mode mode;
+h8300_shift_needs_scratch_p (int count, enum machine_mode mode)
{
enum h8_cpu cpu;
int a, lr, ar;
@@ -3310,8 +3416,7 @@ h8300_shift_needs_scratch_p (count, mode)
/* Emit the assembler code for doing shifts. */
const char *
-output_a_shift (operands)
- rtx *operands;
+output_a_shift (rtx *operands)
{
static int loopend_lab;
rtx shift = operands[3];
@@ -3463,8 +3568,7 @@ output_a_shift (operands)
}
static unsigned int
-h8300_asm_insn_count (template)
- const char *template;
+h8300_asm_insn_count (const char *template)
{
unsigned int count = 1;
@@ -3476,9 +3580,7 @@ h8300_asm_insn_count (template)
}
unsigned int
-compute_a_shift_length (insn, operands)
- rtx insn ATTRIBUTE_UNUSED;
- rtx *operands;
+compute_a_shift_length (rtx insn ATTRIBUTE_UNUSED, rtx *operands)
{
rtx shift = operands[3];
enum machine_mode mode = GET_MODE (shift);
@@ -3626,9 +3728,7 @@ compute_a_shift_length (insn, operands)
}
int
-compute_a_shift_cc (insn, operands)
- rtx insn ATTRIBUTE_UNUSED;
- rtx *operands;
+compute_a_shift_cc (rtx insn ATTRIBUTE_UNUSED, rtx *operands)
{
rtx shift = operands[3];
enum machine_mode mode = GET_MODE (shift);
@@ -3722,12 +3822,10 @@ compute_a_shift_cc (insn, operands)
/* A rotation by a non-constant will cause a loop to be generated, in
which a rotation by one bit is used. A rotation by a constant,
including the one in the loop, will be taken care of by
- emit_a_rotate () at the insn emit time. */
+ output_a_rotate () at the insn emit time. */
int
-expand_a_rotate (code, operands)
- enum rtx_code code;
- rtx operands[];
+expand_a_rotate (enum rtx_code code, rtx operands[])
{
rtx dst = operands[0];
rtx src = operands[1];
@@ -3779,12 +3877,10 @@ expand_a_rotate (code, operands)
return 1;
}
-/* Emit rotate insns. */
+/* Output rotate insns. */
const char *
-emit_a_rotate (code, operands)
- enum rtx_code code;
- rtx *operands;
+output_a_rotate (enum rtx_code code, rtx *operands)
{
rtx dst = operands[0];
rtx rotate_amount = operands[2];
@@ -3889,15 +3985,62 @@ emit_a_rotate (code, operands)
return "";
}
+
+unsigned int
+compute_a_rotate_length (rtx *operands)
+{
+ rtx src = operands[1];
+ rtx amount_rtx = operands[2];
+ enum machine_mode mode = GET_MODE (src);
+ int amount;
+ unsigned int length = 0;
+
+ if (GET_CODE (amount_rtx) != CONST_INT)
+ abort ();
+
+ amount = INTVAL (amount_rtx);
+
+ /* Clean up AMOUNT. */
+ if (amount < 0)
+ amount = 0;
+ if ((unsigned int) amount > GET_MODE_BITSIZE (mode))
+ amount = GET_MODE_BITSIZE (mode);
+
+ /* Determine the faster direction. After this phase, amount
+ will be at most a half of GET_MODE_BITSIZE (mode). */
+ if ((unsigned int) amount > GET_MODE_BITSIZE (mode) / (unsigned) 2)
+ /* Flip the direction. */
+ amount = GET_MODE_BITSIZE (mode) - amount;
+
+ /* See if a byte swap (in HImode) or a word swap (in SImode) can
+ boost up the rotation. */
+ if ((mode == HImode && TARGET_H8300 && amount >= 5)
+ || (mode == HImode && TARGET_H8300H && amount >= 6)
+ || (mode == HImode && TARGET_H8300S && amount == 8)
+ || (mode == SImode && TARGET_H8300H && amount >= 10)
+ || (mode == SImode && TARGET_H8300S && amount >= 13))
+ {
+ /* Adjust AMOUNT and flip the direction. */
+ amount = GET_MODE_BITSIZE (mode) / 2 - amount;
+ length += 6;
+ }
+
+ /* We use 2-bit rotations on the H8S. */
+ if (TARGET_H8300S)
+ amount = amount / 2 + amount % 2;
+
+ /* The H8/300 uses three insns to rotate one bit, taking 6
+ length. */
+ length += amount * ((TARGET_H8300 && mode == HImode) ? 6 : 2);
+
+ return length;
+}
/* Fix the operands of a gen_xxx so that it could become a bit
operating insn. */
int
-fix_bit_operand (operands, what, type)
- rtx *operands;
- int what;
- enum rtx_code type;
+fix_bit_operand (rtx *operands, int what, enum rtx_code type)
{
/* The bit_operand predicate accepts any memory during RTL generation, but
only 'U' memory afterwards, so if this is a MEM operand, we must force
@@ -3945,8 +4088,7 @@ fix_bit_operand (operands, what, type)
by the "interrupt" attribute. */
static int
-h8300_interrupt_function_p (func)
- tree func;
+h8300_interrupt_function_p (tree func)
{
tree a;
@@ -3961,8 +4103,7 @@ h8300_interrupt_function_p (func)
by the "OS_Task" attribute. */
static int
-h8300_os_task_function_p (func)
- tree func;
+h8300_os_task_function_p (tree func)
{
tree a;
@@ -3977,8 +4118,7 @@ h8300_os_task_function_p (func)
by the "monitor" attribute. */
static int
-h8300_monitor_function_p (func)
- tree func;
+h8300_monitor_function_p (tree func)
{
tree a;
@@ -3993,8 +4133,7 @@ h8300_monitor_function_p (func)
through the function vector. */
int
-h8300_funcvec_function_p (func)
- tree func;
+h8300_funcvec_function_p (tree func)
{
tree a;
@@ -4009,8 +4148,7 @@ h8300_funcvec_function_p (func)
data area. */
int
-h8300_eightbit_data_p (decl)
- tree decl;
+h8300_eightbit_data_p (tree decl)
{
tree a;
@@ -4025,8 +4163,7 @@ h8300_eightbit_data_p (decl)
data area. */
int
-h8300_tiny_data_p (decl)
- tree decl;
+h8300_tiny_data_p (tree decl)
{
tree a;
@@ -4040,9 +4177,7 @@ h8300_tiny_data_p (decl)
/* Generate an 'interrupt_handler' attribute for decls. */
static void
-h8300_insert_attributes (node, attributes)
- tree node;
- tree *attributes;
+h8300_insert_attributes (tree node, tree *attributes)
{
if (!pragma_interrupt
|| TREE_CODE (node) != FUNCTION_DECL)
@@ -4085,12 +4220,10 @@ const struct attribute_spec h8300_attribute_table[] =
/* Handle an attribute requiring a FUNCTION_DECL; arguments as in
struct attribute_spec.handler. */
static tree
-h8300_handle_fndecl_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+h8300_handle_fndecl_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
@@ -4105,12 +4238,10 @@ h8300_handle_fndecl_attribute (node, name, args, flags, no_add_attrs)
/* Handle an "eightbit_data" attribute; arguments as in
struct attribute_spec.handler. */
static tree
-h8300_handle_eightbit_data_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+h8300_handle_eightbit_data_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
tree decl = *node;
@@ -4130,12 +4261,10 @@ h8300_handle_eightbit_data_attribute (node, name, args, flags, no_add_attrs)
/* Handle an "tiny_data" attribute; arguments as in
struct attribute_spec.handler. */
static tree
-h8300_handle_tiny_data_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+h8300_handle_tiny_data_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
tree decl = *node;
@@ -4155,10 +4284,7 @@ h8300_handle_tiny_data_attribute (node, name, args, flags, no_add_attrs)
/* Mark function vectors, and various small data objects. */
static void
-h8300_encode_section_info (decl, rtl, first)
- tree decl;
- rtx rtl;
- int first;
+h8300_encode_section_info (tree decl, rtx rtl, int first)
{
int extra_flags = 0;
@@ -4181,9 +4307,7 @@ h8300_encode_section_info (decl, rtl, first)
}
const char *
-output_simode_bld (bild, operands)
- int bild;
- rtx operands[];
+output_simode_bld (int bild, rtx operands[])
{
if (TARGET_H8300)
{
@@ -4218,190 +4342,16 @@ output_simode_bld (bild, operands)
output_asm_insn ("xor.l\t%S0,%S0", operands);
/* Perform the bit store. */
- output_asm_insn ("bst\t#0,%w0", operands);
+ output_asm_insn ("rotxl.l\t%S0", operands);
}
/* All done. */
return "";
}
-/* Given INSN and its current length LENGTH, return the adjustment
- (in bytes) to correctly compute INSN's length.
-
- We use this to get the lengths of various memory references correct. */
-
-int
-h8300_adjust_insn_length (insn, length)
- rtx insn;
- int length ATTRIBUTE_UNUSED;
-{
- rtx pat = PATTERN (insn);
-
- /* We must filter these out before calling get_attr_adjust_length. */
- if (GET_CODE (pat) == USE
- || GET_CODE (pat) == CLOBBER
- || GET_CODE (pat) == SEQUENCE
- || GET_CODE (pat) == ADDR_VEC
- || GET_CODE (pat) == ADDR_DIFF_VEC)
- return 0;
-
- if (get_attr_adjust_length (insn) == ADJUST_LENGTH_NO)
- return 0;
-
- /* Adjust length for reg->mem and mem->reg copies. */
- if (GET_CODE (pat) == SET
- && (GET_CODE (SET_SRC (pat)) == MEM
- || GET_CODE (SET_DEST (pat)) == MEM))
- {
- /* This insn might need a length adjustment. */
- rtx addr;
-
- if (GET_CODE (SET_SRC (pat)) == MEM)
- addr = XEXP (SET_SRC (pat), 0);
- else
- addr = XEXP (SET_DEST (pat), 0);
-
- if (TARGET_H8300)
- {
- /* On the H8/300, we subtract the difference between the
- actual length and the longest one, which is @(d:16,ERs). */
-
- /* @Rs is 2 bytes shorter than the longest. */
- if (GET_CODE (addr) == REG)
- return -2;
-
- /* @aa:8 is 2 bytes shorter than the longest. */
- if (GET_MODE (SET_SRC (pat)) == QImode
- && h8300_eightbit_constant_address_p (addr))
- return -2;
- }
- else
- {
- /* On the H8/300H and H8S, we subtract the difference
- between the actual length and the longest one, which is
- @(d:24,ERs). */
-
- /* @ERs is 6 bytes shorter than the longest. */
- if (GET_CODE (addr) == REG)
- return -6;
-
- /* @(d:16,ERs) is 6 bytes shorter than the longest. */
- if (GET_CODE (addr) == PLUS
- && GET_CODE (XEXP (addr, 0)) == REG
- && GET_CODE (XEXP (addr, 1)) == CONST_INT
- && INTVAL (XEXP (addr, 1)) > -32768
- && INTVAL (XEXP (addr, 1)) < 32767)
- return -4;
-
- /* @aa:8 is 6 bytes shorter than the longest. */
- if (GET_MODE (SET_SRC (pat)) == QImode
- && h8300_eightbit_constant_address_p (addr))
- return -6;
-
- /* @aa:16 is 4 bytes shorter than the longest. */
- if (h8300_tiny_constant_address_p (addr))
- return -4;
-
- /* @aa:24 is 2 bytes shorter than the longest. */
- if (GET_CODE (addr) == CONST_INT)
- return -2;
- }
- }
-
- /* Loading some constants needs adjustment. */
- if (GET_CODE (pat) == SET
- && GET_CODE (SET_SRC (pat)) == CONST_INT
- && GET_MODE (SET_DEST (pat)) == SImode
- && INTVAL (SET_SRC (pat)) != 0)
- {
- int val = INTVAL (SET_SRC (pat));
-
- if (TARGET_H8300
- && ((val & 0xffff) == 0
- || ((val >> 16) & 0xffff) == 0))
- return -2;
-
- if (TARGET_H8300H || TARGET_H8300S)
- {
- if (val == (val & 0xff)
- || val == (val & 0xff00))
- return 4 - 6;
-
- switch (val & 0xffffffff)
- {
- case 0xffffffff:
- case 0xfffffffe:
- case 0xfffffffc:
- case 0x0000ffff:
- case 0x0000fffe:
- case 0xffff0000:
- case 0xfffe0000:
- case 0x00010000:
- case 0x00020000:
- return 4 - 6;
- }
- }
- }
-
- /* Rotations need various adjustments. */
- if (GET_CODE (pat) == SET
- && (GET_CODE (SET_SRC (pat)) == ROTATE
- || GET_CODE (SET_SRC (pat)) == ROTATERT))
- {
- rtx src = SET_SRC (pat);
- enum machine_mode mode = GET_MODE (src);
- int amount;
- int states = 0;
-
- if (GET_CODE (XEXP (src, 1)) != CONST_INT)
- return 0;
-
- amount = INTVAL (XEXP (src, 1));
-
- /* Clean up AMOUNT. */
- if (amount < 0)
- amount = 0;
- if ((unsigned int) amount > GET_MODE_BITSIZE (mode))
- amount = GET_MODE_BITSIZE (mode);
-
- /* Determine the faster direction. After this phase, amount
- will be at most a half of GET_MODE_BITSIZE (mode). */
- if ((unsigned int) amount > GET_MODE_BITSIZE (mode) / (unsigned) 2)
- /* Flip the direction. */
- amount = GET_MODE_BITSIZE (mode) - amount;
-
- /* See if a byte swap (in HImode) or a word swap (in SImode) can
- boost up the rotation. */
- if ((mode == HImode && TARGET_H8300 && amount >= 5)
- || (mode == HImode && TARGET_H8300H && amount >= 6)
- || (mode == HImode && TARGET_H8300S && amount == 8)
- || (mode == SImode && TARGET_H8300H && amount >= 10)
- || (mode == SImode && TARGET_H8300S && amount >= 13))
- {
- /* Adjust AMOUNT and flip the direction. */
- amount = GET_MODE_BITSIZE (mode) / 2 - amount;
- states += 6;
- }
-
- /* We use 2-bit rotations on the H8S. */
- if (TARGET_H8300S)
- amount = amount / 2 + amount % 2;
-
- /* The H8/300 uses three insns to rotate one bit, taking 6
- states. */
- states += amount * ((TARGET_H8300 && mode == HImode) ? 6 : 2);
-
- return -(20 - states);
- }
-
- return 0;
-}
-
#ifndef OBJECT_FORMAT_ELF
static void
-h8300_asm_named_section (name, flags)
- const char *name;
- unsigned int flags ATTRIBUTE_UNUSED;
+h8300_asm_named_section (const char *name, unsigned int flags ATTRIBUTE_UNUSED)
{
/* ??? Perhaps we should be using default_coff_asm_named_section. */
fprintf (asm_out_file, "\t.section %s\n", name);
@@ -4412,8 +4362,7 @@ h8300_asm_named_section (name, flags)
which is a special case of the 'R' operand. */
int
-h8300_eightbit_constant_address_p (x)
- rtx x;
+h8300_eightbit_constant_address_p (rtx x)
{
/* The ranges of the 8-bit area. */
const unsigned HOST_WIDE_INT n1 = trunc_int_for_mode (0xff00, HImode);
@@ -4444,8 +4393,7 @@ h8300_eightbit_constant_address_p (x)
on H8/300H and H8S. */
int
-h8300_tiny_constant_address_p (x)
- rtx x;
+h8300_tiny_constant_address_p (rtx x)
{
/* The ranges of the 16-bit area. */
const unsigned HOST_WIDE_INT h1 = trunc_int_for_mode (0x00000000, SImode);
@@ -4477,8 +4425,7 @@ h8300_tiny_constant_address_p (x)
}
int
-byte_accesses_mergeable_p (addr1, addr2)
- rtx addr1, addr2;
+byte_accesses_mergeable_p (rtx addr1, rtx addr2)
{
HOST_WIDE_INT offset1, offset2;
rtx reg1, reg2;
@@ -4521,3 +4468,52 @@ byte_accesses_mergeable_p (addr1, addr2)
return 0;
}
+
+/* Return nonzero if we have the same comparison insn as I3 two insns
+ before I3. I3 is assumed to be a comparision insn. */
+
+int
+same_cmp_preceding_p (rtx i3)
+{
+ rtx i1, i2;
+
+ /* Make sure we have a sequence of three insns. */
+ i2 = prev_nonnote_insn (i3);
+ if (i2 == NULL_RTX)
+ return 0;
+ i1 = prev_nonnote_insn (i2);
+ if (i1 == NULL_RTX)
+ return 0;
+
+ return (INSN_P (i1) && rtx_equal_p (PATTERN (i1), PATTERN (i3))
+ && any_condjump_p (i2) && onlyjump_p (i2));
+}
+
+/* Initialize the GCC target structure. */
+#undef TARGET_ATTRIBUTE_TABLE
+#define TARGET_ATTRIBUTE_TABLE h8300_attribute_table
+
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
+
+#undef TARGET_ASM_FUNCTION_EPILOGUE
+#define TARGET_ASM_FUNCTION_EPILOGUE h8300_output_function_epilogue
+
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START h8300_file_start
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+
+#undef TARGET_ASM_FILE_END
+#define TARGET_ASM_FILE_END h8300_file_end
+
+#undef TARGET_ENCODE_SECTION_INFO
+#define TARGET_ENCODE_SECTION_INFO h8300_encode_section_info
+
+#undef TARGET_INSERT_ATTRIBUTES
+#define TARGET_INSERT_ATTRIBUTES h8300_insert_attributes
+
+#undef TARGET_RTX_COSTS
+#define TARGET_RTX_COSTS h8300_rtx_costs
+
+struct gcc_target targetm = TARGET_INITIALIZER;
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index 90143eb9b5f..c04e531e725 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -1002,9 +1002,6 @@ struct cum_arg
so give the MEM rtx a byte's mode. */
#define FUNCTION_MODE QImode
-#define ADJUST_INSN_LENGTH(INSN, LENGTH) \
- LENGTH += h8300_adjust_insn_length (INSN, LENGTH);
-
#define BRANCH_COST 0
/* Tell final.c how to eliminate redundant test instructions. */
@@ -1030,10 +1027,6 @@ struct cum_arg
/* Control the assembler format that we output. */
-/* Output at beginning/end of assembler file. */
-
-#define ASM_FILE_START(FILE) asm_file_start (FILE)
-
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
@@ -1128,7 +1121,7 @@ struct cum_arg
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
- This is suitable for output with `assemble_name'.
+ This is suitable for output with `assemble_name'.
N.B.: The h8300.md branch_true and branch_false patterns also know
how to generate internal labels. */
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index 28573d0abf9..ad1d348a761 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -22,11 +22,9 @@
;; the Free Software Foundation, 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
-;; Some of the extend instructions accept a general_operand_src, which
-;; allows all the normal memory addressing modes. The length computations
-;; don't take this into account. The lengths in the MD file should be
-;; "worst case" and then be adjusted to their correct values by
-;; h8300_adjust_insn_length.
+;; We compute exact length on each instruction for most of the time.
+;; In some case, most notably bit operations that may involve memory
+;; operands, the lengths in this file are "worst case".
;; On the H8/300H and H8S, adds/subs operate on the 32bit "er"
;; registers. Right now GCC doesn't expose the "e" half to the
@@ -90,12 +88,6 @@
(const_int 6)))]
(const_int 200)))
-;; The necessity of instruction length adjustment.
-
-(define_attr "adjust_length" "yes,no"
- (cond [(eq_attr "type" "branch") (const_string "no")]
- (const_string "yes")))
-
;; Condition code settings.
;;
;; none - insn does not affect cc
@@ -150,7 +142,7 @@
DONE;
}")
-(define_insn ""
+(define_insn "*movqi_h8300"
[(set (match_operand:QI 0 "general_operand_dst" "=r,r ,<,r,r,m")
(match_operand:QI 1 "general_operand_src" " I,r>,r,n,m,r"))]
"TARGET_H8300
@@ -166,7 +158,7 @@
[(set_attr "length" "2,2,2,2,4,4")
(set_attr "cc" "set_zn,set_znv,set_znv,set_znv,set_znv,set_znv")])
-(define_insn ""
+(define_insn "*movqi_h8300hs"
[(set (match_operand:QI 0 "general_operand_dst" "=r,r ,<,r,r,m")
(match_operand:QI 1 "general_operand_src" " I,r>,r,n,m,r"))]
"(TARGET_H8300H || TARGET_H8300S)
@@ -179,7 +171,8 @@
mov.b %R1,%X0
mov.b %R1,%X0
mov.b %X1,%R0"
- [(set_attr "length" "2,2,2,2,8,8")
+ [(set (attr "length")
+ (symbol_ref "compute_mov_length (operands)"))
(set_attr "cc" "set_zn,set_znv,set_znv,clobber,set_znv,set_znv")])
(define_expand "movqi"
@@ -205,9 +198,8 @@
mov.b %X1,%X0
mov.b %R1,%X0
mov.b %R1,%X0"
- [(set_attr_alternative "length"
- [(const_int 2) (const_int 2) (const_int 2)
- (if_then_else (eq_attr "cpu" "h8300") (const_int 4) (const_int 8))])
+ [(set (attr "length")
+ (symbol_ref "compute_mov_length (operands)"))
(set_attr "cc" "set_zn,set_znv,set_znv,set_znv")])
;; movhi
@@ -242,7 +234,7 @@
DONE;
}")
-(define_insn ""
+(define_insn "*movhi_h8300"
[(set (match_operand:HI 0 "general_operand_dst" "=r,r,<,r,r,m")
(match_operand:HI 1 "general_operand_src" "I,r>,r,i,m,r"))]
"TARGET_H8300
@@ -260,10 +252,11 @@
mov.w %T1,%T0
mov.w %T1,%T0
mov.w %T1,%T0"
- [(set_attr "length" "2,2,2,4,4,4")
+ [(set (attr "length")
+ (symbol_ref "compute_mov_length (operands)"))
(set_attr "cc" "set_zn,set_znv,set_znv,set_znv,set_znv,set_znv")])
-(define_insn ""
+(define_insn "*movhi_h8300hs"
[(set (match_operand:HI 0 "general_operand_dst" "=r,r,<,r,r,m")
(match_operand:HI 1 "general_operand_src" "I,r>,r,i,m,r"))]
"(TARGET_H8300H || TARGET_H8300S)
@@ -276,7 +269,8 @@
mov.w %T1,%T0
mov.w %T1,%T0
mov.w %T1,%T0"
- [(set_attr "length" "2,2,2,4,8,8")
+ [(set (attr "length")
+ (symbol_ref "compute_mov_length (operands)"))
(set_attr "cc" "set_zn,set_znv,set_znv,set_znv,set_znv,set_znv")])
(define_expand "movhi"
@@ -302,9 +296,8 @@
mov.w %T1,%T0
mov.w %T1,%T0
mov.w %T1,%T0"
- [(set_attr_alternative "length"
- [(const_int 2) (const_int 2) (const_int 4)
- (if_then_else (eq_attr "cpu" "h8300") (const_int 4) (const_int 8))])
+ [(set (attr "length")
+ (symbol_ref "compute_mov_length (operands)"))
(set_attr "cc" "set_zn,set_znv,set_znv,set_znv")])
;; movsi
@@ -353,7 +346,7 @@
}
}")
-(define_insn "movsi_h8300"
+(define_insn "*movsi_h8300"
[(set (match_operand:SI 0 "general_operand_dst" "=r,r,r,o,<,r")
(match_operand:SI 1 "general_operand_src" "I,r,io,r,r,>"))]
"TARGET_H8300
@@ -395,14 +388,19 @@
}
else
{
- /* See if either half is zero. If so, use sub.w to clear
- that half. */
if (GET_CODE (operands[1]) == CONST_INT)
{
+ /* If either half is zero, use sub.w to clear that
+ half. */
if ((INTVAL (operands[1]) & 0xffff) == 0)
return \"mov.w %e1,%e0\;sub.w %f0,%f0\";
if (((INTVAL (operands[1]) >> 16) & 0xffff) == 0)
return \"sub.w %e0,%e0\;mov.w %f1,%f0\";
+ /* If the upper half and the lower half are the same,
+ copy one half to the other. */
+ if ((INTVAL (operands[1]) & 0xffff)
+ == ((INTVAL (operands[1]) >> 16) & 0xffff))
+ return \"mov.w\\t%e1,%e0\;mov.w\\t%e0,%f0\";
}
return \"mov.w %e1,%e0\;mov.w %f1,%f0\";
}
@@ -416,10 +414,11 @@
abort ();
}
}"
- [(set_attr "length" "4,4,8,8,4,4")
+ [(set (attr "length")
+ (symbol_ref "compute_mov_length (operands)"))
(set_attr "cc" "clobber")])
-(define_insn "movsf_h8300"
+(define_insn "*movsf_h8300"
[(set (match_operand:SF 0 "general_operand_dst" "=r,r,r,o,<,r")
(match_operand:SF 1 "general_operand_src" "I,r,io,r,r,>"))]
"TARGET_H8300
@@ -472,10 +471,11 @@
abort ();
}
}"
- [(set_attr "length" "4,4,8,8,4,4")
+ [(set (attr "length")
+ (symbol_ref "compute_mov_length (operands)"))
(set_attr "cc" "clobber")])
-(define_insn "movsi_h8300hs"
+(define_insn "*movsi_h8300hs"
[(set (match_operand:SI 0 "general_operand_dst" "=r,r,r,<,r,r,m,*a,*a,r")
(match_operand:SI 1 "general_operand_src" "I,r,i,r,>,m,r,I,r,*a"))]
"(TARGET_H8300S || TARGET_H8300H)
@@ -547,10 +547,11 @@
}
return \"mov.l %S1,%S0\";
}"
- [(set_attr "length" "2,2,6,4,4,10,10,2,6,4")
+ [(set (attr "length")
+ (symbol_ref "compute_mov_length (operands)"))
(set_attr "cc" "set_zn,set_znv,clobber,set_znv,set_znv,set_znv,set_znv,none_0hit,none_0hit,set_znv")])
-(define_insn "movsf_h8300h"
+(define_insn "*movsf_h8300h"
[(set (match_operand:SF 0 "general_operand_dst" "=r,r,r,m,<,r")
(match_operand:SF 1 "general_operand_src" "I,r,im,r,r,>"))]
"(TARGET_H8300H || TARGET_H8300S)
@@ -563,7 +564,8 @@
mov.l %S1,%S0
mov.l %S1,%S0
mov.l %S1,%S0"
- [(set_attr "length" "2,2,10,10,4,4")
+ [(set (attr "length")
+ (symbol_ref "compute_mov_length (operands)"))
(set_attr "cc" "set_zn,set_znv,set_znv,set_znv,set_znv,set_znv")])
;; ----------------------------------------------------------------------
@@ -1170,7 +1172,6 @@
and %X2,%X0
bclr %W2,%R0"
[(set_attr "length" "2,8")
- (set_attr "adjust_length" "no")
(set_attr "cc" "set_znv,none_0hit")])
(define_expand "andqi3"
@@ -1271,7 +1272,6 @@
or\\t%X2,%X0
bset\\t%V2,%R0"
[(set_attr "length" "2,8")
- (set_attr "adjust_length" "no")
(set_attr "cc" "set_znv,none_0hit")])
(define_expand "iorqi3"
@@ -1313,7 +1313,6 @@
xor\\t%X2,%X0
bnot\\t%V2,%R0"
[(set_attr "length" "2,8")
- (set_attr "adjust_length" "no")
(set_attr "cc" "set_znv,none_0hit")])
(define_expand "xorqi3"
@@ -1796,8 +1795,8 @@
[(set_attr "cc" "clobber")
(set (attr "length")
(if_then_else (match_operand:QI 0 "small_call_insn_operand" "")
- (const_int 4)
- (const_int 8)))])
+ (const_int 2)
+ (const_int 4)))])
;; Call subroutine, returning value in operand 0
;; (which must be a hard register).
@@ -1820,8 +1819,8 @@
[(set_attr "cc" "clobber")
(set (attr "length")
(if_then_else (match_operand:QI 0 "small_call_insn_operand" "")
- (const_int 4)
- (const_int 8)))])
+ (const_int 2)
+ (const_int 4)))])
(define_insn "nop"
[(const_int 0)]
@@ -2091,7 +2090,7 @@
(zero_extend:SI (match_operand:QI 1 "general_operand_src" "")))]
"(TARGET_H8300H || TARGET_H8300S)
&& reg_overlap_mentioned_p (operands[0], operands[1])
- && reload_completed"
+ && reload_completed"
[(set (match_dup 2)
(match_dup 1))
(set (match_dup 3)
@@ -2106,7 +2105,7 @@
(zero_extend:SI (match_operand:QI 1 "general_operand_src" "")))]
"(TARGET_H8300H || TARGET_H8300S)
&& !reg_overlap_mentioned_p (operands[0], operands[1])
- && reload_completed"
+ && reload_completed"
[(set (match_dup 0)
(const_int 0))
(set (strict_low_part (match_dup 2))
@@ -2431,8 +2430,9 @@
(rotate:QI (match_operand:QI 1 "register_operand" "0")
(match_operand:QI 2 "immediate_operand" "")))]
""
- "* return emit_a_rotate (ROTATE, operands);"
- [(set_attr "length" "20")
+ "* return output_a_rotate (ROTATE, operands);"
+ [(set (attr "length")
+ (symbol_ref "compute_a_rotate_length (operands)"))
(set_attr "cc" "clobber")])
(define_expand "rotlhi3"
@@ -2447,8 +2447,9 @@
(rotate:HI (match_operand:HI 1 "register_operand" "0")
(match_operand:QI 2 "immediate_operand" "")))]
""
- "* return emit_a_rotate (ROTATE, operands);"
- [(set_attr "length" "20")
+ "* return output_a_rotate (ROTATE, operands);"
+ [(set (attr "length")
+ (symbol_ref "compute_a_rotate_length (operands)"))
(set_attr "cc" "clobber")])
(define_expand "rotlsi3"
@@ -2463,8 +2464,9 @@
(rotate:SI (match_operand:SI 1 "register_operand" "0")
(match_operand:QI 2 "immediate_operand" "")))]
"TARGET_H8300H || TARGET_H8300S"
- "* return emit_a_rotate (ROTATE, operands);"
- [(set_attr "length" "20")
+ "* return output_a_rotate (ROTATE, operands);"
+ [(set (attr "length")
+ (symbol_ref "compute_a_rotate_length (operands)"))
(set_attr "cc" "clobber")])
;; -----------------------------------------------------------------
@@ -2533,7 +2535,7 @@
"(TARGET_H8300H || TARGET_H8300S)
&& INTVAL (operands[2]) < 16"
"* return output_simode_bld (0, operands);"
- [(set_attr "cc" "clobber,clobber")
+ [(set_attr "cc" "set_znv,set_znv")
(set_attr "length" "8,6")])
;;
@@ -2563,7 +2565,7 @@
&& INTVAL (operands[2]) < 16
&& (1 << INTVAL (operands[2])) == INTVAL (operands[3])"
"* return output_simode_bld (1, operands);"
- [(set_attr "cc" "clobber,clobber")
+ [(set_attr "cc" "set_znv,set_znv")
(set_attr "length" "8,6")])
(define_expand "insv"
@@ -2623,8 +2625,7 @@
""
"bld %Z2,%Y1\;b%c4 #0,%R0\;bst #0,%R0; bl1"
[(set_attr "cc" "clobber")
- (set_attr "length" "6")
- (set_attr "adjust_length" "no")])
+ (set_attr "length" "6")])
(define_insn ""
[(set (match_operand:HI 0 "bit_operand" "=Ur")
@@ -2638,8 +2639,7 @@
""
"bld %Z2,%Y1\;b%c5 %Z4,%Y3\;bst #0,%R0; bl3"
[(set_attr "cc" "clobber")
- (set_attr "length" "6")
- (set_attr "adjust_length" "no")])
+ (set_attr "length" "6")])
;; -----------------------------------------------------------------
;; COMBINE PATTERNS
@@ -3968,8 +3968,8 @@
;; dead 1 eq/ne dec.l
;; dead 2 eq/ne dec.l
;;
-;; dead 1 geu/ltu shlr.l
-;; dead 3 (H8S) geu/ltu shlr.l
+;; dead 1 geu/ltu shar.l
+;; dead 3 (H8S) geu/ltu shar.l
;;
;; ---- 255 geu/ltu mov.b
@@ -4013,7 +4013,7 @@
;;
;; into
;;
-;; shlr.w r0
+;; shar.w r0
;; bne .L1
(define_peephole2
@@ -4021,7 +4021,7 @@
(compare (match_operand:HI 0 "register_operand" "")
(match_operand:HI 1 "const_int_operand" "")))
(set (pc)
- (if_then_else (match_operator 2 "gtuleu_operator"
+ (if_then_else (match_operator 2 "gtle_operator"
[(cc0) (const_int 0)])
(label_ref (match_operand 3 "" ""))
(pc)))]
@@ -4030,7 +4030,7 @@
&& (INTVAL (operands[1]) == 1
|| (TARGET_H8300S && INTVAL (operands[1]) == 3))"
[(parallel [(set (match_dup 0)
- (lshiftrt:HI (match_dup 0)
+ (ashiftrt:HI (match_dup 0)
(match_dup 5)))
(clobber (scratch:QI))])
(set (cc0)
@@ -4039,9 +4039,18 @@
(if_then_else (match_dup 4)
(label_ref (match_dup 3))
(pc)))]
- "operands[4] = ((GET_CODE (operands[2]) == GTU) ?
- gen_rtx_NE (VOIDmode, cc0_rtx, const0_rtx) :
- gen_rtx_EQ (VOIDmode, cc0_rtx, const0_rtx));
+ "switch (GET_CODE (operands[2]))
+ {
+ case GTU:
+ operands[4] = gen_rtx_NE (VOIDmode, cc0_rtx, const0_rtx);
+ break;
+ case LEU:
+ operands[4] = gen_rtx_EQ (VOIDmode, cc0_rtx, const0_rtx);
+ break;
+ default:
+ operands[4] = operands[2];
+ break;
+ }
operands[5] = GEN_INT (exact_log2 (INTVAL (operands[1]) + 1));")
;; Transform
@@ -4112,11 +4121,11 @@
;; dead 0xffffff?? except -1 and -2 eq/ne xor.b and not.l
;; dead 0xffff??ff eq/ne xor.b and not.l
;;
-;; live 1 geu/ltu copy and shlr.l
-;; live 3 (H8S) geu/ltu copy and shlr.l
+;; live 1 geu/ltu copy and shar.l
+;; live 3 (H8S) geu/ltu copy and shar.l
;;
-;; dead 1 geu/ltu shlr.l
-;; dead 3 (H8S) geu/ltu shlr.l
+;; dead 1 geu/ltu shar.l
+;; dead 3 (H8S) geu/ltu shar.l
;;
;; dead 3 (H8/300H) geu/ltu and.b and test
;; dead 7 geu/ltu and.b and test
@@ -4180,7 +4189,7 @@
(pc)))]
"operands[4] = GEN_INT (- INTVAL (operands[1]));")
-;; For certain (in)equaltity comparisions against a constant, we can
+;; For certain (in)equaltity comparisons against a constant, we can
;; XOR the register with the constant, and test the register against
;; 0.
@@ -4247,27 +4256,31 @@
;; into
;;
;; mov.l er0,er1
-;; shlr.l er1
+;; shar.l er1
;; bne .L1
+;; We avoid this transformation if we see more than one copy of the
+;; same compare insn immediately before this one.
+
(define_peephole2
[(match_scratch:SI 4 "r")
(set (cc0)
(compare (match_operand:SI 0 "register_operand" "")
(match_operand:SI 1 "const_int_operand" "")))
(set (pc)
- (if_then_else (match_operator 2 "gtuleu_operator"
+ (if_then_else (match_operator 2 "gtle_operator"
[(cc0) (const_int 0)])
(label_ref (match_operand 3 "" ""))
(pc)))]
"(TARGET_H8300H || TARGET_H8300S)
&& !peep2_reg_dead_p (1, operands[0])
&& (INTVAL (operands[1]) == 1
- || (TARGET_H8300S && INTVAL (operands[1]) == 3))"
+ || (TARGET_H8300S && INTVAL (operands[1]) == 3))
+ && !same_cmp_preceding_p (insn)"
[(set (match_dup 4)
(match_dup 0))
(parallel [(set (match_dup 4)
- (lshiftrt:SI (match_dup 4)
+ (ashiftrt:SI (match_dup 4)
(match_dup 6)))
(clobber (scratch:QI))])
(set (cc0)
@@ -4276,9 +4289,18 @@
(if_then_else (match_dup 5)
(label_ref (match_dup 3))
(pc)))]
- "operands[5] = ((GET_CODE (operands[2]) == GTU) ?
- gen_rtx_NE (VOIDmode, cc0_rtx, const0_rtx) :
- gen_rtx_EQ (VOIDmode, cc0_rtx, const0_rtx));
+ "switch (GET_CODE (operands[2]))
+ {
+ case GTU:
+ operands[5] = gen_rtx_NE (VOIDmode, cc0_rtx, const0_rtx);
+ break;
+ case LEU:
+ operands[5] = gen_rtx_EQ (VOIDmode, cc0_rtx, const0_rtx);
+ break;
+ default:
+ operands[5] = operands[2];
+ break;
+ }
operands[6] = GEN_INT (exact_log2 (INTVAL (operands[1]) + 1));")
;; Transform
@@ -4288,7 +4310,7 @@
;;
;; into
;;
-;; shlr.l er0
+;; shar.l er0
;; bne .L1
(define_peephole2
@@ -4296,7 +4318,7 @@
(compare (match_operand:SI 0 "register_operand" "")
(match_operand:SI 1 "const_int_operand" "")))
(set (pc)
- (if_then_else (match_operator 2 "gtuleu_operator"
+ (if_then_else (match_operator 2 "gtle_operator"
[(cc0) (const_int 0)])
(label_ref (match_operand 3 "" ""))
(pc)))]
@@ -4305,7 +4327,7 @@
&& (INTVAL (operands[1]) == 1
|| (TARGET_H8300S && INTVAL (operands[1]) == 3))"
[(parallel [(set (match_dup 0)
- (lshiftrt:SI (match_dup 0)
+ (ashiftrt:SI (match_dup 0)
(match_dup 5)))
(clobber (scratch:QI))])
(set (cc0)
@@ -4314,9 +4336,18 @@
(if_then_else (match_dup 4)
(label_ref (match_dup 3))
(pc)))]
- "operands[4] = ((GET_CODE (operands[2]) == GTU) ?
- gen_rtx_NE (VOIDmode, cc0_rtx, const0_rtx) :
- gen_rtx_EQ (VOIDmode, cc0_rtx, const0_rtx));
+ "switch (GET_CODE (operands[2]))
+ {
+ case GTU:
+ operands[4] = gen_rtx_NE (VOIDmode, cc0_rtx, const0_rtx);
+ break;
+ case LEU:
+ operands[4] = gen_rtx_EQ (VOIDmode, cc0_rtx, const0_rtx);
+ break;
+ default:
+ operands[4] = operands[2];
+ break;
+ }
operands[5] = GEN_INT (exact_log2 (INTVAL (operands[1]) + 1));")
;; Transform
diff --git a/gcc/config/i370/i370.c b/gcc/config/i370/i370.c
index cbb118b1b9b..ee9e8608c77 100644
--- a/gcc/config/i370/i370.c
+++ b/gcc/config/i370/i370.c
@@ -107,6 +107,7 @@ static void i370_globalize_label PARAMS ((FILE *, const char *));
#endif
static void i370_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void i370_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
+static void i370_file_start PARAMS ((void));
static void i370_file_end PARAMS ((void));
#ifdef LONGEXTERNAL
@@ -120,7 +121,7 @@ static bool i370_rtx_costs PARAMS ((rtx, int, int, int *));
#ifdef TARGET_HLASM
#define MVS_HASH_PRIME 999983
-#if defined(HOST_EBCDIC)
+#if HOST_CHARSET == HOST_CHARSET_EBCDIC
#define MVS_SET_SIZE 256
#else
#define MVS_SET_SIZE 128
@@ -155,7 +156,7 @@ static alias_node_t *alias_anchor = 0;
and must handled in a special manner. */
static const char *const mvs_function_table[MVS_FUNCTION_TABLE_LENGTH] =
{
-#if defined(HOST_EBCDIC) /* Changed for EBCDIC collating sequence */
+#if HOST_CHARSET == HOST_CHARSET_EBCDIC /* Changed for EBCDIC collating sequence */
"ceil", "edc_acos", "edc_asin", "edc_atan", "edc_ata2", "edc_cos",
"edc_cosh", "edc_erf", "edc_erfc", "edc_exp", "edc_gamm", "edc_lg10",
"edc_log", "edc_sin", "edc_sinh", "edc_sqrt", "edc_tan", "edc_tanh",
@@ -175,7 +176,7 @@ static const char *const mvs_function_table[MVS_FUNCTION_TABLE_LENGTH] =
#endif /* TARGET_HLASM */
/* ===================================================== */
-#if defined(TARGET_EBCDIC) && !defined(HOST_EBCDIC)
+#if defined(TARGET_EBCDIC) && HOST_CHARSET == HOST_CHARSET_ASCII
/* ASCII to EBCDIC conversion table. */
static const unsigned char ascebc[256] =
{
@@ -228,10 +229,9 @@ static const unsigned char ascebc[256] =
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0xFF
};
-#endif /* TARGET_EBCDIC && ! HOST_EBCDIC */
+#endif /* target EBCDIC, host ASCII */
-
-#if defined(HOST_EBCDIC) && !defined(TARGET_EBCDIC)
+#if !defined(TARGET_EBCDIC) && HOST_CHARSET == HOST_CHARSET_EBCDIC
/* EBCDIC to ASCII conversion table. */
static const unsigned char ebcasc[256] =
{
@@ -300,7 +300,7 @@ static const unsigned char ebcasc[256] =
/*F8 8 9 */
0x38, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF
};
-#endif /* HOST_EBCDIC && ! TARGET_EBCDIC */
+#endif /* target ASCII, host EBCDIC */
/* Initialize the GCC target structure. */
#ifdef TARGET_HLASM
@@ -320,6 +320,8 @@ static const unsigned char ebcasc[256] =
#define TARGET_ASM_FUNCTION_PROLOGUE i370_output_function_prologue
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE i370_output_function_epilogue
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START i370_file_start
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END i370_file_end
#undef TARGET_ASM_INTERNAL_LABEL
@@ -348,11 +350,11 @@ char
mvs_map_char (c)
int c;
{
-#if defined(TARGET_EBCDIC) && !defined(HOST_EBCDIC)
+#if defined(TARGET_EBCDIC) && HOST_CHARSET == HOST_CHARSET_ASCII
fprintf (stderr, "mvs_map_char: TE & !HE: c = %02x\n", c);
return ascebc[c];
#else
-#if defined(HOST_EBCDIC) && !defined(TARGET_EBCDIC)
+#if !defined(TARGET_EBCDIC) && HOST_CHARSET == HOST_CHARSET_EBCDIC
fprintf (stderr, "mvs_map_char: !TE & HE: c = %02x\n", c);
return ebcasc[c];
#else
@@ -1603,6 +1605,12 @@ i370_output_function_epilogue (file, l)
}
static void
+i370_file_start ()
+{
+ fputs ("\tRMODE\tANY\n\tCSECT\n", asm_out_file);
+}
+
+static void
i370_file_end ()
{
fputs ("\tEND\n", asm_out_file);
diff --git a/gcc/config/i370/i370.h b/gcc/config/i370/i370.h
index dd82a6f677f..d7933c178cd 100644
--- a/gcc/config/i370/i370.h
+++ b/gcc/config/i370/i370.h
@@ -141,7 +141,7 @@ extern size_t mvs_function_name_length;
/* but only define it if really needed, since otherwise it will break builds */
#ifdef TARGET_EBCDIC
-#ifdef HOST_EBCDIC
+#if HOST_CHARSET == HOST_CHARSET_EBCDIC
#define MAP_CHARACTER(c) ((char)(c))
#else
#define MAP_CHARACTER(c) ((char)mvs_map_char (c))
@@ -1029,10 +1029,6 @@ enum reg_class
"0", "2", "4", "6" \
}
-#define ASM_FILE_START(FILE) \
-{ fputs ("\tRMODE\tANY\n", FILE); \
- fputs ("\tCSECT\n", FILE); }
-
#define ASM_COMMENT_START "*"
#define ASM_APP_OFF ""
#define ASM_APP_ON ""
diff --git a/gcc/config/i386/att.h b/gcc/config/i386/att.h
index c95b6ad881e..b51f66b65b2 100644
--- a/gcc/config/i386/att.h
+++ b/gcc/config/i386/att.h
@@ -45,14 +45,7 @@ do \
} while (0)
/* Output at beginning of assembler file. */
-/* The .file command should always begin the output. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- do { \
- output_file_directive (FILE, main_input_filename); \
- if (ix86_asm_dialect == ASM_INTEL) \
- fputs ("\t.intel_syntax\n", FILE); \
- } while (0)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
/* This is how to output an assembler line
that says to advance the location counter
diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h
index 64b152f0d49..52dcf1bc4c2 100644
--- a/gcc/config/i386/freebsd.h
+++ b/gcc/config/i386/freebsd.h
@@ -133,3 +133,13 @@ Boston, MA 02111-1307, USA. */
#undef DEFAULT_PCC_STRUCT_RETURN
#define DEFAULT_PCC_STRUCT_RETURN 0
+
+/* FreeBSD sets the rounding precision of the FPU to 53 bits. Let the
+ compiler get the contents of <float.h> and std::numeric_limits correct. */
+#define SUBTARGET_OVERRIDE_OPTIONS \
+ do { \
+ real_format_for_mode[XFmode - QFmode] \
+ = &ieee_extended_intel_96_round_53_format; \
+ real_format_for_mode[TFmode - QFmode] \
+ = &ieee_extended_intel_96_round_53_format; \
+ } while (0)
diff --git a/gcc/config/i386/gas.h b/gcc/config/i386/gas.h
index 6dec86e08a4..7104ac3d31b 100644
--- a/gcc/config/i386/gas.h
+++ b/gcc/config/i386/gas.h
@@ -121,12 +121,4 @@ Boston, MA 02111-1307, USA. */
/* Print opcodes the way that GAS expects them. */
#define GAS_MNEMONICS 1
-/* Output at beginning of assembler file. */
-/* The .file command should always begin the output. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- do { \
- output_file_directive (FILE, main_input_filename); \
- if (ix86_asm_dialect == ASM_INTEL) \
- fputs ("\t.intel_syntax\n", FILE); \
- } while (0)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
diff --git a/gcc/config/i386/i386-interix.h b/gcc/config/i386/i386-interix.h
index 4d3f8603b43..c58d07ba787 100644
--- a/gcc/config/i386/i386-interix.h
+++ b/gcc/config/i386/i386-interix.h
@@ -92,16 +92,8 @@ Boston, MA 02111-1307, USA. */
/* The global __fltused is necessary to cause the printf/scanf routines
for outputting/inputting floating point numbers to be loaded. Since this
is kind of hard to detect, we just do it all the time. */
-
-#ifdef ASM_FILE_START
-#undef ASM_FILE_START
-#endif
-#define ASM_FILE_START(FILE) \
- do { fprintf (FILE, "\t.file\t"); \
- output_quoted_string (FILE, dump_base_name); \
- fprintf (FILE, "\n"); \
- fprintf (FILE, ".global\t__fltused\n"); \
- } while (0)
+#undef X86_FILE_START_FLTUSED
+#define X86_FILE_START_FLTUSED 1
/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 51f22cf2507..8d9c08f99fa 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -829,6 +829,7 @@ static void x86_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
static bool x86_can_output_mi_thunk PARAMS ((tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
+static void x86_file_start PARAMS ((void));
static void ix86_reorg PARAMS ((void));
bool ix86_expand_carry_flag_compare PARAMS ((enum rtx_code, rtx, rtx, rtx*));
@@ -1006,6 +1007,9 @@ static void init_ext_80387_constants PARAMS ((void));
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK x86_can_output_mi_thunk
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START x86_file_start
+
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS ix86_rtx_costs
#undef TARGET_ADDRESS_COST
@@ -1369,6 +1373,14 @@ override_options ()
if (x86_arch_always_fancy_math_387 & (1 << ix86_arch))
target_flags &= ~MASK_NO_FANCY_MATH_387;
+ /* Turn on SSE2 builtins for -mpni. */
+ if (TARGET_PNI)
+ target_flags |= MASK_SSE2;
+
+ /* Turn on SSE builtins for -msse2. */
+ if (TARGET_SSE2)
+ target_flags |= MASK_SSE;
+
if (TARGET_64BIT)
{
if (TARGET_ALIGN_DOUBLE)
@@ -3153,10 +3165,12 @@ ix86_va_arg (valist, type)
{
int i;
rtx mem;
+ rtx x;
/* Never use the memory itself, as it has the alias set. */
- addr_rtx = XEXP (assign_temp (type, 0, 1, 0), 0);
- mem = gen_rtx_MEM (BLKmode, addr_rtx);
+ x = XEXP (assign_temp (type, 0, 1, 0), 0);
+ mem = gen_rtx_MEM (BLKmode, x);
+ force_operand (x, addr_rtx);
set_mem_alias_set (mem, get_varargs_alias_set ());
set_mem_align (mem, BITS_PER_UNIT);
@@ -12765,25 +12779,20 @@ struct builtin_description
const unsigned int flag;
};
-/* Used for builtins that are enabled both by -msse and -msse2. */
-#define MASK_SSE1 (MASK_SSE | MASK_SSE2)
-#define MASK_SSE164 (MASK_SSE | MASK_SSE2 | MASK_64BIT)
-#define MASK_SSE264 (MASK_SSE2 | MASK_64BIT)
-
static const struct builtin_description bdesc_comi[] =
{
- { MASK_SSE1, CODE_FOR_sse_comi, "__builtin_ia32_comieq", IX86_BUILTIN_COMIEQSS, UNEQ, 0 },
- { MASK_SSE1, CODE_FOR_sse_comi, "__builtin_ia32_comilt", IX86_BUILTIN_COMILTSS, UNLT, 0 },
- { MASK_SSE1, CODE_FOR_sse_comi, "__builtin_ia32_comile", IX86_BUILTIN_COMILESS, UNLE, 0 },
- { MASK_SSE1, CODE_FOR_sse_comi, "__builtin_ia32_comigt", IX86_BUILTIN_COMIGTSS, GT, 0 },
- { MASK_SSE1, CODE_FOR_sse_comi, "__builtin_ia32_comige", IX86_BUILTIN_COMIGESS, GE, 0 },
- { MASK_SSE1, CODE_FOR_sse_comi, "__builtin_ia32_comineq", IX86_BUILTIN_COMINEQSS, LTGT, 0 },
- { MASK_SSE1, CODE_FOR_sse_ucomi, "__builtin_ia32_ucomieq", IX86_BUILTIN_UCOMIEQSS, UNEQ, 0 },
- { MASK_SSE1, CODE_FOR_sse_ucomi, "__builtin_ia32_ucomilt", IX86_BUILTIN_UCOMILTSS, UNLT, 0 },
- { MASK_SSE1, CODE_FOR_sse_ucomi, "__builtin_ia32_ucomile", IX86_BUILTIN_UCOMILESS, UNLE, 0 },
- { MASK_SSE1, CODE_FOR_sse_ucomi, "__builtin_ia32_ucomigt", IX86_BUILTIN_UCOMIGTSS, GT, 0 },
- { MASK_SSE1, CODE_FOR_sse_ucomi, "__builtin_ia32_ucomige", IX86_BUILTIN_UCOMIGESS, GE, 0 },
- { MASK_SSE1, CODE_FOR_sse_ucomi, "__builtin_ia32_ucomineq", IX86_BUILTIN_UCOMINEQSS, LTGT, 0 },
+ { MASK_SSE, CODE_FOR_sse_comi, "__builtin_ia32_comieq", IX86_BUILTIN_COMIEQSS, UNEQ, 0 },
+ { MASK_SSE, CODE_FOR_sse_comi, "__builtin_ia32_comilt", IX86_BUILTIN_COMILTSS, UNLT, 0 },
+ { MASK_SSE, CODE_FOR_sse_comi, "__builtin_ia32_comile", IX86_BUILTIN_COMILESS, UNLE, 0 },
+ { MASK_SSE, CODE_FOR_sse_comi, "__builtin_ia32_comigt", IX86_BUILTIN_COMIGTSS, GT, 0 },
+ { MASK_SSE, CODE_FOR_sse_comi, "__builtin_ia32_comige", IX86_BUILTIN_COMIGESS, GE, 0 },
+ { MASK_SSE, CODE_FOR_sse_comi, "__builtin_ia32_comineq", IX86_BUILTIN_COMINEQSS, LTGT, 0 },
+ { MASK_SSE, CODE_FOR_sse_ucomi, "__builtin_ia32_ucomieq", IX86_BUILTIN_UCOMIEQSS, UNEQ, 0 },
+ { MASK_SSE, CODE_FOR_sse_ucomi, "__builtin_ia32_ucomilt", IX86_BUILTIN_UCOMILTSS, UNLT, 0 },
+ { MASK_SSE, CODE_FOR_sse_ucomi, "__builtin_ia32_ucomile", IX86_BUILTIN_UCOMILESS, UNLE, 0 },
+ { MASK_SSE, CODE_FOR_sse_ucomi, "__builtin_ia32_ucomigt", IX86_BUILTIN_UCOMIGTSS, GT, 0 },
+ { MASK_SSE, CODE_FOR_sse_ucomi, "__builtin_ia32_ucomige", IX86_BUILTIN_UCOMIGESS, GE, 0 },
+ { MASK_SSE, CODE_FOR_sse_ucomi, "__builtin_ia32_ucomineq", IX86_BUILTIN_UCOMINEQSS, LTGT, 0 },
{ MASK_SSE2, CODE_FOR_sse2_comi, "__builtin_ia32_comisdeq", IX86_BUILTIN_COMIEQSD, UNEQ, 0 },
{ MASK_SSE2, CODE_FOR_sse2_comi, "__builtin_ia32_comisdlt", IX86_BUILTIN_COMILTSD, UNLT, 0 },
{ MASK_SSE2, CODE_FOR_sse2_comi, "__builtin_ia32_comisdle", IX86_BUILTIN_COMILESD, UNLE, 0 },
@@ -12801,51 +12810,51 @@ static const struct builtin_description bdesc_comi[] =
static const struct builtin_description bdesc_2arg[] =
{
/* SSE */
- { MASK_SSE1, CODE_FOR_addv4sf3, "__builtin_ia32_addps", IX86_BUILTIN_ADDPS, 0, 0 },
- { MASK_SSE1, CODE_FOR_subv4sf3, "__builtin_ia32_subps", IX86_BUILTIN_SUBPS, 0, 0 },
- { MASK_SSE1, CODE_FOR_mulv4sf3, "__builtin_ia32_mulps", IX86_BUILTIN_MULPS, 0, 0 },
- { MASK_SSE1, CODE_FOR_divv4sf3, "__builtin_ia32_divps", IX86_BUILTIN_DIVPS, 0, 0 },
- { MASK_SSE1, CODE_FOR_vmaddv4sf3, "__builtin_ia32_addss", IX86_BUILTIN_ADDSS, 0, 0 },
- { MASK_SSE1, CODE_FOR_vmsubv4sf3, "__builtin_ia32_subss", IX86_BUILTIN_SUBSS, 0, 0 },
- { MASK_SSE1, CODE_FOR_vmmulv4sf3, "__builtin_ia32_mulss", IX86_BUILTIN_MULSS, 0, 0 },
- { MASK_SSE1, CODE_FOR_vmdivv4sf3, "__builtin_ia32_divss", IX86_BUILTIN_DIVSS, 0, 0 },
-
- { MASK_SSE1, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpeqps", IX86_BUILTIN_CMPEQPS, EQ, 0 },
- { MASK_SSE1, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpltps", IX86_BUILTIN_CMPLTPS, LT, 0 },
- { MASK_SSE1, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpleps", IX86_BUILTIN_CMPLEPS, LE, 0 },
- { MASK_SSE1, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpgtps", IX86_BUILTIN_CMPGTPS, LT, 1 },
- { MASK_SSE1, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpgeps", IX86_BUILTIN_CMPGEPS, LE, 1 },
- { MASK_SSE1, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpunordps", IX86_BUILTIN_CMPUNORDPS, UNORDERED, 0 },
- { MASK_SSE1, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpneqps", IX86_BUILTIN_CMPNEQPS, EQ, 0 },
- { MASK_SSE1, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpnltps", IX86_BUILTIN_CMPNLTPS, LT, 0 },
- { MASK_SSE1, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpnleps", IX86_BUILTIN_CMPNLEPS, LE, 0 },
- { MASK_SSE1, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpngtps", IX86_BUILTIN_CMPNGTPS, LT, 1 },
- { MASK_SSE1, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpngeps", IX86_BUILTIN_CMPNGEPS, LE, 1 },
- { MASK_SSE1, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpordps", IX86_BUILTIN_CMPORDPS, UNORDERED, 0 },
- { MASK_SSE1, CODE_FOR_vmmaskcmpv4sf3, "__builtin_ia32_cmpeqss", IX86_BUILTIN_CMPEQSS, EQ, 0 },
- { MASK_SSE1, CODE_FOR_vmmaskcmpv4sf3, "__builtin_ia32_cmpltss", IX86_BUILTIN_CMPLTSS, LT, 0 },
- { MASK_SSE1, CODE_FOR_vmmaskcmpv4sf3, "__builtin_ia32_cmpless", IX86_BUILTIN_CMPLESS, LE, 0 },
- { MASK_SSE1, CODE_FOR_vmmaskcmpv4sf3, "__builtin_ia32_cmpunordss", IX86_BUILTIN_CMPUNORDSS, UNORDERED, 0 },
- { MASK_SSE1, CODE_FOR_vmmaskncmpv4sf3, "__builtin_ia32_cmpneqss", IX86_BUILTIN_CMPNEQSS, EQ, 0 },
- { MASK_SSE1, CODE_FOR_vmmaskncmpv4sf3, "__builtin_ia32_cmpnltss", IX86_BUILTIN_CMPNLTSS, LT, 0 },
- { MASK_SSE1, CODE_FOR_vmmaskncmpv4sf3, "__builtin_ia32_cmpnless", IX86_BUILTIN_CMPNLESS, LE, 0 },
- { MASK_SSE1, CODE_FOR_vmmaskncmpv4sf3, "__builtin_ia32_cmpordss", IX86_BUILTIN_CMPORDSS, UNORDERED, 0 },
-
- { MASK_SSE1, CODE_FOR_sminv4sf3, "__builtin_ia32_minps", IX86_BUILTIN_MINPS, 0, 0 },
- { MASK_SSE1, CODE_FOR_smaxv4sf3, "__builtin_ia32_maxps", IX86_BUILTIN_MAXPS, 0, 0 },
- { MASK_SSE1, CODE_FOR_vmsminv4sf3, "__builtin_ia32_minss", IX86_BUILTIN_MINSS, 0, 0 },
- { MASK_SSE1, CODE_FOR_vmsmaxv4sf3, "__builtin_ia32_maxss", IX86_BUILTIN_MAXSS, 0, 0 },
-
- { MASK_SSE1, CODE_FOR_sse_andv4sf3, "__builtin_ia32_andps", IX86_BUILTIN_ANDPS, 0, 0 },
- { MASK_SSE1, CODE_FOR_sse_nandv4sf3, "__builtin_ia32_andnps", IX86_BUILTIN_ANDNPS, 0, 0 },
- { MASK_SSE1, CODE_FOR_sse_iorv4sf3, "__builtin_ia32_orps", IX86_BUILTIN_ORPS, 0, 0 },
- { MASK_SSE1, CODE_FOR_sse_xorv4sf3, "__builtin_ia32_xorps", IX86_BUILTIN_XORPS, 0, 0 },
-
- { MASK_SSE1, CODE_FOR_sse_movss, "__builtin_ia32_movss", IX86_BUILTIN_MOVSS, 0, 0 },
- { MASK_SSE1, CODE_FOR_sse_movhlps, "__builtin_ia32_movhlps", IX86_BUILTIN_MOVHLPS, 0, 0 },
- { MASK_SSE1, CODE_FOR_sse_movlhps, "__builtin_ia32_movlhps", IX86_BUILTIN_MOVLHPS, 0, 0 },
- { MASK_SSE1, CODE_FOR_sse_unpckhps, "__builtin_ia32_unpckhps", IX86_BUILTIN_UNPCKHPS, 0, 0 },
- { MASK_SSE1, CODE_FOR_sse_unpcklps, "__builtin_ia32_unpcklps", IX86_BUILTIN_UNPCKLPS, 0, 0 },
+ { MASK_SSE, CODE_FOR_addv4sf3, "__builtin_ia32_addps", IX86_BUILTIN_ADDPS, 0, 0 },
+ { MASK_SSE, CODE_FOR_subv4sf3, "__builtin_ia32_subps", IX86_BUILTIN_SUBPS, 0, 0 },
+ { MASK_SSE, CODE_FOR_mulv4sf3, "__builtin_ia32_mulps", IX86_BUILTIN_MULPS, 0, 0 },
+ { MASK_SSE, CODE_FOR_divv4sf3, "__builtin_ia32_divps", IX86_BUILTIN_DIVPS, 0, 0 },
+ { MASK_SSE, CODE_FOR_vmaddv4sf3, "__builtin_ia32_addss", IX86_BUILTIN_ADDSS, 0, 0 },
+ { MASK_SSE, CODE_FOR_vmsubv4sf3, "__builtin_ia32_subss", IX86_BUILTIN_SUBSS, 0, 0 },
+ { MASK_SSE, CODE_FOR_vmmulv4sf3, "__builtin_ia32_mulss", IX86_BUILTIN_MULSS, 0, 0 },
+ { MASK_SSE, CODE_FOR_vmdivv4sf3, "__builtin_ia32_divss", IX86_BUILTIN_DIVSS, 0, 0 },
+
+ { MASK_SSE, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpeqps", IX86_BUILTIN_CMPEQPS, EQ, 0 },
+ { MASK_SSE, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpltps", IX86_BUILTIN_CMPLTPS, LT, 0 },
+ { MASK_SSE, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpleps", IX86_BUILTIN_CMPLEPS, LE, 0 },
+ { MASK_SSE, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpgtps", IX86_BUILTIN_CMPGTPS, LT, 1 },
+ { MASK_SSE, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpgeps", IX86_BUILTIN_CMPGEPS, LE, 1 },
+ { MASK_SSE, CODE_FOR_maskcmpv4sf3, "__builtin_ia32_cmpunordps", IX86_BUILTIN_CMPUNORDPS, UNORDERED, 0 },
+ { MASK_SSE, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpneqps", IX86_BUILTIN_CMPNEQPS, EQ, 0 },
+ { MASK_SSE, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpnltps", IX86_BUILTIN_CMPNLTPS, LT, 0 },
+ { MASK_SSE, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpnleps", IX86_BUILTIN_CMPNLEPS, LE, 0 },
+ { MASK_SSE, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpngtps", IX86_BUILTIN_CMPNGTPS, LT, 1 },
+ { MASK_SSE, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpngeps", IX86_BUILTIN_CMPNGEPS, LE, 1 },
+ { MASK_SSE, CODE_FOR_maskncmpv4sf3, "__builtin_ia32_cmpordps", IX86_BUILTIN_CMPORDPS, UNORDERED, 0 },
+ { MASK_SSE, CODE_FOR_vmmaskcmpv4sf3, "__builtin_ia32_cmpeqss", IX86_BUILTIN_CMPEQSS, EQ, 0 },
+ { MASK_SSE, CODE_FOR_vmmaskcmpv4sf3, "__builtin_ia32_cmpltss", IX86_BUILTIN_CMPLTSS, LT, 0 },
+ { MASK_SSE, CODE_FOR_vmmaskcmpv4sf3, "__builtin_ia32_cmpless", IX86_BUILTIN_CMPLESS, LE, 0 },
+ { MASK_SSE, CODE_FOR_vmmaskcmpv4sf3, "__builtin_ia32_cmpunordss", IX86_BUILTIN_CMPUNORDSS, UNORDERED, 0 },
+ { MASK_SSE, CODE_FOR_vmmaskncmpv4sf3, "__builtin_ia32_cmpneqss", IX86_BUILTIN_CMPNEQSS, EQ, 0 },
+ { MASK_SSE, CODE_FOR_vmmaskncmpv4sf3, "__builtin_ia32_cmpnltss", IX86_BUILTIN_CMPNLTSS, LT, 0 },
+ { MASK_SSE, CODE_FOR_vmmaskncmpv4sf3, "__builtin_ia32_cmpnless", IX86_BUILTIN_CMPNLESS, LE, 0 },
+ { MASK_SSE, CODE_FOR_vmmaskncmpv4sf3, "__builtin_ia32_cmpordss", IX86_BUILTIN_CMPORDSS, UNORDERED, 0 },
+
+ { MASK_SSE, CODE_FOR_sminv4sf3, "__builtin_ia32_minps", IX86_BUILTIN_MINPS, 0, 0 },
+ { MASK_SSE, CODE_FOR_smaxv4sf3, "__builtin_ia32_maxps", IX86_BUILTIN_MAXPS, 0, 0 },
+ { MASK_SSE, CODE_FOR_vmsminv4sf3, "__builtin_ia32_minss", IX86_BUILTIN_MINSS, 0, 0 },
+ { MASK_SSE, CODE_FOR_vmsmaxv4sf3, "__builtin_ia32_maxss", IX86_BUILTIN_MAXSS, 0, 0 },
+
+ { MASK_SSE, CODE_FOR_sse_andv4sf3, "__builtin_ia32_andps", IX86_BUILTIN_ANDPS, 0, 0 },
+ { MASK_SSE, CODE_FOR_sse_nandv4sf3, "__builtin_ia32_andnps", IX86_BUILTIN_ANDNPS, 0, 0 },
+ { MASK_SSE, CODE_FOR_sse_iorv4sf3, "__builtin_ia32_orps", IX86_BUILTIN_ORPS, 0, 0 },
+ { MASK_SSE, CODE_FOR_sse_xorv4sf3, "__builtin_ia32_xorps", IX86_BUILTIN_XORPS, 0, 0 },
+
+ { MASK_SSE, CODE_FOR_sse_movss, "__builtin_ia32_movss", IX86_BUILTIN_MOVSS, 0, 0 },
+ { MASK_SSE, CODE_FOR_sse_movhlps, "__builtin_ia32_movhlps", IX86_BUILTIN_MOVHLPS, 0, 0 },
+ { MASK_SSE, CODE_FOR_sse_movlhps, "__builtin_ia32_movlhps", IX86_BUILTIN_MOVLHPS, 0, 0 },
+ { MASK_SSE, CODE_FOR_sse_unpckhps, "__builtin_ia32_unpckhps", IX86_BUILTIN_UNPCKHPS, 0, 0 },
+ { MASK_SSE, CODE_FOR_sse_unpcklps, "__builtin_ia32_unpcklps", IX86_BUILTIN_UNPCKLPS, 0, 0 },
/* MMX */
{ MASK_MMX, CODE_FOR_addv8qi3, "__builtin_ia32_paddb", IX86_BUILTIN_PADDB, 0, 0 },
@@ -12868,15 +12877,15 @@ static const struct builtin_description bdesc_2arg[] =
{ MASK_MMX, CODE_FOR_mulv4hi3, "__builtin_ia32_pmullw", IX86_BUILTIN_PMULLW, 0, 0 },
{ MASK_MMX, CODE_FOR_smulv4hi3_highpart, "__builtin_ia32_pmulhw", IX86_BUILTIN_PMULHW, 0, 0 },
- { MASK_SSE1 | MASK_3DNOW_A, CODE_FOR_umulv4hi3_highpart, "__builtin_ia32_pmulhuw", IX86_BUILTIN_PMULHUW, 0, 0 },
+ { MASK_SSE | MASK_3DNOW_A, CODE_FOR_umulv4hi3_highpart, "__builtin_ia32_pmulhuw", IX86_BUILTIN_PMULHUW, 0, 0 },
{ MASK_MMX, CODE_FOR_mmx_anddi3, "__builtin_ia32_pand", IX86_BUILTIN_PAND, 0, 0 },
{ MASK_MMX, CODE_FOR_mmx_nanddi3, "__builtin_ia32_pandn", IX86_BUILTIN_PANDN, 0, 0 },
{ MASK_MMX, CODE_FOR_mmx_iordi3, "__builtin_ia32_por", IX86_BUILTIN_POR, 0, 0 },
{ MASK_MMX, CODE_FOR_mmx_xordi3, "__builtin_ia32_pxor", IX86_BUILTIN_PXOR, 0, 0 },
- { MASK_SSE1 | MASK_3DNOW_A, CODE_FOR_mmx_uavgv8qi3, "__builtin_ia32_pavgb", IX86_BUILTIN_PAVGB, 0, 0 },
- { MASK_SSE1 | MASK_3DNOW_A, CODE_FOR_mmx_uavgv4hi3, "__builtin_ia32_pavgw", IX86_BUILTIN_PAVGW, 0, 0 },
+ { MASK_SSE | MASK_3DNOW_A, CODE_FOR_mmx_uavgv8qi3, "__builtin_ia32_pavgb", IX86_BUILTIN_PAVGB, 0, 0 },
+ { MASK_SSE | MASK_3DNOW_A, CODE_FOR_mmx_uavgv4hi3, "__builtin_ia32_pavgw", IX86_BUILTIN_PAVGW, 0, 0 },
{ MASK_MMX, CODE_FOR_eqv8qi3, "__builtin_ia32_pcmpeqb", IX86_BUILTIN_PCMPEQB, 0, 0 },
{ MASK_MMX, CODE_FOR_eqv4hi3, "__builtin_ia32_pcmpeqw", IX86_BUILTIN_PCMPEQW, 0, 0 },
@@ -12885,10 +12894,10 @@ static const struct builtin_description bdesc_2arg[] =
{ MASK_MMX, CODE_FOR_gtv4hi3, "__builtin_ia32_pcmpgtw", IX86_BUILTIN_PCMPGTW, 0, 0 },
{ MASK_MMX, CODE_FOR_gtv2si3, "__builtin_ia32_pcmpgtd", IX86_BUILTIN_PCMPGTD, 0, 0 },
- { MASK_SSE1 | MASK_3DNOW_A, CODE_FOR_umaxv8qi3, "__builtin_ia32_pmaxub", IX86_BUILTIN_PMAXUB, 0, 0 },
- { MASK_SSE1 | MASK_3DNOW_A, CODE_FOR_smaxv4hi3, "__builtin_ia32_pmaxsw", IX86_BUILTIN_PMAXSW, 0, 0 },
- { MASK_SSE1 | MASK_3DNOW_A, CODE_FOR_uminv8qi3, "__builtin_ia32_pminub", IX86_BUILTIN_PMINUB, 0, 0 },
- { MASK_SSE1 | MASK_3DNOW_A, CODE_FOR_sminv4hi3, "__builtin_ia32_pminsw", IX86_BUILTIN_PMINSW, 0, 0 },
+ { MASK_SSE | MASK_3DNOW_A, CODE_FOR_umaxv8qi3, "__builtin_ia32_pmaxub", IX86_BUILTIN_PMAXUB, 0, 0 },
+ { MASK_SSE | MASK_3DNOW_A, CODE_FOR_smaxv4hi3, "__builtin_ia32_pmaxsw", IX86_BUILTIN_PMAXSW, 0, 0 },
+ { MASK_SSE | MASK_3DNOW_A, CODE_FOR_uminv8qi3, "__builtin_ia32_pminub", IX86_BUILTIN_PMINUB, 0, 0 },
+ { MASK_SSE | MASK_3DNOW_A, CODE_FOR_sminv4hi3, "__builtin_ia32_pminsw", IX86_BUILTIN_PMINSW, 0, 0 },
{ MASK_MMX, CODE_FOR_mmx_punpckhbw, "__builtin_ia32_punpckhbw", IX86_BUILTIN_PUNPCKHBW, 0, 0 },
{ MASK_MMX, CODE_FOR_mmx_punpckhwd, "__builtin_ia32_punpckhwd", IX86_BUILTIN_PUNPCKHWD, 0, 0 },
@@ -12902,9 +12911,9 @@ static const struct builtin_description bdesc_2arg[] =
{ MASK_MMX, CODE_FOR_mmx_packssdw, 0, IX86_BUILTIN_PACKSSDW, 0, 0 },
{ MASK_MMX, CODE_FOR_mmx_packuswb, 0, IX86_BUILTIN_PACKUSWB, 0, 0 },
- { MASK_SSE1, CODE_FOR_cvtpi2ps, 0, IX86_BUILTIN_CVTPI2PS, 0, 0 },
- { MASK_SSE1, CODE_FOR_cvtsi2ss, 0, IX86_BUILTIN_CVTSI2SS, 0, 0 },
- { MASK_SSE164, CODE_FOR_cvtsi2ssq, 0, IX86_BUILTIN_CVTSI642SS, 0, 0 },
+ { MASK_SSE, CODE_FOR_cvtpi2ps, 0, IX86_BUILTIN_CVTPI2PS, 0, 0 },
+ { MASK_SSE, CODE_FOR_cvtsi2ss, 0, IX86_BUILTIN_CVTSI2SS, 0, 0 },
+ { MASK_SSE | MASK_64BIT, CODE_FOR_cvtsi2ssq, 0, IX86_BUILTIN_CVTSI642SS, 0, 0 },
{ MASK_MMX, CODE_FOR_ashlv4hi3, 0, IX86_BUILTIN_PSLLW, 0, 0 },
{ MASK_MMX, CODE_FOR_ashlv4hi3, 0, IX86_BUILTIN_PSLLWI, 0, 0 },
@@ -12925,7 +12934,7 @@ static const struct builtin_description bdesc_2arg[] =
{ MASK_MMX, CODE_FOR_ashrv2si3, 0, IX86_BUILTIN_PSRAD, 0, 0 },
{ MASK_MMX, CODE_FOR_ashrv2si3, 0, IX86_BUILTIN_PSRADI, 0, 0 },
- { MASK_SSE1 | MASK_3DNOW_A, CODE_FOR_mmx_psadbw, 0, IX86_BUILTIN_PSADBW, 0, 0 },
+ { MASK_SSE | MASK_3DNOW_A, CODE_FOR_mmx_psadbw, 0, IX86_BUILTIN_PSADBW, 0, 0 },
{ MASK_MMX, CODE_FOR_mmx_pmaddwd, 0, IX86_BUILTIN_PMADDWD, 0, 0 },
/* SSE2 */
@@ -13055,26 +13064,34 @@ static const struct builtin_description bdesc_2arg[] =
{ MASK_SSE2, CODE_FOR_sse2_pmaddwd, 0, IX86_BUILTIN_PMADDWD128, 0, 0 },
{ MASK_SSE2, CODE_FOR_cvtsi2sd, 0, IX86_BUILTIN_CVTSI2SD, 0, 0 },
- { MASK_SSE264, CODE_FOR_cvtsi2sdq, 0, IX86_BUILTIN_CVTSI642SD, 0, 0 },
+ { MASK_SSE2 | MASK_64BIT, CODE_FOR_cvtsi2sdq, 0, IX86_BUILTIN_CVTSI642SD, 0, 0 },
{ MASK_SSE2, CODE_FOR_cvtsd2ss, 0, IX86_BUILTIN_CVTSD2SS, 0, 0 },
- { MASK_SSE2, CODE_FOR_cvtss2sd, 0, IX86_BUILTIN_CVTSS2SD, 0, 0 }
+ { MASK_SSE2, CODE_FOR_cvtss2sd, 0, IX86_BUILTIN_CVTSS2SD, 0, 0 },
+
+ /* PNI MMX */
+ { MASK_PNI, CODE_FOR_addsubv4sf3, "__builtin_ia32_addsubps", IX86_BUILTIN_ADDSUBPS, 0, 0 },
+ { MASK_PNI, CODE_FOR_addsubv2df3, "__builtin_ia32_addsubpd", IX86_BUILTIN_ADDSUBPD, 0, 0 },
+ { MASK_PNI, CODE_FOR_haddv4sf3, "__builtin_ia32_haddps", IX86_BUILTIN_HADDPS, 0, 0 },
+ { MASK_PNI, CODE_FOR_haddv2df3, "__builtin_ia32_haddpd", IX86_BUILTIN_HADDPD, 0, 0 },
+ { MASK_PNI, CODE_FOR_hsubv4sf3, "__builtin_ia32_hsubps", IX86_BUILTIN_HSUBPS, 0, 0 },
+ { MASK_PNI, CODE_FOR_hsubv2df3, "__builtin_ia32_hsubpd", IX86_BUILTIN_HSUBPD, 0, 0 }
};
static const struct builtin_description bdesc_1arg[] =
{
- { MASK_SSE1 | MASK_3DNOW_A, CODE_FOR_mmx_pmovmskb, 0, IX86_BUILTIN_PMOVMSKB, 0, 0 },
- { MASK_SSE1, CODE_FOR_sse_movmskps, 0, IX86_BUILTIN_MOVMSKPS, 0, 0 },
+ { MASK_SSE | MASK_3DNOW_A, CODE_FOR_mmx_pmovmskb, 0, IX86_BUILTIN_PMOVMSKB, 0, 0 },
+ { MASK_SSE, CODE_FOR_sse_movmskps, 0, IX86_BUILTIN_MOVMSKPS, 0, 0 },
- { MASK_SSE1, CODE_FOR_sqrtv4sf2, 0, IX86_BUILTIN_SQRTPS, 0, 0 },
- { MASK_SSE1, CODE_FOR_rsqrtv4sf2, 0, IX86_BUILTIN_RSQRTPS, 0, 0 },
- { MASK_SSE1, CODE_FOR_rcpv4sf2, 0, IX86_BUILTIN_RCPPS, 0, 0 },
+ { MASK_SSE, CODE_FOR_sqrtv4sf2, 0, IX86_BUILTIN_SQRTPS, 0, 0 },
+ { MASK_SSE, CODE_FOR_rsqrtv4sf2, 0, IX86_BUILTIN_RSQRTPS, 0, 0 },
+ { MASK_SSE, CODE_FOR_rcpv4sf2, 0, IX86_BUILTIN_RCPPS, 0, 0 },
- { MASK_SSE1, CODE_FOR_cvtps2pi, 0, IX86_BUILTIN_CVTPS2PI, 0, 0 },
- { MASK_SSE1, CODE_FOR_cvtss2si, 0, IX86_BUILTIN_CVTSS2SI, 0, 0 },
- { MASK_SSE164, CODE_FOR_cvtss2siq, 0, IX86_BUILTIN_CVTSS2SI64, 0, 0 },
- { MASK_SSE1, CODE_FOR_cvttps2pi, 0, IX86_BUILTIN_CVTTPS2PI, 0, 0 },
- { MASK_SSE1, CODE_FOR_cvttss2si, 0, IX86_BUILTIN_CVTTSS2SI, 0, 0 },
- { MASK_SSE164, CODE_FOR_cvttss2siq, 0, IX86_BUILTIN_CVTTSS2SI64, 0, 0 },
+ { MASK_SSE, CODE_FOR_cvtps2pi, 0, IX86_BUILTIN_CVTPS2PI, 0, 0 },
+ { MASK_SSE, CODE_FOR_cvtss2si, 0, IX86_BUILTIN_CVTSS2SI, 0, 0 },
+ { MASK_SSE | MASK_64BIT, CODE_FOR_cvtss2siq, 0, IX86_BUILTIN_CVTSS2SI64, 0, 0 },
+ { MASK_SSE, CODE_FOR_cvttps2pi, 0, IX86_BUILTIN_CVTTPS2PI, 0, 0 },
+ { MASK_SSE, CODE_FOR_cvttss2si, 0, IX86_BUILTIN_CVTTSS2SI, 0, 0 },
+ { MASK_SSE | MASK_64BIT, CODE_FOR_cvttss2siq, 0, IX86_BUILTIN_CVTTSS2SI64, 0, 0 },
{ MASK_SSE2, CODE_FOR_sse2_pmovmskb, 0, IX86_BUILTIN_PMOVMSKB128, 0, 0 },
{ MASK_SSE2, CODE_FOR_sse2_movmskpd, 0, IX86_BUILTIN_MOVMSKPD, 0, 0 },
@@ -13096,14 +13113,19 @@ static const struct builtin_description bdesc_1arg[] =
{ MASK_SSE2, CODE_FOR_cvtsd2si, 0, IX86_BUILTIN_CVTSD2SI, 0, 0 },
{ MASK_SSE2, CODE_FOR_cvttsd2si, 0, IX86_BUILTIN_CVTTSD2SI, 0, 0 },
- { MASK_SSE264, CODE_FOR_cvtsd2siq, 0, IX86_BUILTIN_CVTSD2SI64, 0, 0 },
- { MASK_SSE264, CODE_FOR_cvttsd2siq, 0, IX86_BUILTIN_CVTTSD2SI64, 0, 0 },
+ { MASK_SSE2 | MASK_64BIT, CODE_FOR_cvtsd2siq, 0, IX86_BUILTIN_CVTSD2SI64, 0, 0 },
+ { MASK_SSE2 | MASK_64BIT, CODE_FOR_cvttsd2siq, 0, IX86_BUILTIN_CVTTSD2SI64, 0, 0 },
{ MASK_SSE2, CODE_FOR_cvtps2dq, 0, IX86_BUILTIN_CVTPS2DQ, 0, 0 },
{ MASK_SSE2, CODE_FOR_cvtps2pd, 0, IX86_BUILTIN_CVTPS2PD, 0, 0 },
{ MASK_SSE2, CODE_FOR_cvttps2dq, 0, IX86_BUILTIN_CVTTPS2DQ, 0, 0 },
- { MASK_SSE2, CODE_FOR_sse2_movq, 0, IX86_BUILTIN_MOVQ, 0, 0 }
+ { MASK_SSE2, CODE_FOR_sse2_movq, 0, IX86_BUILTIN_MOVQ, 0, 0 },
+
+ /* PNI */
+ { MASK_PNI, CODE_FOR_movshdup, 0, IX86_BUILTIN_MOVSHDUP, 0, 0 },
+ { MASK_PNI, CODE_FOR_movsldup, 0, IX86_BUILTIN_MOVSLDUP, 0, 0 },
+ { MASK_PNI, CODE_FOR_movddup, 0, IX86_BUILTIN_MOVDDUP, 0, 0 }
};
void
@@ -13194,6 +13216,13 @@ ix86_init_mmx_sse_builtins ()
= build_function_type (void_type_node, void_list_node);
tree void_ftype_unsigned
= build_function_type_list (void_type_node, unsigned_type_node, NULL_TREE);
+ tree void_ftype_unsigned_unsigned
+ = build_function_type_list (void_type_node, unsigned_type_node,
+ unsigned_type_node, NULL_TREE);
+ tree void_ftype_pcvoid_unsigned_unsigned
+ = build_function_type_list (void_type_node, const_ptr_type_node,
+ unsigned_type_node, unsigned_type_node,
+ NULL_TREE);
tree unsigned_ftype_void
= build_function_type (unsigned_type_node, void_list_node);
tree di_ftype_void
@@ -13512,52 +13541,52 @@ ix86_init_mmx_sse_builtins ()
def_builtin (MASK_MMX, "__builtin_ia32_packssdw", v4hi_ftype_v2si_v2si, IX86_BUILTIN_PACKSSDW);
def_builtin (MASK_MMX, "__builtin_ia32_packuswb", v8qi_ftype_v4hi_v4hi, IX86_BUILTIN_PACKUSWB);
- def_builtin (MASK_SSE1, "__builtin_ia32_ldmxcsr", void_ftype_unsigned, IX86_BUILTIN_LDMXCSR);
- def_builtin (MASK_SSE1, "__builtin_ia32_stmxcsr", unsigned_ftype_void, IX86_BUILTIN_STMXCSR);
- def_builtin (MASK_SSE1, "__builtin_ia32_cvtpi2ps", v4sf_ftype_v4sf_v2si, IX86_BUILTIN_CVTPI2PS);
- def_builtin (MASK_SSE1, "__builtin_ia32_cvtps2pi", v2si_ftype_v4sf, IX86_BUILTIN_CVTPS2PI);
- def_builtin (MASK_SSE1, "__builtin_ia32_cvtsi2ss", v4sf_ftype_v4sf_int, IX86_BUILTIN_CVTSI2SS);
- def_builtin (MASK_SSE164, "__builtin_ia32_cvtsi642ss", v4sf_ftype_v4sf_int64, IX86_BUILTIN_CVTSI642SS);
- def_builtin (MASK_SSE1, "__builtin_ia32_cvtss2si", int_ftype_v4sf, IX86_BUILTIN_CVTSS2SI);
- def_builtin (MASK_SSE164, "__builtin_ia32_cvtss2si64", int64_ftype_v4sf, IX86_BUILTIN_CVTSS2SI64);
- def_builtin (MASK_SSE1, "__builtin_ia32_cvttps2pi", v2si_ftype_v4sf, IX86_BUILTIN_CVTTPS2PI);
- def_builtin (MASK_SSE1, "__builtin_ia32_cvttss2si", int_ftype_v4sf, IX86_BUILTIN_CVTTSS2SI);
- def_builtin (MASK_SSE164, "__builtin_ia32_cvttss2si64", int64_ftype_v4sf, IX86_BUILTIN_CVTTSS2SI64);
-
- def_builtin (MASK_SSE1 | MASK_3DNOW_A, "__builtin_ia32_pextrw", int_ftype_v4hi_int, IX86_BUILTIN_PEXTRW);
- def_builtin (MASK_SSE1 | MASK_3DNOW_A, "__builtin_ia32_pinsrw", v4hi_ftype_v4hi_int_int, IX86_BUILTIN_PINSRW);
-
- def_builtin (MASK_SSE1 | MASK_3DNOW_A, "__builtin_ia32_maskmovq", void_ftype_v8qi_v8qi_pchar, IX86_BUILTIN_MASKMOVQ);
-
- def_builtin (MASK_SSE1, "__builtin_ia32_loadaps", v4sf_ftype_pcfloat, IX86_BUILTIN_LOADAPS);
- def_builtin (MASK_SSE1, "__builtin_ia32_loadups", v4sf_ftype_pcfloat, IX86_BUILTIN_LOADUPS);
- def_builtin (MASK_SSE1, "__builtin_ia32_loadss", v4sf_ftype_pcfloat, IX86_BUILTIN_LOADSS);
- def_builtin (MASK_SSE1, "__builtin_ia32_storeaps", void_ftype_pfloat_v4sf, IX86_BUILTIN_STOREAPS);
- def_builtin (MASK_SSE1, "__builtin_ia32_storeups", void_ftype_pfloat_v4sf, IX86_BUILTIN_STOREUPS);
- def_builtin (MASK_SSE1, "__builtin_ia32_storess", void_ftype_pfloat_v4sf, IX86_BUILTIN_STORESS);
-
- def_builtin (MASK_SSE1, "__builtin_ia32_loadhps", v4sf_ftype_v4sf_pv2si, IX86_BUILTIN_LOADHPS);
- def_builtin (MASK_SSE1, "__builtin_ia32_loadlps", v4sf_ftype_v4sf_pv2si, IX86_BUILTIN_LOADLPS);
- def_builtin (MASK_SSE1, "__builtin_ia32_storehps", void_ftype_pv2si_v4sf, IX86_BUILTIN_STOREHPS);
- def_builtin (MASK_SSE1, "__builtin_ia32_storelps", void_ftype_pv2si_v4sf, IX86_BUILTIN_STORELPS);
-
- def_builtin (MASK_SSE1, "__builtin_ia32_movmskps", int_ftype_v4sf, IX86_BUILTIN_MOVMSKPS);
- def_builtin (MASK_SSE1 | MASK_3DNOW_A, "__builtin_ia32_pmovmskb", int_ftype_v8qi, IX86_BUILTIN_PMOVMSKB);
- def_builtin (MASK_SSE1, "__builtin_ia32_movntps", void_ftype_pfloat_v4sf, IX86_BUILTIN_MOVNTPS);
- def_builtin (MASK_SSE1 | MASK_3DNOW_A, "__builtin_ia32_movntq", void_ftype_pdi_di, IX86_BUILTIN_MOVNTQ);
-
- def_builtin (MASK_SSE1 | MASK_3DNOW_A, "__builtin_ia32_sfence", void_ftype_void, IX86_BUILTIN_SFENCE);
-
- def_builtin (MASK_SSE1 | MASK_3DNOW_A, "__builtin_ia32_psadbw", di_ftype_v8qi_v8qi, IX86_BUILTIN_PSADBW);
-
- def_builtin (MASK_SSE1, "__builtin_ia32_rcpps", v4sf_ftype_v4sf, IX86_BUILTIN_RCPPS);
- def_builtin (MASK_SSE1, "__builtin_ia32_rcpss", v4sf_ftype_v4sf, IX86_BUILTIN_RCPSS);
- def_builtin (MASK_SSE1, "__builtin_ia32_rsqrtps", v4sf_ftype_v4sf, IX86_BUILTIN_RSQRTPS);
- def_builtin (MASK_SSE1, "__builtin_ia32_rsqrtss", v4sf_ftype_v4sf, IX86_BUILTIN_RSQRTSS);
- def_builtin (MASK_SSE1, "__builtin_ia32_sqrtps", v4sf_ftype_v4sf, IX86_BUILTIN_SQRTPS);
- def_builtin (MASK_SSE1, "__builtin_ia32_sqrtss", v4sf_ftype_v4sf, IX86_BUILTIN_SQRTSS);
-
- def_builtin (MASK_SSE1, "__builtin_ia32_shufps", v4sf_ftype_v4sf_v4sf_int, IX86_BUILTIN_SHUFPS);
+ def_builtin (MASK_SSE, "__builtin_ia32_ldmxcsr", void_ftype_unsigned, IX86_BUILTIN_LDMXCSR);
+ def_builtin (MASK_SSE, "__builtin_ia32_stmxcsr", unsigned_ftype_void, IX86_BUILTIN_STMXCSR);
+ def_builtin (MASK_SSE, "__builtin_ia32_cvtpi2ps", v4sf_ftype_v4sf_v2si, IX86_BUILTIN_CVTPI2PS);
+ def_builtin (MASK_SSE, "__builtin_ia32_cvtps2pi", v2si_ftype_v4sf, IX86_BUILTIN_CVTPS2PI);
+ def_builtin (MASK_SSE, "__builtin_ia32_cvtsi2ss", v4sf_ftype_v4sf_int, IX86_BUILTIN_CVTSI2SS);
+ def_builtin (MASK_SSE | MASK_64BIT, "__builtin_ia32_cvtsi642ss", v4sf_ftype_v4sf_int64, IX86_BUILTIN_CVTSI642SS);
+ def_builtin (MASK_SSE, "__builtin_ia32_cvtss2si", int_ftype_v4sf, IX86_BUILTIN_CVTSS2SI);
+ def_builtin (MASK_SSE | MASK_64BIT, "__builtin_ia32_cvtss2si64", int64_ftype_v4sf, IX86_BUILTIN_CVTSS2SI64);
+ def_builtin (MASK_SSE, "__builtin_ia32_cvttps2pi", v2si_ftype_v4sf, IX86_BUILTIN_CVTTPS2PI);
+ def_builtin (MASK_SSE, "__builtin_ia32_cvttss2si", int_ftype_v4sf, IX86_BUILTIN_CVTTSS2SI);
+ def_builtin (MASK_SSE | MASK_64BIT, "__builtin_ia32_cvttss2si64", int64_ftype_v4sf, IX86_BUILTIN_CVTTSS2SI64);
+
+ def_builtin (MASK_SSE | MASK_3DNOW_A, "__builtin_ia32_pextrw", int_ftype_v4hi_int, IX86_BUILTIN_PEXTRW);
+ def_builtin (MASK_SSE | MASK_3DNOW_A, "__builtin_ia32_pinsrw", v4hi_ftype_v4hi_int_int, IX86_BUILTIN_PINSRW);
+
+ def_builtin (MASK_SSE | MASK_3DNOW_A, "__builtin_ia32_maskmovq", void_ftype_v8qi_v8qi_pchar, IX86_BUILTIN_MASKMOVQ);
+
+ def_builtin (MASK_SSE, "__builtin_ia32_loadaps", v4sf_ftype_pcfloat, IX86_BUILTIN_LOADAPS);
+ def_builtin (MASK_SSE, "__builtin_ia32_loadups", v4sf_ftype_pcfloat, IX86_BUILTIN_LOADUPS);
+ def_builtin (MASK_SSE, "__builtin_ia32_loadss", v4sf_ftype_pcfloat, IX86_BUILTIN_LOADSS);
+ def_builtin (MASK_SSE, "__builtin_ia32_storeaps", void_ftype_pfloat_v4sf, IX86_BUILTIN_STOREAPS);
+ def_builtin (MASK_SSE, "__builtin_ia32_storeups", void_ftype_pfloat_v4sf, IX86_BUILTIN_STOREUPS);
+ def_builtin (MASK_SSE, "__builtin_ia32_storess", void_ftype_pfloat_v4sf, IX86_BUILTIN_STORESS);
+
+ def_builtin (MASK_SSE, "__builtin_ia32_loadhps", v4sf_ftype_v4sf_pv2si, IX86_BUILTIN_LOADHPS);
+ def_builtin (MASK_SSE, "__builtin_ia32_loadlps", v4sf_ftype_v4sf_pv2si, IX86_BUILTIN_LOADLPS);
+ def_builtin (MASK_SSE, "__builtin_ia32_storehps", void_ftype_pv2si_v4sf, IX86_BUILTIN_STOREHPS);
+ def_builtin (MASK_SSE, "__builtin_ia32_storelps", void_ftype_pv2si_v4sf, IX86_BUILTIN_STORELPS);
+
+ def_builtin (MASK_SSE, "__builtin_ia32_movmskps", int_ftype_v4sf, IX86_BUILTIN_MOVMSKPS);
+ def_builtin (MASK_SSE | MASK_3DNOW_A, "__builtin_ia32_pmovmskb", int_ftype_v8qi, IX86_BUILTIN_PMOVMSKB);
+ def_builtin (MASK_SSE, "__builtin_ia32_movntps", void_ftype_pfloat_v4sf, IX86_BUILTIN_MOVNTPS);
+ def_builtin (MASK_SSE | MASK_3DNOW_A, "__builtin_ia32_movntq", void_ftype_pdi_di, IX86_BUILTIN_MOVNTQ);
+
+ def_builtin (MASK_SSE | MASK_3DNOW_A, "__builtin_ia32_sfence", void_ftype_void, IX86_BUILTIN_SFENCE);
+
+ def_builtin (MASK_SSE | MASK_3DNOW_A, "__builtin_ia32_psadbw", di_ftype_v8qi_v8qi, IX86_BUILTIN_PSADBW);
+
+ def_builtin (MASK_SSE, "__builtin_ia32_rcpps", v4sf_ftype_v4sf, IX86_BUILTIN_RCPPS);
+ def_builtin (MASK_SSE, "__builtin_ia32_rcpss", v4sf_ftype_v4sf, IX86_BUILTIN_RCPSS);
+ def_builtin (MASK_SSE, "__builtin_ia32_rsqrtps", v4sf_ftype_v4sf, IX86_BUILTIN_RSQRTPS);
+ def_builtin (MASK_SSE, "__builtin_ia32_rsqrtss", v4sf_ftype_v4sf, IX86_BUILTIN_RSQRTSS);
+ def_builtin (MASK_SSE, "__builtin_ia32_sqrtps", v4sf_ftype_v4sf, IX86_BUILTIN_SQRTPS);
+ def_builtin (MASK_SSE, "__builtin_ia32_sqrtss", v4sf_ftype_v4sf, IX86_BUILTIN_SQRTSS);
+
+ def_builtin (MASK_SSE, "__builtin_ia32_shufps", v4sf_ftype_v4sf_v4sf_int, IX86_BUILTIN_SHUFPS);
/* Original 3DNow! */
def_builtin (MASK_3DNOW, "__builtin_ia32_femms", void_ftype_void, IX86_BUILTIN_FEMMS);
@@ -13589,7 +13618,7 @@ ix86_init_mmx_sse_builtins ()
def_builtin (MASK_3DNOW_A, "__builtin_ia32_pswapdsf", v2sf_ftype_v2sf, IX86_BUILTIN_PSWAPDSF);
def_builtin (MASK_3DNOW_A, "__builtin_ia32_pswapdsi", v2si_ftype_v2si, IX86_BUILTIN_PSWAPDSI);
- def_builtin (MASK_SSE1, "__builtin_ia32_setzerops", v4sf_ftype_void, IX86_BUILTIN_SSE_ZERO);
+ def_builtin (MASK_SSE, "__builtin_ia32_setzerops", v4sf_ftype_void, IX86_BUILTIN_SSE_ZERO);
/* SSE2 */
def_builtin (MASK_SSE2, "__builtin_ia32_pextrw128", int_ftype_v8hi_int, IX86_BUILTIN_PEXTRW128);
@@ -13640,15 +13669,15 @@ ix86_init_mmx_sse_builtins ()
def_builtin (MASK_SSE2, "__builtin_ia32_cvtsd2si", int_ftype_v2df, IX86_BUILTIN_CVTSD2SI);
def_builtin (MASK_SSE2, "__builtin_ia32_cvttsd2si", int_ftype_v2df, IX86_BUILTIN_CVTTSD2SI);
- def_builtin (MASK_SSE264, "__builtin_ia32_cvtsd2si64", int64_ftype_v2df, IX86_BUILTIN_CVTSD2SI64);
- def_builtin (MASK_SSE264, "__builtin_ia32_cvttsd2si64", int64_ftype_v2df, IX86_BUILTIN_CVTTSD2SI64);
+ def_builtin (MASK_SSE2 | MASK_64BIT, "__builtin_ia32_cvtsd2si64", int64_ftype_v2df, IX86_BUILTIN_CVTSD2SI64);
+ def_builtin (MASK_SSE2 | MASK_64BIT, "__builtin_ia32_cvttsd2si64", int64_ftype_v2df, IX86_BUILTIN_CVTTSD2SI64);
def_builtin (MASK_SSE2, "__builtin_ia32_cvtps2dq", v4si_ftype_v4sf, IX86_BUILTIN_CVTPS2DQ);
def_builtin (MASK_SSE2, "__builtin_ia32_cvtps2pd", v2df_ftype_v4sf, IX86_BUILTIN_CVTPS2PD);
def_builtin (MASK_SSE2, "__builtin_ia32_cvttps2dq", v4si_ftype_v4sf, IX86_BUILTIN_CVTTPS2DQ);
def_builtin (MASK_SSE2, "__builtin_ia32_cvtsi2sd", v2df_ftype_v2df_int, IX86_BUILTIN_CVTSI2SD);
- def_builtin (MASK_SSE264, "__builtin_ia32_cvtsi642sd", v2df_ftype_v2df_int64, IX86_BUILTIN_CVTSI642SD);
+ def_builtin (MASK_SSE2 | MASK_64BIT, "__builtin_ia32_cvtsi642sd", v2df_ftype_v2df_int64, IX86_BUILTIN_CVTSI642SD);
def_builtin (MASK_SSE2, "__builtin_ia32_cvtsd2ss", v4sf_ftype_v4sf_v2df, IX86_BUILTIN_CVTSD2SS);
def_builtin (MASK_SSE2, "__builtin_ia32_cvtss2sd", v2df_ftype_v2df_v4sf, IX86_BUILTIN_CVTSS2SD);
@@ -13672,7 +13701,7 @@ ix86_init_mmx_sse_builtins ()
def_builtin (MASK_SSE2, "__builtin_ia32_stored", void_ftype_pcint_v4si, IX86_BUILTIN_STORED);
def_builtin (MASK_SSE2, "__builtin_ia32_movq", v2di_ftype_v2di, IX86_BUILTIN_MOVQ);
- def_builtin (MASK_SSE1, "__builtin_ia32_setzero128", v2di_ftype_void, IX86_BUILTIN_CLRTI);
+ def_builtin (MASK_SSE, "__builtin_ia32_setzero128", v2di_ftype_void, IX86_BUILTIN_CLRTI);
def_builtin (MASK_SSE2, "__builtin_ia32_psllw128", v8hi_ftype_v8hi_v2di, IX86_BUILTIN_PSLLW128);
def_builtin (MASK_SSE2, "__builtin_ia32_pslld128", v4si_ftype_v4si_v2di, IX86_BUILTIN_PSLLD128);
@@ -13699,6 +13728,26 @@ ix86_init_mmx_sse_builtins ()
def_builtin (MASK_SSE2, "__builtin_ia32_psradi128", v4si_ftype_v4si_int, IX86_BUILTIN_PSRADI128);
def_builtin (MASK_SSE2, "__builtin_ia32_pmaddwd128", v4si_ftype_v8hi_v8hi, IX86_BUILTIN_PMADDWD128);
+
+ /* Prescott New Instructions. */
+ def_builtin (MASK_PNI, "__builtin_ia32_monitor",
+ void_ftype_pcvoid_unsigned_unsigned,
+ IX86_BUILTIN_MONITOR);
+ def_builtin (MASK_PNI, "__builtin_ia32_mwait",
+ void_ftype_unsigned_unsigned,
+ IX86_BUILTIN_MWAIT);
+ def_builtin (MASK_PNI, "__builtin_ia32_movshdup",
+ v4sf_ftype_v4sf,
+ IX86_BUILTIN_MOVSHDUP);
+ def_builtin (MASK_PNI, "__builtin_ia32_movsldup",
+ v4sf_ftype_v4sf,
+ IX86_BUILTIN_MOVSLDUP);
+ def_builtin (MASK_PNI, "__builtin_ia32_lddqu",
+ v16qi_ftype_pcchar, IX86_BUILTIN_LDDQU);
+ def_builtin (MASK_PNI, "__builtin_ia32_loadddup",
+ v2df_ftype_pcdouble, IX86_BUILTIN_LOADDDUP);
+ def_builtin (MASK_PNI, "__builtin_ia32_movddup",
+ v2df_ftype_v2df, IX86_BUILTIN_MOVDDUP);
}
/* Errors in the source file can cause expand_expr to return const0_rtx
@@ -14508,6 +14557,41 @@ ix86_expand_builtin (exp, target, subtarget, mode, ignore)
case IX86_BUILTIN_STORED:
return ix86_expand_store_builtin (CODE_FOR_sse2_stored, arglist);
+ case IX86_BUILTIN_MONITOR:
+ arg0 = TREE_VALUE (arglist);
+ arg1 = TREE_VALUE (TREE_CHAIN (arglist));
+ arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
+ op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
+ op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0);
+ op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0);
+ if (!REG_P (op0))
+ op0 = copy_to_mode_reg (SImode, op0);
+ if (!REG_P (op1))
+ op1 = copy_to_mode_reg (SImode, op1);
+ if (!REG_P (op2))
+ op2 = copy_to_mode_reg (SImode, op2);
+ emit_insn (gen_monitor (op0, op1, op2));
+ return 0;
+
+ case IX86_BUILTIN_MWAIT:
+ arg0 = TREE_VALUE (arglist);
+ arg1 = TREE_VALUE (TREE_CHAIN (arglist));
+ op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
+ op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0);
+ if (!REG_P (op0))
+ op0 = copy_to_mode_reg (SImode, op0);
+ if (!REG_P (op1))
+ op1 = copy_to_mode_reg (SImode, op1);
+ emit_insn (gen_mwait (op0, op1));
+ return 0;
+
+ case IX86_BUILTIN_LOADDDUP:
+ return ix86_expand_unop_builtin (CODE_FOR_loadddup, arglist, target, 1);
+
+ case IX86_BUILTIN_LDDQU:
+ return ix86_expand_unop_builtin (CODE_FOR_lddqu, arglist, target,
+ 1);
+
default:
break;
}
@@ -14892,8 +14976,8 @@ ix86_memory_move_cost (mode, class, in)
if (mode == TFmode)
mode = XFmode;
return ((in ? ix86_cost->int_load[2] : ix86_cost->int_store[2])
- * ((int) GET_MODE_SIZE (mode)
- + UNITS_PER_WORD -1 ) / UNITS_PER_WORD);
+ * (((int) GET_MODE_SIZE (mode)
+ + UNITS_PER_WORD - 1) / UNITS_PER_WORD));
}
}
@@ -15490,15 +15574,14 @@ x86_output_mi_thunk (file, thunk, delta, vcall_offset, function)
output_asm_insn ("mov{l}\t{%0, %1|%1, %0}", xops);
}
- xops[0] = DECL_RTL (function);
+ xops[0] = XEXP (DECL_RTL (function), 0);
if (TARGET_64BIT)
{
if (!flag_pic || (*targetm.binds_local_p) (function))
output_asm_insn ("jmp\t%P0", xops);
else
{
- tmp = XEXP (xops[0], 0);
- tmp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, tmp), UNSPEC_GOTPCREL);
+ tmp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, xops[0]), UNSPEC_GOTPCREL);
tmp = gen_rtx_CONST (Pmode, tmp);
tmp = gen_rtx_MEM (QImode, tmp);
xops[0] = tmp;
@@ -15532,6 +15615,18 @@ x86_output_mi_thunk (file, thunk, delta, vcall_offset, function)
}
}
+static void
+x86_file_start ()
+{
+ default_file_start ();
+ if (X86_FILE_START_VERSION_DIRECTIVE)
+ fputs ("\t.version\t\"01.01\"\n", asm_out_file);
+ if (X86_FILE_START_FLTUSED)
+ fputs ("\t.global\t__fltused\n", asm_out_file);
+ if (ix86_asm_dialect == ASM_INTEL)
+ fputs ("\t.intel_syntax\n", asm_out_file);
+}
+
int
x86_field_alignment (field, computed)
tree field;
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index b8a6b7b035d..c115f6a2199 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -121,12 +121,13 @@ extern int target_flags;
#define MASK_MMX 0x00002000 /* Support MMX regs/builtins */
#define MASK_SSE 0x00004000 /* Support SSE regs/builtins */
#define MASK_SSE2 0x00008000 /* Support SSE2 regs/builtins */
-#define MASK_3DNOW 0x00010000 /* Support 3Dnow builtins */
-#define MASK_3DNOW_A 0x00020000 /* Support Athlon 3Dnow builtins */
-#define MASK_128BIT_LONG_DOUBLE 0x00040000 /* long double size is 128bit */
-#define MASK_64BIT 0x00080000 /* Produce 64bit code */
-#define MASK_MS_BITFIELD_LAYOUT 0x00100000 /* Use native (MS) bitfield layout */
-#define MASK_TLS_DIRECT_SEG_REFS 0x00200000 /* Avoid adding %gs:0 */
+#define MASK_PNI 0x00010000 /* Support PNI regs/builtins */
+#define MASK_3DNOW 0x00020000 /* Support 3Dnow builtins */
+#define MASK_3DNOW_A 0x00040000 /* Support Athlon 3Dnow builtins */
+#define MASK_128BIT_LONG_DOUBLE 0x00080000 /* long double size is 128bit */
+#define MASK_64BIT 0x00100000 /* Produce 64bit code */
+#define MASK_MS_BITFIELD_LAYOUT 0x00200000 /* Use native (MS) bitfield layout */
+#define MASK_TLS_DIRECT_SEG_REFS 0x00400000 /* Avoid adding %gs:0 */
/* Unused: 0x03e0000 */
@@ -300,8 +301,9 @@ extern int x86_prefetch_sse;
#define ASSEMBLER_DIALECT (ix86_asm_dialect)
-#define TARGET_SSE ((target_flags & (MASK_SSE | MASK_SSE2)) != 0)
+#define TARGET_SSE ((target_flags & MASK_SSE) != 0)
#define TARGET_SSE2 ((target_flags & MASK_SSE2) != 0)
+#define TARGET_PNI ((target_flags & MASK_PNI) != 0)
#define TARGET_SSE_MATH ((ix86_fpmath & FPMATH_SSE) != 0)
#define TARGET_MIX_SSE_I387 ((ix86_fpmath & FPMATH_SSE) \
&& (ix86_fpmath & FPMATH_387))
@@ -397,6 +399,10 @@ extern int x86_prefetch_sse;
N_("Support MMX, SSE and SSE2 built-in functions and code generation") }, \
{ "no-sse2", -MASK_SSE2, \
N_("Do not support MMX, SSE and SSE2 built-in functions and code generation") }, \
+ { "pni", MASK_PNI, \
+ N_("Support MMX, SSE, SSE2 and PNI built-in functions and code generation") },\
+ { "no-pni", -MASK_PNI, \
+ N_("Do not support MMX, SSE, SSE2 and PNI built-in functions and code generation") },\
{ "128bit-long-double", MASK_128BIT_LONG_DOUBLE, \
N_("sizeof(long double) is 16") }, \
{ "96bit-long-double", -MASK_128BIT_LONG_DOUBLE, \
@@ -611,6 +617,8 @@ extern int x86_prefetch_sse;
builtin_define ("__SSE__"); \
if (TARGET_SSE2) \
builtin_define ("__SSE2__"); \
+ if (TARGET_PNI) \
+ builtin_define ("__PNI__"); \
if (TARGET_SSE_MATH && TARGET_SSE) \
builtin_define ("__SSE_MATH__"); \
if (TARGET_SSE_MATH && TARGET_SSE2) \
@@ -1115,6 +1123,9 @@ do { \
&& (TARGET_64BIT || !TARGET_PARTIAL_REG_STALL)) \
|| ((MODE2) == DImode && TARGET_64BIT))))
+/* It is possible to write patterns to move flags; but until someone
+ does it, */
+#define AVOID_CCMODE_COPIES
/* Specify the modes required to caller save a given hard regno.
We do this on i386 to prevent flags from being saved at all.
@@ -2516,6 +2527,22 @@ enum ix86_builtins
IX86_BUILTIN_MFENCE,
IX86_BUILTIN_LFENCE,
+ /* Prescott New Instructions. */
+ IX86_BUILTIN_ADDSUBPS,
+ IX86_BUILTIN_HADDPS,
+ IX86_BUILTIN_HSUBPS,
+ IX86_BUILTIN_MOVSHDUP,
+ IX86_BUILTIN_MOVSLDUP,
+ IX86_BUILTIN_ADDSUBPD,
+ IX86_BUILTIN_HADDPD,
+ IX86_BUILTIN_HSUBPD,
+ IX86_BUILTIN_LOADDDUP,
+ IX86_BUILTIN_MOVDDUP,
+ IX86_BUILTIN_LDDQU,
+
+ IX86_BUILTIN_MONITOR,
+ IX86_BUILTIN_MWAIT,
+
IX86_BUILTIN_MAX
};
@@ -3229,6 +3256,10 @@ struct machine_function GTY(())
#define ix86_save_varrargs_registers (cfun->machine->save_varrargs_registers)
#define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching)
+/* Control behavior of x86_file_start. */
+#define X86_FILE_START_VERSION_DIRECTIVE false
+#define X86_FILE_START_FLTUSED false
+
/*
Local variables:
version-control: t
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 7ea02a7a7f9..dc4ece8534a 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -109,6 +109,13 @@
(UNSPEC_MFENCE 59)
(UNSPEC_LFENCE 60)
(UNSPEC_PSADBW 61)
+ (UNSPEC_ADDSUB 71)
+ (UNSPEC_HADD 72)
+ (UNSPEC_HSUB 73)
+ (UNSPEC_MOVSHDUP 74)
+ (UNSPEC_MOVSLDUP 75)
+ (UNSPEC_LDQQU 76)
+ (UNSPEC_MOVDDUP 77)
; x87 Floating point
(UNSPEC_FPATAN 65)
@@ -130,6 +137,8 @@
(UNSPECV_FEMMS 46)
(UNSPECV_CLFLUSH 57)
(UNSPECV_ALIGN 68)
+ (UNSPECV_MONITOR 69)
+ (UNSPECV_MWAIT 70)
])
;; Insns whose names begin with "x86_" are emitted by gen_FOO calls
@@ -15855,6 +15864,58 @@
emit_move_insn (operands[2], temp);
emit_move_insn (operands[7], CONST1_RTX (XFmode)); /* fld1 */
})
+
+(define_expand "atansf2"
+ [(parallel [(set (match_operand:SF 0 "register_operand" "")
+ (unspec:SF [(match_dup 2)
+ (match_operand:SF 1 "register_operand" "")]
+ UNSPEC_FPATAN))
+ (clobber (match_dup 1))])]
+ "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
+ && flag_unsafe_math_optimizations"
+{
+ operands[2] = gen_reg_rtx (SFmode);
+ emit_move_insn (operands[2], CONST1_RTX (SFmode)); /* fld1 */
+})
+
+(define_expand "atandf2"
+ [(parallel [(set (match_operand:DF 0 "register_operand" "")
+ (unspec:DF [(match_dup 2)
+ (match_operand:DF 1 "register_operand" "")]
+ UNSPEC_FPATAN))
+ (clobber (match_dup 1))])]
+ "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
+ && flag_unsafe_math_optimizations"
+{
+ operands[2] = gen_reg_rtx (DFmode);
+ emit_move_insn (operands[2], CONST1_RTX (DFmode)); /* fld1 */
+})
+
+(define_expand "atanxf2"
+ [(parallel [(set (match_operand:XF 0 "register_operand" "")
+ (unspec:XF [(match_dup 2)
+ (match_operand:XF 1 "register_operand" "")]
+ UNSPEC_FPATAN))
+ (clobber (match_dup 1))])]
+ "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
+ && flag_unsafe_math_optimizations"
+{
+ operands[2] = gen_reg_rtx (XFmode);
+ emit_move_insn (operands[2], CONST1_RTX (XFmode)); /* fld1 */
+})
+
+(define_expand "atantf2"
+ [(parallel [(set (match_operand:TF 0 "register_operand" "")
+ (unspec:TF [(match_dup 2)
+ (match_operand:TF 1 "register_operand" "")]
+ UNSPEC_FPATAN))
+ (clobber (match_dup 1))])]
+ "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
+ && flag_unsafe_math_optimizations"
+{
+ operands[2] = gen_reg_rtx (TFmode);
+ emit_move_insn (operands[2], CONST1_RTX (TFmode)); /* fld1 */
+})
;; Block operation instructions
@@ -23460,3 +23521,129 @@
"lfence"
[(set_attr "type" "sse")
(set_attr "memory" "unknown")])
+
+;; PNI
+
+(define_insn "mwait"
+ [(unspec_volatile [(match_operand:SI 0 "register_operand" "a")
+ (match_operand:SI 1 "register_operand" "c")]
+ UNSPECV_MWAIT)]
+ "TARGET_PNI"
+ "mwait\t%0, %1"
+ [(set_attr "length" "3")])
+
+(define_insn "monitor"
+ [(unspec_volatile [(match_operand:SI 0 "register_operand" "a")
+ (match_operand:SI 1 "register_operand" "c")
+ (match_operand:SI 2 "register_operand" "d")]
+ UNSPECV_MONITOR)]
+ "TARGET_PNI"
+ "monitor\t%0, %1, %2"
+ [(set_attr "length" "3")])
+
+;; PNI arithmetic
+
+(define_insn "addsubv4sf3"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "0")
+ (match_operand:V4SF 2 "nonimmediate_operand" "xm")]
+ UNSPEC_ADDSUB))]
+ "TARGET_PNI"
+ "addsubps\t{%2, %0|%0, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "mode" "V4SF")])
+
+(define_insn "addsubv2df3"
+ [(set (match_operand:V2DF 0 "register_operand" "=x")
+ (unspec:V2DF [(match_operand:V2DF 1 "register_operand" "0")
+ (match_operand:V2DF 2 "nonimmediate_operand" "xm")]
+ UNSPEC_ADDSUB))]
+ "TARGET_PNI"
+ "addsubpd\t{%2, %0|%0, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "mode" "V2DF")])
+
+(define_insn "haddv4sf3"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "0")
+ (match_operand:V4SF 2 "nonimmediate_operand" "xm")]
+ UNSPEC_HADD))]
+ "TARGET_PNI"
+ "haddps\t{%2, %0|%0, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "mode" "V4SF")])
+
+(define_insn "haddv2df3"
+ [(set (match_operand:V2DF 0 "register_operand" "=x")
+ (unspec:V2DF [(match_operand:V2DF 1 "register_operand" "0")
+ (match_operand:V2DF 2 "nonimmediate_operand" "xm")]
+ UNSPEC_HADD))]
+ "TARGET_PNI"
+ "haddpd\t{%2, %0|%0, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "mode" "V2DF")])
+
+(define_insn "hsubv4sf3"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "0")
+ (match_operand:V4SF 2 "nonimmediate_operand" "xm")]
+ UNSPEC_HSUB))]
+ "TARGET_PNI"
+ "hsubps\t{%2, %0|%0, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "mode" "V4SF")])
+
+(define_insn "hsubv2df3"
+ [(set (match_operand:V2DF 0 "register_operand" "=x")
+ (unspec:V2DF [(match_operand:V2DF 1 "register_operand" "0")
+ (match_operand:V2DF 2 "nonimmediate_operand" "xm")]
+ UNSPEC_HSUB))]
+ "TARGET_PNI"
+ "hsubpd\t{%2, %0|%0, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "mode" "V2DF")])
+
+(define_insn "movshdup"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (unspec:V4SF
+ [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] UNSPEC_MOVSHDUP))]
+ "TARGET_PNI"
+ "movshdup\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sse")
+ (set_attr "mode" "V4SF")])
+
+(define_insn "movsldup"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (unspec:V4SF
+ [(match_operand:V4SF 1 "nonimmediate_operand" "xm")] UNSPEC_MOVSLDUP))]
+ "TARGET_PNI"
+ "movsldup\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sse")
+ (set_attr "mode" "V4SF")])
+
+(define_insn "lddqu"
+ [(set (match_operand:V16QI 0 "register_operand" "=x")
+ (unspec:V16QI [(match_operand:V16QI 1 "memory_operand" "m")]
+ UNSPEC_LDQQU))]
+ "TARGET_PNI"
+ "lddqu\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "mode" "TI")])
+
+(define_insn "loadddup"
+ [(set (match_operand:V2DF 0 "register_operand" "=x")
+ (vec_duplicate:V2DF (match_operand:DF 1 "memory_operand" "m")))]
+ "TARGET_PNI"
+ "movddup\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "mode" "DF")])
+
+(define_insn "movddup"
+ [(set (match_operand:V2DF 0 "register_operand" "=x")
+ (vec_duplicate:V2DF
+ (vec_select:DF (match_operand:V2DF 1 "register_operand" "x")
+ (parallel [(const_int 0)]))))]
+ "TARGET_PNI"
+ "movddup\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "mode" "DF")])
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index df66a58447b..98a25a95eaf 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -25,13 +25,7 @@ Boston, MA 02111-1307, USA. */
/* Output at beginning of assembler file. */
/* The .file command should always begin the output. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- do { \
- output_file_directive (FILE, main_input_filename); \
- if (ix86_asm_dialect == ASM_INTEL) \
- fputs ("\t.intel_syntax\n", FILE); \
- } while (0)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#define TARGET_VERSION fprintf (stderr, " (i386 Linux/ELF)");
@@ -234,7 +228,7 @@ Boston, MA 02111-1307, USA. */
signal-turned-exceptions for them. There's also no configure-run for
the target, so we can't check on (e.g.) HAVE_SYS_UCONTEXT_H. Using the
target libc1 macro should be enough. */
-#ifndef USE_GNULIBC_1
+#if !(defined (USE_GNULIBC_1) || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 0))
#include <signal.h>
#include <sys/ucontext.h>
diff --git a/gcc/config/i386/sco5.h b/gcc/config/i386/sco5.h
index b4096a7ca40..b53bc21305c 100644
--- a/gcc/config/i386/sco5.h
+++ b/gcc/config/i386/sco5.h
@@ -44,12 +44,9 @@ Boston, MA 02111-1307, USA. */
#define CTORS_SECTION_ASM_OP "\t.section\t.ctors, \"aw\""
#define DTORS_SECTION_ASM_OP "\t.section\t.dtors, \"aw\""
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-do { \
- output_file_directive((FILE),main_input_filename); \
- fprintf ((FILE), "\t.version\t\"01.01\"\n"); \
-} while (0)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+#undef X86_FILE_START_VERSION_DIRECTIVE
+#define X86_FILE_START_VERSION_DIRECTIVE true
/* A C statement (sans semicolon) to output to the stdio stream
FILE the assembler definition of uninitialized global DECL named
diff --git a/gcc/config/i386/sysv4.h b/gcc/config/i386/sysv4.h
index 6b3335e8923..d3e2d8b835d 100644
--- a/gcc/config/i386/sysv4.h
+++ b/gcc/config/i386/sysv4.h
@@ -34,12 +34,9 @@ Boston, MA 02111-1307, USA. */
/* Output at beginning of assembler file. */
/* The .file command should always begin the output. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- do { \
- output_file_directive (FILE, main_input_filename); \
- fprintf (FILE, "\t.version\t\"01.01\"\n"); \
- } while (0)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+#undef X86_FILE_START_VERSION_DIRECTIVE
+#define X86_FILE_START_VERSION_DIRECTIVE true
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
diff --git a/gcc/config/i960/i960-coff.h b/gcc/config/i960/i960-coff.h
index 47bcc8d7122..aaae56d566f 100644
--- a/gcc/config/i960/i960-coff.h
+++ b/gcc/config/i960/i960-coff.h
@@ -32,9 +32,8 @@ Boston, MA 02111-1307, USA. */
use the standard definition of LIB_SPEC. */
#undef LIB_SPEC
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- output_file_directive ((FILE), main_input_filename)
+/* Emit a .file directive. */
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
/* Support the ctors and dtors sections for g++. */
diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h
index 59719776bce..89bd554d7c2 100644
--- a/gcc/config/i960/i960.h
+++ b/gcc/config/i960/i960.h
@@ -1161,10 +1161,6 @@ extern struct rtx_def *i960_compare_op0, *i960_compare_op1;
/* Control the assembler format that we output. */
-/* Output at beginning of assembler file. */
-
-#define ASM_FILE_START(file)
-
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
@@ -1206,7 +1202,7 @@ extern struct rtx_def *i960_compare_op0, *i960_compare_op1;
/* This is how to output a note to DBX telling it the line number
to which the following sequence of instructions corresponds. */
-#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
+#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
{ if (write_symbols == SDB_DEBUG) { \
fprintf ((FILE), "\t.ln %d\n", \
(sdb_begin_function_line \
diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h
index e0760f3e17b..030c5ed667b 100644
--- a/gcc/config/ia64/ia64-protos.h
+++ b/gcc/config/ia64/ia64-protos.h
@@ -134,7 +134,7 @@ extern int ia64_register_move_cost PARAMS((enum machine_mode, enum reg_class,
enum reg_class));
extern int ia64_epilogue_uses PARAMS((int));
extern int ia64_eh_uses PARAMS((int));
-extern void emit_safe_across_calls PARAMS((FILE *));
+extern void emit_safe_across_calls PARAMS((void));
extern void ia64_init_builtins PARAMS((void));
extern void ia64_override_options PARAMS((void));
extern int ia64_dbx_register_number PARAMS((int));
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 68854291962..e610f62bb8f 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -49,6 +49,7 @@ Boston, MA 02111-1307, USA. */
#include "tm_p.h"
#include "hashtab.h"
#include "langhooks.h"
+#include "cfglayout.h"
/* This is used for communication between ASM_OUTPUT_LABEL and
ASM_OUTPUT_LABELREF. */
@@ -240,6 +241,7 @@ static void bundling PARAMS ((FILE *, int, rtx, rtx));
static void ia64_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
+static void ia64_file_start PARAMS ((void));
static void ia64_select_rtx_section PARAMS ((enum machine_mode, rtx,
unsigned HOST_WIDE_INT));
@@ -355,6 +357,9 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START ia64_file_start
+
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS ia64_rtx_costs
#undef TARGET_ADDRESS_COST
@@ -1494,11 +1499,7 @@ ia64_expand_call (retval, addr, nextarg, sibcall_p)
}
if (sibcall_p)
- {
- use_reg (&CALL_INSN_FUNCTION_USAGE (insn), b0);
- use_reg (&CALL_INSN_FUNCTION_USAGE (insn),
- gen_rtx_REG (DImode, AR_PFS_REGNUM));
- }
+ use_reg (&CALL_INSN_FUNCTION_USAGE (insn), b0);
}
void
@@ -1552,7 +1553,7 @@ ia64_split_call (retval, addr, retaddr, scratch_r, scratch_b,
/* If we find we're calling through a register, then we're actually
calling through a descriptor, so load up the values. */
- if (REG_P (addr))
+ if (REG_P (addr) && GR_REGNO_P (REGNO (addr)))
{
rtx tmp;
bool addr_dead_p;
@@ -1607,9 +1608,15 @@ ia64_split_call (retval, addr, retaddr, scratch_r, scratch_b,
/* Begin the assembly file. */
+static void
+ia64_file_start ()
+{
+ default_file_start ();
+ emit_safe_across_calls ();
+}
+
void
-emit_safe_across_calls (f)
- FILE *f;
+emit_safe_across_calls ()
{
unsigned int rs, re;
int out_state;
@@ -1626,19 +1633,19 @@ emit_safe_across_calls (f)
continue;
if (out_state == 0)
{
- fputs ("\t.pred.safe_across_calls ", f);
+ fputs ("\t.pred.safe_across_calls ", asm_out_file);
out_state = 1;
}
else
- fputc (',', f);
+ fputc (',', asm_out_file);
if (re == rs + 1)
- fprintf (f, "p%u", rs);
+ fprintf (asm_out_file, "p%u", rs);
else
- fprintf (f, "p%u-p%u", rs, re - 1);
+ fprintf (asm_out_file, "p%u-p%u", rs, re - 1);
rs = re + 1;
}
if (out_state)
- fputc ('\n', f);
+ fputc ('\n', asm_out_file);
}
/* Helper function for ia64_compute_frame_size: find an appropriate general
@@ -2774,7 +2781,7 @@ ia64_expand_epilogue (sibcall_p)
reg = gen_rtx_REG (DImode, AR_PFS_REGNUM);
emit_move_insn (reg, alt_reg);
}
- else if (! current_function_is_leaf)
+ else if (TEST_HARD_REG_BIT (current_frame_info.mask, AR_PFS_REGNUM))
{
alt_regno = next_scratch_gr_reg ();
alt_reg = gen_rtx_REG (DImode, alt_regno);
@@ -8252,6 +8259,9 @@ ia64_expand_builtin (exp, target, subtarget, mode, ignore)
if (! target || ! register_operand (target, DImode))
target = gen_reg_rtx (DImode);
emit_insn (gen_bsp_value (target));
+#ifdef POINTERS_EXTEND_UNSIGNED
+ target = convert_memory_address (ptr_mode, target);
+#endif
return target;
case IA64_BUILTIN_FLUSHRS:
@@ -8466,6 +8476,7 @@ ia64_output_mi_thunk (file, thunk, delta, vcall_offset, function)
rtx this, insn, funexp;
reload_completed = 1;
+ epilogue_completed = 1;
no_new_pseudos = 1;
/* Set things up as ia64_expand_prologue might. */
@@ -8480,7 +8491,7 @@ ia64_output_mi_thunk (file, thunk, delta, vcall_offset, function)
reg_names[IN_REG (0)] = ia64_reg_numbers[0];
/* Mark the end of the (empty) prologue. */
- emit_note (NULL, NOTE_INSN_PROLOGUE_END);
+ emit_note (NOTE_INSN_PROLOGUE_END);
this = gen_rtx_REG (Pmode, IN_REG (0));
@@ -8533,6 +8544,7 @@ ia64_output_mi_thunk (file, thunk, delta, vcall_offset, function)
/* Code generation for calls relies on splitting. */
reload_completed = 1;
+ epilogue_completed = 1;
try_split (PATTERN (insn), insn, 0);
emit_barrier ();
@@ -8551,6 +8563,7 @@ ia64_output_mi_thunk (file, thunk, delta, vcall_offset, function)
final_end_function ();
reload_completed = 0;
+ epilogue_completed = 0;
no_new_pseudos = 0;
}
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 9e1a5133582..e7e1d29d613 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1456,11 +1456,6 @@ do { \
#define EH_USES(REGNO) ia64_eh_uses (REGNO)
-/* Output at beginning of assembler file. */
-
-#define ASM_FILE_START(FILE) \
- emit_safe_across_calls (FILE)
-
/* Output part N of a function descriptor for DECL. For ia64, both
words are emitted with a single relocation, so ignore N > 0. */
#define ASM_OUTPUT_FDESC(FILE, DECL, PART) \
@@ -1837,7 +1832,7 @@ do { \
#define REGISTER_NAMES \
{ \
/* General registers. */ \
- "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", \
+ "ap", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", \
"r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19", \
"r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", \
"r30", "r31", \
diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md
index 3187211f9b8..d0c65de1a21 100644
--- a/gcc/config/ia64/ia64.md
+++ b/gcc/config/ia64/ia64.md
@@ -5432,7 +5432,7 @@
[(unspec_volatile [(const_int 0)] UNSPECV_PSAC_NORMAL)]
""
{
- emit_safe_across_calls (asm_out_file);
+ emit_safe_across_calls ();
return "";
}
[(set_attr "itanium_class" "ignore")
diff --git a/gcc/config/ia64/sysv4.h b/gcc/config/ia64/sysv4.h
index 39809cf360d..5db10895860 100644
--- a/gcc/config/ia64/sysv4.h
+++ b/gcc/config/ia64/sysv4.h
@@ -117,26 +117,6 @@ do { \
fputc ('\n', FILE); \
} while (0)
-/* A C expression which outputs to the stdio stream STREAM some appropriate
- text to go at the start of an assembler file. */
-
-/* ??? Looks like almost every port, except for a few original ones, get this
- wrong. Must emit #NO_APP as first line of file to turn of special assembler
- preprocessing of files. */
-
-/* ??? Even worse, it doesn't work, because gas does not accept the tab chars
- that dwarf2out.c emits when #NO_APP. */
-
-/* ??? Unrelated, but dwarf2out.c emits unnecessary newlines after strings,
- may as well fix at the same time. */
-
-#undef ASM_FILE_START
-#define ASM_FILE_START(STREAM) \
-do { \
- output_file_directive (STREAM, main_input_filename); \
- emit_safe_across_calls (STREAM); \
-} while (0)
-
/* Override default elf definition. */
#undef TARGET_ASM_SELECT_RTX_SECTION
#define TARGET_ASM_SELECT_RTX_SECTION ia64_select_rtx_section
diff --git a/gcc/config/ia64/unwind-ia64.c b/gcc/config/ia64/unwind-ia64.c
index 573a84a75ce..9b6023da58a 100644
--- a/gcc/config/ia64/unwind-ia64.c
+++ b/gcc/config/ia64/unwind-ia64.c
@@ -1647,7 +1647,24 @@ _Unwind_GetRegionStart (struct _Unwind_Context *context)
void *
_Unwind_FindEnclosingFunction (void *pc)
{
- return NULL;
+ struct unw_table_entry *ent;
+ unsigned long segment_base, gp;
+
+ ent = _Unwind_FindTableEntry (pc, &segment_base, &gp);
+ if (ent == NULL)
+ return NULL;
+ else
+ return (void *)(segment_base + ent->start_offset);
+}
+
+/* Get the value of the CFA as saved in CONTEXT. In GCC/Dwarf2 parlance,
+ the CFA is the value of the stack pointer on entry; In IA-64 unwind
+ parlance, this is the PSP. */
+
+_Unwind_Word
+_Unwind_GetCFA (struct _Unwind_Context *context)
+{
+ return (_Unwind_Ptr) context->psp;
}
diff --git a/gcc/config/interix.h b/gcc/config/interix.h
index d04e5477dd7..9d05f1bcc0a 100644
--- a/gcc/config/interix.h
+++ b/gcc/config/interix.h
@@ -5,20 +5,20 @@
Modified from code
Contributed by Douglas B. Rupp (drupp@cs.washington.edu).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/interix3.h b/gcc/config/interix3.h
index 4d4e85c2f13..9e2cc35a4ef 100644
--- a/gcc/config/interix3.h
+++ b/gcc/config/interix3.h
@@ -3,20 +3,20 @@
Copyright (C) 2001 Free Software Foundation, Inc.
Contributed by Douglas B. Rupp (rupp@gnat.com)
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/ip2k/crt0.S b/gcc/config/ip2k/crt0.S
index 131ccb6ec6e..17133ce99fe 100644
--- a/gcc/config/ip2k/crt0.S
+++ b/gcc/config/ip2k/crt0.S
@@ -2,9 +2,9 @@
; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
; Contributed by Red Hat, Inc.
;
-; This file is part of GNU CC.
+; This file is part of GCC.
;
-; GNU CC is free software; you can redistribute it and/or modify
+; GCC 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.
@@ -17,13 +17,13 @@
; respects; for example, they cover modification of the file, and
; distribution when not linked into another program.)
;
-; GNU CC is distributed in the hope that it will be useful,
+; GCC 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
+; along with GCC; see the file COPYING. If not, write to
; the Free Software Foundation, 59 Temple Place - Suite 330,
; Boston, MA 02111-1307, USA.
;
diff --git a/gcc/config/ip2k/ip2k-protos.h b/gcc/config/ip2k/ip2k-protos.h
index 0bc901c8462..d1553ac047e 100644
--- a/gcc/config/ip2k/ip2k-protos.h
+++ b/gcc/config/ip2k/ip2k-protos.h
@@ -1,20 +1,20 @@
/* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Red Hat, Inc and Ubicom, Inc.
- This file is part of GNU CC.
+ This file is part of GCC.
- GNU CC is free software; you can redistribute it and/or modify
+ GCC 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,
+ GCC 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
+ along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/ip2k/ip2k.c b/gcc/config/ip2k/ip2k.c
index 3e165054c95..3b41a260469 100644
--- a/gcc/config/ip2k/ip2k.c
+++ b/gcc/config/ip2k/ip2k.c
@@ -3,20 +3,20 @@
Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Red Hat, Inc and Ubicom, Inc.
- This file is part of GNU CC.
+ This file is part of GCC.
- GNU CC is free software; you can redistribute it and/or modify
+ GCC 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,
+ GCC 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
+ along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/ip2k/ip2k.h b/gcc/config/ip2k/ip2k.h
index 937cf4bba69..a60f5272e19 100644
--- a/gcc/config/ip2k/ip2k.h
+++ b/gcc/config/ip2k/ip2k.h
@@ -1,31 +1,28 @@
-/* Definitions of target machine for GNU compiler,
+/* Definitions of target machine for GCC,
For Ubicom IP2022 Communications Controller
Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Red Hat, Inc and Ubicom, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Set up System V.4 (aka ELF) defaults. */
-
-#include "elfos.h"
-#undef ASM_SPEC /* But we have a GAS assembler. */
+#undef ASM_SPEC /* We have a GAS assembler. */
#define TARGET_CPU_CPP_BUILTINS() \
do \
@@ -40,82 +37,9 @@ Boston, MA 02111-1307, USA. */
/* This declaration should be present. */
extern int target_flags;
-/* `TARGET_...'
- This series of macros is to allow compiler command arguments to
- enable or disable the use of optional features of the target
- machine. For example, one machine description serves both the
- 68000 and the 68020; a command argument tells the compiler whether
- it should use 68020-only instructions or not. This command
- argument works by means of a macro `TARGET_68020' that tests a bit
- in `target_flags'.
-
- Define a macro `TARGET_FEATURENAME' for each such option. Its
- definition should test a bit in `target_flags'; for example:
-
- #define TARGET_68020 (target_flags & 1)
-
- One place where these macros are used is in the
- condition-expressions of instruction patterns. Note how
- `TARGET_68020' appears frequently in the 68000 machine description
- file, `m68k.md'. Another place they are used is in the
- definitions of the other macros in the `MACHINE.h' file. */
-
-
-
#define TARGET_SWITCHES {{"",0, NULL}}
-/* This macro defines names of command options to set and clear bits
- in `target_flags'. Its definition is an initializer with a
- subgrouping for each command option.
-
- Each subgrouping contains a string constant, that defines the
- option name, and a number, which contains the bits to set in
- `target_flags'. A negative number says to clear bits instead; the
- negative of the number is which bits to clear. The actual option
- name is made by appending `-m' to the specified name.
-
- One of the subgroupings should have a null string. The number in
- this grouping is the default value for `target_flags'. Any target
- options act starting with that value.
-
- Here is an example which defines `-m68000' and `-m68020' with
- opposite meanings, and picks the latter as the default:
-
- #define TARGET_SWITCHES \
- { { "68020", 1}, \
- { "68000", -1}, \
- { "", 1}} */
-
-
-/* This macro is similar to `TARGET_SWITCHES' but defines names of
- command options that have values. Its definition is an
- initializer with a subgrouping for each command option.
-
- Each subgrouping contains a string constant, that defines the
- fixed part of the option name, and the address of a variable. The
- variable, type `char *', is set to the variable part of the given
- option if the fixed part matches. The actual option name is made
- by appending `-m' to the specified name.
-
- Here is an example which defines `-mshort-data-NUMBER'. If the
- given option is `-mshort-data-512', the variable `m88k_short_data'
- will be set to the string `"512"'.
-
- extern char *m88k_short_data;
- #define TARGET_OPTIONS \
- { { "short-data-", &m88k_short_data } } */
#define TARGET_VERSION fprintf (stderr, " (ip2k, GNU assembler syntax)")
-/* This macro is a C statement to print on `stderr' a string
- describing the particular machine description choice. Every
- machine description should define `TARGET_VERSION'. For example:
-
- #ifdef MOTOROLA
- #define TARGET_VERSION \
- fprintf (stderr, " (68k, Motorola syntax)")
- #else
- #define TARGET_VERSION \
- fprintf (stderr, " (68k, MIT syntax)")
- #endif */
/* Caller-saves is not a win for the IP2K. Pretty much anywhere that
a register is permitted allows SP-relative addresses too.
@@ -128,16 +52,6 @@ extern int target_flags;
flag_pic = 0; \
} while (0)
-/* `OVERRIDE_OPTIONS'
- Sometimes certain combinations of command options do not make
- sense on a particular target machine. You can define a macro
- `OVERRIDE_OPTIONS' to take account of this. This macro, if
- defined, is executed once just after all the command options have
- been parsed.
-
- Don't use this macro to turn on various extra optimizations for
- `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
-
/* Put each function in its own section so that PAGE-instruction
relaxation can do its best. */
#define OPTIMIZATION_OPTIONS(LEVEL, SIZEFLAG) \
@@ -146,24 +60,11 @@ extern int target_flags;
flag_function_sections = 1; \
} while (0)
-/* Define this if most significant byte of a word is the lowest numbered. */
#define BITS_BIG_ENDIAN 0
-
-/* Define this if most significant byte of a word is the lowest numbered. */
#define BYTES_BIG_ENDIAN 1
-
-/* Define this if most significant word of a multiword number is the lowest
- numbered. */
#define WORDS_BIG_ENDIAN 1
-
-/* Number of bits in an addressable storage unit. */
#define BITS_PER_UNIT 8
-
-/* Width in bits of a "word", which is the contents of a machine register.
- Note that this is not necessarily the width of data type `int'; */
#define BITS_PER_WORD 8
-
-/* Width of a word, in units (bytes). */
#define UNITS_PER_WORD (BITS_PER_WORD / BITS_PER_UNIT)
/* Width in bits of a pointer.
@@ -173,131 +74,56 @@ extern int target_flags;
/* Maximum sized of reasonable data type DImode or Dfmode ... */
#define MAX_FIXED_MODE_SIZE 64
-/* Allocation boundary (in *bits*) for storing arguments in argument list. */
#define PARM_BOUNDARY 8
-
-/* Allocation boundary (in *bits*) for the code of a function. */
#define FUNCTION_BOUNDARY 16
-
-/* Alignment of field after `int : 0' in a structure. */
#define EMPTY_FIELD_BOUNDARY 8
-
-/* No data type wants to be aligned rounder than this. */
-
#define BIGGEST_ALIGNMENT 8
#define STRICT_ALIGNMENT 0
#define PCC_BITFIELD_TYPE_MATTERS 1
-/* A C expression for the size in bits of the type `int' on the
- target machine. If you don't define this, the default is one word. */
#undef INT_TYPE_SIZE
#define INT_TYPE_SIZE 16
-
-/* A C expression for the size in bits of the type `short' on the
- target machine. If you don't define this, the default is half a
- word. (If this would be less than one storage unit, it is rounded
- up to one unit.) */
#undef SHORT_TYPE_SIZE
#define SHORT_TYPE_SIZE 16
-/* A C expression for the size in bits of the type `long' on the
- target machine. If you don't define this, the default is one word. */
#undef LONG_TYPE_SIZE
#define LONG_TYPE_SIZE 32
-
-
-/* Maximum number for the size in bits of the type `long' on the
- target machine. If this is undefined, the default is
- `LONG_TYPE_SIZE'. Otherwise, it is the constant value that is the
- largest value that `LONG_TYPE_SIZE' can have at run-time. This is
- used in `cpp'. */
#define MAX_LONG_TYPE_SIZE 32
-/* A C expression for the size in bits of the type `long long' on the
- target machine. If you don't define this, the default is two
- words. If you want to support GNU Ada on your machine, the value
- of macro must be at least 64. */
#undef LONG_LONG_TYPE_SIZE
#define LONG_LONG_TYPE_SIZE 64
#undef CHAR_TYPE_SIZE
#define CHAR_TYPE_SIZE 8
-/* A C expression for the size in bits of the type `char' on the
- target machine. If you don't define this, the default is one
- quarter of a word. (If this would be less than one storage unit,
- it is rounded up to one unit.) */
#undef FLOAT_TYPE_SIZE
#define FLOAT_TYPE_SIZE 32
-/* A C expression for the size in bits of the type `float' on the
- target machine. If you don't define this, the default is one word. */
#undef DOUBLE_TYPE_SIZE
#define DOUBLE_TYPE_SIZE 32
-/* A C expression for the size in bits of the type `double' on the
- target machine. If you don't define this, the default is two
- words. */
-
-/* A C expression for the size in bits of the type `long double' on
- the target machine. If you don't define this, the default is two
- words. */
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE 32
#define DEFAULT_SIGNED_CHAR 1
-/* An expression whose value is 1 or 0, according to whether the type
- `char' should be signed or unsigned by default. The user can
- always override this default with the options `-fsigned-char' and
- `-funsigned-char'. */
/* #define DEFAULT_SHORT_ENUMS 1
This was the default for the IP2k but gcc has a bug (as of 17th May
2001) in the way that library calls to the memory checker functions
are issues that screws things up if an enum is not equivalent to
an int. */
-/* `DEFAULT_SHORT_ENUMS'
- A C expression to determine whether to give an `enum' type only as
- many bytes as it takes to represent the range of possible values
- of that type. A nonzero value means to do that; a zero value
- means all `enum' types should be allocated like `int'.
-
- If you don't define the macro, the default is 0. */
#define SIZE_TYPE "unsigned int"
-/* A C expression for a string describing the name of the data type
- to use for size values. The typedef name `size_t' is defined
- using the contents of the string.
-
- The string can contain more than one keyword. If so, separate
- them with spaces, and write first any length keyword, then
- `unsigned' if appropriate, and finally `int'. The string must
- exactly match one of the data type names defined in the function
- `init_decl_processing' in the file `c-decl.c'. You may not omit
- `int' or change the order--that would cause the compiler to crash
- on startup.
-
- If you don't define this macro, the default is `"long unsigned
- int"'. */
#define PTRDIFF_TYPE "int"
-/* A C expression for a string describing the name of the data type
- to use for the result of subtracting two pointers. The typedef
- name `ptrdiff_t' is defined using the contents of the string. See
- `SIZE_TYPE' above for more information.
-
- If you don't define this macro, the default is `"long int"'. */
#undef WCHAR_TYPE
#define WCHAR_TYPE "int"
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 16
-/* A C expression for the size in bits of the data type for wide
- characters. This is used in `cpp', which cannot make use of
- `WCHAR_TYPE'. */
#define HARD_REG_SIZE (UNITS_PER_WORD)
/* Standard register usage.
@@ -307,11 +133,6 @@ extern int target_flags;
#define FIRST_PSEUDO_REGISTER (0x104) /* Skip over physical regs, VFP, AP. */
-/* Number of hardware registers known to the compiler. They receive
- numbers 0 through `FIRST_PSEUDO_REGISTER-1'; thus, the first
- pseudo register's number really is assigned the number
- `FIRST_PSEUDO_REGISTER'. */
-
#define REG_IP 0x4
#define REG_IPH REG_IP
#define REG_IPL 0x5
@@ -360,25 +181,6 @@ extern int target_flags;
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/*r224..r255*/\
1,1,1,1}
-/* An initializer that says which registers are used for fixed
- purposes all throughout the compiled code and are therefore not
- available for general allocation. These would include the stack
- pointer, the frame pointer (except on machines where that can be
- used as a general register when no frame pointer is needed), the
- program counter on machines where that is considered one of the
- addressable registers, and any other numbered register with a
- standard use.
-
- This information is expressed as a sequence of numbers, separated
- by commas and surrounded by braces. The Nth number is 1 if
- register N is fixed, 0 otherwise.
-
- The table initialized from this macro, and the table initialized by
- the following one, may be overridden at run time either
- automatically, by the actions of the macro
- `CONDITIONAL_REGISTER_USAGE', or by the user with the command
- options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'. */
-
#define CALL_USED_REGISTERS { \
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/* r0.. r31*/\
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/* r32.. r63*/\
@@ -390,22 +192,7 @@ extern int target_flags;
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,/*r224..r255*/\
1,1,1,1}
-/* Like `FIXED_REGISTERS' but has 1 for each register that is
- clobbered (in general) by function calls as well as for fixed
- registers. This macro therefore identifies the registers that are
- not available for general allocation of values that must live
- across function calls.
-
- If a register has 0 in `CALL_USED_REGISTERS', the compiler
- automatically saves it on function entry and restores it on
- function exit, if the register is used within the function. */
-
#define NON_SAVING_SETJMP 0
-/* If this macro is defined and has a nonzero value, it means that
- `setjmp' and related functions fail to save the registers, or that
- `longjmp' fails to restore them. To compensate, the compiler
- avoids putting variables in registers in functions that use
- `setjmp'. */
#define REG_ALLOC_ORDER { \
0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f, \
@@ -442,32 +229,8 @@ extern int target_flags;
0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f, \
0x100,0x101,0x102,0x103}
-/* If defined, an initializer for a vector of integers, containing the
- numbers of hard registers in the order in which GNU CC should
- prefer to use them (from most preferred to least).
-
- If this macro is not defined, registers are used lowest numbered
- first (all else being equal).
-
- One use of this macro is on machines where the highest numbered
- registers must always be saved and the save-multiple-registers
- instruction supports only sequences of consecutive registers. On
- such machines, define `REG_ALLOC_ORDER' to be an initializer that
- lists the highest numbered allocatable register first. */
#define ORDER_REGS_FOR_LOCAL_ALLOC ip2k_init_local_alloc (reg_alloc_order)
-/* A C statement (sans semicolon) to choose the order in which to
- allocate hard registers for pseudo-registers local to a basic
- block.
-
- Store the desired register order in the array `reg_alloc_order'.
- Element 0 should be the register to allocate first; element 1, the
- next register; and so on.
-
- The macro body should not assume anything about the contents of
- `reg_alloc_order' before execution of the macro.
-
- On most machines, it is not necessary to define this macro. */
/* Are we allowed to rename registers? For some reason, regrename was
changing DP to IP (when it appeared in addresses like (plus:HI
@@ -482,77 +245,7 @@ extern int target_flags;
#define HARD_REGNO_NREGS(REGNO, MODE) \
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-/* A C expression for the number of consecutive hard registers,
- starting at register number REGNO, required to hold a value of mode
- MODE.
-
- On a machine where all registers are exactly one word, a suitable
- definition of this macro is
-
- #define HARD_REGNO_NREGS(REGNO, MODE) \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
- / UNITS_PER_WORD)) */
-
#define HARD_REGNO_MODE_OK(REGNO, MODE) 1
-/* A C expression that is nonzero if it is permissible to store a
- value of mode MODE in hard register number REGNO (or in several
- registers starting with that one). For a machine where all
- registers are equivalent, a suitable definition is
-
- #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
-
- It is not necessary for this macro to check for the numbers of
- fixed registers, because the allocation mechanism considers them
- to be always occupied.
-
- On some machines, double-precision values must be kept in even/odd
- register pairs. The way to implement that is to define this macro
- to reject odd register numbers for such modes.
-
- The minimum requirement for a mode to be OK in a register is that
- the `movMODE' instruction pattern support moves between the
- register and any other hard register for which the mode is OK; and
- that moving a value into the register and back out not alter it.
-
- Since the same instruction used to move `SImode' will work for all
- narrower integer modes, it is not necessary on any machine for
- `HARD_REGNO_MODE_OK' to distinguish between these modes, provided
- you define patterns `movhi', etc., to take advantage of this. This
- is useful because of the interaction between `HARD_REGNO_MODE_OK'
- and `MODES_TIEABLE_P'; it is very desirable for all integer modes
- to be tieable.
-
- Many machines have special registers for floating point arithmetic.
- Often people assume that floating point machine modes are allowed
- only in floating point registers. This is not true. Any
- registers that can hold integers can safely *hold* a floating
- point machine mode, whether or not floating arithmetic can be done
- on it in those registers. Integer move instructions can be used
- to move the values.
-
- On some machines, though, the converse is true: fixed-point machine
- modes may not go in floating registers. This is true if the
- floating registers normalize any value stored in them, because
- storing a non-floating value there would garble it. In this case,
- `HARD_REGNO_MODE_OK' should reject fixed-point machine modes in
- floating registers. But if the floating registers do not
- automatically normalize, if you can store any bit pattern in one
- and retrieve it unchanged without a trap, then any machine mode
- may go in a floating register, so you can define this macro to say
- so.
-
- The primary significance of special floating registers is rather
- that they are the registers acceptable in floating point arithmetic
- instructions. However, this is of no concern to
- `HARD_REGNO_MODE_OK'. You handle it by writing the proper
- constraints for those instructions.
-
- On some machines, the floating registers are especially slow to
- access, so that it is better to store a value in a stack frame
- than in such a register if floating point arithmetic is not being
- done. As long as the floating registers are not in class
- `GENERAL_REGS', they will not be used unless some pattern's
- constraint asks for one. */
#define MODES_TIEABLE_P(MODE1, MODE2) \
(((MODE1) == QImode && (MODE2) == HImode) \
@@ -564,14 +257,6 @@ extern int target_flags;
(((MODE1) > HImode && (MODE2) == HImode)
|| ((MODE1) == HImode && (MODE2) > HImode)) */
-/* A C expression that is nonzero if it is desirable to choose
- register allocation so as to avoid move instructions between a
- value of mode MODE1 and a value of mode MODE2.
-
- If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R,
- MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1,
- MODE2)' must be zero. */
-
enum reg_class {
NO_REGS,
DPH_REGS,
@@ -590,21 +275,7 @@ enum reg_class {
LIM_REG_CLASSES
};
-/* An enumeral type that must be defined with all the register class
- names as enumeral values. `NO_REGS' must be first. `ALL_REGS'
- must be the last register class, followed by one more enumeral
- value, `LIM_REG_CLASSES', which is not a register class but rather
- tells how many classes there are.
-
- Each register class has a number, which is the value of casting
- the class name to type `int'. The number serves as an index in
- many of the tables described below. */
-
-
#define N_REG_CLASSES (int)LIM_REG_CLASSES
-/* The number of distinct register classes, defined as follows:
-
- #define N_REG_CLASSES (int) LIM_REG_CLASSES */
#define REG_CLASS_NAMES { \
"NO_REGS", \
@@ -621,9 +292,6 @@ enum reg_class {
"NONSP_REGS", \
"GENERAL_REGS" \
}
-/* An initializer containing the names of the register classes as C
- string constants. These names are used in writing some of the
- debugging dumps. */
#define REG_CLASS_CONTENTS { \
@@ -642,17 +310,6 @@ enum reg_class {
{0xffffffff,-1,-1,-1,-1,-1,-1,-1,15} /* GENERAL_REGS */ \
}
-/* An initializer containing the contents of the register classes, as
- integers which are bit masks. The Nth integer specifies the
- contents of class N. The way the integer MASK is interpreted is
- that register R is in the class if `MASK & (1 << R)' is 1.
-
- When the machine has more than 32 registers, an integer does not
- suffice. Then the integers are replaced by sub-initializers,
- braced groupings containing several integers. Each
- sub-initializer must be suitable as an initializer for the type
- `HARD_REG_SET' which is defined in `hard-reg-set.h'. */
-
#define REGNO_REG_CLASS(R) \
( (R) == REG_IPH ? IPH_REGS \
: (R) == REG_IPL ? IPL_REGS \
@@ -662,28 +319,11 @@ enum reg_class {
: (R) == REG_SPL ? SP_REGS \
: NONPTR_REGS)
-/* A C expression whose value is a register class containing hard
- register REGNO. In general there is more than one such class;
- choose a class which is "minimal", meaning that no smaller class
- also contains the register. */
-
#define MODE_BASE_REG_CLASS(MODE) ((MODE) == QImode ? PTR_REGS : DP_SP_REGS)
-/* This is a variation of the BASE_REG_CLASS macro which allows
- the selection of a base register in a mode dependent manner.
- If MODE is VOIDmode then it should return the same value as
- BASE_REG_CLASS. */
#define BASE_REG_CLASS PTR_REGS
-/* A macro whose definition is the name of the class to which a valid
- base register must belong. A base register is one used in an
- address which is the register value plus a displacement. */
#define INDEX_REG_CLASS NO_REGS
-/* A macro whose definition is the name of the class to which a valid
- index register must belong. An index register is one used in an
- address where its value is either multiplied by a scale factor or
- added to another register (as well as added to a displacement). */
-
#define REG_CLASS_FROM_LETTER(C) \
( (C) == 'j' ? IPH_REGS \
@@ -699,219 +339,22 @@ enum reg_class {
: (C) == 'd' ? NONPTR_REGS \
: NO_REGS)
-/* A C expression which defines the machine-dependent operand
- constraint letters for register classes. If CHAR is such a
- letter, the value should be the register class corresponding to
- it. Otherwise, the value should be `NO_REGS'. The register
- letter `r', corresponding to class `GENERAL_REGS', will not be
- passed to this macro; you do not need to handle it. */
-
-
#define REGNO_OK_FOR_BASE_P(R) \
((R) == REG_DP || (R) == REG_IP || (R) == REG_SP)
-/* A C expression which is nonzero if register number R is suitable
- for use as a base register in operand addresses. It may be either
- a suitable hard register or a pseudo register that has been
- allocated such a hard register. */
#define REGNO_MODE_OK_FOR_BASE_P(R,M) \
((R) == REG_DP || (R) == REG_SP \
|| ((R) == REG_IP && GET_MODE_SIZE (M) <= 1))
-/* A C expression that is just like `REGNO_OK_FOR_BASE_P', except that
- that expression may examine the mode of the memory reference in
- MODE. You should define this macro if the mode of the memory
- reference affects whether a register may be used as a base
- register. If you define this macro, the compiler will use it
- instead of `REGNO_OK_FOR_BASE_P'. */
#define REGNO_OK_FOR_INDEX_P(NUM) 0
-/* A C expression which is nonzero if register number NUM is suitable
- for use as an index register in operand addresses. It may be
- either a suitable hard register or a pseudo register that has been
- allocated such a hard register.
-
- The difference between an index register and a base register is
- that the index register may be scaled. If an address involves the
- sum of two registers, neither one of them scaled, then either one
- may be labeled the "base" and the other the "index"; but whichever
- labeling is used must fit the machine's constraints of which
- registers may serve in each capacity. The compiler will try both
- labelings, looking for one that is valid, and will reload one or
- both registers only if neither labeling works. */
#define PREFERRED_RELOAD_CLASS(X, CLASS) (CLASS)
-/* A C expression that places additional restrictions on the register
- class to use when it is necessary to copy value X into a register
- in class CLASS. The value is a register class; perhaps CLASS, or
- perhaps another, smaller class. On many machines, the following
- definition is safe:
-
- #define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)
-
- Sometimes returning a more restrictive class makes better code.
- For example, on the 68000, when X is an integer constant that is
- in range for a `moveq' instruction, the value of this macro is
- always `DATA_REGS' as long as CLASS includes the data registers.
- Requiring a data register guarantees that a `moveq' will be used.
-
- If X is a `const_double', by returning `NO_REGS' you can force X
- into a memory constant. This is useful on certain machines where
- immediate floating values cannot be loaded into certain kinds of
- registers. */
-
-/* `PREFERRED_OUTPUT_RELOAD_CLASS (X, CLASS)'
- Like `PREFERRED_RELOAD_CLASS', but for output reloads instead of
- input reloads. If you don't define this macro, the default is to
- use CLASS, unchanged. */
-
-/* `LIMIT_RELOAD_CLASS (MODE, CLASS)'
- A C expression that places additional restrictions on the register
- class to use when it is necessary to be able to hold a value of
- mode MODE in a reload register for which class CLASS would
- ordinarily be used.
-
- Unlike `PREFERRED_RELOAD_CLASS', this macro should be used when
- there are certain modes that simply can't go in certain reload
- classes.
-
- The value is a register class; perhaps CLASS, or perhaps another,
- smaller class.
-
- Don't define this macro unless the target machine has limitations
- which require the macro to do something nontrivial. */
-
-/* SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X)
- `SECONDARY_RELOAD_CLASS (CLASS, MODE, X)'
- `SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X)'
- Many machines have some registers that cannot be copied directly
- to or from memory or even from other types of registers. An
- example is the `MQ' register, which on most machines, can only be
- copied to or from general registers, but not memory. Some
- machines allow copying all registers to and from memory, but
- require a scratch register for stores to some memory locations
- (e.g., those with symbolic address on the RT, and those with
- certain symbolic address on the SPARC when compiling PIC). In
- some cases, both an intermediate and a scratch register are
- required.
-
- You should define these macros to indicate to the reload phase
- that it may need to allocate at least one register for a reload in
- addition to the register to contain the data. Specifically, if
- copying X to a register CLASS in MODE requires an intermediate
- register, you should define `SECONDARY_INPUT_RELOAD_CLASS' to
- return the largest register class all of whose registers can be
- used as intermediate registers or scratch registers.
-
- If copying a register CLASS in MODE to X requires an intermediate
- or scratch register, `SECONDARY_OUTPUT_RELOAD_CLASS' should be
- defined to return the largest register class required. If the
- requirements for input and output reloads are the same, the macro
- `SECONDARY_RELOAD_CLASS' should be used instead of defining both
- macros identically.
-
- The values returned by these macros are often `GENERAL_REGS'.
- Return `NO_REGS' if no spare register is needed; i.e., if X can be
- directly copied to or from a register of CLASS in MODE without
- requiring a scratch register. Do not define this macro if it
- would always return `NO_REGS'.
-
- If a scratch register is required (either with or without an
- intermediate register), you should define patterns for
- `reload_inM' or `reload_outM', as required (*note Standard
- Names::.. These patterns, which will normally be implemented with
- a `define_expand', should be similar to the `movM' patterns,
- except that operand 2 is the scratch register.
-
- Define constraints for the reload register and scratch register
- that contain a single register class. If the original reload
- register (whose class is CLASS) can meet the constraint given in
- the pattern, the value returned by these macros is used for the
- class of the scratch register. Otherwise, two additional reload
- registers are required. Their classes are obtained from the
- constraints in the insn pattern.
-
- X might be a pseudo-register or a `subreg' of a pseudo-register,
- which could either be in a hard register or in memory. Use
- `true_regnum' to find out; it will return -1 if the pseudo is in
- memory and the hard register number if it is in a register.
-
- These macros should not be used in the case where a particular
- class of registers can only be copied to memory and not to another
- class of registers. In that case, secondary reload registers are
- not needed and would not be helpful. Instead, a stack location
- must be used to perform the copy and the `movM' pattern should use
- memory as an intermediate storage. This case often occurs between
- floating-point and general registers. */
-
-/* `SECONDARY_MEMORY_NEEDED (CLASS1, CLASS2, M)'
- Certain machines have the property that some registers cannot be
- copied to some other registers without using memory. Define this
- macro on those machines to be a C expression that is nonzero if
- objects of mode M in registers of CLASS1 can only be copied to
- registers of class CLASS2 by storing a register of CLASS1 into
- memory and loading that memory location into a register of CLASS2.
-
- Do not define this macro if its value would always be zero.
-
- `SECONDARY_MEMORY_NEEDED_RTX (MODE)'
- Normally when `SECONDARY_MEMORY_NEEDED' is defined, the compiler
- allocates a stack slot for a memory location needed for register
- copies. If this macro is defined, the compiler instead uses the
- memory location defined by this macro.
-
- Do not define this macro if you do not define
- `SECONDARY_MEMORY_NEEDED'. */
#define SMALL_REGISTER_CLASSES 1
-/* Normally the compiler avoids choosing registers that have been
- explicitly mentioned in the rtl as spill registers (these
- registers are normally those used to pass parameters and return
- values). However, some machines have so few registers of certain
- classes that there would not be enough registers to use as spill
- registers if this were done.
-
- Define `SMALL_REGISTER_CLASSES' to be an expression with a nonzero
- value on these machines. When this macro has a nonzero value, the
- compiler allows registers explicitly used in the rtl to be used as
- spill registers but avoids extending the lifetime of these
- registers.
-
- It is always safe to define this macro with a nonzero value, but
- if you unnecessarily define it, you will reduce the amount of
- optimizations that can be performed in some cases. If you do not
- define this macro with a nonzero value when it is required, the
- compiler will run out of spill registers and print a fatal error
- message. For most machines, you should not define this macro at
- all. */
#define CLASS_LIKELY_SPILLED_P(CLASS) class_likely_spilled_p(CLASS)
-/* A C expression whose value is nonzero if pseudos that have been
- assigned to registers of class CLASS would likely be spilled
- because registers of CLASS are needed for spill registers.
-
- The default value of this macro returns 1 if CLASS has exactly one
- register and zero otherwise. On most machines, this default
- should be used. Only define this macro to some other expression
- if pseudo allocated by `local-alloc.c' end up in memory because
- their hard registers were needed for spill registers. If this
- macro returns nonzero for those classes, those pseudos will only
- be allocated by `global.c', which knows how to reallocate the
- pseudo to another register. If there would not be another
- register available for reallocation, you should not change the
- definition of this macro since the only effect of such a
- definition would be to slow down register allocation. */
#define CLASS_MAX_NREGS(CLASS, MODE) GET_MODE_SIZE (MODE)
-/* A C expression for the maximum number of consecutive registers of
- class CLASS needed to hold a value of mode MODE.
-
- This is closely related to the macro `HARD_REGNO_NREGS'. In fact,
- the value of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be
- the maximum value of `HARD_REGNO_NREGS (REGNO, MODE)' for all
- REGNO values in the class CLASS.
-
- This macro helps control the handling of multiple-word values in
- the reload pass. */
#define CONST_OK_FOR_LETTER_P(VALUE, C) \
((C) == 'I' ? (VALUE) >= -255 && (VALUE) <= -1 : \
@@ -924,81 +367,20 @@ enum reg_class {
(C) == 'P' ? (VALUE) >= 0 && (VALUE) <= 255: \
0)
-/* A C expression that defines the machine-dependent operand
- constraint letters (`I', `J', `K', ... `P') that specify
- particular ranges of integer values. If C is one of those
- letters, the expression should check that VALUE, an integer, is in
- the appropriate range and return 1 if so, 0 otherwise. If C is
- not one of those letters, the value should be 0 regardless of
- VALUE. */
-
#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0
-/* `CONST_DOUBLE_OK_FOR_LETTER_P (VALUE, C)'
- A C expression that defines the machine-dependent operand
- constraint letters that specify particular ranges of
- `const_double' values (`G' or `H').
-
- If C is one of those letters, the expression should check that
- VALUE, an RTX of code `const_double', is in the appropriate range
- and return 1 if so, 0 otherwise. If C is not one of those
- letters, the value should be 0 regardless of VALUE.
-
- `const_double' is used for all floating-point constants and for
- `DImode' fixed-point constants. A given letter can accept either
- or both kinds of values. It can use `GET_MODE' to distinguish
- between these kinds. */
-
#define EXTRA_CONSTRAINT(X, C) ip2k_extra_constraint (X, C)
-/* A C expression that defines the optional machine-dependent
- constraint letters (``Q', `R', `S', `T', `U') that can'
- be used to segregate specific types of operands, usually memory
- references, for the target machine. Normally this macro will not
- be defined. If it is required for a particular target machine, it
- should return 1 if VALUE corresponds to the operand type
- represented by the constraint letter C. If C is not defined as an
- extra constraint, the value returned should be 0 regardless of
- VALUE.
-
- For example, on the ROMP, load instructions cannot have their
- output in r0 if the memory reference contains a symbolic address.
- Constraint letter `Q' is defined as representing a memory address
- that does *not* contain a symbolic address. An alternative is
- specified with a `Q' constraint on the input and `r' on the
- output. The next alternative specifies `m' on the input and a
- register class that does not include r0 on the output. */
-
/* This is an undocumented variable which describes
how GCC will pop a data. */
#define STACK_POP_CODE PRE_INC
#define STACK_PUSH_CODE POST_DEC
-/* This macro defines the operation used when something is pushed on
- the stack. In RTL, a push operation will be `(set (mem
- (STACK_PUSH_CODE (reg sp))) ...)'
-
- The choices are `PRE_DEC', `POST_DEC', `PRE_INC', and `POST_INC'.
- Which of these is correct depends on the stack direction and on
- whether the stack pointer points to the last item on the stack or
- whether it points to the space for the next item on the stack.
-
- The default is `PRE_DEC' when `STACK_GROWS_DOWNWARD' is defined,
- which is almost always right, and `PRE_INC' otherwise, which is
- often wrong. */
-
#define STACK_CHECK_BUILTIN 1
/* Prologue code will do stack checking as necessary. */
#define STARTING_FRAME_OFFSET (0)
-/* Offset from the frame pointer to the first local variable slot to
- be allocated.
-
- If `FRAME_GROWS_DOWNWARD', find the next slot's offset by
- subtracting the first slot's length from `STARTING_FRAME_OFFSET'.
- Otherwise, it is found by adding the length of the first slot to
- the value `STARTING_FRAME_OFFSET'. */
#define FRAME_GROWS_DOWNWARD 1
#define STACK_GROWS_DOWNWARD 1
@@ -1008,20 +390,6 @@ enum reg_class {
pc, etc. */
#define FIRST_PARM_OFFSET(FUNDECL) 0
-/* Offset from the argument pointer register to the first argument's
- address. On some machines it may depend on the data type of the
- function.
-
- If `ARGS_GROW_DOWNWARD', this is the offset to the location above
- the first argument's address. */
-
-/* `STACK_DYNAMIC_OFFSET (FUNDECL)'
- Offset from the stack pointer register to an item dynamically
- allocated on the stack, e.g., by `alloca'.
-
- The default value for this macro is `STACK_POINTER_OFFSET' plus the
- length of the outgoing arguments. The default is correct for most
- machines. See `function.c' for details. */
#define STACK_POINTER_OFFSET 1
/* IP2K stack is post-decremented, so 0(sp) is address of open space
@@ -1029,33 +397,13 @@ enum reg_class {
outgoing arguments are placed. */
#define STACK_BOUNDARY 8
-/* Define this macro if there is a guaranteed alignment for the stack
- pointer on this machine. The definition is a C expression for the
- desired alignment (measured in bits). This value is used as a
- default if PREFERRED_STACK_BOUNDARY is not defined. */
#define STACK_POINTER_REGNUM REG_SP
-/* The register number of the stack pointer register, which must also
- be a fixed register according to `FIXED_REGISTERS'. On most
- machines, the hardware determines which register this is. */
#define FRAME_POINTER_REGNUM REG_VFP
-/* The register number of the frame pointer register, which is used to
- access automatic variables in the stack frame. On some machines,
- the hardware determines which register this is. On other
- machines, you can choose any register you wish for this purpose. */
-
#define HARD_FRAME_POINTER_REGNUM REG_FP
#define ARG_POINTER_REGNUM REG_AP
-/* The register number of the arg pointer register, which is used to
- access the function's argument list. On some machines, this is
- the same as the frame pointer register. On some machines, the
- hardware determines which register this is. On other machines,
- you can choose any register you wish for this purpose. If this is
- not the same register as the frame pointer register, then you must
- mark it as a fixed register according to `FIXED_REGISTERS', or
- arrange to be able to eliminate it (*note Elimination::.). */
/* We don't really want to support nested functions. But we'll crash
in various testsuite tests if we don't at least define the register
@@ -1063,40 +411,8 @@ enum reg_class {
bad a place as any for this. */
#define STATIC_CHAIN_REGNUM REG_RESULT
-/* Register numbers used for passing a function's static chain
- pointer. If register windows are used, the register number as
- seen by the called function is `STATIC_CHAIN_INCOMING_REGNUM',
- while the register number as seen by the calling function is
- `STATIC_CHAIN_REGNUM'. If these registers are the same,
- `STATIC_CHAIN_INCOMING_REGNUM' need not be defined.
-
- The static chain register need not be a fixed register.
-
- If the static chain is passed in memory, these macros should not be
- defined; instead, the next two macros should be defined. */
#define FRAME_POINTER_REQUIRED (!flag_omit_frame_pointer)
-/* A C expression which is nonzero if a function must have and use a
- frame pointer. This expression is evaluated in the reload pass.
- If its value is nonzero the function will have a frame pointer.
-
- The expression can in principle examine the current function and
- decide according to the facts, but on most machines the constant 0
- or the constant 1 suffices. Use 0 when the machine allows code to
- be generated with no frame pointer, and doing so saves some time
- or space. Use 1 when there is no possible advantage to avoiding a
- frame pointer.
-
- In certain cases, the compiler does not know how to produce valid
- code without a frame pointer. The compiler recognizes those cases
- and automatically gives the function a frame pointer regardless of
- what `FRAME_POINTER_REQUIRED' says. You don't need to worry about
- them.
-
- In a function that does not require a frame pointer, the frame
- pointer register can be allocated for ordinary usage, unless you
- mark it as a fixed register. See `FIXED_REGISTERS' for more
- information. */
#define ELIMINABLE_REGS { \
{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
@@ -1105,226 +421,35 @@ enum reg_class {
{FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
{HARD_FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
}
-/* If defined, this macro specifies a table of register pairs used to
- eliminate unneeded registers that point into the stack frame. If
- it is not defined, the only elimination attempted by the compiler
- is to replace references to the frame pointer with references to
- the stack pointer.
-
- The definition of this macro is a list of structure
- initializations, each of which specifies an original and
- replacement register.
-
- On some machines, the position of the argument pointer is not
- known until the compilation is completed. In such a case, a
- separate hard register must be used for the argument pointer.
- This register can be eliminated by replacing it with either the
- frame pointer or the argument pointer, depending on whether or not
- the frame pointer has been eliminated.
-
- In this case, you might specify:
- #define ELIMINABLE_REGS \
- {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
- {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
- {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
-
- Note that the elimination of the argument pointer with the stack
- pointer is specified first since that is the preferred elimination. */
-
#define CAN_ELIMINATE(FROM, TO) \
((FROM) == HARD_FRAME_POINTER_REGNUM \
? (flag_omit_frame_pointer && !frame_pointer_needed) : 1)
/* Don't eliminate FP unless we EXPLICITLY_ASKED */
-/* A C expression that returns nonzero if the compiler is allowed to
- try to replace register number FROM-REG with register number
- TO-REG. This macro need only be defined if `ELIMINABLE_REGS' is
- defined, and will usually be the constant 1, since most of the
- cases preventing register elimination are things that the compiler
- already knows about. */
-
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
((OFFSET) = ip2k_init_elim_offset ((FROM), (TO)))
-/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
- specifies the initial difference between the specified pair of
- registers. This macro must be defined if `ELIMINABLE_REGS' is
- defined. */
-
#define RETURN_ADDR_RTX(COUNT, X) \
(((COUNT) == 0) ? gen_rtx_REG (HImode, REG_CALLH) : NULL_RTX)
-/* A C expression whose value is RTL representing the value of the
- return address for the frame COUNT steps up from the current
- frame, after the prologue. FRAMEADDR is the frame pointer of the
- COUNT frame, or the frame pointer of the COUNT - 1 frame if
- `RETURN_ADDR_IN_PREVIOUS_FRAME' is defined.
-
- The value of the expression must always be the correct address when
- COUNT is zero, but may be `NULL_RTX' if there is not way to
- determine the return address of other frames. */
#define PUSH_ROUNDING(NPUSHED) (NPUSHED)
-/* A C expression that is the number of bytes actually pushed onto the
- stack when an instruction attempts to push NPUSHED bytes.
-
- If the target machine does not have a push instruction, do not
- define this macro. That directs GNU CC to use an alternate
- strategy: to allocate the entire argument block and then store the
- arguments into it.
-
- On some machines, the definition
-
- #define PUSH_ROUNDING(BYTES) (BYTES)
-
- will suffice. But on other machines, instructions that appear to
- push one byte actually push two bytes in an attempt to maintain
- alignment. Then the definition should be
-
- #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1) */
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
ip2k_return_pops_args ((FUNDECL), (FUNTYPE), (SIZE))
-/* A C expression that should indicate the number of bytes of its own
- arguments that a function pops on returning, or 0 if the function
- pops no arguments and the caller must therefore pop them all after
- the function returns.
-
- FUNDECL is a C variable whose value is a tree node that describes
- the function in question. Normally it is a node of type
- `FUNCTION_DECL' that describes the declaration of the function.
- From this you can obtain the DECL_MACHINE_ATTRIBUTES of the
- function.
-
- FUNTYPE is a C variable whose value is a tree node that describes
- the function in question. Normally it is a node of type
- `FUNCTION_TYPE' that describes the data type of the function.
- From this it is possible to obtain the data types of the value and
- arguments (if known).
-
- When a call to a library function is being considered, FUNDECL
- will contain an identifier node for the library function. Thus, if
- you need to distinguish among various library functions, you can
- do so by their names. Note that "library function" in this
- context means a function used to perform arithmetic, whose name is
- known specially in the compiler and was not mentioned in the C
- code being compiled.
-
- STACK-SIZE is the number of bytes of arguments passed on the
- stack. If a variable number of bytes is passed, it is zero, and
- argument popping will always be the responsibility of the calling
- function.
-
- On the VAX, all functions always pop their arguments, so the
- definition of this macro is STACK-SIZE. On the 68000, using the
- standard calling convention, no functions pop their arguments, so
- the value of the macro is always 0 in this case. But an
- alternative calling convention is available in which functions
- that take a fixed number of arguments pop them but other functions
- (such as `printf') pop nothing (the caller pops all). When this
- convention is in use, FUNTYPE is examined to determine whether a
- function takes a fixed number of arguments. */
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
-/* A C expression that controls whether a function argument is passed
- in a register, and which register.
-
- The arguments are CUM, which summarizes all the previous
- arguments; MODE, the machine mode of the argument; TYPE, the data
- type of the argument as a tree node or 0 if that is not known
- (which happens for C support library functions); and NAMED, which
- is 1 for an ordinary argument and 0 for nameless arguments that
- correspond to `...' in the called function's prototype.
-
- The value of the expression is usually either a `reg' RTX for the
- hard register in which to pass the argument, or zero to pass the
- argument on the stack.
-
- For machines like the VAX and 68000, where normally all arguments
- are pushed, zero suffices as a definition.
-
- The value of the expression can also be a `parallel' RTX. This is
- used when an argument is passed in multiple locations. The mode
- of the of the `parallel' should be the mode of the entire
- argument. The `parallel' holds any number of `expr_list' pairs;
- each one describes where part of the argument is passed. In each
- `expr_list', the first operand can be either a `reg' RTX for the
- hard register in which to pass this part of the argument, or zero
- to pass the argument on the stack. If this operand is a `reg',
- then the mode indicates how large this part of the argument is.
- The second operand of the `expr_list' is a `const_int' which gives
- the offset in bytes into the entire argument where this part
- starts.
-
- The usual way to make the ANSI library `stdarg.h' work on a machine
- where some arguments are usually passed in registers, is to cause
- nameless arguments to be passed on the stack instead. This is done
- by making `FUNCTION_ARG' return 0 whenever NAMED is 0.
-
- You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the
- definition of this macro to determine if this argument is of a
- type that must be passed in the stack. If `REG_PARM_STACK_SPACE'
- is not defined and `FUNCTION_ARG' returns nonzero for such an
- argument, the compiler will abort. If `REG_PARM_STACK_SPACE' is
- defined, the argument will be computed in the stack and then
- loaded into a register. */
#define CUMULATIVE_ARGS int
-/* A C type for declaring a variable that is used as the first
- argument of `FUNCTION_ARG' and other related values. For some
- target machines, the type `int' suffices and can hold the number
- of bytes of argument so far.
-
- There is no need to record in `CUMULATIVE_ARGS' anything about the
- arguments that have been passed on the stack. The compiler has
- other variables to keep track of that. For target machines on
- which all arguments are passed on the stack, there is no need to
- store anything in `CUMULATIVE_ARGS'; however, the data structure
- must exist and should not be empty, so use `int'. */
-
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
((CUM) = 0)
-/* A C statement (sans semicolon) for initializing the variable CUM
- for the state at the beginning of the argument list. The variable
- has type `CUMULATIVE_ARGS'. The value of FNTYPE is the tree node
- for the data type of the function which will receive the args, or 0
- if the args are to a compiler support library function. The value
- of INDIRECT is nonzero when processing an indirect call, for
- example a call through a function pointer. The value of INDIRECT
- is zero for a call to an explicitly named function, a library
- function call, or when `INIT_CUMULATIVE_ARGS' is used to find
- arguments for the function being compiled.
-
- When processing a call to a compiler support library function,
- LIBNAME identifies which one. It is a `symbol_ref' rtx which
- contains the name of the function, as a string. LIBNAME is 0 when
- an ordinary C function call is being processed. Thus, each time
- this macro is called, either LIBNAME or FNTYPE is nonzero, but
- never both of them at once. */
-
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)
/* All arguments are passed on stack - do nothing here. */
-/* A C statement (sans semicolon) to update the summarizer variable
- CUM to advance past an argument in the argument list. The values
- MODE, TYPE and NAMED describe that argument. Once this is done,
- the variable CUM is suitable for analyzing the *following*
- argument with `FUNCTION_ARG', etc.
-
- This macro need not do anything if the argument in question was
- passed on the stack. The compiler knows how to track the amount
- of stack space used for arguments without any special help. */
-
#define FUNCTION_ARG_REGNO_P(R) 0
-/* A C expression that is nonzero if REGNO is the number of a hard
- register in which function arguments are sometimes passed. This
- does *not* include implicit arguments such as the static chain and
- the structure-value address. On many machines, no registers can be
- used for this purpose since all function arguments are pushed on
- the stack. */
#define FUNCTION_VALUE(VALTYPE, FUNC) \
((TYPE_MODE (VALTYPE) == QImode) \
@@ -1334,115 +459,23 @@ enum reg_class {
/* Because functions returning 'char' actually widen to 'int', we have to
use $81 as the return location if we think we only have a 'char'. */
-/* A C expression to create an RTX representing the place where a
- function returns a value of data type VALTYPE. VALTYPE is a tree
- node representing a data type. Write `TYPE_MODE (VALTYPE)' to get
- the machine mode used to represent that type. On many machines,
- only the mode is relevant. (Actually, on most machines, scalar
- values are returned in the same place regardless of mode).
-
- The value of the expression is usually a `reg' RTX for the hard
- register where the return value is stored. The value can also be a
- `parallel' RTX, if the return value is in multiple places. See
- `FUNCTION_ARG' for an explanation of the `parallel' form.
-
- If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same
- promotion rules specified in `PROMOTE_MODE' if VALTYPE is a scalar
- type.
-
- If the precise function being called is known, FUNC is a tree node
- (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
- makes it possible to use a different value-returning convention
- for specific functions when all their calls are known.
-
- `FUNCTION_VALUE' is not used for return vales with aggregate data
- types, because these are returned in another way. See
- `STRUCT_VALUE_REGNUM' and related macros, below. */
-
#define LIBCALL_VALUE(MODE) gen_rtx_REG ((MODE), REG_RESULT)
-/* A C expression to create an RTX representing the place where a
- library function returns a value of mode MODE. If the precise
- function being called is known, FUNC is a tree node
- (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
- makes it possible to use a different value-returning convention
- for specific functions when all their calls are known.
-
- Note that "library function" in this context means a compiler
- support routine, used to perform arithmetic, whose name is known
- specially by the compiler and was not mentioned in the C code being
- compiled.
-
- The definition of `LIBRARY_VALUE' need not be concerned aggregate
- data types, because none of the library functions returns such
- types. */
#define FUNCTION_VALUE_REGNO_P(N) ((N) == REG_RESULT)
-/* A C expression that is nonzero if REGNO is the number of a hard
- register in which the values of called function may come back.
-
- A register whose use for returning values is limited to serving as
- the second of a pair (for a value of type `double', say) need not
- be recognized by this macro. So for most machines, this definition
- suffices:
-
- #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
-
- If the machine has register windows, so that the caller and the
- called function use different registers for the return value, this
- macro should recognize only the caller's register numbers. */
#define RETURN_IN_MEMORY(TYPE) \
((TYPE_MODE (TYPE) == BLKmode) ? int_size_in_bytes (TYPE) > 8 : 0)
-/* A C expression which can inhibit the returning of certain function
- values in registers, based on the type of value. A nonzero value
- says to return the function value in memory, just as large
- structures are always returned. Here TYPE will be a C expression
- of type `tree', representing the data type of the value.
-
- Note that values of mode `BLKmode' must be explicitly handled by
- this macro. Also, the option `-fpcc-struct-return' takes effect
- regardless of this macro. On most systems, it is possible to
- leave the macro undefined; this causes a default definition to be
- used, whose value is the constant 1 for `BLKmode' values, and 0
- otherwise.
-
- Do not use this macro to indicate that structures and unions
- should always be returned in memory. You should instead use
- `DEFAULT_PCC_STRUCT_RETURN' to indicate this. */
/* Indicate that large structures are passed by reference. */
#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM,MODE,TYPE,NAMED) 0
-
#define DEFAULT_PCC_STRUCT_RETURN 0
-/* Define this macro to be 1 if all structure and union return values
- must be in memory. Since this results in slower code, this should
- be defined only if needed for compatibility with other compilers
- or with an ABI. If you define this macro to be 0, then the
- conventions used for structure and union return values are decided
- by the `RETURN_IN_MEMORY' macro.
-
- If not defined, this defaults to the value 1. */
#define STRUCT_VALUE 0
-/* If the structure value address is not passed in a register, define
- `STRUCT_VALUE' as an expression returning an RTX for the place
- where the address is passed. If it returns 0, the address is
- passed as an "invisible" first argument. */
#define STRUCT_VALUE_INCOMING 0
-/* If the incoming location is not a register, then you should define
- `STRUCT_VALUE_INCOMING' as an expression for an RTX for where the
- called function should find the value. If it should find the
- value on the stack, define this to create a `mem' which refers to
- the frame pointer. A definition of 0 means that the address is
- passed as an "invisible" first argument. */
#define EPILOGUE_USES(REGNO) 0
-/* Define this macro as a C expression that is nonzero for registers
- are used by the epilogue or the `return' pattern. The stack and
- frame pointer registers are already be assumed to be used as
- needed. */
#define SETUP_INCOMING_VARARGS(ARGS_SO_FAR,MODE,TYPE, \
PRETEND_ARGS_SIZE,SECOND_TIME) \
@@ -1456,21 +489,7 @@ enum reg_class {
#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
-/* A C expression that is 1 if the RTX X is a constant which is a
- valid address. On most machines, this can be defined as
- `CONSTANT_P (X)', but a few machines are more restrictive in which
- constant addresses are supported.
-
- `CONSTANT_P' accepts integer-values expressions whose values are
- not explicitly known, such as `symbol_ref', `label_ref', and
- `high' expressions and `const' arithmetic expressions, in addition
- to `const_int' and `const_double' expressions. */
-
#define MAX_REGS_PER_ADDRESS 1
-/* A number, the maximum number of registers that can appear in a
- valid memory address. Note that it is up to you to specify a
- value equal to the maximum number that `GO_IF_LEGITIMATE_ADDRESS'
- would ever accept. */
#ifdef REG_OK_STRICT
# define GO_IF_LEGITIMATE_ADDRESS(MODE, OPERAND, ADDR) \
@@ -1485,74 +504,6 @@ enum reg_class {
goto ADDR; \
}
#endif
-/* A C compound statement with a conditional `goto LABEL;' executed
- if X (an RTX) is a legitimate memory address on the target machine
- for a memory operand of mode MODE.
-
- It usually pays to define several simpler macros to serve as
- subroutines for this one. Otherwise it may be too complicated to
- understand.
-
- This macro must exist in two variants: a strict variant and a
- non-strict one. The strict variant is used in the reload pass. It
- must be defined so that any pseudo-register that has not been
- allocated a hard register is considered a memory reference. In
- contexts where some kind of register is required, a pseudo-register
- with no hard register must be rejected.
-
- The non-strict variant is used in other passes. It must be
- defined to accept all pseudo-registers in every context where some
- kind of register is required.
-
- Compiler source files that want to use the strict variant of this
- macro define the macro `REG_OK_STRICT'. You should use an `#ifdef
- REG_OK_STRICT' conditional to define the strict variant in that
- case and the non-strict variant otherwise.
-
- Subroutines to check for acceptable registers for various purposes
- (one for base registers, one for index registers, and so on) are
- typically among the subroutines used to define
- `GO_IF_LEGITIMATE_ADDRESS'. Then only these subroutine macros
- need have two variants; the higher levels of macros may be the
- same whether strict or not.
-
- Normally, constant addresses which are the sum of a `symbol_ref'
- and an integer are stored inside a `const' RTX to mark them as
- constant. Therefore, there is no need to recognize such sums
- specifically as legitimate addresses. Normally you would simply
- recognize any `const' as legitimate.
-
- Usually `PRINT_OPERAND_ADDRESS' is not prepared to handle constant
- sums that are not marked with `const'. It assumes that a naked
- `plus' indicates indexing. If so, then you *must* reject such
- naked constant sums as illegitimate addresses, so that none of
- them will be given to `PRINT_OPERAND_ADDRESS'.
-
- On some machines, whether a symbolic address is legitimate depends
- on the section that the address refers to. On these machines,
- define the macro `ENCODE_SECTION_INFO' to store the information
- into the `symbol_ref', and then check for it here. When you see a
- `const', you will have to look inside it to find the `symbol_ref'
- in order to determine the section. *Note Assembler Format::.
-
- The best way to modify the name string is by adding text to the
- beginning, with suitable punctuation to prevent any ambiguity.
- Allocate the new name in `saveable_obstack'. You will have to
- modify `ASM_OUTPUT_LABELREF' to remove and decode the added text
- and output the name accordingly, and define `STRIP_NAME_ENCODING'
- to access the original name string.
-
- You can check the information stored here into the `symbol_ref' in
- the definitions of the macros `GO_IF_LEGITIMATE_ADDRESS' and
- `PRINT_OPERAND_ADDRESS'. */
-
-/* A C expression that is nonzero if X (assumed to be a `reg' RTX) is
- valid for use as a base register. For hard registers, it should
- always accept those which the hardware permits and reject the
- others. Whether the macro accepts or rejects pseudo registers
- must be controlled by `REG_OK_STRICT' as described above. This
- usually requires two variant definitions, of which `REG_OK_STRICT'
- controls the one actually used. */
#define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
@@ -1570,39 +521,6 @@ enum reg_class {
#endif
#define REG_OK_FOR_INDEX_P(X) 0
-/* A C expression that is nonzero if X (assumed to be a `reg' RTX) is
- valid for use as an index register.
-
- The difference between an index register and a base register is
- that the index register may be scaled. If an address involves the
- sum of two registers, neither one of them scaled, then either one
- may be labeled the "base" and the other the "index"; but whichever
- labeling is used must fit the machine's constraints of which
- registers may serve in each capacity. The compiler will try both
- labelings, looking for one that is valid, and will reload one or
- both registers only if neither labeling works. */
-
-
-/* A C compound statement that attempts to replace X with a valid
- memory address for an operand of mode MODE. WIN will be a C
- statement label elsewhere in the code; the macro definition may use
-
- GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
-
- to avoid further processing if the address has become legitimate.
-
- X will always be the result of a call to `break_out_memory_refs',
- and OLDX will be the operand that was given to that function to
- produce X.
-
- The code generated by this macro should not alter the substructure
- of X. If it transforms X into a more legitimate form, it should
- assign X (which will always be a C variable) a new value.
-
- It is not necessary for this macro to come up with a legitimate
- address. The compiler has standard ways of doing so in all cases.
- In fact, it is safe for this macro to do nothing. But often a
- machine-dependent strategy can generate better code. */
#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \
do { rtx orig_x = (X); \
@@ -1684,266 +602,54 @@ do { \
} \
} \
}
-/* A C compound statement that attempts to replace X, which is an
- address that needs reloading, with a valid memory address for an
- operand of mode MODE. WIN will be a C statement label elsewhere
- in the code. It is not necessary to define this macro, but it
- might be useful for performance reasons.
-
- For example, on the i386, it is sometimes possible to use a single
- reload register instead of two by reloading a sum of two pseudo
- registers into a register. On the other hand, for number of RISC
- processors offsets are limited so that often an intermediate
- address needs to be generated in order to address a stack slot.
- By defining LEGITIMIZE_RELOAD_ADDRESS appropriately, the
- intermediate addresses generated for adjacent some stack slots can
- be made identical, and thus be shared.
-
- *Note*: This macro should be used with caution. It is necessary
- to know something of how reload works in order to effectively use
- this, and it is quite easy to produce macros that build in too
- much knowledge of reload internals.
-
- *Note*: This macro must be able to reload an address created by a
- previous invocation of this macro. If it fails to handle such
- addresses then the compiler may generate incorrect code or abort.
-
- The macro definition should use `push_reload' to indicate parts
- that need reloading; OPNUM, TYPE and IND_LEVELS are usually
- suitable to be passed unaltered to `push_reload'.
-
- The code generated by this macro must not alter the substructure of
- X. If it transforms X into a more legitimate form, it should
- assign X (which will always be a C variable) a new value. This
- also applies to parts that you change indirectly by calling
- `push_reload'.
-
- The macro definition may use `strict_memory_address_p' to test if
- the address has become legitimate.
-
- If you want to change only a part of X, one standard way of doing
- this is to use `copy_rtx'. Note, however, that is unshares only a
- single level of rtl. Thus, if the part to be changed is not at the
- top level, you'll need to replace first the top leve It is not
- necessary for this macro to come up with a legitimate address;
- but often a machine-dependent strategy can generate better code. */
-
+
#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
do { \
if (ip2k_mode_dependent_address (ADDR)) goto LABEL; \
} while (0)
-/* A C statement or compound statement with a conditional `goto
- LABEL;' executed if memory address X (an RTX) can have different
- meanings depending on the machine mode of the memory reference it
- is used for or if the address is valid for some modes but not
- others.
-
- Autoincrement and autodecrement addresses typically have
- mode-dependent effects because the amount of the increment or
- decrement is the size of the operand being addressed. Some
- machines have other mode-dependent addresses. Many RISC machines
- have no mode-dependent addresses.
-
- You may assume that ADDR is a valid address for the machine. */
-
#define LEGITIMATE_CONSTANT_P(X) 1
-/* A C expression that is nonzero if X is a legitimate constant for
- an immediate operand on the target machine. You can assume that X
- satisfies `CONSTANT_P', so you need not check this. In fact, `1'
- is a suitable definition for this macro on machines where anything
- `CONSTANT_P' is valid. */
#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) 7
-/* A C expression for the cost of moving data from a register in class
- FROM to one in class TO. The classes are expressed using the
- enumeration values such as `GENERAL_REGS'. A value of 2 is the
- default; other values are interpreted relative to that.
-
- It is not required that the cost always equal 2 when FROM is the
- same as TO; on some machines it is expensive to move between
- registers if they are not general registers.
-
- If reload sees an insn consisting of a single `set' between two
- hard registers, and if `REGISTER_MOVE_COST' applied to their
- classes returns a value of 2, reload does not check to ensure that
- the constraints of the insn are met. Setting a cost of other than
- 2 will allow reload to verify that the constraints are met. You
- should do this if the `movM' pattern's constraints do not allow
- such copying. */
#define MEMORY_MOVE_COST(MODE,CLASS,IN) 6
-/* A C expression for the cost of moving data of mode M between a
- register and memory. A value of 4 is the default; this cost is
- relative to those in `REGISTER_MOVE_COST'.
-
- If moving between registers and memory is more expensive than
- between two registers, you should define this macro to express the
- relative cost. */
#define SLOW_BYTE_ACCESS 0
-/* Define this macro as a C expression which is nonzero if accessing
- less than a word of memory (i.e. a `char' or a `short') is no
- faster than accessing a word of memory, i.e., if such access
- require more than one instruction or if there is no difference in
- cost between byte and (aligned) word loads.
-
- When this macro is not defined, the compiler will access a field by
- finding the smallest containing object; when it is defined, a
- fullword load will be used if alignment permits. Unless bytes
- accesses are faster than word accesses, using word accesses is
- preferable since it may eliminate subsequent memory access if
- subsequent accesses occur to other fields in the same word of the
- structure, but to different bytes.
-
- `SLOW_ZERO_EXTEND'
- Define this macro if zero-extension (of a `char' or `short' to an
- `int') can be done faster if the destination is a register that is
- known to be zero.
-
- If you define this macro, you must have instruction patterns that
- recognize RTL structures like this:
-
- (set (strict_low_part (subreg:QI (reg:SI ...) 0)) ...)
-
- and likewise for `HImode'.
-
- `SLOW_UNALIGNED_ACCESS'
- Define this macro to be the value 1 if unaligned accesses have a
- cost many times greater than aligned accesses, for example if they
- are emulated in a trap handler.
-
- When this macro is nonzero, the compiler will act as if
- `STRICT_ALIGNMENT' were nonzero when generating code for block
- moves. This can cause significantly more instructions to be
- produced. Therefore, do not set this macro nonzero if unaligned
- accesses only add a cycle or two to the time for a memory access.
-
- If the value of this macro is always zero, it need not be defined.
-
- `MOVE_RATIO'
- 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 you don't define this, a reasonable default is used. */
#define NO_FUNCTION_CSE
-/* Define this macro if it is as good or better to call a constant
- function address than to call an address kept in a register. */
-
#define NO_RECURSIVE_FUNCTION_CSE
-/* Define this macro if it is as good or better for a function to call
- itself with an explicit address than to call an address kept in a
- register.
-
- `ADJUST_COST (INSN, LINK, DEP_INSN, COST)'
- A C statement (sans semicolon) to update the integer variable COST
- based on the relationship between INSN that is dependent on
- DEP_INSN through the dependence LINK. The default is to make no
- adjustment to COST. This can be used for example to specify to
- the scheduler that an output- or anti-dependence does not incur
- the same cost as a data-dependence.
-
- `ADJUST_PRIORITY (INSN)'
- A C statement (sans semicolon) to update the integer scheduling
- priority `INSN_PRIORITY(INSN)'. Reduce the priority to execute
- the INSN earlier, increase the priority to execute INSN later.
- Do not define this macro if you do not need to adjust the
- scheduling priorities of insns. */
#define TEXT_SECTION_ASM_OP ".text"
-/* A C expression whose value is a string containing the assembler
- operation that should precede instructions and read-only data.
- Normally `".text"' is right. */
-
#define DATA_SECTION_ASM_OP ".data"
-/* A C expression whose value is a string containing the assembler
- operation to identify the following data as writable initialized
- data. Normally `".data"' is right. */
#define JUMP_TABLES_IN_TEXT_SECTION 1
-/* Define this macro if jump tables (for `tablejump' insns) should be
- output in the text section, along with the assembler instructions.
- Otherwise, the readonly data section is used.
-
- This macro is irrelevant if there is no separate readonly data
- section. */
#define ASM_COMMENT_START " ; "
-/* A C string constant describing how to begin a comment in the target
- assembler language. The compiler assumes that the comment will
- end at the end of the line. */
#define ASM_APP_ON "/* #APP */\n"
-/* A C string constant for text to be output before each `asm'
- statement or group of consecutive ones. Normally this is
- `"#APP"', which is a comment that has no effect on most assemblers
- but tells the GNU assembler that it must check the lines that
- follow for all valid assembler constructs. */
#define ASM_APP_OFF "/* #NOAPP */\n"
-/* A C string constant for text to be output after each `asm'
- statement or group of consecutive ones. Normally this is
- `"#NO_APP"', which tells the GNU assembler to resume making the
- time-saving assumptions that are valid for ordinary compiler
- output. */
#define ASM_OUTPUT_DOUBLE(STREAM, VALUE) \
fprintf ((STREAM), ".double %.20e\n", (VALUE))
#define ASM_OUTPUT_FLOAT(STREAM, VALUE) \
asm_output_float ((STREAM), (VALUE))
-/* `ASM_OUTPUT_LONG_DOUBLE (STREAM, VALUE)'
- `ASM_OUTPUT_THREE_QUARTER_FLOAT (STREAM, VALUE)'
- `ASM_OUTPUT_SHORT_FLOAT (STREAM, VALUE)'
- `ASM_OUTPUT_BYTE_FLOAT (STREAM, VALUE)'
- A C statement to output to the stdio stream STREAM an assembler
- instruction to assemble a floating-point constant of `TFmode',
- `DFmode', `SFmode', `TQFmode', `HFmode', or `QFmode',
- respectively, whose value is VALUE. VALUE will be a C expression
- of type `REAL_VALUE_TYPE'. Macros such as
- `REAL_VALUE_TO_TARGET_DOUBLE' are useful for writing these
- definitions. */
-
#define ASM_OUTPUT_INT(FILE, VALUE) \
( fprintf ((FILE), "\t.long "), \
output_addr_const ((FILE), (VALUE)), \
fputs ("\n", (FILE)))
- /* Likewise for `short' and `char' constants. */
-
#define ASM_OUTPUT_SHORT(FILE,VALUE) \
asm_output_short ((FILE), (VALUE))
#define ASM_OUTPUT_CHAR(FILE,VALUE) \
asm_output_char ((FILE), (VALUE))
-/* `ASM_OUTPUT_QUADRUPLE_INT (STREAM, EXP)'
- A C statement to output to the stdio stream STREAM an assembler
- instruction to assemble an integer of 16, 8, 4, 2 or 1 bytes,
- respectively, whose value is VALUE. The argument EXP will be an
- RTL expression which represents a constant value. Use
- `output_addr_const (STREAM, EXP)' to output this value as an
- assembler expression.
-
- For sizes larger than `UNITS_PER_WORD', if the action of a macro
- would be identical to repeatedly calling the macro corresponding to
- a size of `UNITS_PER_WORD', once for each word, you need not define
- the macro. */
-
#define ASM_OUTPUT_BYTE(FILE,VALUE) \
asm_output_byte ((FILE), (VALUE))
-/* A C statement to output to the stdio stream STREAM an assembler
- instruction to assemble a single byte containing the number VALUE. */
#define IS_ASM_LOGICAL_LINE_SEPARATOR(C) \
((C) == '\n' || ((C) == '$'))
-/* Define this macro as a C expression which is nonzero if C is used
- as a logical line separator by the assembler.
-
- If you do not define this macro, the default is that only the
- character `;' is treated as a logical line separator. */
#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
do { \
@@ -1951,17 +657,6 @@ do { \
assemble_name ((STREAM), (NAME)); \
fprintf ((STREAM), ",%d\n", (int)(SIZE)); \
} while (0)
-/* A C statement (sans semicolon) to output to the stdio stream
- STREAM the assembler definition of a common-label named NAME whose
- size is SIZE bytes. The variable ROUNDED is the size rounded up
- to whatever alignment the caller wants.
-
- Use the expression `assemble_name (STREAM, NAME)' to output the
- name itself; before and after that, output the additional
- assembler syntax for defining the name, and a newline.
-
- This macro controls how the assembler definitions of uninitialized
- common global variables are output. */
#define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED) \
do { \
@@ -1969,17 +664,6 @@ do { \
assemble_name ((STREAM), (NAME)); \
fprintf ((STREAM), ",%d\n", (int)(SIZE)); \
} while (0)
-/* A C statement (sans semicolon) to output to the stdio stream
- STREAM the assembler definition of a local-common-label named NAME
- whose size is SIZE bytes. The variable ROUNDED is the size
- rounded up to whatever alignment the caller wants.
-
- Use the expression `assemble_name (STREAM, NAME)' to output the
- name itself; before and after that, output the additional
- assembler syntax for defining the name, and a newline.
-
- This macro controls how the assembler definitions of uninitialized
- static variables are output. */
#undef WEAK_ASM_OP
#define WEAK_ASM_OP ".weak"
@@ -1990,14 +674,6 @@ do { \
if (!flag_inhibit_size_directive) \
ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
} while (0)
-/* A C statement (sans semicolon) to output to the stdio stream
- STREAM any text necessary for declaring the size of a function
- which is being defined. The argument NAME is the name of the
- function. The argument DECL is the `FUNCTION_DECL' tree node
- representing the function.
-
- If this macro is not defined, then the function size is not
- defined. */
#define ESCAPES \
"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
@@ -2060,52 +736,13 @@ do { \
"$f8","$f9","$fa","$fb","$fc","$fd","$fe","$ff", \
"vfph","vfpl","vaph","vapl"}
-/* A C initializer containing the assembler's names for the machine
- registers, each one as a C string constant. This is what
- translates register numbers in the compiler into assembler
- language. */
-
#define PRINT_OPERAND(STREAM, X, CODE) \
print_operand ((STREAM), (X), (CODE))
-/* A C compound statement to output to stdio stream STREAM the
- assembler syntax for an instruction operand X. X is an RTL
- expression.
-
- CODE is a value that can be used to specify one of several ways of
- printing the operand. It is used when identical operands must be
- printed differently depending on the context. CODE comes from the
- `%' specification that was used to request printing of the
- operand. If the specification was just `%DIGIT' then CODE is 0;
- if the specification was `%LTR DIGIT' then CODE is the ASCII code
- for LTR.
-
- If X is a register, this macro should print the register's name.
- The names can be found in an array `reg_names' whose type is `char
- *[]'. `reg_names' is initialized from `REGISTER_NAMES'.
-
- When the machine description has a specification `%PUNCT' (a `%'
- followed by a punctuation character), this macro is called with a
- null pointer for X and the punctuation character for CODE. */
#define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
((CODE) == '<' || (CODE) == '>')
-/* A C expression which evaluates to true if CODE is a valid
- punctuation character for use in the `PRINT_OPERAND' macro. If
- `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no
- punctuation characters (except for the standard one, `%') are used
- in this way. */
-
#define PRINT_OPERAND_ADDRESS(STREAM, X) print_operand_address(STREAM, X)
-/* A C compound statement to output to stdio stream STREAM the
- assembler syntax for an instruction operand that is a memory
- reference whose address is X. X is an RTL expression.
-
- On some machines, the syntax for a symbolic address depends on the
- section that the address refers to. On these machines, define the
- macro `ENCODE_SECTION_INFO' to store the information into the
- `symbol_ref', and then check for it here. *Note Assembler
- Format::. */
/* Since register names don't have a prefix, we must preface all
user identifiers with the '_' to prevent confusion. */
@@ -2113,15 +750,6 @@ do { \
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX "_"
#define LOCAL_LABEL_PREFIX ".L"
-/* `LOCAL_LABEL_PREFIX'
- `REGISTER_PREFIX'
- `IMMEDIATE_PREFIX'
- If defined, C string expressions to be used for the `%R', `%L',
- `%U', and `%I' options of `asm_fprintf' (see `final.c'). These
- are useful when a single `md' file must support multiple assembler
- formats. In that case, the various `tm.h' files can define these
- macros differently. */
-
#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
asm_fprintf ((STREAM), "\tpage\t%L%d\n\tjmp\t%L%d\n", (VALUE), (VALUE))
@@ -2134,49 +762,18 @@ do { \
#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
asm_fprintf ((STREAM), "\tpage\t%L%d\n\tjmp\t%L%d\n", (VALUE), (VALUE))
-/* This macro should be provided on machines where the addresses in a
- dispatch table are absolute.
-
- The definition should be a C statement to output to the stdio
- stream STREAM an assembler pseudo-instruction to generate a
- reference to a label. VALUE is the number of an internal label
- whose definition is output using `(*targetm.asm_out.internal_label)'. For
- example,
-
- fprintf ((STREAM), "\t.word L%d\n", (VALUE)) */
-
#define ASM_OUTPUT_ALIGN(STREAM, POWER) \
fprintf ((STREAM), "\t.align %d\n", (POWER))
-/* A C statement to output to the stdio stream STREAM an assembler
- command to advance the location counter to a multiple of 2 to the
- POWER bytes. POWER will be a C expression of type `int'. */
/* Since instructions are 16 bit word addresses, we should lie and claim that
the dispatch vectors are in QImode. Otherwise the offset into the jump
table will be scaled by the MODE_SIZE. */
#define CASE_VECTOR_MODE QImode
-/* An alias for a machine mode name. This is the machine mode that
- elements of a jump-table should have. */
-
-
-/* `CASE_VALUES_THRESHOLD'
- Define this to be the smallest number of different values for
- which it is best to use a jump-table instead of a tree of
- conditional branches. The default is four for machines with a
- `casesi' instruction and five otherwise. This is best for most
- machines. */
#undef WORD_REGISTER_OPERATIONS
-/* Define this macro if operations between registers with integral
- mode smaller than a word are always performed on the entire
- register. Most RISC machines have this property and most CISC
- machines do not. */
#define MOVE_MAX 1
-/* The maximum number of bytes that a single instruction can move
- quickly between memory and registers or between two memory
- locations. */
#define MOVE_RATIO 3
/* MOVE_RATIO is the number of move instructions that is better than a
@@ -2184,51 +781,15 @@ do { \
large with each move. */
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
-/* A C expression which is nonzero if on this machine it is safe to
- "convert" an integer of INPREC bits to one of OUTPREC bits (where
- OUTPREC is smaller than INPREC) by merely operating on it as if it
- had only OUTPREC bits.
-
- On many machines, this expression can be 1.
-
- When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for
- modes for which `MODES_TIEABLE_P' is 0, suboptimal code can result.
- If this is the case, making `TRULY_NOOP_TRUNCATION' return 0 in
- such cases may improve things. */
#define Pmode HImode
-/* An alias for the machine mode for pointers. On most machines,
- define this to be the integer mode corresponding to the width of a
- hardware pointer; `SImode' on 32-bit machine or `DImode' on 64-bit
- machines. On some machines you must define this to be one of the
- partial integer modes, such as `PSImode'.
-
- The width of `Pmode' must be at least as large as the value of
- `POINTER_SIZE'. If it is not equal, you must define the macro
- `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to
- `Pmode'. */
#define FUNCTION_MODE HImode
-/* An alias for the machine mode used for memory references to
- functions being called, in `call' RTL expressions. On most
- machines this should be `QImode'. */
#define INTEGRATE_THRESHOLD(DECL) \
(1 + (3 * list_length (DECL_ARGUMENTS (DECL)) / 2))
-/* A C expression for the maximum number of instructions above which
- the function DECL should not be inlined. DECL is a
- `FUNCTION_DECL' node.
-
- The default definition of this macro is 64 plus 8 times the number
- of arguments that the function accepts. Some people think a larger
- threshold should be used on RISC machines. */
#define DOLLARS_IN_IDENTIFIERS 0
-/* Define this macro to control use of the character `$' in identifier
- names. 0 means `$' is not allowed by default; 1 means it is
- allowed. 1 is the default; there is no need to define this macro
- in that case. This macro controls the compiler proper; it does
- not affect the preprocessor. */
extern int ip2k_reorg_in_progress;
/* Flag if we're in the middle of IP2k-specific reorganization. */
@@ -2263,14 +824,8 @@ extern int ip2k_reorg_merge_qimode;
#define TRAMPOLINE_TEMPLATE(FILE) abort ()
-/* Length in units of the trampoline for entering a nested function. */
-
#define TRAMPOLINE_SIZE 4
-/* Emit RTL insns to initialize the variable parts of a trampoline.
- FNADDR is an RTX for the address of the function's pure code.
- CXT is an RTX for the static chain value for the function. */
-
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
{ \
emit_move_insn (gen_rtx_MEM (HImode, plus_constant ((TRAMP), 2)), \
@@ -2292,21 +847,11 @@ extern int ip2k_reorg_merge_qimode;
fprintf ((FILE), "/* profiler %d */", (LABELNO))
#define TARGET_MEM_FUNCTIONS
-/* Define this macro if GNU CC should generate calls to the System V
- (and ANSI C) library functions `memcpy' and `memset' rather than
- the BSD functions `bcopy' and `bzero'. */
-
#undef ENDFILE_SPEC
#undef LINK_SPEC
#undef STARTFILE_SPEC
-/* Another C string constant used much like `LINK_SPEC'. The
- difference between the two is that `ENDFILE_SPEC' is used at the
- very end of the command given to the linker.
-
- Do not define this macro if it does not need to do anything. */
-
#if defined(__STDC__) || defined(ALMOST_STDC)
#define AS2(a,b,c) #a "\t" #b "," #c
#define AS1(a,b) #a "\t" #b
@@ -2318,10 +863,6 @@ extern int ip2k_reorg_merge_qimode;
#define OUT_AS2(a,b,c) output_asm_insn (AS2 (a,b,c), operands)
#define CR_TAB "\n\t"
-/* Define this macro as a C statement that declares additional library
- routines renames existing ones. `init_optabs' calls this macro
- after initializing all the normal library routines. */
-
#define INIT_TARGET_OPTABS \
{ \
smul_optab->handlers[(int) SImode].libfunc \
diff --git a/gcc/config/ip2k/ip2k.md b/gcc/config/ip2k/ip2k.md
index b4f257980aa..ddd6fd20a7b 100644
--- a/gcc/config/ip2k/ip2k.md
+++ b/gcc/config/ip2k/ip2k.md
@@ -3,20 +3,20 @@
;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
;; Contributed by Red Hat, Inc and Ubicom, Inc.
;;
-;; This file is part of GNU CC.
+;; This file is part of GCC.
;;
-;; GNU CC is free software; you can redistribute it and/or modify
+;; GCC 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,
+;; GCC 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
+;; along with GCC; see the file COPYING. If not, write to
;; the Free Software Foundation, 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/ip2k/libgcc.S b/gcc/config/ip2k/libgcc.S
index fb0c9887195..5be482f9ca7 100644
--- a/gcc/config/ip2k/libgcc.S
+++ b/gcc/config/ip2k/libgcc.S
@@ -2,9 +2,9 @@
; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
; Contributed by Red Hat, Inc and Ubicom, Inc.
;
-; This file is part of GNU CC.
+; This file is part of GCC.
;
-; GNU CC is free software; you can redistribute it and/or modify
+; GCC 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.
@@ -17,13 +17,13 @@
; respects; for example, they cover modification of the file, and
; distribution when not linked into another program.)
;
-; GNU CC is distributed in the hope that it will be useful,
+; GCC 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
+; along with GCC; see the file COPYING. If not, write to
; the Free Software Foundation, 59 Temple Place - Suite 330,
; Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/kaos.h b/gcc/config/kaos.h
index 1d0a7b1b0bb..98719ac2b28 100644
--- a/gcc/config/kaos.h
+++ b/gcc/config/kaos.h
@@ -1,4 +1,4 @@
-/* Definitions of target machine for GNU compiler.
+/* Definitions of target machine for GCC.
common kaOS definitions for all architectures.
Copyright (C) 2003 Free Software Foundation, Inc.
diff --git a/gcc/config/libgloss.h b/gcc/config/libgloss.h
index f73982b8634..3f9bf6c9ef2 100644
--- a/gcc/config/libgloss.h
+++ b/gcc/config/libgloss.h
@@ -2,20 +2,20 @@
targeting GCC for Libgloss supported targets.
Copyright (C) 1996 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/linux-aout.h b/gcc/config/linux-aout.h
index 13d9bfd6e83..f63efd47790 100644
--- a/gcc/config/linux-aout.h
+++ b/gcc/config/linux-aout.h
@@ -1,21 +1,21 @@
-/* Definitions for Linux-based GNU systems.
+/* Definitions for Linux-based GNU systems with a.out binaries.
Copyright (C) 1995, 1997, 1999, 2000 Free Software Foundation, Inc.
Contributed by H.J. Lu (hjl@nynexst.com)
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index ea322b36d85..15c83b0d8c9 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -3,20 +3,20 @@
Contributed by Eric Youngdale.
Modified for stabs-in-ELF by H.J. Lu (hjl@lucon.org).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/lynx-ng.h b/gcc/config/lynx-ng.h
index 7c257c7982e..c23ad39a77f 100644
--- a/gcc/config/lynx-ng.h
+++ b/gcc/config/lynx-ng.h
@@ -1,20 +1,20 @@
/* Target independent definitions for LynxOS, using Lynx's old as and ld.
Copyright (C) 1993, 1999 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/lynx.h b/gcc/config/lynx.h
index e060675a7ce..267f499e221 100644
--- a/gcc/config/lynx.h
+++ b/gcc/config/lynx.h
@@ -1,21 +1,21 @@
-/* Target independent definitions for LynxOS.
+/* Target independent definitions for LynxOS using gas and gnu ld.
Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002
Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
@@ -84,14 +84,12 @@ Boston, MA 02111-1307, USA. */
"\t.text\n\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO)
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line) \
- { static int sym_lineno = 1; \
- fprintf (file, ".stabn 68,0,%d,.LM%d-", \
- line, sym_lineno); \
+#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
+ { fprintf (file, ".stabn 68,0,%d,.LM%d-", \
+ line, counter); \
assemble_name (file, \
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
- fprintf (file, "\n.LM%d:\n", sym_lineno); \
- sym_lineno += 1; }
+ fprintf (file, "\n.LM%d:\n", counter); }
/* Handle #pragma pack and sometimes #pragma weak. */
diff --git a/gcc/config/m32r/m32r-protos.h b/gcc/config/m32r/m32r-protos.h
index 103bff790bf..db84b7af683 100644
--- a/gcc/config/m32r/m32r-protos.h
+++ b/gcc/config/m32r/m32r-protos.h
@@ -30,7 +30,6 @@ extern unsigned m32r_compute_frame_size PARAMS ((int));
extern int m32r_first_insn_address PARAMS ((void));
extern void m32r_expand_prologue PARAMS ((void));
extern void m32r_finalize_pic PARAMS ((void));
-extern void m32r_asm_file_start PARAMS ((FILE *));
extern int direct_return PARAMS ((void));
#ifdef TREE_CODE
extern enum m32r_function_type m32r_compute_function_type PARAMS ((tree));
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index 55b7cf71d80..3622d0657ea 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -77,6 +77,8 @@ static tree m32r_handle_model_attribute PARAMS ((tree *, tree, tree, int, bool
static void m32r_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void m32r_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
+static void m32r_file_start PARAMS ((void));
+
static int m32r_adjust_cost PARAMS ((rtx, rtx, rtx, int));
static int m32r_adjust_priority PARAMS ((rtx, int));
static void m32r_sched_init PARAMS ((FILE *, int, int));
@@ -103,6 +105,9 @@ static bool m32r_rtx_costs PARAMS ((rtx, int, int, int *));
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE m32r_output_function_epilogue
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START m32r_file_start
+
#undef TARGET_SCHED_ADJUST_COST
#define TARGET_SCHED_ADJUST_COST m32r_adjust_cost
#undef TARGET_SCHED_ADJUST_PRIORITY
@@ -2215,15 +2220,13 @@ m32r_initialize_trampoline (tramp, fnaddr, cxt)
{
}
-/* Set the cpu type and print out other fancy things,
- at the top of the file. */
-
-void
-m32r_asm_file_start (file)
- FILE * file;
+static void
+m32r_file_start ()
{
+ default_file_start ();
+
if (flag_verbose_asm)
- fprintf (file,
+ fprintf (asm_out_file,
"%s M32R/D special options: -G " HOST_WIDE_INT_PRINT_UNSIGNED "\n",
ASM_COMMENT_START, g_switch_value);
}
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index 8c82589552e..815de108844 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -30,7 +30,6 @@ Boston, MA 02111-1307, USA. */
#undef PTRDIFF_TYPE
#undef WCHAR_TYPE
#undef WCHAR_TYPE_SIZE
-#undef ASM_FILE_START
#undef ASM_OUTPUT_EXTERNAL_LIBCALL
#undef TARGET_VERSION
#undef CPP_SPEC
@@ -1517,9 +1516,6 @@ do { \
/* Control the assembler format that we output. */
-/* Output at beginning of assembler file. */
-#define ASM_FILE_START(FILE) m32r_asm_file_start (FILE)
-
/* A C string constant describing how to begin a comment in the target
assembler language. The compiler assumes that the comment will
end at the end of the line. */
@@ -1545,19 +1541,17 @@ do { \
of a word. */
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line) \
+#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
do \
{ \
- static int sym_lineno = 1; \
fprintf (file, ".stabn 68,0,%d,.LM%d-", \
- line, sym_lineno); \
+ line, counter); \
assemble_name \
(file, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
fprintf (file, (optimize_size || TARGET_M32R) \
? "\n\t.debugsym .LM%d\n" \
: "\n.LM%d:\n", \
- sym_lineno); \
- sym_lineno += 1; \
+ counter); \
} \
while (0)
@@ -1687,8 +1681,6 @@ extern char m32r_punct_chars[256];
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
do \
{ \
- extern unsigned HOST_WIDE_INT g_switch_value; \
- \
if (! TARGET_SDATA_NONE \
&& (SIZE) > 0 && (SIZE) <= g_switch_value) \
fprintf ((FILE), "%s", SCOMMON_ASM_OP); \
diff --git a/gcc/config/m32r/m32r.md b/gcc/config/m32r/m32r.md
index 7dad4e0f8f5..1dff60e5bee 100644
--- a/gcc/config/m32r/m32r.md
+++ b/gcc/config/m32r/m32r.md
@@ -2477,7 +2477,7 @@
if (! zero_and_one (operands [2], operands [3]))
FAIL;
- /* Generate the comparision that will set the carry flag. */
+ /* Generate the comparison that will set the carry flag. */
operands[1] = gen_compare (GET_CODE (operands[1]), m32r_compare_op0,
m32r_compare_op1, TRUE);
diff --git a/gcc/config/m68hc11/m68hc11-protos.h b/gcc/config/m68hc11/m68hc11-protos.h
index d2d53388b4b..ff670a9088b 100644
--- a/gcc/config/m68hc11/m68hc11-protos.h
+++ b/gcc/config/m68hc11/m68hc11-protos.h
@@ -33,8 +33,6 @@ extern int m68hc11_initial_elimination_offset PARAMS((int, int));
extern void expand_prologue PARAMS((void));
extern void expand_epilogue PARAMS((void));
-extern void m68hc11_asm_file_start PARAMS((FILE*, const char*));
-
#ifdef TREE_CODE
extern void m68hc11_function_arg_advance PARAMS((CUMULATIVE_ARGS*,
enum machine_mode,
diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c
index 0e2f6233ae9..b40c4e75cd4 100644
--- a/gcc/config/m68hc11/m68hc11.c
+++ b/gcc/config/m68hc11/m68hc11.c
@@ -58,7 +58,6 @@ Note:
#include "target.h"
#include "target-def.h"
-static void print_options PARAMS ((FILE *));
static void emit_move_after_reload PARAMS ((rtx, rtx, rtx));
static rtx simplify_logical PARAMS ((enum machine_mode, int, rtx, rtx *));
static void m68hc11_emit_logical PARAMS ((enum machine_mode, int, rtx *));
@@ -82,6 +81,7 @@ static void asm_print_register PARAMS ((FILE *, int));
static void m68hc11_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
static void m68hc11_asm_out_constructor PARAMS ((rtx, int));
static void m68hc11_asm_out_destructor PARAMS ((rtx, int));
+static void m68hc11_file_start PARAMS ((void));
static void m68hc11_encode_section_info PARAMS((tree, rtx, int));
static int autoinc_mode PARAMS((rtx));
static int m68hc11_make_autoinc_notes PARAMS((rtx *, void *));
@@ -230,6 +230,11 @@ static int nb_soft_regs;
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE m68hc11_output_function_epilogue
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START m68hc11_file_start
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO m68hc11_encode_section_info
@@ -5631,9 +5636,6 @@ m68hc11_rtx_costs (x, code, outer_code, total)
*total = 0;
return true;
- if (outer_code == SET)
- *total = 1 - reload_completed;
-
case ROTATE:
case ROTATERT:
case ASHIFT:
@@ -5663,64 +5665,12 @@ m68hc11_rtx_costs (x, code, outer_code, total)
}
-/* print_options - called at the start of the code generation for a
- module. */
-
-extern char *asm_file_name;
-
-#include <time.h>
-#include <sys/types.h>
-
static void
-print_options (out)
- FILE *out;
-{
- const char *a_time;
- long c_time;
- int i;
- extern int save_argc;
- extern char **save_argv;
-
- fprintf (out, ";;; Command:\t");
- for (i = 0; i < save_argc; i++)
- {
- fprintf (out, "%s", save_argv[i]);
- if (i + 1 < save_argc)
- fprintf (out, " ");
- }
- fprintf (out, "\n");
- c_time = time (0);
- a_time = ctime (&c_time);
- fprintf (out, ";;; Compiled:\t%s", a_time);
-#ifdef __GNUC__
-#ifndef __VERSION__
-#define __VERSION__ "[unknown]"
-#endif
- fprintf (out, ";;; (META)compiled by GNU C version %s.\n", __VERSION__);
-#else
- fprintf (out, ";;; (META)compiled by CC.\n");
-#endif
-}
-
-void
-m68hc11_asm_file_start (out, main_file)
- FILE *out;
- const char *main_file;
+m68hc11_file_start ()
{
- fprintf (out, ";;;-----------------------------------------\n");
- fprintf (out, ";;; Start %s gcc assembly output\n",
- TARGET_M6811
- ? "MC68HC11"
- : TARGET_M68S12 ? "MC68HCS12" : "MC68HC12");
- fprintf (out, ";;; gcc compiler %s\n", version_string);
- print_options (out);
- fprintf (out, ";;;-----------------------------------------\n");
- output_file_directive (out, main_file);
-
- if (TARGET_SHORT)
- fprintf (out, "\t.mode mshort\n");
- else
- fprintf (out, "\t.mode mlong\n");
+ default_file_start ();
+
+ fprintf (asm_out_file, "\t.mode %s\n", TARGET_SHORT ? "mshort" : "mlong");
}
diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h
index d2c70906ce6..1492c775b32 100644
--- a/gcc/config/m68hc11/m68hc11.h
+++ b/gcc/config/m68hc11/m68hc11.h
@@ -1511,17 +1511,6 @@ do { \
#define TARGET_ASM_CONSTRUCTOR m68hc11_asm_out_constructor
#define TARGET_ASM_DESTRUCTOR m68hc11_asm_out_destructor
-/* This is how to begin an assembly language file. Most svr4 assemblers want
- at least a .file directive to come first, and some want to see a .version
- directive come right after that. Here we just establish a default
- which generates only the .file directive. If you need a .version
- directive for any specific target, you should override this definition
- in the target-specific file which includes this one. */
-
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- m68hc11_asm_file_start ((FILE), main_input_filename)
-
/* Comment character */
#define ASM_COMMENT_START ";"
diff --git a/gcc/config/m68k/coff.h b/gcc/config/m68k/coff.h
index 062a4b6489a..77be8b9743c 100644
--- a/gcc/config/m68k/coff.h
+++ b/gcc/config/m68k/coff.h
@@ -76,9 +76,7 @@ Boston, MA 02111-1307, USA. */
"%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp", \
"%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7" }
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- output_file_directive ((FILE), main_input_filename)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
/* If defined, a C expression whose value is a string containing the
assembler operation to identify the following data as uninitialized global
diff --git a/gcc/config/m68k/hp320.h b/gcc/config/m68k/hp320.h
index a63f3643831..a755aca672c 100644
--- a/gcc/config/m68k/hp320.h
+++ b/gcc/config/m68k/hp320.h
@@ -112,7 +112,6 @@ Boston, MA 02111-1307, USA. */
#endif /* default is -msoft-float */
-
/* -m68000 requires special flags to the assembler. */
#define ASM_SPEC \
"%{m68000:-mc68000}%{mc68000:-mc68000}%{!mc68000:%{!m68000:-mc68020}}"
@@ -168,7 +167,6 @@ Boston, MA 02111-1307, USA. */
#undef REGISTER_NAMES
#undef ASM_OUTPUT_REG_PUSH
#undef ASM_OUTPUT_REG_POP
-#undef ASM_FILE_START
#undef ASM_APP_ON
#undef ASM_APP_OFF
#undef TEXT_SECTION_ASM_OP
@@ -211,16 +209,7 @@ Boston, MA 02111-1307, USA. */
fprintf (FILE, "\tmov.l (%%sp)+,%s\n", reg_names[REGNO])
/* For HPUX versions before 6.5, define this macro as empty. */
-#define ASM_FILE_START(FILE) \
- if (TARGET_68020) \
- { \
- if (TARGET_68881) \
- fprintf (FILE, "\tversion 3\n"); /* 68020 fp regs saved */ \
- else \
- fprintf (FILE, "\tversion 2\n"); /* 68020 no fp regs saved */ \
- } \
- else \
- fprintf (FILE, "\tversion 1\n"); /* 68010 */
+#define TARGET_ASM_FILE_START m68k_hp320_file_start
#define ASM_APP_ON ""
@@ -276,7 +265,7 @@ do { \
fprintf (FILE, "\tspace %u\n", (int)(SIZE))
#define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME)
-#define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO)
+#define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO, COUNTER)
/* Output a float value (represented as a C double) as an immediate operand.
This macro is a 68k-specific macro. */
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 02b09117d6e..d4df6cf3351 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -59,6 +59,7 @@ static void m68k_svr3_asm_out_constructor PARAMS ((rtx, int));
#endif
#ifdef HPUX_ASM
static void m68k_hp320_internal_label PARAMS ((FILE *, const char *, unsigned long));
+static void m68k_hp320_file_start PARAMS ((void));
#endif
static void m68k_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
@@ -131,6 +132,9 @@ int m68k_last_compare_had_fp_operands;
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall
+#undef TARGET_ASM_FILE_START_APP_OFF
+#define TARGET_ASM_FILE_START_APP_OFF true
+
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS m68k_rtx_costs
@@ -3663,6 +3667,16 @@ m68k_hp320_internal_label (stream, prefix, labelno)
else
fprintf (stream, "%s%ld:\n", prefix, labelno);
}
+
+static void
+m68k_hp320_file_start ()
+{
+ /* version 1: 68010.
+ 2: 68020 without FPU.
+ 3: 68020 with FPU. */
+ fprintf (asm_out_file, "\tversion %d\n",
+ TARGET_68020 ? (TARGET_68881 ? 3 : 2) : 1);
+}
#endif
static void
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index a3f04e6766c..12c30b8ba26 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -1292,11 +1292,6 @@ __transfer_from_trampoline () \
/* Control the assembler format that we output. */
-/* Output at beginning of assembler file. */
-
-#define ASM_FILE_START(FILE) \
- fprintf (FILE, "#NO_APP\n");
-
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
diff --git a/gcc/config/mcore/mcore-pe.h b/gcc/config/mcore/mcore-pe.h
index 96381c97e7b..35055e5762f 100644
--- a/gcc/config/mcore/mcore-pe.h
+++ b/gcc/config/mcore/mcore-pe.h
@@ -105,33 +105,23 @@ drectve_section () \
} \
while (0);
-#undef ASM_FILE_START
-#define ASM_FILE_START(STREAM) \
- do \
- { \
- fprintf (STREAM, "%s Generated by gcc %s for MCore/pe\n", \
- ASM_COMMENT_START, version_string); \
- output_file_directive ((STREAM), main_input_filename); \
- } \
- while (0)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
+#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
{ \
if (write_symbols == DBX_DEBUG) \
{ \
- static int sym_lineno = 1; \
char buffer[256]; \
\
- ASM_GENERATE_INTERNAL_LABEL (buffer, "LM", sym_lineno); \
+ ASM_GENERATE_INTERNAL_LABEL (buffer, "LM", COUNTER); \
fprintf (FILE, ".stabn 68,0,%d,", LINE); \
assemble_name (FILE, buffer); \
putc ('-', FILE); \
assemble_name (FILE, \
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
putc ('\n', FILE); \
- (*targetm.asm_out.internal_label) (FILE, "LM", sym_lineno); \
- sym_lineno ++; \
+ (*targetm.asm_out.internal_label) (FILE, "LM", COUNTER); \
} \
}
diff --git a/gcc/config/mips/iris6-o32.h b/gcc/config/mips/iris6-o32.h
index 3ef2fe40d67..20a66946966 100644
--- a/gcc/config/mips/iris6-o32.h
+++ b/gcc/config/mips/iris6-o32.h
@@ -2,8 +2,8 @@
(O32 ABI). */
/* The O32 ABI on IRIX 6 defaults to the mips2 ISA. */
-#undef MIPS_ISA_DEFAULT
-#define MIPS_ISA_DEFAULT 2
+#undef MIPS_CPU_STRING_DEFAULT
+#define MIPS_CPU_STRING_DEFAULT "mips2"
/* Specify wchar_t and wint_t types. */
#undef WCHAR_TYPE
diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h
index 9ba7d21d2c1..6a3e792290c 100644
--- a/gcc/config/mips/iris6.h
+++ b/gcc/config/mips/iris6.h
@@ -356,8 +356,6 @@ current_section_flags () \
/* SGI assembler needs all sorts of extra help to do alignment properly. */
#undef ASM_OUTPUT_ALIGN
#define ASM_OUTPUT_ALIGN iris6_asm_output_align
-#undef ASM_FILE_START
-#define ASM_FILE_START iris6_asm_file_start
#undef MAX_OFILE_ALIGNMENT
#define MAX_OFILE_ALIGNMENT (32768*8)
diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h
index a9480d39840..217647bbfbd 100644
--- a/gcc/config/mips/mips-protos.h
+++ b/gcc/config/mips/mips-protos.h
@@ -28,8 +28,6 @@ Boston, MA 02111-1307, USA. */
extern HOST_WIDE_INT compute_frame_size PARAMS ((HOST_WIDE_INT));
extern int mips_initial_elimination_offset PARAMS ((int, int));
-extern void mips_asm_file_start PARAMS ((FILE *));
-extern void iris6_asm_file_start PARAMS ((FILE *));
extern void iris6_asm_output_align PARAMS ((FILE *, unsigned));
extern const char * current_section_name PARAMS ((void));
extern unsigned int current_section_flags PARAMS ((void));
@@ -78,7 +76,7 @@ extern tree mips_build_va_list PARAMS ((void));
extern void mips_va_start PARAMS ((tree, rtx));
extern struct rtx_def *mips_va_arg PARAMS ((tree, tree));
-extern void expand_block_move PARAMS ((rtx *));
+extern bool mips_expand_block_move PARAMS ((rtx, rtx, rtx));
extern bool mips_expand_unaligned_load PARAMS ((rtx, rtx,
unsigned int,
int));
@@ -98,8 +96,6 @@ extern void mips_split_64bit_move PARAMS ((rtx, rtx));
extern const char *mips_output_move PARAMS ((rtx, rtx));
extern const char *mips_emit_prefetch PARAMS ((rtx *));
extern const char *mips_restore_gp PARAMS ((rtx *));
-extern const char *output_block_move PARAMS ((rtx, rtx *, int,
- enum block_move_type));
extern void override_options PARAMS ((void));
extern void mips_conditional_register_usage PARAMS ((void));
extern void print_operand_address PARAMS ((FILE *, rtx));
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 47f3edde76f..ef43a1af281 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -220,11 +220,12 @@ static void mips_legitimize_const_move PARAMS ((enum machine_mode,
rtx, rtx));
static int m16_check_op PARAMS ((rtx, int, int, int));
static bool mips_function_ok_for_sibcall PARAMS ((tree, tree));
-static void block_move_loop PARAMS ((rtx, rtx,
- unsigned int,
- int,
- rtx, rtx));
-static void block_move_call PARAMS ((rtx, rtx, rtx));
+static void mips_block_move_straight PARAMS ((rtx, rtx,
+ HOST_WIDE_INT));
+static void mips_adjust_block_mem PARAMS ((rtx, HOST_WIDE_INT,
+ rtx *, rtx *));
+static void mips_block_move_loop PARAMS ((rtx, rtx,
+ HOST_WIDE_INT));
static void mips_arg_info PARAMS ((const CUMULATIVE_ARGS *,
enum machine_mode,
tree, int,
@@ -272,9 +273,10 @@ static void iris6_asm_named_section_1 PARAMS ((const char *,
unsigned int));
static void iris6_asm_named_section PARAMS ((const char *,
unsigned int));
-static int iris_section_align_entry_eq PARAMS ((const PTR, const PTR));
-static hashval_t iris_section_align_entry_hash PARAMS ((const PTR));
+static int iris_section_align_entry_eq PARAMS ((const void *, const void *));
+static hashval_t iris_section_align_entry_hash PARAMS ((const void *));
static int iris6_section_align_1 PARAMS ((void **, void *));
+static void iris6_file_start PARAMS ((void));
static void iris6_file_end PARAMS ((void));
#endif
static int mips_adjust_cost PARAMS ((rtx, rtx, rtx, int));
@@ -291,6 +293,7 @@ static int mips_use_dfa_pipeline_interface PARAMS ((void));
static bool mips_rtx_costs PARAMS ((rtx, int, int, int *));
static int mips_address_cost PARAMS ((rtx));
static void mips_encode_section_info PARAMS ((tree, rtx, int));
+static void mips_file_start PARAMS ((void));
static void mips_file_end PARAMS ((void));
/* Structure to be filled in by compute_frame_size with register
@@ -836,8 +839,10 @@ const struct mips_cpu_info mips_cpu_info_table[] = {
#define TARGET_ASM_UNALIGNED_HI_OP "\t.align 0\n\t.half\t"
#undef TARGET_ASM_UNALIGNED_SI_OP
#define TARGET_ASM_UNALIGNED_SI_OP "\t.align 0\n\t.word\t"
+/* The IRIX 6 O32 assembler gives an error for `align 0; .dword', contrary
+ to the documentation, so disable it. */
#undef TARGET_ASM_UNALIGNED_DI_OP
-#define TARGET_ASM_UNALIGNED_DI_OP "\t.align 0\n\t.dword\t"
+#define TARGET_ASM_UNALIGNED_DI_OP NULL
#endif
#undef TARGET_ASM_FUNCTION_PROLOGUE
@@ -872,12 +877,17 @@ const struct mips_cpu_info mips_cpu_info_table[] = {
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG mips_reorg
+#undef TARGET_ASM_FILE_START
#undef TARGET_ASM_FILE_END
#ifdef TARGET_IRIX6
+#define TARGET_ASM_FILE_START iris6_file_start
#define TARGET_ASM_FILE_END iris6_file_end
#else
+#define TARGET_ASM_FILE_START mips_file_start
#define TARGET_ASM_FILE_END mips_file_end
#endif
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -3676,569 +3686,166 @@ mips_set_return_address (address, scratch)
emit_move_insn (gen_rtx_MEM (GET_MODE (address), scratch), address);
}
-/* Write a loop to move a constant number of bytes.
- Generate load/stores as follows:
-
- do {
- temp1 = src[0];
- temp2 = src[1];
- ...
- temp<last> = src[MAX_MOVE_REGS-1];
- dest[0] = temp1;
- dest[1] = temp2;
- ...
- dest[MAX_MOVE_REGS-1] = temp<last>;
- src += MAX_MOVE_REGS;
- dest += MAX_MOVE_REGS;
- } while (src != final);
-
- This way, no NOP's are needed, and only MAX_MOVE_REGS+3 temp
- registers are needed.
-
- Aligned moves move MAX_MOVE_REGS*4 bytes every (2*MAX_MOVE_REGS)+3
- cycles, unaligned moves move MAX_MOVE_REGS*4 bytes every
- (4*MAX_MOVE_REGS)+3 cycles, assuming no cache misses. */
-
-#define MAX_MOVE_REGS 4
-#define MAX_MOVE_BYTES (MAX_MOVE_REGS * UNITS_PER_WORD)
+/* Emit straight-line code to move LENGTH bytes from SRC to DEST.
+ Assume that the areas do not overlap. */
static void
-block_move_loop (dest_reg, src_reg, bytes, align, orig_dest, orig_src)
- rtx dest_reg; /* register holding destination address */
- rtx src_reg; /* register holding source address */
- unsigned int bytes; /* # bytes to move */
- int align; /* alignment */
- rtx orig_dest; /* original dest */
- rtx orig_src; /* original source for making a reg note */
-{
- rtx dest_mem = replace_equiv_address (orig_dest, dest_reg);
- rtx src_mem = replace_equiv_address (orig_src, src_reg);
- rtx align_rtx = GEN_INT (align);
- rtx label;
- rtx final_src;
- rtx bytes_rtx;
- int leftover;
-
- if (bytes < (unsigned)2 * MAX_MOVE_BYTES)
- abort ();
+mips_block_move_straight (dest, src, length)
+ rtx dest, src;
+ HOST_WIDE_INT length;
+{
+ HOST_WIDE_INT offset, delta;
+ unsigned HOST_WIDE_INT bits;
+ int i;
+ enum machine_mode mode;
+ rtx *regs;
+
+ /* Work out how many bits to move at a time. If both operands have
+ half-word alignment, it is usually better to move in half words.
+ For instance, lh/lh/sh/sh is usually better than lwl/lwr/swl/swr
+ and lw/lw/sw/sw is usually better than ldl/ldr/sdl/sdr.
+ Otherwise move word-sized chunks. */
+ if (MEM_ALIGN (src) == BITS_PER_WORD / 2
+ && MEM_ALIGN (dest) == BITS_PER_WORD / 2)
+ bits = BITS_PER_WORD / 2;
+ else
+ bits = BITS_PER_WORD;
- leftover = bytes % MAX_MOVE_BYTES;
- bytes -= leftover;
+ mode = mode_for_size (bits, MODE_INT, 0);
+ delta = bits / BITS_PER_UNIT;
- label = gen_label_rtx ();
- final_src = gen_reg_rtx (Pmode);
- bytes_rtx = GEN_INT (bytes);
+ /* Allocate a buffer for the temporary registers. */
+ regs = alloca (sizeof (rtx) * length / delta);
- if (bytes > 0x7fff)
- {
- if (Pmode == DImode)
- {
- emit_insn (gen_movdi (final_src, bytes_rtx));
- emit_insn (gen_adddi3 (final_src, final_src, src_reg));
- }
- else
- {
- emit_insn (gen_movsi (final_src, bytes_rtx));
- emit_insn (gen_addsi3 (final_src, final_src, src_reg));
- }
- }
- else
+ /* Load as many BITS-sized chunks as possible. Use a normal load if
+ the source has enough alignment, otherwise use left/right pairs. */
+ for (offset = 0, i = 0; offset + delta <= length; offset += delta, i++)
{
- if (Pmode == DImode)
- emit_insn (gen_adddi3 (final_src, src_reg, bytes_rtx));
- else
- emit_insn (gen_addsi3 (final_src, src_reg, bytes_rtx));
- }
-
- emit_label (label);
+ rtx part;
- bytes_rtx = GEN_INT (MAX_MOVE_BYTES);
- emit_insn (gen_movstrsi_internal (dest_mem, src_mem, bytes_rtx, align_rtx));
+ regs[i] = gen_reg_rtx (mode);
+ part = adjust_address (src, mode, offset);
+ if (MEM_ALIGN (part) >= bits)
+ emit_move_insn (regs[i], part);
+ else if (!mips_expand_unaligned_load (regs[i], part, bits, 0))
+ abort ();
+ }
- if (Pmode == DImode)
+ /* Copy the chunks to the destination. */
+ for (offset = 0, i = 0; offset + delta <= length; offset += delta, i++)
{
- emit_insn (gen_adddi3 (src_reg, src_reg, bytes_rtx));
- emit_insn (gen_adddi3 (dest_reg, dest_reg, bytes_rtx));
- emit_insn (gen_cmpdi (src_reg, final_src));
+ rtx part;
+
+ part = adjust_address (dest, mode, offset);
+ if (MEM_ALIGN (part) >= bits)
+ emit_move_insn (part, regs[i]);
+ else if (!mips_expand_unaligned_store (part, regs[i], bits, 0))
+ abort ();
}
- else
+
+ /* Mop up any left-over bytes. */
+ if (offset < length)
{
- emit_insn (gen_addsi3 (src_reg, src_reg, bytes_rtx));
- emit_insn (gen_addsi3 (dest_reg, dest_reg, bytes_rtx));
- emit_insn (gen_cmpsi (src_reg, final_src));
+ src = adjust_address (src, mode, offset);
+ dest = adjust_address (dest, mode, offset);
+ move_by_pieces (dest, src, length - offset,
+ MIN (MEM_ALIGN (src), MEM_ALIGN (dest)), 0);
}
-
- emit_jump_insn (gen_bne (label));
-
- if (leftover)
- emit_insn (gen_movstrsi_internal (dest_mem, src_mem, GEN_INT (leftover),
- align_rtx));
}
-/* Use a library function to move some bytes. */
-
-static void
-block_move_call (dest_reg, src_reg, bytes_rtx)
- rtx dest_reg;
- rtx src_reg;
- rtx bytes_rtx;
-{
- /* We want to pass the size as Pmode, which will normally be SImode
- but will be DImode if we are using 64 bit longs and pointers. */
- if (GET_MODE (bytes_rtx) != VOIDmode
- && GET_MODE (bytes_rtx) != (unsigned) Pmode)
- bytes_rtx = convert_to_mode (Pmode, bytes_rtx, 1);
-
-#ifdef TARGET_MEM_FUNCTIONS
- 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,
- VOIDmode, 3, src_reg, Pmode, dest_reg, Pmode,
- convert_to_mode (TYPE_MODE (integer_type_node), bytes_rtx,
- TREE_UNSIGNED (integer_type_node)),
- TYPE_MODE (integer_type_node));
-#endif
-}
-
-/* Expand string/block move operations.
-
- operands[0] is the pointer to the destination.
- operands[1] is the pointer to the source.
- operands[2] is the number of bytes to move.
- operands[3] is the alignment. */
+#define MAX_MOVE_REGS 4
+#define MAX_MOVE_BYTES (MAX_MOVE_REGS * UNITS_PER_WORD)
-void
-expand_block_move (operands)
- rtx operands[];
-{
- rtx bytes_rtx = operands[2];
- rtx align_rtx = operands[3];
- int constp = GET_CODE (bytes_rtx) == CONST_INT;
- unsigned HOST_WIDE_INT bytes = constp ? INTVAL (bytes_rtx) : 0;
- unsigned int align = INTVAL (align_rtx);
- rtx orig_src = operands[1];
- rtx orig_dest = operands[0];
- rtx src_reg;
- rtx dest_reg;
-
- if (constp && bytes == 0)
- return;
- if (align > (unsigned) UNITS_PER_WORD)
- align = UNITS_PER_WORD;
+/* Helper function for doing a loop-based block operation on memory
+ reference MEM. Each iteration of the loop will operate on LENGTH
+ bytes of MEM.
- /* Move the address into scratch registers. */
- dest_reg = copy_addr_to_reg (XEXP (orig_dest, 0));
- src_reg = copy_addr_to_reg (XEXP (orig_src, 0));
+ Create a new base register for use within the loop and point it to
+ the start of MEM. Create a new memory reference that uses this
+ register. Store them in *LOOP_REG and *LOOP_MEM respectively. */
- if (TARGET_MEMCPY)
- block_move_call (dest_reg, src_reg, bytes_rtx);
+static void
+mips_adjust_block_mem (mem, length, loop_reg, loop_mem)
+ rtx mem, *loop_reg, *loop_mem;
+ HOST_WIDE_INT length;
+{
+ *loop_reg = copy_addr_to_reg (XEXP (mem, 0));
- else if (constp && bytes <= (unsigned)2 * MAX_MOVE_BYTES
- && align == (unsigned) UNITS_PER_WORD)
- move_by_pieces (orig_dest, orig_src, bytes, align * BITS_PER_WORD, 0);
+ /* Although the new mem does not refer to a known location,
+ it does keep up to LENGTH bytes of alignment. */
+ *loop_mem = change_address (mem, BLKmode, *loop_reg);
+ set_mem_align (*loop_mem, MIN (MEM_ALIGN (mem), length * BITS_PER_UNIT));
+}
- else if (constp && bytes <= (unsigned)2 * MAX_MOVE_BYTES)
- emit_insn (gen_movstrsi_internal (replace_equiv_address (orig_dest,
- dest_reg),
- replace_equiv_address (orig_src,
- src_reg),
- bytes_rtx, align_rtx));
- else if (constp && align >= (unsigned) UNITS_PER_WORD && optimize)
- block_move_loop (dest_reg, src_reg, bytes, align, orig_dest, orig_src);
+/* Move LENGTH bytes from SRC to DEST using a loop that moves MAX_MOVE_BYTES
+ per iteration. LENGTH must be at least MAX_MOVE_BYTES. Assume that the
+ memory regions do not overlap. */
- else if (constp && optimize)
- {
- /* If the alignment is not word aligned, generate a test at
- runtime, to see whether things wound up aligned, and we
- can use the faster lw/sw instead ulw/usw. */
+static void
+mips_block_move_loop (dest, src, length)
+ rtx dest, src;
+ HOST_WIDE_INT length;
+{
+ rtx label, src_reg, dest_reg, final_src;
+ HOST_WIDE_INT leftover;
- rtx temp = gen_reg_rtx (Pmode);
- rtx aligned_label = gen_label_rtx ();
- rtx join_label = gen_label_rtx ();
- int leftover = bytes % MAX_MOVE_BYTES;
+ leftover = length % MAX_MOVE_BYTES;
+ length -= leftover;
- bytes -= leftover;
+ /* Create registers and memory references for use within the loop. */
+ mips_adjust_block_mem (src, MAX_MOVE_BYTES, &src_reg, &src);
+ mips_adjust_block_mem (dest, MAX_MOVE_BYTES, &dest_reg, &dest);
- if (Pmode == DImode)
- {
- emit_insn (gen_iordi3 (temp, src_reg, dest_reg));
- emit_insn (gen_anddi3 (temp, temp, GEN_INT (UNITS_PER_WORD - 1)));
- emit_insn (gen_cmpdi (temp, const0_rtx));
- }
- else
- {
- emit_insn (gen_iorsi3 (temp, src_reg, dest_reg));
- emit_insn (gen_andsi3 (temp, temp, GEN_INT (UNITS_PER_WORD - 1)));
- emit_insn (gen_cmpsi (temp, const0_rtx));
- }
+ /* Calculate the value that SRC_REG should have after the last iteration
+ of the loop. */
+ final_src = expand_simple_binop (Pmode, PLUS, src_reg, GEN_INT (length),
+ 0, 0, OPTAB_WIDEN);
- emit_jump_insn (gen_beq (aligned_label));
-
- /* Unaligned loop. */
- block_move_loop (dest_reg, src_reg, bytes, 1, orig_dest, orig_src);
- emit_jump_insn (gen_jump (join_label));
- emit_barrier ();
+ /* Emit the start of the loop. */
+ label = gen_label_rtx ();
+ emit_label (label);
- /* Aligned loop. */
- emit_label (aligned_label);
- block_move_loop (dest_reg, src_reg, bytes, UNITS_PER_WORD, orig_dest,
- orig_src);
- emit_label (join_label);
+ /* Emit the loop body. */
+ mips_block_move_straight (dest, src, MAX_MOVE_BYTES);
- /* Bytes at the end of the loop. */
- if (leftover)
- emit_insn (gen_movstrsi_internal (replace_equiv_address (orig_dest,
- dest_reg),
- replace_equiv_address (orig_src,
- src_reg),
- GEN_INT (leftover),
- GEN_INT (align)));
- }
+ /* Move on to the next block. */
+ emit_move_insn (src_reg, plus_constant (src_reg, MAX_MOVE_BYTES));
+ emit_move_insn (dest_reg, plus_constant (dest_reg, MAX_MOVE_BYTES));
+ /* Emit the loop condition. */
+ if (Pmode == DImode)
+ emit_insn (gen_cmpdi (src_reg, final_src));
else
- block_move_call (dest_reg, src_reg, bytes_rtx);
+ emit_insn (gen_cmpsi (src_reg, final_src));
+ emit_jump_insn (gen_bne (label));
+
+ /* Mop up any left-over bytes. */
+ if (leftover)
+ mips_block_move_straight (dest, src, leftover);
}
-/* Emit load/stores for a small constant block_move.
-
- operands[0] is the memory address of the destination.
- operands[1] is the memory address of the source.
- operands[2] is the number of bytes to move.
- operands[3] is the alignment.
- operands[4] is a temp register.
- operands[5] is a temp register.
- ...
- operands[3+num_regs] is the last temp register.
-
- The block move type can be one of the following:
- BLOCK_MOVE_NORMAL Do all of the block move.
- BLOCK_MOVE_NOT_LAST Do all but the last store.
- BLOCK_MOVE_LAST Do just the last store. */
-
-const char *
-output_block_move (insn, operands, num_regs, move_type)
- rtx insn;
- rtx operands[];
- int num_regs;
- enum block_move_type move_type;
-{
- rtx dest_reg = XEXP (operands[0], 0);
- rtx src_reg = XEXP (operands[1], 0);
- HOST_WIDE_INT bytes = INTVAL (operands[2]);
- int align = INTVAL (operands[3]);
- int num = 0;
- int offset = 0;
- int use_lwl_lwr = 0;
- int last_operand = num_regs + 4;
- int safe_regs = 4;
- int i;
- rtx xoperands[10];
-
- struct {
- const char *load; /* load insn without nop */
- const char *load_nop; /* load insn with trailing nop */
- const char *store; /* store insn */
- const char *final; /* if last_store used: NULL or swr */
- const char *last_store; /* last store instruction */
- int offset; /* current offset */
- enum machine_mode mode; /* mode to use on (MEM) */
- } load_store[4];
-
- /* ??? Detect a bug in GCC, where it can give us a register
- the same as one of the addressing registers and reduce
- the number of registers available. */
- for (i = 4; i < last_operand && safe_regs < (int) ARRAY_SIZE (xoperands); i++)
- if (! reg_mentioned_p (operands[i], operands[0])
- && ! reg_mentioned_p (operands[i], operands[1]))
- xoperands[safe_regs++] = operands[i];
-
- if (safe_regs < last_operand)
- {
- xoperands[0] = operands[0];
- xoperands[1] = operands[1];
- xoperands[2] = operands[2];
- xoperands[3] = operands[3];
- return output_block_move (insn, xoperands, safe_regs - 4, move_type);
- }
-
- /* If we are given global or static addresses, and we would be
- emitting a few instructions, try to save time by using a
- temporary register for the pointer. */
- /* ??? The SGI Irix6 assembler fails when a SYMBOL_REF is used in
- an ldl/ldr instruction pair. We play it safe, and always move
- constant addresses into registers when generating N32/N64 code, just
- in case we might emit an unaligned load instruction. */
- if (num_regs > 2 && (bytes > 2 * align || move_type != BLOCK_MOVE_NORMAL
- || mips_abi == ABI_N32
- || mips_abi == ABI_64))
- {
- if (CONSTANT_P (src_reg))
- {
- src_reg = operands[3 + num_regs--];
- if (move_type != BLOCK_MOVE_LAST)
- {
- xoperands[1] = operands[1];
- xoperands[0] = src_reg;
- if (Pmode == DImode)
- output_asm_insn ("dla\t%0,%1", xoperands);
- else
- output_asm_insn ("la\t%0,%1", xoperands);
- }
- }
-
- if (CONSTANT_P (dest_reg))
- {
- dest_reg = operands[3 + num_regs--];
- if (move_type != BLOCK_MOVE_LAST)
- {
- xoperands[1] = operands[0];
- xoperands[0] = dest_reg;
- if (Pmode == DImode)
- output_asm_insn ("dla\t%0,%1", xoperands);
- else
- output_asm_insn ("la\t%0,%1", xoperands);
- }
- }
- }
+/* Expand a movstrsi instruction. */
- /* ??? We really shouldn't get any LO_SUM addresses here, because they
- are not offsettable, however, offsettable_address_p says they are
- offsettable. I think this is a bug in offsettable_address_p.
- For expediency, we fix this by just loading the address into a register
- if we happen to get one. */
-
- if (GET_CODE (src_reg) == LO_SUM)
+bool
+mips_expand_block_move (dest, src, length)
+ rtx dest, src, length;
+{
+ if (GET_CODE (length) == CONST_INT)
{
- src_reg = operands[3 + num_regs--];
- if (move_type != BLOCK_MOVE_LAST)
+ if (INTVAL (length) <= 2 * MAX_MOVE_BYTES)
{
- xoperands[2] = XEXP (XEXP (operands[1], 0), 1);
- xoperands[1] = XEXP (XEXP (operands[1], 0), 0);
- xoperands[0] = src_reg;
- if (Pmode == DImode)
- output_asm_insn ("daddiu\t%0,%1,%%lo(%2)", xoperands);
- else
- output_asm_insn ("addiu\t%0,%1,%%lo(%2)", xoperands);
+ mips_block_move_straight (dest, src, INTVAL (length));
+ return true;
}
- }
-
- if (GET_CODE (dest_reg) == LO_SUM)
- {
- dest_reg = operands[3 + num_regs--];
- if (move_type != BLOCK_MOVE_LAST)
+ else if (optimize)
{
- xoperands[2] = XEXP (XEXP (operands[0], 0), 1);
- xoperands[1] = XEXP (XEXP (operands[0], 0), 0);
- xoperands[0] = dest_reg;
- if (Pmode == DImode)
- output_asm_insn ("daddiu\t%0,%1,%%lo(%2)", xoperands);
- else
- output_asm_insn ("addiu\t%0,%1,%%lo(%2)", xoperands);
+ mips_block_move_loop (dest, src, INTVAL (length));
+ return true;
}
}
-
- if (num_regs > (int) ARRAY_SIZE (load_store))
- num_regs = ARRAY_SIZE (load_store);
-
- else if (num_regs < 1)
- abort_with_insn (insn,
- "cannot do block move, not enough scratch registers");
-
- while (bytes > 0)
- {
- load_store[num].offset = offset;
-
- if (TARGET_64BIT && bytes >= 8 && align >= 8)
- {
- load_store[num].load = "ld\t%0,%1";
- load_store[num].load_nop = "ld\t%0,%1%#";
- load_store[num].store = "sd\t%0,%1";
- load_store[num].last_store = "sd\t%0,%1";
- load_store[num].final = 0;
- load_store[num].mode = DImode;
- offset += 8;
- bytes -= 8;
- }
-
- /* ??? Fails because of a MIPS assembler bug? */
- else if (TARGET_64BIT && bytes >= 8
- && ! TARGET_SR71K
- && ! TARGET_MIPS16)
- {
- if (BYTES_BIG_ENDIAN)
- {
- load_store[num].load = "ldl\t%0,%1\n\tldr\t%0,%2";
- load_store[num].load_nop = "ldl\t%0,%1\n\tldr\t%0,%2%#";
- load_store[num].store = "sdl\t%0,%1\n\tsdr\t%0,%2";
- load_store[num].last_store = "sdr\t%0,%2";
- load_store[num].final = "sdl\t%0,%1";
- }
- else
- {
- load_store[num].load = "ldl\t%0,%2\n\tldr\t%0,%1";
- load_store[num].load_nop = "ldl\t%0,%2\n\tldr\t%0,%1%#";
- load_store[num].store = "sdl\t%0,%2\n\tsdr\t%0,%1";
- load_store[num].last_store = "sdr\t%0,%1";
- load_store[num].final = "sdl\t%0,%2";
- }
-
- load_store[num].mode = DImode;
- offset += 8;
- bytes -= 8;
- use_lwl_lwr = 1;
- }
-
- else if (bytes >= 4 && align >= 4)
- {
- load_store[num].load = "lw\t%0,%1";
- load_store[num].load_nop = "lw\t%0,%1%#";
- load_store[num].store = "sw\t%0,%1";
- load_store[num].last_store = "sw\t%0,%1";
- load_store[num].final = 0;
- load_store[num].mode = SImode;
- offset += 4;
- bytes -= 4;
- }
-
- else if (bytes >= 4
- && ! TARGET_SR71K
- && ! TARGET_MIPS16)
- {
- if (BYTES_BIG_ENDIAN)
- {
- load_store[num].load = "lwl\t%0,%1\n\tlwr\t%0,%2";
- load_store[num].load_nop = "lwl\t%0,%1\n\tlwr\t%0,%2%#";
- load_store[num].store = "swl\t%0,%1\n\tswr\t%0,%2";
- load_store[num].last_store = "swr\t%0,%2";
- load_store[num].final = "swl\t%0,%1";
- }
- else
- {
- load_store[num].load = "lwl\t%0,%2\n\tlwr\t%0,%1";
- load_store[num].load_nop = "lwl\t%0,%2\n\tlwr\t%0,%1%#";
- load_store[num].store = "swl\t%0,%2\n\tswr\t%0,%1";
- load_store[num].last_store = "swr\t%0,%1";
- load_store[num].final = "swl\t%0,%2";
- }
-
- load_store[num].mode = SImode;
- offset += 4;
- bytes -= 4;
- use_lwl_lwr = 1;
- }
-
- else if (bytes >= 2 && align >= 2)
- {
- load_store[num].load = "lh\t%0,%1";
- load_store[num].load_nop = "lh\t%0,%1%#";
- load_store[num].store = "sh\t%0,%1";
- load_store[num].last_store = "sh\t%0,%1";
- load_store[num].final = 0;
- load_store[num].mode = HImode;
- offset += 2;
- bytes -= 2;
- }
- else
- {
- load_store[num].load = "lb\t%0,%1";
- load_store[num].load_nop = "lb\t%0,%1%#";
- load_store[num].store = "sb\t%0,%1";
- load_store[num].last_store = "sb\t%0,%1";
- load_store[num].final = 0;
- load_store[num].mode = QImode;
- offset++;
- bytes--;
- }
-
- /* Emit load/stores now if we have run out of registers or are
- at the end of the move. */
-
- if (++num == num_regs || bytes == 0)
- {
- /* If only load/store, we need a NOP after the load. */
- if (num == 1)
- load_store[0].load = load_store[0].load_nop;
-
- if (move_type != BLOCK_MOVE_LAST)
- {
- for (i = 0; i < num; i++)
- {
- int offset;
-
- if (!operands[i + 4])
- 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]));
-
- offset = load_store[i].offset;
- xoperands[0] = operands[i + 4];
- 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));
- }
-
- output_asm_insn (load_store[i].load, xoperands);
- }
- }
-
- for (i = 0; i < num; i++)
- {
- int last_p = (i == num-1 && bytes == 0);
- 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));
-
-
- 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));
- }
-
- if (move_type == BLOCK_MOVE_NORMAL)
- output_asm_insn (load_store[i].store, xoperands);
-
- else if (move_type == BLOCK_MOVE_NOT_LAST)
- {
- if (!last_p)
- output_asm_insn (load_store[i].store, xoperands);
-
- else if (load_store[i].final != 0)
- output_asm_insn (load_store[i].final, xoperands);
- }
-
- else if (last_p)
- output_asm_insn (load_store[i].last_store, xoperands);
- }
-
- num = 0; /* reset load_store */
- use_lwl_lwr = 0;
- }
- }
-
- return "";
+ return false;
}
/* Argument support functions. */
@@ -6501,11 +6108,10 @@ mips_output_ascii (stream, string_param, len)
relevant .comm/.lcomm/.extern/.sdata declaration when the code is
processed, it generates a two instruction sequence. */
-void
-mips_asm_file_start (stream)
- FILE *stream;
+static void
+mips_file_start ()
{
- ASM_OUTPUT_SOURCE_FILENAME (stream, main_input_filename);
+ default_file_start ();
/* Versions of the MIPS assembler before 2.20 generate errors if a branch
inside of a .set noreorder section jumps to a label outside of the .set
@@ -6513,7 +6119,7 @@ mips_asm_file_start (stream)
fixing the bug. */
if (TARGET_MIPS_AS && optimize && flag_delayed_branch)
- fprintf (stream, "\t.set\tnobopt\n");
+ fprintf (asm_out_file, "\t.set\tnobopt\n");
if (TARGET_GAS)
{
@@ -6541,28 +6147,26 @@ mips_asm_file_start (stream)
because in this way we can avoid creating an allocated section. We
do not want this section to take up any space in the running
executable. */
- fprintf (stream, "\t.section .mdebug.%s\n", abi_string);
+ fprintf (asm_out_file, "\t.section .mdebug.%s\n", abi_string);
/* Restore the default section. */
- fprintf (stream, "\t.previous\n");
+ fprintf (asm_out_file, "\t.previous\n");
#endif
}
-
-
/* Generate the pseudo ops that System V.4 wants. */
#ifndef ABICALLS_ASM_OP
#define ABICALLS_ASM_OP "\t.abicalls"
#endif
if (TARGET_ABICALLS)
/* ??? but do not want this (or want pic0) if -non-shared? */
- fprintf (stream, "%s\n", ABICALLS_ASM_OP);
+ fprintf (asm_out_file, "%s\n", ABICALLS_ASM_OP);
if (TARGET_MIPS16)
- fprintf (stream, "\t.set\tmips16\n");
+ fprintf (asm_out_file, "\t.set\tmips16\n");
if (flag_verbose_asm)
- fprintf (stream, "\n%s -G value = %d, Arch = %s, ISA = %d\n",
+ fprintf (asm_out_file, "\n%s -G value = %d, Arch = %s, ISA = %d\n",
ASM_COMMENT_START,
mips_section_threshold, mips_arch_info->name, mips_isa);
}
@@ -7286,7 +6890,7 @@ mips_output_function_prologue (file, size)
#ifdef SDB_DEBUGGING_INFO
if (debug_info_level != DINFO_LEVEL_TERSE && write_symbols == SDB_DEBUG)
- ASM_OUTPUT_SOURCE_LINE (file, DECL_SOURCE_LINE (current_function_decl));
+ ASM_OUTPUT_SOURCE_LINE (file, DECL_SOURCE_LINE (current_function_decl), 0);
#endif
/* In mips16 mode, we may need to generate a 32 bit to handle
@@ -10022,7 +9626,7 @@ mips_output_conditional_branch (insn,
/* The kind of comparison we are doing. */
enum rtx_code code = GET_CODE (operands[0]);
/* Nonzero if the opcode for the comparison needs a `z' indicating
- that it is a comparision against zero. */
+ that it is a comparison against zero. */
int need_z_p;
/* A string to use in the assembly output to represent the first
operand. */
@@ -10260,7 +9864,7 @@ mips_output_conditional_branch (insn,
strcpy (buffer, "%(%<%[");
c = strchr (buffer, '\0');
- /* Generate the reversed comparision. This takes four
+ /* Generate the reversed comparison. This takes four
bytes. */
if (float_p)
sprintf (c, "%%*b%s\t%%Z2%s",
@@ -10684,8 +10288,8 @@ static FILE *iris_orig_asm_out_file;
static int
iris_section_align_entry_eq (p1, p2)
- const PTR p1;
- const PTR p2;
+ const void *p1;
+ const void *p2;
{
const struct iris_section_align_entry *old = p1;
const char *new = p2;
@@ -10695,7 +10299,7 @@ iris_section_align_entry_eq (p1, p2)
static hashval_t
iris_section_align_entry_hash (p)
- const PTR p;
+ const void *p;
{
const struct iris_section_align_entry *old = p;
return htab_hash_string (old->name);
@@ -10736,15 +10340,13 @@ iris6_asm_output_align (file, log)
switching games so that we can emit a .section directive at the
beginning of the file with the proper alignment attached. */
-void
-iris6_asm_file_start (stream)
- FILE *stream;
+static void
+iris6_file_start ()
{
- mips_asm_file_start (stream);
+ mips_file_start ();
iris_orig_asm_out_file = asm_out_file;
- stream = tmpfile ();
- asm_out_file = stream;
+ asm_out_file = tmpfile ();
iris_section_align_htab = htab_create (31, iris_section_align_entry_hash,
iris_section_align_entry_eq, NULL);
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 9dd5dc68865..40ea4df9364 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -26,7 +26,6 @@ Boston, MA 02111-1307, USA. */
/* Standard GCC variables that we reference. */
-extern char *asm_file_name;
extern char call_used_regs[];
extern int may_call_alloca;
extern char **save_argv;
@@ -95,15 +94,6 @@ enum mips_abicalls_type {
/* Recast the abicalls class to be the abicalls attribute. */
#define mips_abicalls_attr ((enum attr_abicalls)mips_abicalls)
-/* Which type of block move to do (whether or not the last store is
- split out so it can fill a branch delay slot). */
-
-enum block_move_type {
- BLOCK_MOVE_NORMAL, /* generate complete block move */
- BLOCK_MOVE_NOT_LAST, /* generate all but last store */
- BLOCK_MOVE_LAST /* generate just the last store */
-};
-
/* Information about one recognized processor. Defined here for the
benefit of TARGET_CPU_CPP_BUILTINS. */
struct mips_cpu_info {
@@ -131,8 +121,6 @@ extern int file_in_function_warning; /* warning given about .file in func */
extern int sdb_label_count; /* block start/end next label # */
extern int sdb_begin_function_line; /* Starting Line of current function */
extern int mips_section_threshold; /* # bytes of data/sdata cutoff */
-/* extern unsigned HOST_WIDE_INT g_switch_value; */ /* value of the -G xx switch */
-extern int g_switch_set; /* whether -G xx was passed. */
extern int sym_lineno; /* sgi next label # for each stmt */
extern int set_noreorder; /* # of nested .set noreorder's */
extern int set_nomacro; /* # of nested .set nomacro's */
@@ -1400,7 +1388,7 @@ do { \
#define PUT_SDB_FUNCTION_END(LINE) \
do { \
- ASM_OUTPUT_SOURCE_LINE (asm_out_file, LINE + sdb_begin_function_line); \
+ ASM_OUTPUT_SOURCE_LINE (asm_out_file, LINE + sdb_begin_function_line, 0); \
} while (0)
#define PUT_SDB_EPILOGUE_END(NAME)
@@ -3288,17 +3276,6 @@ typedef struct mips_args {
/* Control the assembler format that we output. */
-/* Output at beginning of assembler file.
- If we are optimizing to use the global pointer, create a temporary
- file to hold all of the text stuff, and write it out to the end.
- This is needed because the MIPS assembler is evidently one pass,
- and if it hasn't seen the relevant .comm/.lcomm/.extern/.sdata
- declaration when the code is processed, it generates a two
- instruction sequence. */
-
-#undef ASM_FILE_START
-#define ASM_FILE_START(STREAM) mips_asm_file_start (STREAM)
-
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
@@ -3716,7 +3693,7 @@ while (0)
#endif
#ifndef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE, COUNTER) \
mips_output_lineno (STREAM, LINE)
#endif
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 3bc3f85a036..2841369f92f 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -640,7 +640,8 @@
{
if (ISA_HAS_COND_TRAP)
return \"teq\\t$0,$0\";
- else if (TARGET_MIPS16)
+ /* The IRIX 6 O32 assembler requires the first break operand. */
+ else if (TARGET_MIPS16 || ! TARGET_GAS)
return \"break 0\";
else
return \"break\";
@@ -5460,151 +5461,15 @@ move\\t%0,%z4\\n\\
(define_expand "movstrsi"
[(parallel [(set (match_operand:BLK 0 "general_operand" "")
(match_operand:BLK 1 "general_operand" ""))
- (use (match_operand:SI 2 "arith32_operand" ""))
- (use (match_operand:SI 3 "immediate_operand" ""))])]
- "!TARGET_MIPS16"
- "
-{
- if (operands[0]) /* avoid unused code messages */
- {
- expand_block_move (operands);
+ (use (match_operand:SI 2 "" ""))
+ (use (match_operand:SI 3 "const_int_operand" ""))])]
+ "!TARGET_MIPS16 && !TARGET_MEMCPY"
+ {
+ if (mips_expand_block_move (operands[0], operands[1], operands[2]))
DONE;
- }
-}")
-
-;; Insn generated by block moves
-
-(define_insn "movstrsi_internal"
- [(set (match_operand:BLK 0 "memory_operand" "=o") ;; destination
- (match_operand:BLK 1 "memory_operand" "o")) ;; source
- (clobber (match_scratch:SI 4 "=&d")) ;; temp 1
- (clobber (match_scratch:SI 5 "=&d")) ;; temp 2
- (clobber (match_scratch:SI 6 "=&d")) ;; temp 3
- (clobber (match_scratch:SI 7 "=&d")) ;; temp 4
- (use (match_operand:SI 2 "small_int" "I")) ;; # bytes to move
- (use (match_operand:SI 3 "small_int" "I")) ;; alignment
- (use (const_int 0))] ;; normal block move
- ""
- "* return output_block_move (insn, operands, 4, BLOCK_MOVE_NORMAL);"
- [(set_attr "type" "store")
- (set_attr "mode" "none")
- (set_attr "length" "80")])
-
-;; We need mips16 versions, because an offset from the stack pointer
-;; is not offsettable, since the stack pointer can only handle 4 and 8
-;; byte loads.
-
-(define_insn ""
- [(set (match_operand:BLK 0 "memory_operand" "=o") ;; destination
- (match_operand:BLK 1 "memory_operand" "o")) ;; source
- (clobber (match_scratch:SI 4 "=&d")) ;; temp 1
- (clobber (match_scratch:SI 5 "=&d")) ;; temp 2
- (clobber (match_scratch:SI 6 "=&d")) ;; temp 3
- (clobber (match_scratch:SI 7 "=&d")) ;; temp 4
- (use (match_operand:SI 2 "small_int" "I")) ;; # bytes to move
- (use (match_operand:SI 3 "small_int" "I")) ;; alignment
- (use (const_int 0))] ;; normal block move
- "TARGET_MIPS16"
- "* return output_block_move (insn, operands, 4, BLOCK_MOVE_NORMAL);"
- [(set_attr "type" "multi")
- (set_attr "mode" "none")
- (set_attr "length" "80")])
-
-;; Split a block move into 2 parts, the first part is everything
-;; except for the last move, and the second part is just the last
-;; store, which is exactly 1 instruction (ie, not a usw), so it can
-;; fill a delay slot. This also prevents a bug in delayed branches
-;; from showing up, which reuses one of the registers in our clobbers.
-
-;; ??? Disabled because it doesn't preserve alias information for
-;; operands 0 and 1. Also, the rtl for the second insn doesn't mention
-;; that it uses the registers clobbered by the first.
-;;
-;; It would probably be better to split the block into individual
-;; instructions instead.
-(define_split
- [(set (mem:BLK (match_operand:SI 0 "register_operand" ""))
- (mem:BLK (match_operand:SI 1 "register_operand" "")))
- (clobber (match_operand:SI 4 "register_operand" ""))
- (clobber (match_operand:SI 5 "register_operand" ""))
- (clobber (match_operand:SI 6 "register_operand" ""))
- (clobber (match_operand:SI 7 "register_operand" ""))
- (use (match_operand:SI 2 "small_int" ""))
- (use (match_operand:SI 3 "small_int" ""))
- (use (const_int 0))]
-
- "reload_completed && 0 && INTVAL (operands[2]) > 0"
-
- ;; All but the last move
- [(parallel [(set (mem:BLK (match_dup 0))
- (mem:BLK (match_dup 1)))
- (clobber (match_dup 4))
- (clobber (match_dup 5))
- (clobber (match_dup 6))
- (clobber (match_dup 7))
- (use (match_dup 2))
- (use (match_dup 3))
- (use (const_int 1))])
-
- ;; The last store, so it can fill a delay slot
- (parallel [(set (mem:BLK (match_dup 0))
- (mem:BLK (match_dup 1)))
- (clobber (match_dup 4))
- (clobber (match_dup 5))
- (clobber (match_dup 6))
- (clobber (match_dup 7))
- (use (match_dup 2))
- (use (match_dup 3))
- (use (const_int 2))])]
-
- "")
-
-(define_insn "movstrsi_internal2"
- [(set (match_operand:BLK 0 "memory_operand" "=o") ;; destination
- (match_operand:BLK 1 "memory_operand" "o")) ;; source
- (clobber (match_scratch:SI 4 "=&d")) ;; temp 1
- (clobber (match_scratch:SI 5 "=&d")) ;; temp 2
- (clobber (match_scratch:SI 6 "=&d")) ;; temp 3
- (clobber (match_scratch:SI 7 "=&d")) ;; temp 4
- (use (match_operand:SI 2 "small_int" "I")) ;; # bytes to move
- (use (match_operand:SI 3 "small_int" "I")) ;; alignment
- (use (const_int 1))] ;; all but last store
- ""
- "* return output_block_move (insn, operands, 4, BLOCK_MOVE_NOT_LAST);"
- [(set_attr "type" "store")
- (set_attr "mode" "none")
- (set_attr "length" "80")])
-
-(define_insn ""
- [(set (match_operand:BLK 0 "memory_operand" "=o") ;; destination
- (match_operand:BLK 1 "memory_operand" "o")) ;; source
- (clobber (match_scratch:SI 4 "=&d")) ;; temp 1
- (clobber (match_scratch:SI 5 "=&d")) ;; temp 2
- (clobber (match_scratch:SI 6 "=&d")) ;; temp 3
- (clobber (match_scratch:SI 7 "=&d")) ;; temp 4
- (use (match_operand:SI 2 "small_int" "I")) ;; # bytes to move
- (use (match_operand:SI 3 "small_int" "I")) ;; alignment
- (use (const_int 1))] ;; all but last store
- "TARGET_MIPS16"
- "* return output_block_move (insn, operands, 4, BLOCK_MOVE_NOT_LAST);"
- [(set_attr "type" "multi")
- (set_attr "mode" "none")
- (set_attr "length" "80")])
-
-(define_insn "movstrsi_internal3"
- [(set (match_operand:BLK 0 "memory_operand" "=m") ;; destination
- (match_operand:BLK 1 "memory_operand" "m")) ;; source
- (clobber (match_scratch:SI 4 "=&d")) ;; temp 1
- (clobber (match_scratch:SI 5 "=&d")) ;; temp 2
- (clobber (match_scratch:SI 6 "=&d")) ;; temp 3
- (clobber (match_scratch:SI 7 "=&d")) ;; temp 4
- (use (match_operand:SI 2 "small_int" "I")) ;; # bytes to move
- (use (match_operand:SI 3 "small_int" "I")) ;; alignment
- (use (const_int 2))] ;; just last store of block move
- ""
- "* return output_block_move (insn, operands, 4, BLOCK_MOVE_LAST);"
- [(set_attr "type" "store")
- (set_attr "mode" "none")])
+ else
+ FAIL;
+ })
;;
;; ....................
@@ -7022,7 +6887,7 @@ move\\t%0,%z4\\n\\
[(set_attr "type" "branch")
(set_attr "mode" "none")])
-;; Conditional branch on equality comparision.
+;; Conditional branch on equality comparison.
(define_insn "branch_equality"
[(set (pc)
diff --git a/gcc/config/mmix/mmix-protos.h b/gcc/config/mmix/mmix-protos.h
index 24ba4813209..7e04d6aa998 100644
--- a/gcc/config/mmix/mmix-protos.h
+++ b/gcc/config/mmix/mmix-protos.h
@@ -33,7 +33,6 @@ extern int mmix_register_move_cost
PARAMS ((enum machine_mode, enum reg_class, enum reg_class));
extern const char *mmix_text_section_asm_op PARAMS ((void));
extern const char *mmix_data_section_asm_op PARAMS ((void));
-extern void mmix_asm_file_start PARAMS ((FILE *));
extern void mmix_asm_output_source_filename PARAMS ((FILE *, const char *));
extern void mmix_output_quoted_string PARAMS ((FILE *, const char *, int));
extern void mmix_asm_output_source_line PARAMS ((FILE *, int));
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index bf2a4a22f21..290b5d83e07 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -135,6 +135,7 @@ static void mmix_target_asm_function_epilogue
static void mmix_reorg PARAMS ((void));
static void mmix_asm_output_mi_thunk
PARAMS ((FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
+static void mmix_file_start PARAMS ((void));
static void mmix_file_end PARAMS ((void));
static bool mmix_rtx_costs
PARAMS ((rtx, int, int, int *));
@@ -174,6 +175,10 @@ static bool mmix_rtx_costs
#define TARGET_ASM_OUTPUT_MI_THUNK mmix_asm_output_mi_thunk
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START mmix_file_start
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END mmix_file_end
@@ -1297,17 +1302,15 @@ mmix_strip_name_encoding (name)
return name;
}
-/* ASM_FILE_START. */
+/* TARGET_ASM_FILE_START.
+ We just emit a little comment for the time being. */
-void
-mmix_asm_file_start (stream)
- FILE * stream;
+static void
+mmix_file_start ()
{
- /* We just emit a little comment for the time being. FIXME: Perhaps add
- -mstandalone and some segment and prefix setup here. */
- ASM_OUTPUT_SOURCE_FILENAME (stream, main_input_filename);
+ default_file_start ();
- fprintf (stream, "! mmixal:= 8H LOC Data_Section\n");
+ fputs ("! mmixal:= 8H LOC Data_Section\n", asm_out_file);
/* Make sure each file starts with the text section. */
text_section ();
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index 9ff4e97e52e..95c64447724 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -919,9 +919,6 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
/* Node: File Framework */
-#define ASM_FILE_START(STREAM) \
- mmix_asm_file_start (STREAM)
-
/* While any other punctuation character but ";" would do, we prefer "%"
or "!"; "!" is an unary operator and so will not be mistakenly included
in correctly formed expressions. The hash character adds mass; catches
@@ -939,7 +936,7 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
#define OUTPUT_QUOTED_STRING(STREAM, STRING) \
mmix_output_quoted_string (STREAM, STRING, strlen (STRING))
-#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
+#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE, COUNTER) \
mmix_asm_output_source_line (STREAM, LINE)
#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
diff --git a/gcc/config/mn10300/mn10300-protos.h b/gcc/config/mn10300/mn10300-protos.h
index 4816e6f1f09..209a7e6c891 100644
--- a/gcc/config/mn10300/mn10300-protos.h
+++ b/gcc/config/mn10300/mn10300-protos.h
@@ -53,7 +53,6 @@ extern struct rtx_def *mn10300_va_arg PARAMS ((tree, tree));
#endif /* TREE_CODE */
extern struct rtx_def *mn10300_builtin_saveregs PARAMS ((void));
-extern void asm_file_start PARAMS ((FILE *));
extern void expand_prologue PARAMS ((void));
extern void expand_epilogue PARAMS ((void));
extern int initial_offset PARAMS ((int, int));
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index 5a281260ca3..da2185dc029 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -58,6 +58,7 @@ Boston, MA 02111-1307, USA. */
static int mn10300_address_cost_1 PARAMS ((rtx, int *));
static int mn10300_address_cost PARAMS ((rtx));
static bool mn10300_rtx_costs PARAMS ((rtx, int, int, int *));
+static void mn10300_file_start PARAMS ((void));
/* Initialize the GCC target structure. */
@@ -69,21 +70,20 @@ static bool mn10300_rtx_costs PARAMS ((rtx, int, int, int *));
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST mn10300_address_cost
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START mn10300_file_start
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+
struct gcc_target targetm = TARGET_INITIALIZER;
-void
-asm_file_start (file)
- FILE *file;
+static void
+mn10300_file_start ()
{
- fprintf (file, "#\tGCC For the Matsushita MN10300\n");
- if (optimize)
- fprintf (file, "# -O%d\n", optimize);
- else
- fprintf (file, "\n\n");
+ default_file_start ();
if (TARGET_AM33)
- fprintf (file, "\t.am33\n");
- output_file_directive (file, main_input_filename);
+ fprintf (asm_out_file, "\t.am33\n");
}
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index 88d6fdcd58e..cae8f2a3f81 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -839,10 +839,6 @@ struct cum_arg {int nbytes; };
#define DATA_SECTION_ASM_OP "\t.section .data"
#define BSS_SECTION_ASM_OP "\t.section .bss"
-/* Output at beginning/end of assembler file. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) asm_file_start(FILE)
-
#define ASM_COMMENT_START "#"
/* Output to assembler file text saying following lines
diff --git a/gcc/config/ns32k/NOTES b/gcc/config/ns32k/NOTES
index 824c80c841e..6c5ff9bce7a 100644
--- a/gcc/config/ns32k/NOTES
+++ b/gcc/config/ns32k/NOTES
@@ -12,7 +12,7 @@ Ian Dall <ian@beware.dropbear.id.au>
The ns32x81 fpu handles most operands in hardware, but traps on NaN,
Inf and Denormalized numbers. The correct behavior can be handled by
the trap handler. This is mostly transparent to the compiler, but in
-the case of floating point comparisions, the trap handler and the
+the case of floating point comparisons, the trap handler and the
compiler must co-operate.
Comparing a Nan with anything (including another Nan) is an unordered
@@ -90,7 +90,7 @@ For example the emitted code for the case of RLT is
which is, in effect "branch if not less than and not unordered."
-These extra comparisions are safe if the trap handler doesn't set the
+These extra comparisons are safe if the trap handler doesn't set the
L flag, since in that case the additional "bhi" instructions are never
taken. Also, these extra branch instructions are controlled by the
"-mieee-compare" option.
diff --git a/gcc/config/ns32k/ns32k.c b/gcc/config/ns32k/ns32k.c
index 248e9b4f964..10ee5cf3595 100644
--- a/gcc/config/ns32k/ns32k.c
+++ b/gcc/config/ns32k/ns32k.c
@@ -96,6 +96,9 @@ static int ns32k_address_cost PARAMS ((rtx));
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST ns32k_address_cost
+#undef TARGET_ASM_FILE_START_APP_OFF
+#define TARGET_ASM_FILE_START_APP_OFF true
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Generate the assembly code for function entry. FILE is a stdio
diff --git a/gcc/config/ns32k/ns32k.h b/gcc/config/ns32k/ns32k.h
index 17979fb8680..0236a420da9 100644
--- a/gcc/config/ns32k/ns32k.h
+++ b/gcc/config/ns32k/ns32k.h
@@ -1256,10 +1256,6 @@ __transfer_from_trampoline () \
/* Define the output Assembly Language */
-/* Output at beginning of assembler file. */
-
-#define ASM_FILE_START(FILE) fprintf (FILE, "#NO_APP\n");
-
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
diff --git a/gcc/config/pa/elf.h b/gcc/config/pa/elf.h
index e5b7478154e..5b35178ea91 100644
--- a/gcc/config/pa/elf.h
+++ b/gcc/config/pa/elf.h
@@ -32,20 +32,7 @@ Boston, MA 02111-1307, USA. */
#define DATA_SECTION_ASM_OP "\t.data"
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-do { \
- if (TARGET_PA_20) \
- fputs("\t.LEVEL 2.0\n", FILE); \
- else if (TARGET_PA_11) \
- fputs("\t.LEVEL 1.1\n", FILE); \
- else \
- fputs("\t.LEVEL 1.0\n", FILE); \
- if (profile_flag)\
- fprintf (FILE, "\t.IMPORT _mcount, ENTRY\n");\
- if (write_symbols != NO_DEBUG) \
- output_file_directive ((FILE), main_input_filename); \
- } while (0)
+#define TARGET_ASM_FILE_START pa_elf_file_start
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h
index fa20da08ed5..ed7c82bf846 100644
--- a/gcc/config/pa/pa-linux.h
+++ b/gcc/config/pa/pa-linux.h
@@ -106,29 +106,7 @@ Boston, MA 02111-1307, USA. */
#define DATA_SECTION_ASM_OP "\t.data"
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
-/* Output at beginning of assembler file. We override the definition
- from <linux.h> so that we can get the proper .LEVEL directive. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- do \
- { \
- if (write_symbols != NO_DEBUG) \
- { \
- output_file_directive (FILE, main_input_filename); \
- fputs ("\t.version\t\"01.01\"\n", FILE); \
- } \
- if (TARGET_64BIT) \
- fputs("\t.LEVEL 2.0w\n", FILE); \
- else if (TARGET_PA_20) \
- fputs("\t.LEVEL 2.0\n", FILE); \
- else if (TARGET_PA_11) \
- fputs("\t.LEVEL 1.1\n", FILE); \
- else \
- fputs("\t.LEVEL 1.0\n", FILE); \
- if (profile_flag) \
- fputs ("\t.IMPORT _mcount, CODE\n", FILE); \
- } \
- while (0)
+#define TARGET_ASM_FILE_START pa_linux_file_start
/* We want local labels to start with period if made with asm_fprintf. */
#undef LOCAL_LABEL_PREFIX
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 4fa4e8c8b87..b17d1dc923f 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -39,7 +39,6 @@ Boston, MA 02111-1307, USA. */
#include "optabs.h"
#include "libfuncs.h"
#include "reload.h"
-#include "c-tree.h"
#include "integrate.h"
#include "function.h"
#include "obstack.h"
@@ -136,6 +135,15 @@ static void copy_fp_args PARAMS ((rtx)) ATTRIBUTE_UNUSED;
static int length_fp_args PARAMS ((rtx)) ATTRIBUTE_UNUSED;
static struct deferred_plabel *get_plabel PARAMS ((const char *))
ATTRIBUTE_UNUSED;
+static inline void pa_file_start_level PARAMS ((void)) ATTRIBUTE_UNUSED;
+static inline void pa_file_start_space PARAMS ((int)) ATTRIBUTE_UNUSED;
+static inline void pa_file_start_file PARAMS ((int)) ATTRIBUTE_UNUSED;
+static inline void pa_file_start_mcount PARAMS ((const char*)) ATTRIBUTE_UNUSED;
+static void pa_elf_file_start PARAMS ((void)) ATTRIBUTE_UNUSED;
+static void pa_som_file_start PARAMS ((void)) ATTRIBUTE_UNUSED;
+static void pa_linux_file_start PARAMS ((void)) ATTRIBUTE_UNUSED;
+static void pa_hpux64_gas_file_start PARAMS ((void)) ATTRIBUTE_UNUSED;
+static void pa_hpux64_hpas_file_start PARAMS ((void)) ATTRIBUTE_UNUSED;
static void output_deferred_plabels PARAMS ((void));
/* Save the operands last given to a compare for use when we
@@ -4903,6 +4911,106 @@ output_global_address (file, x, round_constant)
output_addr_const (file, x);
}
+/* Output boilerplate text to appear at the beginning of the file.
+ There are several possible versions. */
+#define aputs(x) fputs(x, asm_out_file)
+static inline void
+pa_file_start_level ()
+{
+ if (TARGET_64BIT)
+ aputs ("\t.LEVEL 2.0w\n");
+ else if (TARGET_PA_20)
+ aputs ("\t.LEVEL 2.0\n");
+ else if (TARGET_PA_11)
+ aputs ("\t.LEVEL 1.1\n");
+ else
+ aputs ("\t.LEVEL 1.0\n");
+}
+
+static inline void
+pa_file_start_space (sortspace)
+ int sortspace;
+{
+ aputs ("\t.SPACE $PRIVATE$");
+ if (sortspace)
+ aputs (",SORT=16");
+ aputs ("\n\t.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31"
+ "\n\t.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82"
+ "\n\t.SPACE $TEXT$");
+ if (sortspace)
+ aputs (",SORT=8");
+ aputs ("\n\t.SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44"
+ "\n\t.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY\n");
+}
+
+static inline void
+pa_file_start_file (want_version)
+ int want_version;
+{
+ if (write_symbols != NO_DEBUG)
+ {
+ output_file_directive (asm_out_file, main_input_filename);
+ if (want_version)
+ aputs ("\t.version\t\"01.01\"\n");
+ }
+}
+
+static inline void
+pa_file_start_mcount (aswhat)
+ const char *aswhat;
+{
+ if (profile_flag)
+ fprintf (asm_out_file, "\t.IMPORT _mcount,%s\n", aswhat);
+}
+
+static void
+pa_elf_file_start ()
+{
+ pa_file_start_level ();
+ pa_file_start_mcount ("ENTRY");
+ pa_file_start_file (0);
+}
+
+static void
+pa_som_file_start ()
+{
+ pa_file_start_level ();
+ pa_file_start_space (0);
+ aputs ("\t.IMPORT $global$,DATA\n"
+ "\t.IMPORT $$dyncall,MILLICODE\n");
+ pa_file_start_mcount ("CODE");
+ pa_file_start_file (0);
+}
+
+static void
+pa_linux_file_start ()
+{
+ pa_file_start_file (1);
+ pa_file_start_level ();
+ pa_file_start_mcount ("CODE");
+}
+
+static void
+pa_hpux64_gas_file_start ()
+{
+ pa_file_start_level ();
+#ifdef ASM_OUTPUT_TYPE_DIRECTIVE
+ if (profile_flag)
+ ASM_OUTPUT_TYPE_DIRECTIVE (asm_out_file, "_mcount", "function");
+#endif
+ pa_file_start_file (1);
+}
+
+static void
+pa_hpux64_hpas_file_start ()
+{
+ pa_file_start_level ();
+ pa_file_start_space (1);
+ pa_file_start_mcount ("CODE");
+ pa_file_start_file (0);
+}
+#undef aputs
+
static struct deferred_plabel *
get_plabel (fname)
const char *fname;
diff --git a/gcc/config/pa/pa64-hpux.h b/gcc/config/pa/pa64-hpux.h
index bd652c982c4..d16d741e2d1 100644
--- a/gcc/config/pa/pa64-hpux.h
+++ b/gcc/config/pa/pa64-hpux.h
@@ -100,25 +100,8 @@ Boston, MA 02111-1307, USA. */
/* We are using GAS. */
#define TARGET_GAS 1
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-do { \
- if (TARGET_64BIT) \
- fputs("\t.LEVEL 2.0w\n", FILE); \
- else if (TARGET_PA_20) \
- fputs("\t.LEVEL 2.0\n", FILE); \
- else if (TARGET_PA_11) \
- fputs("\t.LEVEL 1.1\n", FILE); \
- else \
- fputs("\t.LEVEL 1.0\n", FILE); \
- if (profile_flag) \
- ASM_OUTPUT_TYPE_DIRECTIVE (FILE, "_mcount", "function"); \
- if (write_symbols != NO_DEBUG) \
- { \
- output_file_directive ((FILE), main_input_filename); \
- fputs ("\t.version\t\"01.01\"\n", FILE); \
- } \
-} while (0)
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START pa_hpux64_gas_file_start
/* This is how we output a null terminated string. */
#undef STRING_ASM_OP
@@ -221,28 +204,8 @@ do { \
/* This target uses the ELF object file format. */
#define OBJECT_FORMAT_ELF
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-do { \
- if (TARGET_64BIT) \
- fputs("\t.LEVEL 2.0w\n", FILE); \
- else if (TARGET_PA_20) \
- fputs("\t.LEVEL 2.0\n", FILE); \
- else if (TARGET_PA_11) \
- fputs("\t.LEVEL 1.1\n", FILE); \
- else \
- fputs("\t.LEVEL 1.0\n", FILE); \
- fputs("\t.SPACE $PRIVATE$,SORT=16\n\
-\t.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31\n\
-\t.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82\n\
-\t.SPACE $TEXT$,SORT=8\n\
-\t.SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44\n\
-\t.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY\n", FILE); \
- if (profile_flag) \
- fprintf (FILE, "\t.IMPORT _mcount, CODE\n"); \
- if (write_symbols != NO_DEBUG) \
- output_file_directive ((FILE), main_input_filename); \
-} while (0)
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START pa_hpux64_hpas_file_start
#undef TEXT_SECTION_ASM_OP
#define TEXT_SECTION_ASM_OP "\t.SUBSPA $CODE$\n"
diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
index 577a67ea31e..6d34bf93fd3 100644
--- a/gcc/config/pa/som.h
+++ b/gcc/config/pa/som.h
@@ -30,18 +30,21 @@ Boston, MA 02111-1307, USA. */
/* We make the first line stab special to avoid adding several
gross hacks to GAS. */
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line) \
- { static int sym_lineno = 1; \
- static tree last_function_decl = NULL; \
- if (current_function_decl == last_function_decl) \
- fprintf (file, "\t.stabn 68,0,%d,L$M%d-%s\nL$M%d:\n", \
- line, sym_lineno, \
- XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0) + 1, \
- sym_lineno); \
- else \
- fprintf (file, "\t.stabn 68,0,%d,0\n", line); \
- last_function_decl = current_function_decl; \
- sym_lineno += 1; }
+#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
+ { static tree last_function_decl = NULL; \
+ if (current_function_decl == last_function_decl) \
+ { \
+ rtx func = DECL_RTL (current_function_decl); \
+ const char *name = XSTR (XEXP (func, 0), 0); \
+ fprintf (file, "\t.stabn 68,0,%d,L$M%d-%s\nL$M%d:\n", \
+ line, counter, \
+ (* targetm.strip_name_encoding) (name), \
+ counter); \
+ } \
+ else \
+ fprintf (file, "\t.stabn 68,0,%d,0\n", line); \
+ last_function_decl = current_function_decl; \
+ }
/* gdb needs a null N_SO at the end of each file for scattered loading. */
@@ -214,29 +217,7 @@ do { \
fputs ("\n", FILE); \
}} while (0)
-/* Output at beginning of assembler file. */
-
-#define ASM_FILE_START(FILE) \
-do { \
- if (TARGET_PA_20) \
- fputs("\t.LEVEL 2.0\n", FILE); \
- else if (TARGET_PA_11) \
- fputs("\t.LEVEL 1.1\n", FILE); \
- else \
- fputs("\t.LEVEL 1.0\n", FILE); \
- fputs ("\t.SPACE $PRIVATE$\n\
-\t.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31\n\
-\t.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82\n\
-\t.SPACE $TEXT$\n\
-\t.SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44\n\
-\t.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY\n\
-\t.IMPORT $global$,DATA\n\
-\t.IMPORT $$dyncall,MILLICODE\n", FILE);\
- if (profile_flag)\
- fprintf (FILE, "\t.IMPORT _mcount, CODE\n");\
- if (write_symbols != NO_DEBUG) \
- output_file_directive ((FILE), main_input_filename); \
- } while (0)
+#define TARGET_ASM_FILE_START pa_som_file_start
/* Output before code. */
diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h
index 5016145e192..317eda93330 100644
--- a/gcc/config/pdp11/pdp11.h
+++ b/gcc/config/pdp11/pdp11.h
@@ -990,20 +990,6 @@ extern struct rtx_def *cc0_reg_rtx;
/* Control the assembler format that we output. */
-/* Output at beginning of assembler file. */
-
-#if 0
-#define ASM_FILE_START(FILE) \
-( \
-fprintf (FILE, "\t.data\n"), \
-fprintf (FILE, "$help$: . = .+8 ; space for tmp moves!\n") \
-/* do we need reg def's R0 = %0 etc ??? */ \
-)
-#else
-#define ASM_FILE_START(FILE)
-#endif
-
-
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
diff --git a/gcc/config/ptx4.h b/gcc/config/ptx4.h
index f3ccb02a116..2ce83798b7c 100644
--- a/gcc/config/ptx4.h
+++ b/gcc/config/ptx4.h
@@ -184,16 +184,14 @@ Boston, MA 02111-1307, USA.
current function. */
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line) \
+#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
do \
{ \
- static int sym_lineno = 1; \
fprintf (file, ".stabn 68,0,%d,.LM%d-", \
- line, sym_lineno); \
+ line, counter); \
assemble_name (file, \
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
- fprintf (file, "\n.LM%d:\n", sym_lineno); \
- sym_lineno += 1; \
+ fprintf (file, "\n.LM%d:\n", counter); \
} \
while (0)
diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h
index 0ca22cd72d6..d40221513aa 100644
--- a/gcc/config/rs6000/aix.h
+++ b/gcc/config/rs6000/aix.h
@@ -87,8 +87,8 @@
Don't do this until the fixed IBM assembler is more generally available.
When this becomes permanently defined, the ASM_OUTPUT_EXTERNAL,
ASM_OUTPUT_EXTERNAL_LIBCALL, and RS6000_OUTPUT_BASENAME macros will no
- longer be needed. Also, the extern declaration of mcount in ASM_FILE_START
- will no longer be needed. */
+ longer be needed. Also, the extern declaration of mcount in
+ rs6000_xcoff_file_start will no longer be needed. */
/* #define ASM_SPEC "-u %(asm_cpu)" */
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index 30b10da257e..52340a8e029 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -93,6 +93,7 @@ do { \
#define CC1_SPEC "\
+%{gused: -feliminate-unused-debug-symbols %<gused }\
%{static: %{Zdynamic: %e conflicting code gen style switches are used}}\
%{!static:%{!mdynamic-no-pic:-fPIC}}"
diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
index 3cfe0204734..c3e4a586570 100644
--- a/gcc/config/rs6000/linux.h
+++ b/gcc/config/rs6000/linux.h
@@ -93,7 +93,18 @@
#ifdef IN_LIBGCC2
#include <signal.h>
-#include <sys/ucontext.h>
+
+/* During the 2.5 kernel series the kernel ucontext was changed, but
+ the new layout is compatible with the old one, so we just define
+ and use the old one here for simplicity and compatibility. */
+
+struct kernel_old_ucontext {
+ unsigned long uc_flags;
+ struct ucontext *uc_link;
+ stack_t uc_stack;
+ struct sigcontext_struct uc_mcontext;
+ sigset_t uc_sigmask;
+};
enum { SIGNAL_FRAMESIZE = 64 };
#endif
@@ -129,7 +140,7 @@ enum { SIGNAL_FRAMESIZE = 64 };
struct siginfo *pinfo; \
void *puc; \
struct siginfo info; \
- struct ucontext uc; \
+ struct kernel_old_ucontext uc; \
} *rt_ = (CONTEXT)->cfa; \
sc_ = &rt_->uc.uc_mcontext; \
} \
@@ -153,15 +164,9 @@ enum { SIGNAL_FRAMESIZE = 64 };
(FS)->regs.reg[LINK_REGISTER_REGNUM].loc.offset \
= (long)&(sc_->regs->link) - new_cfa_; \
\
- /* The unwinder expects the IP to point to the following insn, \
- whereas the kernel returns the address of the actual \
- faulting insn. We store NIP+4 in an unused register slot to \
- get the same result for multiple evaluation of the same signal \
- frame. */ \
- sc_->regs->gpr[47] = sc_->regs->nip + 4; \
(FS)->regs.reg[CR0_REGNO].how = REG_SAVED_OFFSET; \
(FS)->regs.reg[CR0_REGNO].loc.offset \
- = (long)&(sc_->regs->gpr[47]) - new_cfa_; \
+ = (long)&(sc_->regs->nip) - new_cfa_; \
(FS)->retaddr_column = CR0_REGNO; \
goto SUCCESS; \
} while (0)
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index a5c62e2f904..c1c1edb4d30 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -103,17 +103,6 @@
rs6000_override_options (((TARGET_DEFAULT ^ target_flags) & MASK_64BIT) \
? (char *) 0 : TARGET_CPU_DEFAULT)
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- do \
- { \
- output_file_directive ((FILE), main_input_filename); \
- rs6000_file_start (FILE, (((TARGET_DEFAULT ^ target_flags) \
- & MASK_64BIT) \
- ? (char *) 0 : TARGET_CPU_DEFAULT)); \
- } \
- while (0)
-
#endif
#undef ASM_DEFAULT_SPEC
@@ -443,12 +432,11 @@
/* This is the same as the dbxelf.h version, except that we need to
use the function code label, not the function descriptor. */
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
+#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE, COUNTER) \
do \
{ \
- static int sym_lineno = 1; \
char temp[256]; \
- ASM_GENERATE_INTERNAL_LABEL (temp, "LM", sym_lineno); \
+ ASM_GENERATE_INTERNAL_LABEL (temp, "LM", COUNTER); \
fprintf (FILE, "\t.stabn 68,0,%d,", LINE); \
assemble_name (FILE, temp); \
putc ('-', FILE); \
@@ -457,8 +445,7 @@ do \
assemble_name (FILE, \
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
putc ('\n', FILE); \
- (*targetm.asm_out.internal_label) (FILE, "LM", sym_lineno); \
- sym_lineno += 1; \
+ (*targetm.asm_out.internal_label) (FILE, "LM", COUNTER); \
} \
while (0)
diff --git a/gcc/config/rs6000/lynx.h b/gcc/config/rs6000/lynx.h
index 82e35b2fcb5..464b243207a 100644
--- a/gcc/config/rs6000/lynx.h
+++ b/gcc/config/rs6000/lynx.h
@@ -24,7 +24,6 @@
#undef PTRDIFF_TYPE
#undef WCHAR_TYPE
#undef WCHAR_TYPE_SIZE
-#undef ASM_FILE_START
#undef EXTRA_SECTIONS
#undef READONLY_DATA_SECTION
#undef READONLY_DATA_SECTION_ASM_OP
diff --git a/gcc/config/rs6000/power4.md b/gcc/config/rs6000/power4.md
index e19df2ddade..7f54ff0a739 100644
--- a/gcc/config/rs6000/power4.md
+++ b/gcc/config/rs6000/power4.md
@@ -349,7 +349,7 @@
(eq_attr "cpu" "power4"))
"vq_power4")
-(define_insn_reservation "power4-veccomplex" 2
+(define_insn_reservation "power4-veccomplex" 5
(and (eq_attr "type" "veccomplex")
(eq_attr "cpu" "power4"))
"vq_power4")
@@ -372,7 +372,8 @@
(define_bypass 4 "power4-vecload" "power4-vecperm")
-(define_bypass 3 "power4-vecsimple,power4-veccomplex" "power4-vecperm")
+(define_bypass 3 "power4-vecsimple" "power4-vecperm")
+(define_bypass 6 "power4-veccomplex" "power4-vecperm")
(define_bypass 3 "power4-vecperm"
"power4-vecsimple,power4-veccomplex,power4-vecfloat")
(define_bypass 9 "power4-vecfloat" "power4-vecperm")
diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h
index 75f7d907b3a..051da0206a7 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -27,7 +27,7 @@
#ifdef RTX_CODE
#ifdef TREE_CODE
-extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx, int));
+extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx, int, int));
extern void rs6000_va_start PARAMS ((tree, rtx));
#endif /* TREE_CODE */
@@ -167,7 +167,6 @@ extern enum direction function_arg_padding PARAMS ((enum machine_mode, tree));
extern void optimization_options PARAMS ((int, int));
extern void rs6000_override_options PARAMS ((const char *));
-extern void rs6000_file_start PARAMS ((FILE *, const char *));
extern int direct_return PARAMS ((void));
extern union tree_node *rs6000_build_va_list PARAMS ((void));
extern int first_reg_to_save PARAMS ((void));
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 8bd2a0cb78b..a3eb255a231 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -50,6 +50,10 @@
#include "target-def.h"
#include "langhooks.h"
#include "reload.h"
+#include "cfglayout.h"
+#if TARGET_XCOFF
+#include "xcoffout.h" /* get declarations of xcoff_*_section_name */
+#endif
#ifndef TARGET_NO_PROTOTYPE
#define TARGET_NO_PROTOTYPE 0
@@ -234,6 +238,7 @@ static void rs6000_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
static rtx rs6000_emit_set_long_const PARAMS ((rtx,
HOST_WIDE_INT, HOST_WIDE_INT));
+static void rs6000_file_start PARAMS ((void));
#if TARGET_ELF
static unsigned int rs6000_elf_section_type_flags PARAMS ((tree, const char *,
int));
@@ -258,6 +263,7 @@ static void rs6000_xcoff_select_rtx_section PARAMS ((enum machine_mode, rtx,
unsigned HOST_WIDE_INT));
static const char * rs6000_xcoff_strip_name_encoding PARAMS ((const char *));
static unsigned int rs6000_xcoff_section_type_flags PARAMS ((tree, const char *, int));
+static void rs6000_xcoff_file_start PARAMS ((void));
static void rs6000_xcoff_file_end PARAMS ((void));
#endif
#if TARGET_MACHO
@@ -940,15 +946,22 @@ optimization_options (level, size)
/* Do anything needed at the start of the asm file. */
-void
-rs6000_file_start (file, default_cpu)
- FILE *file;
- const char *default_cpu;
+static void
+rs6000_file_start ()
{
size_t i;
char buffer[80];
const char *start = buffer;
struct rs6000_cpu_select *ptr;
+ const char *default_cpu = TARGET_CPU_DEFAULT;
+ FILE *file = asm_out_file;
+
+ default_file_start ();
+
+#ifdef TARGET_BI_ARCH
+ if ((TARGET_DEFAULT ^ target_flags) & MASK_64BIT)
+ default_cpu = 0;
+#endif
if (flag_verbose_asm)
{
@@ -3638,11 +3651,12 @@ rs6000_emit_move (dest, source, mode)
so we never return a PARALLEL. */
void
-init_cumulative_args (cum, fntype, libname, incoming)
+init_cumulative_args (cum, fntype, libname, incoming, libcall)
CUMULATIVE_ARGS *cum;
tree fntype;
rtx libname ATTRIBUTE_UNUSED;
int incoming;
+ int libcall;
{
static CUMULATIVE_ARGS zero_cumulative;
@@ -3651,7 +3665,8 @@ init_cumulative_args (cum, fntype, libname, incoming)
cum->fregno = FP_ARG_MIN_REG;
cum->vregno = ALTIVEC_ARG_MIN_REG;
cum->prototype = (fntype && TYPE_ARG_TYPES (fntype));
- cum->call_cookie = CALL_NORMAL;
+ cum->call_cookie = ((DEFAULT_ABI == ABI_V4 && libcall)
+ ? CALL_LIBCALL : CALL_NORMAL);
cum->sysv_gregno = GP_ARG_MIN_REG;
cum->stdarg = fntype
&& (TYPE_ARG_TYPES (fntype) != 0
@@ -3900,7 +3915,7 @@ rs6000_spe_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type
If this is floating-point and no prototype is specified, we use
both an FP and integer register (or possibly FP reg and stack). Library
- functions (when TYPE is zero) always have the proper types for args,
+ functions (when CALL_LIBCALL is set) always have the proper types for args,
so we can pass the FP value just in one register. emit_library_function
doesn't support PARALLEL anyway. */
@@ -3921,7 +3936,8 @@ function_arg (cum, mode, type, named)
{
if (abi == ABI_V4
&& cum->nargs_prototype < 0
- && type && (cum->prototype || TARGET_NO_PROTOTYPE))
+ && (cum->call_cookie & CALL_LIBCALL) == 0
+ && (cum->prototype || TARGET_NO_PROTOTYPE))
{
/* For the SPE, we need to crxor CR6 always. */
if (TARGET_SPE_ABI)
@@ -10690,7 +10706,7 @@ rs6000_emit_eh_toc_restore (stacksize)
abort ();
emit_move_insn (opcode, insn_after_throw);
- emit_note (NULL, NOTE_INSN_LOOP_BEG);
+ emit_note (NOTE_INSN_LOOP_BEG);
emit_label (loop_start);
do_compare_rtx_and_jump (opcode, tocompare, NE, 1,
@@ -10717,9 +10733,9 @@ rs6000_emit_eh_toc_restore (stacksize)
emit_move_insn (opcode_addr, mem);
emit_move_insn (opcode, gen_rtx_MEM (SImode, opcode_addr));
- emit_note (NULL, NOTE_INSN_LOOP_CONT);
+ emit_note (NOTE_INSN_LOOP_CONT);
emit_jump (loop_start);
- emit_note (NULL, NOTE_INSN_LOOP_END);
+ emit_note (NOTE_INSN_LOOP_END);
emit_label (loop_exit);
}
@@ -10793,7 +10809,7 @@ rs6000_emit_allocate_stack (size, copy_r12)
{
/* Need a note here so that try_split doesn't get confused. */
if (get_last_insn() == NULL_RTX)
- emit_note (0, NOTE_INSN_DELETED);
+ emit_note (NOTE_INSN_DELETED);
insn = emit_move_insn (tmp_reg, todec);
try_split (PATTERN (insn), insn, 0);
todec = tmp_reg;
@@ -11520,9 +11536,9 @@ rs6000_output_function_prologue (file, size)
/* A NOTE_INSN_DELETED is supposed to be at the start and end of
the "toplevel" insn chain. */
- emit_note (0, NOTE_INSN_DELETED);
+ emit_note (NOTE_INSN_DELETED);
rs6000_emit_prologue ();
- emit_note (0, NOTE_INSN_DELETED);
+ emit_note (NOTE_INSN_DELETED);
/* Expand INSN_ADDRESSES so final() doesn't crash. */
{
@@ -11941,9 +11957,9 @@ rs6000_output_function_epilogue (file, size)
/* A NOTE_INSN_DELETED is supposed to be at the start
and end of the "toplevel" insn chain. */
- emit_note (0, NOTE_INSN_DELETED);
+ emit_note (NOTE_INSN_DELETED);
rs6000_emit_epilogue (FALSE);
- emit_note (0, NOTE_INSN_DELETED);
+ emit_note (NOTE_INSN_DELETED);
/* Expand INSN_ADDRESSES so final() doesn't crash. */
{
@@ -12234,10 +12250,11 @@ rs6000_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
rtx this, insn, funexp;
reload_completed = 1;
+ epilogue_completed = 1;
no_new_pseudos = 1;
/* Mark the end of the (empty) prologue. */
- emit_note (NULL, NOTE_INSN_PROLOGUE_END);
+ emit_note (NOTE_INSN_PROLOGUE_END);
/* Find the "this" pointer. If the function returns a structure,
the structure return pointer is in r3. */
@@ -12313,6 +12330,7 @@ rs6000_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
final_end_function ();
reload_completed = 0;
+ epilogue_completed = 0;
no_new_pseudos = 0;
}
@@ -14173,6 +14191,40 @@ rs6000_xcoff_section_type_flags (decl, name, reloc)
return flags | (exact_log2 (align) & SECTION_ENTSIZE);
}
+/* Output at beginning of assembler file.
+
+ Initialize the section names for the RS/6000 at this point.
+
+ Specify filename, including full path, to assembler.
+
+ We want to go into the TOC section so at least one .toc will be emitted.
+ Also, in order to output proper .bs/.es pairs, we need at least one static
+ [RW] section emitted.
+
+ Finally, declare mcount when profiling to make the assembler happy. */
+
+static void
+rs6000_xcoff_file_start ()
+{
+ rs6000_gen_section_name (&xcoff_bss_section_name,
+ main_input_filename, ".bss_");
+ rs6000_gen_section_name (&xcoff_private_data_section_name,
+ main_input_filename, ".rw_");
+ rs6000_gen_section_name (&xcoff_read_only_section_name,
+ main_input_filename, ".ro_");
+
+ fputs ("\t.file\t", asm_out_file);
+ output_quoted_string (asm_out_file, main_input_filename);
+ fputc ('\n', asm_out_file);
+ toc_section ();
+ if (write_symbols != NO_DEBUG)
+ private_data_section ();
+ text_section ();
+ if (profile_flag)
+ fprintf (asm_out_file, "\t.extern %s\n", RS6000_MCOUNT);
+ rs6000_file_start ();
+}
+
/* Output at end of assembler file.
On the RS/6000, referencing data should automatically pull in text. */
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index f0c7ef911cd..d27d42cb6d6 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -1665,6 +1665,7 @@ typedef struct rs6000_stack {
#define CALL_V4_CLEAR_FP_ARGS 0x00000002 /* V.4, no FP args passed */
#define CALL_V4_SET_FP_ARGS 0x00000004 /* V.4, FP args were passed */
#define CALL_LONG 0x00000008 /* always call indirect */
+#define CALL_LIBCALL 0x00000010 /* libcall */
/* 1 if N is a possible register number for a function value
as seen by the caller.
@@ -1743,13 +1744,18 @@ typedef struct rs6000_args
For a library call, FNTYPE is 0. */
#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
- init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE)
+ init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE, FALSE)
/* Similar, but when scanning the definition of a procedure. We always
set NARGS_PROTOTYPE large so we never return an EXPR_LIST. */
#define INIT_CUMULATIVE_INCOMING_ARGS(CUM,FNTYPE,LIBNAME) \
- init_cumulative_args (&CUM, FNTYPE, LIBNAME, TRUE)
+ init_cumulative_args (&CUM, FNTYPE, LIBNAME, TRUE, FALSE)
+
+/* Like INIT_CUMULATIVE_ARGS' but only used for outgoing libcalls. */
+
+#define INIT_CUMULATIVE_LIBCALL_ARGS(CUM, MODE, LIBNAME) \
+ init_cumulative_args (&CUM, NULL_TREE, LIBNAME, FALSE, TRUE)
/* Update the data in CUM to advance over an argument
of mode MODE and data type TYPE.
@@ -2040,9 +2046,12 @@ typedef struct rs6000_args
acceptable. */
#define LEGITIMATE_CONSTANT_P(X) \
- ((GET_CODE (X) != CONST_DOUBLE || GET_MODE (X) == VOIDmode \
+ (((GET_CODE (X) != CONST_DOUBLE \
+ && GET_CODE (X) != CONST_VECTOR) \
+ || GET_MODE (X) == VOIDmode \
|| (TARGET_POWERPC64 && GET_MODE (X) == DImode) \
- || easy_fp_constant (X, GET_MODE (X))) \
+ || easy_fp_constant (X, GET_MODE (X)) \
+ || easy_vector_constant (X, GET_MODE (X))) \
&& !rs6000_tls_referenced_p (X))
/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
@@ -2423,6 +2432,8 @@ extern int toc_initialized;
} \
while (0)
+#define TARGET_ASM_FILE_START rs6000_file_start
+
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
diff --git a/gcc/config/rs6000/spe.md b/gcc/config/rs6000/spe.md
index c2ee1198a6d..82ab17be127 100644
--- a/gcc/config/rs6000/spe.md
+++ b/gcc/config/rs6000/spe.md
@@ -639,8 +639,8 @@
(set_attr "length" "4")])
(define_insn "spe_evfscfsi"
- [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
- (fix:V2SI (match_operand:V2SF 1 "gpc_reg_operand" "r")))]
+ [(set (match_operand:V2SF 0 "gpc_reg_operand" "=r")
+ (float:V2SF (match_operand:V2SI 1 "gpc_reg_operand" "r")))]
"TARGET_SPE"
"evfscfsi %0,%1"
[(set_attr "type" "vecfloat")
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 57b26e39bc7..822a4380f2e 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -170,9 +170,6 @@ extern const char *rs6000_tls_size_string; /* For -mtls-size= */
#define SUBTARGET_OVERRIDE_OPTIONS \
do { \
- extern unsigned HOST_WIDE_INT g_switch_value; \
- extern int g_switch_set; \
- \
if (!g_switch_set) \
g_switch_value = SDATA_DEFAULT_SIZE; \
\
@@ -259,7 +256,8 @@ do { \
rs6000_sdata_name); \
} \
\
- if (rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4) \
+ if ((rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4) \
+ || (rs6000_sdata == SDATA_EABI && !TARGET_EABI)) \
{ \
rs6000_sdata = SDATA_NONE; \
error ("-msdata=%s and -mcall-%s are incompatible", \
@@ -633,8 +631,6 @@ extern int rs6000_pic_labelno;
#undef ASM_OUTPUT_ALIGNED_LOCAL
#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
do { \
- extern unsigned HOST_WIDE_INT g_switch_value; \
- \
if (rs6000_sdata != SDATA_NONE && (SIZE) > 0 \
&& (SIZE) <= g_switch_value) \
{ \
@@ -714,16 +710,6 @@ do { \
|| (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
|| (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G')
-/* Output .file. */
-/* Override elfos.h definition. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-do { \
- output_file_directive ((FILE), main_input_filename); \
- rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \
-} while (0)
-
-
extern int fixuplabelno;
/* Handle constructors specially for -mrelocatable. */
@@ -1078,21 +1064,11 @@ extern int fixuplabelno;
%{symbolic:-Bsymbolic}"
/* GNU/Linux support. */
-#ifdef USE_GNULIBC_1
-#define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
-%{!mnewlib: -lc }"
-#else
#define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
%{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \
%{profile:-lc_p} %{!profile:-lc}}}"
-#endif
-#ifdef USE_GNULIBC_1
-#define STARTFILE_LINUX_SPEC "\
-%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
-%{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
-%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-#elif defined HAVE_LD_PIE
+#ifdef HAVE_LD_PIE
#define STARTFILE_LINUX_SPEC "\
%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
%{mnewlib:ecrti.o%s;:crti.o%s} \
@@ -1113,25 +1089,16 @@ extern int fixuplabelno;
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
-#if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR)
+#if defined(HAVE_LD_EH_FRAME_HDR)
# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
#endif
-#ifdef USE_GNULIBC_1
-#define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
-%{!undef: \
- %{!ansi: \
- %{!std=*:-Dunix -D__unix -Dlinux -D__linux} \
- %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}} \
--Asystem=unix -Asystem=posix"
-#else
#define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
%{!undef: \
%{!ansi: \
%{!std=*:-Dunix -D__unix -Dlinux -D__linux} \
%{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}} \
-Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
-#endif
/* GNU/Hurd support. */
#define LIB_GNU_SPEC "%{mnewlib: --start-group -lgnu -lc --end-group } \
diff --git a/gcc/config/rs6000/sysv4le.h b/gcc/config/rs6000/sysv4le.h
index 0fb2bf959f4..38be8a6886f 100644
--- a/gcc/config/rs6000/sysv4le.h
+++ b/gcc/config/rs6000/sysv4le.h
@@ -1,4 +1,4 @@
-/* Target definitions for GNU compiler for a little endian PowerPC
+/* Target definitions for GCC for a little endian PowerPC
running System V.4
Copyright (C) 1995, 2000, 2003 Free Software Foundation, Inc.
Contributed by Cygnus Support.
@@ -33,14 +33,5 @@
%{mcall-linux: --oformat elf32-powerpc} \
}}}}"
-/* Define this macro as a C expression for the initializer of an
- array of string to tell the driver program which options are
- defaults for this target and thus do not need to be handled
- specially when using `MULTILIB_OPTIONS'.
-
- Do not define this macro if `MULTILIB_OPTIONS' is not defined in
- the target makefile fragment or if none of the options listed in
- `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
-
#undef MULTILIB_DEFAULTS
#define MULTILIB_DEFAULTS { "mlittle", "mcall-sysv" }
diff --git a/gcc/config/rs6000/t-rs6000 b/gcc/config/rs6000/t-rs6000
index edfb76cc87d..caa07153ad3 100644
--- a/gcc/config/rs6000/t-rs6000
+++ b/gcc/config/rs6000/t-rs6000
@@ -7,7 +7,8 @@ rs6000.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
real.h insn-config.h conditions.h insn-attr.h flags.h $(RECOG_H) \
$(OBSTACK_H) $(TREE_H) $(EXPR_H) $(OPTABS_H) except.h function.h \
output.h $(BASIC_BLOCK_H) $(INTEGRATE_H) toplev.h $(GGC_H) $(HASHTAB_H) \
- $(TM_P_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h reload.h gt-rs6000.h
+ $(TM_P_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h reload.h gt-rs6000.h \
+ cfglayout.h
rs6000-c.o: $(srcdir)/config/rs6000/rs6000-c.c \
$(srcdir)/config/rs6000/rs6000-protos.h \
diff --git a/gcc/config/rs6000/xcoff.h b/gcc/config/rs6000/xcoff.h
index affe073dfa5..26d79ec17a1 100644
--- a/gcc/config/rs6000/xcoff.h
+++ b/gcc/config/rs6000/xcoff.h
@@ -108,9 +108,10 @@ toc_section () \
{ \
if (TARGET_MINIMAL_TOC) \
{ \
- /* toc_section is always called at least once from ASM_FILE_START, \
- so this is guaranteed to always be defined once and only once \
- in each file. */ \
+ /* toc_section is always called at least once \
+ from rs6000_xcoff_file_start, so this is \
+ guaranteed to always be defined once and \
+ only once in each file. */ \
if (! toc_initialized) \
{ \
fputs ("\t.toc\nLCTOC..1:\n", asm_out_file); \
@@ -200,40 +201,11 @@ toc_section () \
/* Globalizing directive for a label. */
#define GLOBAL_ASM_OP "\t.globl "
-/* Output at beginning of assembler file.
-
- Initialize the section names for the RS/6000 at this point.
-
- Specify filename, including full path, to assembler.
-
- We want to go into the TOC section so at least one .toc will be emitted.
- Also, in order to output proper .bs/.es pairs, we need at least one static
- [RW] section emitted.
-
- Finally, declare mcount when profiling to make the assembler happy. */
-
-#define ASM_FILE_START(FILE) \
-{ \
- rs6000_gen_section_name (&xcoff_bss_section_name, \
- main_input_filename, ".bss_"); \
- rs6000_gen_section_name (&xcoff_private_data_section_name, \
- main_input_filename, ".rw_"); \
- rs6000_gen_section_name (&xcoff_read_only_section_name, \
- main_input_filename, ".ro_"); \
- \
- fputs ("\t.file\t", FILE); \
- output_quoted_string (FILE, main_input_filename); \
- fputc ('\n', FILE); \
- toc_section (); \
- if (write_symbols != NO_DEBUG) \
- private_data_section (); \
- text_section (); \
- if (profile_flag) \
- fprintf (FILE, "\t.extern %s\n", RS6000_MCOUNT); \
- rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \
-}
-
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START rs6000_xcoff_file_start
#define TARGET_ASM_FILE_END rs6000_xcoff_file_end
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE false
/* This macro produces the initial definition of a function name.
On the RS/6000, we need to place an extra '.' in the function name and
diff --git a/gcc/config/rtems.h b/gcc/config/rtems.h
index a3f9ba301b4..9a284c5a155 100644
--- a/gcc/config/rtems.h
+++ b/gcc/config/rtems.h
@@ -1,20 +1,20 @@
/* Configuration common to all targets running RTEMS.
Copyright (C) 2000, 2002 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 9ca394f8dd6..4f0dd02542c 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -6480,13 +6480,16 @@ s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
HOST_WIDE_INT vcall_offset;
tree function;
{
- rtx op[9];
+ rtx op[10];
+ int nonlocal = 0;
/* Operand 0 is the target function. */
op[0] = XEXP (DECL_RTL (function), 0);
if (flag_pic && !SYMBOL_REF_LOCAL_P (op[0]))
{
- op[0] = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, op[0]), 113);
+ nonlocal = 1;
+ op[0] = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, op[0]),
+ TARGET_64BIT ? 113 : flag_pic == 2 ? 112 : 110);
op[0] = gen_rtx_CONST (Pmode, op[0]);
}
@@ -6511,6 +6514,9 @@ s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
op[7] = NULL_RTX;
op[8] = NULL_RTX;
+ /* Operand 9 can be used for temporary register. */
+ op[9] = NULL_RTX;
+
/* Generate code. */
if (TARGET_64BIT)
{
@@ -6641,14 +6647,39 @@ s390_output_mi_thunk (file, thunk, delta, vcall_offset, function)
/* Jump to target. */
op[8] = gen_label_rtx ();
+
if (!flag_pic)
output_asm_insn ("l\t%4,%8-%5(%4)", op);
- else
+ else if (!nonlocal)
output_asm_insn ("a\t%4,%8-%5(%4)", op);
+ /* We cannot call through .plt, since .plt requires %r12 loaded. */
+ else if (flag_pic == 1)
+ {
+ output_asm_insn ("a\t%4,%8-%5(%4)", op);
+ output_asm_insn ("l\t%4,%0(%4)", op);
+ }
+ else if (flag_pic == 2)
+ {
+ op[9] = gen_rtx_REG (Pmode, 0);
+ output_asm_insn ("l\t%9,%8-4-%5(%4)", op);
+ output_asm_insn ("a\t%4,%8-%5(%4)", op);
+ output_asm_insn ("ar\t%4,%9", op);
+ output_asm_insn ("l\t%4,0(%4)", op);
+ }
+
output_asm_insn ("br\t%4", op);
/* Output literal pool. */
output_asm_insn (".align\t4", op);
+
+ if (nonlocal && flag_pic == 2)
+ output_asm_insn (".long\t%0", op);
+ if (nonlocal)
+ {
+ op[0] = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_");
+ SYMBOL_REF_FLAGS (op[0]) = SYMBOL_FLAG_LOCAL;
+ }
+
(*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (op[8]));
if (!flag_pic)
output_asm_insn (".long\t%0", op);
diff --git a/gcc/config/sh/coff.h b/gcc/config/sh/coff.h
index 4d9aeb3d78d..abffd472376 100644
--- a/gcc/config/sh/coff.h
+++ b/gcc/config/sh/coff.h
@@ -1,4 +1,4 @@
-/* Definitions of target machine for gcc for Hitachi / SuperH SH using ELF.
+/* Definitions of target machine for gcc for Renesas / SuperH SH using ELF.
Copyright (C) 1997, 1998, 2001, 2002 Free Software Foundation, Inc.
Contributed by Jörn Rennecke <joern.rennecke@superh.com>.
@@ -23,10 +23,6 @@ Boston, MA 02111-1307, USA. */
#define SDB_DEBUGGING_INFO 1
-/* Output DBX (stabs) debugging information if doing -gstabs. */
-
-#include "dbxcoff.h"
-
#define SDB_DELIM ";"
#ifndef MAX_OFILE_ALIGNMENT
diff --git a/gcc/config/sh/elf.h b/gcc/config/sh/elf.h
index 0dc2468a860..57930829b51 100644
--- a/gcc/config/sh/elf.h
+++ b/gcc/config/sh/elf.h
@@ -1,4 +1,4 @@
-/* Definitions of target machine for gcc for Hitachi / SuperH SH using ELF.
+/* Definitions of target machine for gcc for Renesas / SuperH SH using ELF.
Copyright (C) 1996, 1997, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Ian Lance Taylor <ian@cygnus.com>.
@@ -19,6 +19,10 @@ 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. */
+/* Let sh.c know this is ELF. */
+#undef TARGET_ELF
+#define TARGET_ELF 1
+
/* Generate DWARF2 debugging information and make it the default */
#define DWARF2_DEBUGGING_INFO 1
@@ -43,21 +47,6 @@ Boston, MA 02111-1307, USA. */
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) do { \
- output_file_directive ((FILE), main_input_filename); \
-/* We also need to show the text section with the proper \
- attributes as in TEXT_SECTION_ASM_OP, before dwarf2out \
- emits it without attributes in TEXT_SECTION, else GAS \
- will complain. We can teach GAS specifically about the \
- default attributes for our choice of text section, but \
- then we would have to change GAS again if/when we change \
- the text section name. */ \
- fprintf ((FILE), "%s\n", TEXT_SECTION_ASM_OP); \
- if (TARGET_LITTLE_ENDIAN) \
- fprintf ((FILE), "\t.little\n"); \
-} while (0)
-
#undef SIZE_TYPE
#define SIZE_TYPE (TARGET_SH5 ? "long unsigned int" : "unsigned int")
@@ -91,16 +80,14 @@ Boston, MA 02111-1307, USA. */
sprintf ((STRING), "*%s%s%ld", LOCAL_LABEL_PREFIX, (PREFIX), (long)(NUM))
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line) \
+#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
do \
{ \
- static int sym_lineno = 1; \
asm_fprintf ((file), ".stabn 68,0,%d,%LLM%d-", \
- (line), sym_lineno); \
+ (line), (counter)); \
assemble_name ((file), \
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
- asm_fprintf ((file), "\n%LLM%d:\n", sym_lineno); \
- sym_lineno += 1; \
+ asm_fprintf ((file), "\n%LLM%d:\n", (counter)); \
} \
while (0)
diff --git a/gcc/config/sh/embed-elf.h b/gcc/config/sh/embed-elf.h
index 4afc78339ad..3d8fd59c204 100644
--- a/gcc/config/sh/embed-elf.h
+++ b/gcc/config/sh/embed-elf.h
@@ -1,4 +1,4 @@
-/* Definitions of target machine for GNU compiler for Hitachi / SuperH SH
+/* Definitions of target machine for GNU compiler for Renesas / SuperH SH
non-Linux embedded targets.
Copyright (C) 2002 Free Software Foundation, Inc.
Contributed by J"orn Rennecke <joern.rennecke@superh.com>
diff --git a/gcc/config/sh/lib1funcs.asm b/gcc/config/sh/lib1funcs.asm
index 74e9839e619..4173d8043f6 100644
--- a/gcc/config/sh/lib1funcs.asm
+++ b/gcc/config/sh/lib1funcs.asm
@@ -25,7 +25,7 @@ along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-!! libgcc routines for the Hitachi / SuperH SH CPUs.
+!! libgcc routines for the Renesas / SuperH SH CPUs.
!! Contributed by Steve Chamberlain.
!! sac@cygnus.com
@@ -998,7 +998,7 @@ hiset: sts macl,r0 ! r0 = bb*dd
#endif /* ! __SH5__ */
#ifdef L_sdivsi3_i4
.title "SH DIVIDE"
-!! 4 byte integer Divide code for the Hitachi SH
+!! 4 byte integer Divide code for the Renesas SH
#ifdef __SH4__
!! args in r4 and r5, result in fpul, clobber dr0, dr2
@@ -1306,7 +1306,7 @@ div0: rts
#ifdef L_udivsi3_i4
.title "SH DIVIDE"
-!! 4 byte integer Divide code for the Hitachi SH
+!! 4 byte integer Divide code for the Renesas SH
#ifdef __SH4__
!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4,
!! and t bit
diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h
index 709a0e40072..10ef2e4a591 100644
--- a/gcc/config/sh/sh-protos.h
+++ b/gcc/config/sh/sh-protos.h
@@ -1,4 +1,4 @@
-/* Definitions of target machine for GNU compiler for Hitachi / SuperH SH.
+/* Definitions of target machine for GNU compiler for Renesas / SuperH SH.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2003
Free Software Foundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com).
@@ -111,7 +111,6 @@ extern tree sh_build_va_list PARAMS ((void));
extern const char *output_jump_label_table PARAMS ((void));
extern int sh_handle_pragma PARAMS ((int (*)(void), void (*)(int), const char *));
extern struct rtx_def *get_fpscr_rtx PARAMS ((void));
-extern void output_file_start PARAMS ((FILE *));
extern int sh_media_register_for_return PARAMS ((void));
extern void sh_expand_prologue PARAMS ((void));
extern void sh_expand_epilogue PARAMS ((void));
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index f63b41d774b..05c6c0ac889 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -1,4 +1,4 @@
-/* Output routines for GCC for Hitachi / SuperH SH.
+/* Output routines for GCC for Renesas / SuperH SH.
Copyright (C) 1993, 1994, 1995, 1997, 1997, 1998, 1999, 2000, 2001, 2002,
2003 Free Software Foundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com).
@@ -47,6 +47,7 @@ Boston, MA 02111-1307, USA. */
#include "langhooks.h"
#include "basic-block.h"
#include "ra.h"
+#include "cfglayout.h"
int code_for_indirect_jump_scratch = CODE_FOR_indirect_jump_scratch;
@@ -55,7 +56,7 @@ int code_for_indirect_jump_scratch = CODE_FOR_indirect_jump_scratch;
/* These are some macros to abstract register modes. */
#define CONST_OK_FOR_ADD(size) \
- (TARGET_SHMEDIA ? CONST_OK_FOR_P (size) : CONST_OK_FOR_I (size))
+ (TARGET_SHMEDIA ? CONST_OK_FOR_I10 (size) : CONST_OK_FOR_I08 (size))
#define GEN_MOV (*(TARGET_SHMEDIA64 ? gen_movdi : gen_movsi))
#define GEN_ADD3 (*(TARGET_SHMEDIA64 ? gen_adddi3 : gen_addsi3))
#define GEN_SUB3 (*(TARGET_SHMEDIA64 ? gen_subdi3 : gen_subsi3))
@@ -174,6 +175,8 @@ enum reg_class reg_class_from_letter[] =
int assembler_dialect;
+static bool shmedia_space_reserved_for_target_registers;
+
static void split_branches PARAMS ((rtx));
static int branch_dest PARAMS ((rtx));
static void force_into PARAMS ((rtx, rtx));
@@ -208,6 +211,8 @@ static int sh_issue_rate PARAMS ((void));
static bool sh_function_ok_for_sibcall PARAMS ((tree, tree));
static bool sh_cannot_modify_jumps_p PARAMS ((void));
+static int sh_target_reg_class (void);
+static bool sh_optimize_target_register_callee_saved (bool);
static bool sh_ms_bitfield_layout_p PARAMS ((tree));
static void sh_init_builtins PARAMS ((void));
@@ -215,6 +220,7 @@ static void sh_media_init_builtins PARAMS ((void));
static rtx sh_expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int));
static void sh_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
+static void sh_file_start PARAMS ((void));
static int flow_dependent_p PARAMS ((rtx, rtx));
static void flow_dependent_p_1 PARAMS ((rtx, rtx, void *));
static int shiftcosts PARAMS ((rtx));
@@ -225,6 +231,9 @@ static bool unspec_caller_rtx_p PARAMS ((rtx));
static bool sh_cannot_copy_insn_p PARAMS ((rtx));
static bool sh_rtx_costs PARAMS ((rtx, int, int, int *));
static int sh_address_cost PARAMS ((rtx));
+static int shmedia_target_regs_stack_space (HARD_REG_SET *);
+static int shmedia_reserve_space_for_target_registers_p (int, HARD_REG_SET *);
+static int shmedia_target_regs_stack_adjust (HARD_REG_SET *);
/* Initialize the GCC target structure. */
#undef TARGET_ATTRIBUTE_TABLE
@@ -251,6 +260,11 @@ static int sh_address_cost PARAMS ((rtx));
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START sh_file_start
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+
#undef TARGET_INSERT_ATTRIBUTES
#define TARGET_INSERT_ATTRIBUTES sh_insert_attributes
@@ -265,6 +279,11 @@ static int sh_address_cost PARAMS ((rtx));
#undef TARGET_CANNOT_MODIFY_JUMPS_P
#define TARGET_CANNOT_MODIFY_JUMPS_P sh_cannot_modify_jumps_p
+#undef TARGET_BRANCH_TARGET_REGISTER_CLASS
+#define TARGET_BRANCH_TARGET_REGISTER_CLASS sh_target_reg_class
+#undef TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED
+#define TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED \
+ sh_optimize_target_register_callee_saved
#undef TARGET_MS_BITFIELD_LAYOUT_P
#define TARGET_MS_BITFIELD_LAYOUT_P sh_ms_bitfield_layout_p
@@ -762,11 +781,20 @@ prepare_move_operands (operands, mode)
&& ! sh_register_operand (operands[1], mode))
operands[1] = copy_to_mode_reg (mode, operands[1]);
+ if (GET_CODE (operands[0]) == MEM && ! memory_operand (operands[0], mode))
+ {
+ /* This is like change_address_1 (operands[0], mode, 0, 1) ,
+ except that we can't use that function because it is static. */
+ rtx new = change_address (operands[0], mode, 0);
+ MEM_COPY_ATTRIBUTES (new, operands[0]);
+ operands[0] = new;
+ }
+
/* This case can happen while generating code to move the result
of a library call to the target. Reject `st r0,@(rX,rY)' because
reload will fail to find a spill register for rX, since r0 is already
being used for the source. */
- else if (GET_CODE (operands[1]) == REG && REGNO (operands[1]) == 0
+ else if (refers_to_regno_p (R0_REG, R0_REG + 1, operands[1], (rtx *)0)
&& GET_CODE (operands[0]) == MEM
&& GET_CODE (XEXP (operands[0], 0)) == PLUS
&& GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == REG)
@@ -1280,26 +1308,38 @@ output_ieee_ccmpeq (insn, operands)
return output_branchy_insn (NE, "bt\t%l9\\;fcmp/eq\t%1,%0", insn, operands);
}
-/* Output to FILE the start of the assembler file. */
-
-void
-output_file_start (file)
- FILE *file;
-{
- output_file_directive (file, main_input_filename);
+/* Output the start of the assembler file. */
- /* Switch to the data section so that the coffsem symbol
- isn't in the text section. */
- data_section ();
+static void
+sh_file_start ()
+{
+ default_file_start ();
+
+ if (TARGET_ELF)
+ /* We need to show the text section with the proper
+ attributes as in TEXT_SECTION_ASM_OP, before dwarf2out
+ emits it without attributes in TEXT_SECTION, else GAS
+ will complain. We can teach GAS specifically about the
+ default attributes for our choice of text section, but
+ then we would have to change GAS again if/when we change
+ the text section name. */
+ fprintf (asm_out_file, "%s\n", TEXT_SECTION_ASM_OP);
+ else
+ /* Switch to the data section so that the coffsem symbol
+ isn't in the text section. */
+ data_section ();
if (TARGET_LITTLE_ENDIAN)
- fprintf (file, "\t.little\n");
+ fputs ("\t.little\n", asm_out_file);
- if (TARGET_SHCOMPACT)
- fprintf (file, "\t.mode\tSHcompact\n");
- else if (TARGET_SHMEDIA)
- fprintf (file, "\t.mode\tSHmedia\n\t.abi\t%i\n",
- TARGET_SHMEDIA64 ? 64 : 32);
+ if (!TARGET_ELF)
+ {
+ if (TARGET_SHCOMPACT)
+ fputs ("\t.mode\tSHcompact\n", asm_out_file);
+ else if (TARGET_SHMEDIA)
+ fprintf (asm_out_file, "\t.mode\tSHmedia\n\t.abi\t%i\n",
+ TARGET_SHMEDIA64 ? 64 : 32);
+ }
}
/* Check if PAT includes UNSPEC_CALLER unspec pattern. */
@@ -1479,8 +1519,8 @@ andcosts (x)
if (TARGET_SHMEDIA)
{
if ((GET_CODE (XEXP (x, 1)) == CONST_INT
- && CONST_OK_FOR_J (INTVAL (XEXP (x, 1))))
- || EXTRA_CONSTRAINT_S (XEXP (x, 1)))
+ && CONST_OK_FOR_I16 (INTVAL (XEXP (x, 1))))
+ || EXTRA_CONSTRAINT_C16 (XEXP (x, 1)))
return 1;
else
return 2;
@@ -1489,13 +1529,13 @@ andcosts (x)
/* These constants are single cycle extu.[bw] instructions. */
if (i == 0xff || i == 0xffff)
return 1;
- /* Constants that can be used in an and immediate instruction is a single
+ /* Constants that can be used in an and immediate instruction in a single
cycle, but this requires r0, so make it a little more expensive. */
- if (CONST_OK_FOR_L (i))
+ if (CONST_OK_FOR_K08 (i))
return 2;
/* Constants that can be loaded with a mov immediate and an and.
This case is probably unnecessary. */
- if (CONST_OK_FOR_I (i))
+ if (CONST_OK_FOR_I08 (i))
return 2;
/* Any other constants requires a 2 cycle pc-relative load plus an and.
This case is probably unnecessary. */
@@ -1527,11 +1567,11 @@ addsubcosts (x)
return TARGET_SHMEDIA64 ? 5 : 3;
case CONST_INT:
- if (CONST_OK_FOR_J (INTVAL (XEXP (x, 1))))
+ if (CONST_OK_FOR_I16 (INTVAL (XEXP (x, 1))))
return 2;
- else if (CONST_OK_FOR_J (INTVAL (XEXP (x, 1)) >> 16))
+ else if (CONST_OK_FOR_I16 (INTVAL (XEXP (x, 1)) >> 16))
return 3;
- else if (CONST_OK_FOR_J ((INTVAL (XEXP (x, 1)) >> 16) >> 16))
+ else if (CONST_OK_FOR_I16 ((INTVAL (XEXP (x, 1)) >> 16) >> 16))
return 4;
/* Fall through. */
@@ -1591,22 +1631,22 @@ sh_rtx_costs (x, code, outer_code, total)
*total = 0;
else if ((outer_code == IOR || outer_code == XOR
|| outer_code == PLUS)
- && CONST_OK_FOR_P (INTVAL (x)))
+ && CONST_OK_FOR_I10 (INTVAL (x)))
*total = 0;
- else if (CONST_OK_FOR_J (INTVAL (x)))
+ else if (CONST_OK_FOR_I16 (INTVAL (x)))
*total = COSTS_N_INSNS (outer_code != SET);
- else if (CONST_OK_FOR_J (INTVAL (x) >> 16))
+ else if (CONST_OK_FOR_I16 (INTVAL (x) >> 16))
*total = COSTS_N_INSNS (2);
- else if (CONST_OK_FOR_J ((INTVAL (x) >> 16) >> 16))
+ else if (CONST_OK_FOR_I16 ((INTVAL (x) >> 16) >> 16))
*total = COSTS_N_INSNS (3);
else
*total = COSTS_N_INSNS (4);
return true;
}
- if (CONST_OK_FOR_I (INTVAL (x)))
+ if (CONST_OK_FOR_I08 (INTVAL (x)))
*total = 0;
else if ((outer_code == AND || outer_code == IOR || outer_code == XOR)
- && CONST_OK_FOR_L (INTVAL (x)))
+ && CONST_OK_FOR_K08 (INTVAL (x)))
*total = 1;
else
*total = 8;
@@ -2024,7 +2064,7 @@ shl_and_kind (left_rtx, mask_rtx, attrp)
{
if (i > right)
break;
- if (! CONST_OK_FOR_L (mask >> i))
+ if (! CONST_OK_FOR_K08 (mask >> i))
continue;
cost = (i != 0) + 2 + ext_shift_insns[left + i];
if (cost < best_cost)
@@ -2041,14 +2081,14 @@ shl_and_kind (left_rtx, mask_rtx, attrp)
{
if (i > right)
break;
- cost = (i != 0) + (CONST_OK_FOR_I (mask >> i) ? 2 : 3)
+ cost = (i != 0) + (CONST_OK_FOR_I08 (mask >> i) ? 2 : 3)
+ (can_ext ? ext_shift_insns : shift_insns)[left + i];
if (cost < best_cost)
{
best = 4 - can_ext;
best_cost = cost;
best_right = i;
- best_len = cost - 1 - ! CONST_OK_FOR_I (mask >> i);
+ best_len = cost - 1 - ! CONST_OK_FOR_I08 (mask >> i);
}
}
@@ -2826,8 +2866,8 @@ hi_const (src)
/* Nonzero if the insn is a move instruction which needs to be fixed. */
/* ??? For a DImode/DFmode moves, we don't need to fix it if each half of the
- CONST_DOUBLE input value is CONST_OK_FOR_I. For a SFmode move, we don't
- need to fix it if the input value is CONST_OK_FOR_I. */
+ CONST_DOUBLE input value is CONST_OK_FOR_I08. For a SFmode move, we don't
+ need to fix it if the input value is CONST_OK_FOR_I08. */
static int
broken_move (insn)
@@ -2864,7 +2904,7 @@ broken_move (insn)
&& GET_CODE (SET_DEST (pat)) == REG
&& FP_REGISTER_P (REGNO (SET_DEST (pat))))
&& (GET_CODE (SET_SRC (pat)) != CONST_INT
- || ! CONST_OK_FOR_I (INTVAL (SET_SRC (pat)))))
+ || ! CONST_OK_FOR_I08 (INTVAL (SET_SRC (pat)))))
return 1;
}
@@ -4688,6 +4728,53 @@ push_regs (mask, interrupt_handler)
push (PR_REG);
}
+/* Calculate how much extra space is needed to save all callee-saved
+ target registers.
+ LIVE_REGS_MASK is the register mask calculated by calc_live_regs. */
+
+static int
+shmedia_target_regs_stack_space (HARD_REG_SET *live_regs_mask)
+{
+ int reg;
+ int stack_space = 0;
+ int interrupt_handler = sh_cfun_interrupt_handler_p ();
+
+ for (reg = LAST_TARGET_REG; reg >= FIRST_TARGET_REG; reg--)
+ if ((! call_used_regs[reg] || interrupt_handler)
+ && ! TEST_HARD_REG_BIT (*live_regs_mask, reg))
+ /* Leave space to save this target register on the stack,
+ in case target register allocation wants to use it. */
+ stack_space += GET_MODE_SIZE (REGISTER_NATURAL_MODE (reg));
+ return stack_space;
+}
+
+/* Decide whether we should reserve space for callee-save target registers,
+ in case target register allocation wants to use them. REGS_SAVED is
+ the space, in bytes, that is already required for register saves.
+ LIVE_REGS_MASK is the register mask calculated by calc_live_regs. */
+
+static int
+shmedia_reserve_space_for_target_registers_p (int regs_saved,
+ HARD_REG_SET *live_regs_mask)
+{
+ if (optimize_size)
+ return 0;
+ return shmedia_target_regs_stack_space (live_regs_mask) <= regs_saved;
+}
+
+/* Decide how much space to reserve for callee-save target registers
+ in case target register allocation wants to use them.
+ LIVE_REGS_MASK is the register mask calculated by calc_live_regs. */
+
+static int
+shmedia_target_regs_stack_adjust (HARD_REG_SET *live_regs_mask)
+{
+ if (shmedia_space_reserved_for_target_registers)
+ return shmedia_target_regs_stack_space (live_regs_mask);
+ else
+ return 0;
+}
+
/* Work out the registers which need to be saved, both as a mask and a
count of saved words. Return the count.
@@ -4791,6 +4878,19 @@ calc_live_regs (live_regs_mask)
}
}
}
+ /* If we have a target register optimization pass after prologue / epilogue
+ threading, we need to assume all target registers will be live even if
+ they aren't now. */
+ if (flag_branch_target_load_optimize2
+ && TARGET_SAVE_ALL_TARGET_REGS
+ && shmedia_space_reserved_for_target_registers)
+ for (reg = LAST_TARGET_REG; reg >= FIRST_TARGET_REG; reg--)
+ if ((! call_used_regs[reg] || interrupt_handler)
+ && ! TEST_HARD_REG_BIT (*live_regs_mask, reg))
+ {
+ SET_HARD_REG_BIT (*live_regs_mask, reg);
+ count += GET_MODE_SIZE (REGISTER_NATURAL_MODE (reg));
+ }
return count;
}
@@ -4940,13 +5040,37 @@ sh_expand_prologue ()
rtx r0 = gen_rtx_REG (Pmode, R0_REG);
int offset_in_r0 = -1;
int sp_in_r0 = 0;
-
- if (d % (STACK_BOUNDARY / BITS_PER_UNIT))
+ int tregs_space = shmedia_target_regs_stack_adjust (&live_regs_mask);
+ int total_size, save_size;
+
+ /* D is the actual number of bytes that we need for saving registers,
+ however, in initial_elimination_offset we have committed to using
+ an additional TREGS_SPACE amount of bytes - in order to keep both
+ addresses to arguments supplied by the caller and local variables
+ valid, we must keep this gap. Place it between the incoming
+ arguments and the actually saved registers in a bid to optimize
+ locality of reference. */
+ total_size = d + tregs_space;
+ total_size += rounded_frame_size (total_size);
+ save_size = total_size - rounded_frame_size (d);
+ if (save_size % (STACK_BOUNDARY / BITS_PER_UNIT))
d_rounding = ((STACK_BOUNDARY / BITS_PER_UNIT)
- - d % (STACK_BOUNDARY / BITS_PER_UNIT));
+ - save_size % (STACK_BOUNDARY / BITS_PER_UNIT));
+
+ /* If adjusting the stack in a single step costs nothing extra, do so.
+ I.e. either if a single addi is enough, or we need a movi anyway,
+ and we don't exceed the maximum offset range (the test for the
+ latter is conservative for simplicity). */
+ if (TARGET_SHMEDIA
+ && (CONST_OK_FOR_I10 (-total_size)
+ || (! CONST_OK_FOR_I10 (-(save_size + d_rounding))
+ && total_size <= 2044)))
+ d_rounding = total_size - save_size;
offset = d + d_rounding;
- output_stack_adjust (-offset, stack_pointer_rtx, 1, frame_insn);
+
+ output_stack_adjust (-(save_size + d_rounding), stack_pointer_rtx,
+ 1, frame_insn);
/* We loop twice: first, we save 8-byte aligned registers in the
higher addresses, that are known to be aligned. Then, we
@@ -5158,16 +5282,39 @@ sh_expand_epilogue ()
int d_rounding = 0;
int save_flags = target_flags;
- int frame_size;
+ int frame_size, save_size;
int fpscr_deferred = 0;
d = calc_live_regs (&live_regs_mask);
- if (TARGET_SH5 && d % (STACK_BOUNDARY / BITS_PER_UNIT))
- d_rounding = ((STACK_BOUNDARY / BITS_PER_UNIT)
- - d % (STACK_BOUNDARY / BITS_PER_UNIT));
+ save_size = d;
+ frame_size = rounded_frame_size (d);
+
+ if (TARGET_SH5)
+ {
+ int tregs_space = shmedia_target_regs_stack_adjust (&live_regs_mask);
+ int total_size;
+ if (d % (STACK_BOUNDARY / BITS_PER_UNIT))
+ d_rounding = ((STACK_BOUNDARY / BITS_PER_UNIT)
+ - d % (STACK_BOUNDARY / BITS_PER_UNIT));
+
+ total_size = d + tregs_space;
+ total_size += rounded_frame_size (total_size);
+ save_size = total_size - frame_size;
+
+ /* If adjusting the stack in a single step costs nothing extra, do so.
+ I.e. either if a single addi is enough, or we need a movi anyway,
+ and we don't exceed the maximum offset range (the test for the
+ latter is conservative for simplicity). */
+ if (TARGET_SHMEDIA
+ && ! frame_pointer_needed
+ && (CONST_OK_FOR_I10 (total_size)
+ || (! CONST_OK_FOR_I10 (save_size + d_rounding)
+ && total_size <= 2044)))
+ d_rounding = frame_size;
- frame_size = rounded_frame_size (d) - d_rounding;
+ frame_size -= d_rounding;
+ }
if (frame_pointer_needed)
{
@@ -5346,33 +5493,33 @@ sh_expand_epilogue ()
if (offset != d + d_rounding)
abort ();
-
- goto finish;
}
- else
- d = 0;
- if (TEST_HARD_REG_BIT (live_regs_mask, PR_REG))
- pop (PR_REG);
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ else /* ! TARGET_SH5 */
{
- int j = (FIRST_PSEUDO_REGISTER - 1) - i;
+ save_size = 0;
+ if (TEST_HARD_REG_BIT (live_regs_mask, PR_REG))
+ pop (PR_REG);
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+ int j = (FIRST_PSEUDO_REGISTER - 1) - i;
+
+ if (j == FPSCR_REG && current_function_interrupt && TARGET_FMOVD
+ && hard_regs_intersect_p (&live_regs_mask,
+ &reg_class_contents[DF_REGS]))
+ fpscr_deferred = 1;
+ else if (j != PR_REG && TEST_HARD_REG_BIT (live_regs_mask, j))
+ pop (j);
+ if (j == FIRST_FP_REG && fpscr_deferred)
+ pop (FPSCR_REG);
- if (j == FPSCR_REG && current_function_interrupt && TARGET_FMOVD
- && hard_regs_intersect_p (&live_regs_mask,
- &reg_class_contents[DF_REGS]))
- fpscr_deferred = 1;
- else if (j != PR_REG && TEST_HARD_REG_BIT (live_regs_mask, j))
- pop (j);
- if (j == FIRST_FP_REG && fpscr_deferred)
- pop (FPSCR_REG);
+ }
}
- finish:
if (target_flags != save_flags && ! current_function_interrupt)
emit_insn (gen_toggle_sz ());
target_flags = save_flags;
output_stack_adjust (extra_push + current_function_pretend_args_size
- + d + d_rounding
+ + save_size + d_rounding
+ current_function_args_info.stack_regs * 8,
stack_pointer_rtx, 7, emit_insn);
@@ -5793,8 +5940,9 @@ sh_va_arg (valist, type)
HOST_WIDE_INT size, rsize;
tree tmp, pptr_type_node;
rtx addr_rtx, r;
- rtx result;
+ rtx result_ptr, result = NULL_RTX;
int pass_by_ref = MUST_PASS_IN_STACK (TYPE_MODE (type), type);
+ rtx lab_over;
size = int_size_in_bytes (type);
rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD;
@@ -5808,7 +5956,7 @@ sh_va_arg (valist, type)
tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
tree next_o, next_o_limit, next_fp, next_fp_limit, next_stack;
int pass_as_float;
- rtx lab_false, lab_over;
+ rtx lab_false;
f_next_o = TYPE_FIELDS (va_list_type_node);
f_next_o_limit = TREE_CHAIN (f_next_o);
@@ -5826,6 +5974,16 @@ sh_va_arg (valist, type)
next_stack = build (COMPONENT_REF, TREE_TYPE (f_next_stack),
valist, f_next_stack);
+ /* Structures with a single member with a distinct mode are passed
+ like their member. This is relevant if the latter has a REAL_TYPE
+ or COMPLEX_TYPE type. */
+ if (TREE_CODE (type) == RECORD_TYPE
+ && TYPE_FIELDS (type)
+ && TREE_CODE (TYPE_FIELDS (type)) == FIELD_DECL
+ && (TREE_CODE (TREE_TYPE (TYPE_FIELDS (type))) == REAL_TYPE
+ || TREE_CODE (TREE_TYPE (TYPE_FIELDS (type))) == COMPLEX_TYPE)
+ && TREE_CHAIN (TYPE_FIELDS (type)) == NULL_TREE)
+ type = TREE_TYPE (TYPE_FIELDS (type));
if (TARGET_SH4)
{
pass_as_float = ((TREE_CODE (type) == REAL_TYPE && size <= 8)
@@ -5842,6 +6000,9 @@ sh_va_arg (valist, type)
lab_false = gen_label_rtx ();
lab_over = gen_label_rtx ();
+ tmp = make_tree (pptr_type_node, addr_rtx);
+ valist = build1 (INDIRECT_REF, ptr_type_node, tmp);
+
if (pass_as_float)
{
int first_floatreg
@@ -5871,6 +6032,37 @@ sh_va_arg (valist, type)
if (r != addr_rtx)
emit_move_insn (addr_rtx, r);
+#ifdef FUNCTION_ARG_SCmode_WART
+ if (TYPE_MODE (type) == SCmode && TARGET_SH4 && TARGET_LITTLE_ENDIAN)
+ {
+ rtx addr, real, imag, result_value, slot;
+ tree subtype = TREE_TYPE (type);
+
+ addr = std_expand_builtin_va_arg (valist, subtype);
+#ifdef POINTERS_EXTEND_UNSIGNED
+ if (GET_MODE (addr) != Pmode)
+ addr = convert_memory_address (Pmode, addr);
+#endif
+ imag = gen_rtx_MEM (TYPE_MODE (type), addr);
+ set_mem_alias_set (imag, get_varargs_alias_set ());
+
+ addr = std_expand_builtin_va_arg (valist, subtype);
+#ifdef POINTERS_EXTEND_UNSIGNED
+ if (GET_MODE (addr) != Pmode)
+ addr = convert_memory_address (Pmode, addr);
+#endif
+ real = gen_rtx_MEM (TYPE_MODE (type), addr);
+ set_mem_alias_set (real, get_varargs_alias_set ());
+
+ result_value = gen_rtx_CONCAT (SCmode, real, imag);
+ /* ??? this interface is stupid - why require a pointer? */
+ result = gen_reg_rtx (Pmode);
+ slot = assign_stack_temp (SCmode, 8, 0);
+ emit_move_insn (slot, result_value);
+ emit_move_insn (result, XEXP (slot, 0));
+ }
+#endif /* FUNCTION_ARG_SCmode_WART */
+
emit_jump_insn (gen_jump (lab_over));
emit_barrier ();
emit_label (lab_false);
@@ -5913,16 +6105,22 @@ sh_va_arg (valist, type)
emit_move_insn (addr_rtx, r);
}
- emit_label (lab_over);
-
- tmp = make_tree (pptr_type_node, addr_rtx);
- valist = build1 (INDIRECT_REF, ptr_type_node, tmp);
+ if (! result)
+ emit_label (lab_over);
}
/* ??? In va-sh.h, there had been code to make values larger than
size 8 indirect. This does not match the FUNCTION_ARG macros. */
- result = std_expand_builtin_va_arg (valist, type);
+ result_ptr = std_expand_builtin_va_arg (valist, type);
+ if (result)
+ {
+ emit_move_insn (result, result_ptr);
+ emit_label (lab_over);
+ }
+ else
+ result = result_ptr;
+
if (pass_by_ref)
{
#ifdef POINTERS_EXTEND_UNSIGNED
@@ -5951,10 +6149,18 @@ initial_elimination_offset (from, to)
int total_auto_space;
int save_flags = target_flags;
int copy_flags;
-
HARD_REG_SET live_regs_mask;
+
+ shmedia_space_reserved_for_target_registers = false;
regs_saved = calc_live_regs (&live_regs_mask);
regs_saved += SHMEDIA_REGS_STACK_ADJUST ();
+
+ if (shmedia_reserve_space_for_target_registers_p (regs_saved, &live_regs_mask))
+ {
+ shmedia_space_reserved_for_target_registers = true;
+ regs_saved += shmedia_target_regs_stack_adjust (&live_regs_mask);
+ }
+
if (TARGET_SH5 && regs_saved % (STACK_BOUNDARY / BITS_PER_UNIT))
regs_saved_rounding = ((STACK_BOUNDARY / BITS_PER_UNIT)
- regs_saved % (STACK_BOUNDARY / BITS_PER_UNIT));
@@ -6037,7 +6243,7 @@ initial_elimination_offset (from, to)
abort ();
}
-/* Handle machine specific pragmas to be semi-compatible with Hitachi
+/* Handle machine specific pragmas to be semi-compatible with Renesas
compiler. */
void
@@ -6373,17 +6579,17 @@ arith_operand (op, mode)
if (TARGET_SHMEDIA)
{
/* FIXME: We should be checking whether the CONST_INT fits in a
- CONST_OK_FOR_J here, but this causes reload_cse to crash when
+ CONST_OK_FOR_I16 here, but this causes reload_cse to crash when
attempting to transform a sequence of two 64-bit sets of the
same register from literal constants into a set and an add,
when the difference is too wide for an add. */
if (GET_CODE (op) == CONST_INT
- || EXTRA_CONSTRAINT_S (op))
+ || EXTRA_CONSTRAINT_C16 (op))
return 1;
else
return 0;
}
- else if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_I (INTVAL (op)))
+ else if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_I08 (INTVAL (op)))
return 1;
return 0;
@@ -6399,7 +6605,7 @@ arith_reg_or_0_operand (op, mode)
if (arith_reg_operand (op, mode))
return 1;
- if (EXTRA_CONSTRAINT_U (op))
+ if (EXTRA_CONSTRAINT_Z (op))
return 1;
return 0;
@@ -6414,7 +6620,7 @@ shmedia_6bit_operand (op, mode)
enum machine_mode mode;
{
return (arith_reg_operand (op, mode)
- || (GET_CODE (op) == CONST_INT && CONST_OK_FOR_O (INTVAL (op))));
+ || (GET_CODE (op) == CONST_INT && CONST_OK_FOR_I06 (INTVAL (op))));
}
/* Returns 1 if OP is a valid source operand for a logical operation. */
@@ -6429,12 +6635,12 @@ logical_operand (op, mode)
if (TARGET_SHMEDIA)
{
- if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_P (INTVAL (op)))
+ if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_I10 (INTVAL (op)))
return 1;
else
return 0;
}
- else if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_L (INTVAL (op)))
+ else if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_K08 (INTVAL (op)))
return 1;
return 0;
@@ -6452,8 +6658,7 @@ and_operand (op, mode)
if (TARGET_SHMEDIA
&& mode == DImode
&& GET_CODE (op) == CONST_INT
- && (INTVAL (op) == (unsigned) 0xffffffff
- || INTVAL (op) == (HOST_WIDE_INT) -1 << 32))
+ && CONST_OK_FOR_J16 (INTVAL (op)))
return 1;
return 0;
@@ -6728,7 +6933,7 @@ target_operand (op, mode)
return 0;
if ((GET_MODE (op) == DImode || GET_MODE (op) == VOIDmode)
- && EXTRA_CONSTRAINT_T (op))
+ && EXTRA_CONSTRAINT_Csy (op))
return ! reload_completed;
return target_reg_operand (op, mode);
@@ -7650,6 +7855,19 @@ sh_cannot_modify_jumps_p ()
return (TARGET_SHMEDIA && (reload_in_progress || reload_completed));
}
+static int
+sh_target_reg_class (void)
+{
+ return TARGET_SHMEDIA ? TARGET_REGS : NO_REGS;
+}
+
+static bool
+sh_optimize_target_register_callee_saved (bool after_prologue_epilogue_gen)
+{
+ return (shmedia_space_reserved_for_target_registers
+ && (! after_prologue_epilogue_gen || TARGET_SAVE_ALL_TARGET_REGS));
+}
+
static bool
sh_ms_bitfield_layout_p (record_type)
tree record_type ATTRIBUTE_UNUSED;
@@ -8235,6 +8453,9 @@ sh_register_move_cost (mode, srcclass, dstclass)
if (dstclass == T_REGS || dstclass == PR_REGS)
return 10;
+ if (dstclass == MAC_REGS && srcclass == MAC_REGS)
+ return 4;
+
if (mode == SImode && ! TARGET_SHMEDIA && TARGET_FMOVD
&& REGCLASS_HAS_FP_REG (srcclass)
&& REGCLASS_HAS_FP_REG (dstclass))
@@ -8317,16 +8538,16 @@ sh_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
int structure_value_byref = 0;
rtx this, this_value, sibcall, insns, funexp;
tree funtype = TREE_TYPE (function);
- int simple_add
- = (TARGET_SHMEDIA ? CONST_OK_FOR_J (delta) : CONST_OK_FOR_I (delta));
+ int simple_add = CONST_OK_FOR_ADD (delta);
int did_load = 0;
rtx scratch0, scratch1, scratch2;
reload_completed = 1;
+ epilogue_completed = 1;
no_new_pseudos = 1;
current_function_uses_only_leaf_regs = 1;
- emit_note (NULL, NOTE_INSN_PROLOGUE_END);
+ emit_note (NOTE_INSN_PROLOGUE_END);
/* Find the "this" pointer. We have such a wide range of ABIs for the
SH that it's best to do this completely machine independently.
@@ -8401,9 +8622,7 @@ sh_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
emit_move_insn (scratch1, GEN_INT (vcall_offset));
offset_addr = gen_rtx_PLUS (Pmode, scratch0, scratch1);
}
- else if (TARGET_SHMEDIA
- ? CONST_OK_FOR_J (vcall_offset)
- : CONST_OK_FOR_I (vcall_offset))
+ else if (CONST_OK_FOR_ADD (vcall_offset))
{
emit_insn (gen_add2_insn (scratch0, GEN_INT (vcall_offset)));
offset_addr = scratch0;
@@ -8474,6 +8693,7 @@ sh_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
}
reload_completed = 0;
+ epilogue_completed = 0;
no_new_pseudos = 0;
}
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 28c9db79c7e..ee49f6b9a79 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -1,4 +1,4 @@
-/* Definitions of target machine for GNU compiler for Hitachi / SuperH SH.
+/* Definitions of target machine for GNU compiler for Renesas / SuperH SH.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003 Free Software Foundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com).
@@ -102,7 +102,7 @@ do { \
} \
if (flag_pic) \
fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
- /* Hitachi saves and restores mac registers on call. */ \
+ /* Renesas saves and restores mac registers on call. */ \
if (TARGET_HITACHI && ! TARGET_NOMACSAVE) \
{ \
call_used_regs[MACH_REG] = 0; \
@@ -150,6 +150,10 @@ extern int target_flags;
#define PADSTRUCT_BIT (1<<28)
#define LITTLE_ENDIAN_BIT (1<<29)
#define IEEE_BIT (1<<30)
+#define SAVE_ALL_TR_BIT (1<<2)
+
+/* Nonzero if this is an ELF target - compile time only */
+#define TARGET_ELF 0
/* Nonzero if we should dump out instruction size info. */
#define TARGET_DUMPISIZE (target_flags & ISIZE_BIT)
@@ -235,14 +239,14 @@ extern int target_flags;
to do function call relaxing. */
#define TARGET_RELAX (target_flags & RELAX_BIT)
-/* Nonzero if using Hitachi's calling convention. */
+/* Nonzero if using Renesas's calling convention. */
#define TARGET_HITACHI (target_flags & HITACHI_BIT)
/* Nonzero if not saving macl/mach when using -mhitachi */
#define TARGET_NOMACSAVE (target_flags & NOMACSAVE_BIT)
/* Nonzero if padding structures to a multiple of 4 bytes. This is
- incompatible with Hitachi's compiler, and gives unusual structure layouts
+ incompatible with Renesas's compiler, and gives unusual structure layouts
which confuse programmers.
??? This option is not useful, but is retained in case there are people
who are still relying on it. It may be deleted in the future. */
@@ -257,6 +261,8 @@ extern int target_flags;
/* Nonzero if we should prefer @GOT calls when generating PIC. */
#define TARGET_PREFERGOT (target_flags & PREFERGOT_BIT)
+#define TARGET_SAVE_ALL_TARGET_REGS (target_flags & SAVE_ALL_TR_BIT)
+
#define SELECT_SH1 (SH1_BIT)
#define SELECT_SH2 (SH2_BIT | SELECT_SH1)
#define SELECT_SH2E (SH_E_BIT | SH2_BIT | SH1_BIT | FPU_SINGLE_BIT)
@@ -417,6 +423,12 @@ do { \
flag_omit_frame_pointer = -1; \
if (SIZE) \
target_flags |= SPACE_BIT; \
+ if (TARGET_SHMEDIA && LEVEL > 1) \
+ { \
+ flag_branch_target_load_optimize = 1; \
+ if (! (SIZE)) \
+ target_flags |= SAVE_ALL_TR_BIT; \
+ } \
} while (0)
#define ASSEMBLER_DIALECT assembler_dialect
@@ -619,6 +631,17 @@ do { \
&& (ALIGN) < FASTEST_ALIGNMENT) \
? FASTEST_ALIGNMENT : (ALIGN))
+/* get_mode_alignment assumes complex values are always held in multiple
+ registers, but that is not the case on the SH; CQImode and CHImode are
+ held in a single integer register. SH5 also holds CSImode and SCmode
+ values in integer regsters. This is relevant for argument passing on
+ SHcompact as we use a stack temp in order to pass CSImode by reference. */
+#define LOCAL_ALIGNMENT(TYPE, ALIGN) \
+ ((GET_MODE_CLASS (TYPE_MODE (TYPE)) == MODE_COMPLEX_INT \
+ || GET_MODE_CLASS (TYPE_MODE (TYPE)) == MODE_COMPLEX_FLOAT) \
+ ? MIN (BIGGEST_ALIGNMENT, GET_MODE_BITSIZE (TYPE_MODE (TYPE))) \
+ : ALIGN)
+
/* Make arrays of chars word-aligned for the same reasons. */
#define DATA_ALIGNMENT(TYPE, ALIGN) \
(TREE_CODE (TYPE) == ARRAY_TYPE \
@@ -665,7 +688,7 @@ do { \
/* Standard register usage. */
-/* Register allocation for the Hitachi calling convention:
+/* Register allocation for the Renesas calling convention:
r0 arg return
r1..r3 scratch
@@ -1102,7 +1125,7 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \
where the address is passed. If it returns 0, the address is
passed as an "invisible" first argument. */
-/* The Hitachi calling convention doesn't quite fit into this scheme since
+/* The Renesas calling convention doesn't quite fit into this scheme since
the address is passed like an invisible argument, but one that is always
passed in memory. */
#define STRUCT_VALUE \
@@ -1264,26 +1287,35 @@ extern int regno_reg_class[FIRST_PSEUDO_REGISTER];
and GENERAL_FP_REGS the alternate class. Since FP0 is likely to be
spilled or used otherwise, we better have the FP_REGS allocated first. */
#define REG_ALLOC_ORDER \
- { 65, 66, 67, 68, 69, 70, 71, 64, \
- 72, 73, 74, 75, 76, 77, 78, 79, \
- 136,137,138,139,140,141,142,143, \
- 80, 81, 82, 83, 84, 85, 86, 87, \
- 88, 89, 90, 91, 92, 93, 94, 95, \
- 96, 97, 98, 99,100,101,102,103, \
+ {/* Caller-saved FPRs */ \
+ 65, 66, 67, 68, 69, 70, 71, 64, \
+ 72, 73, 74, 75, 80, 81, 82, 83, \
+ 84, 85, 86, 87, 88, 89, 90, 91, \
+ 92, 93, 94, 95, 96, 97, 98, 99, \
+ /* Callee-saved FPRs */ \
+ 76, 77, 78, 79,100,101,102,103, \
104,105,106,107,108,109,110,111, \
112,113,114,115,116,117,118,119, \
120,121,122,123,124,125,126,127, \
- 151, 1, 2, 3, 7, 6, 5, 4, \
- 0, 8, 9, 10, 11, 12, 13, 14, \
- 16, 17, 18, 19, 20, 21, 22, 23, \
- 24, 25, 26, 27, 28, 29, 30, 31, \
- 32, 33, 34, 35, 36, 37, 38, 39, \
- 40, 41, 42, 43, 44, 45, 46, 47, \
- 48, 49, 50, 51, 52, 53, 54, 55, \
- 56, 57, 58, 59, 60, 61, 62, 63, \
- 150, 15,145,146,147,144,148,149, \
+ 136,137,138,139,140,141,142,143, \
+ /* FPSCR */ 151, \
+ /* Caller-saved GPRs (except 8/9 on SH1-4) */ \
+ 1, 2, 3, 7, 6, 5, 4, 0, \
+ 8, 9, 17, 19, 20, 21, 22, 23, \
+ 36, 37, 38, 39, 40, 41, 42, 43, \
+ 60, 61, 62, \
+ /* SH1-4 callee-saved saved GPRs / SH5 partially-saved GPRs */ \
+ 10, 11, 12, 13, 14, 18, \
+ /* SH5 callee-saved GPRs */ \
+ 28, 29, 30, 31, 32, 33, 34, 35, \
+ 44, 45, 46, 47, 48, 49, 50, 51, \
+ 52, 53, 54, 55, 56, 57, 58, 59, \
+ /* FPUL */ 150, \
+ /* SH5 branch target registers */ \
128,129,130,131,132,133,134,135, \
- 152 }
+ /* Fixed registers */ \
+ 15, 16, 24, 25, 26, 27, 63,144, \
+ 145,146,147,148,149,152 }
/* The class value for index registers, and the one for base regs. */
#define INDEX_REG_CLASS (TARGET_SHMEDIA ? GENERAL_REGS : R0_REGS)
@@ -1293,46 +1325,119 @@ extern int regno_reg_class[FIRST_PSEUDO_REGISTER];
description. */
extern enum reg_class reg_class_from_letter[];
-#define REG_CLASS_FROM_LETTER(C) \
- ( ISLOWER (C) ? reg_class_from_letter[(C)-'a'] : NO_REGS )
+/* We might use 'Rxx' constraints in the future for exotic reg classes.*/
+#define REG_CLASS_FROM_CONSTRAINT(C, STR) \
+ (ISLOWER (C) ? reg_class_from_letter[(C)-'a'] : NO_REGS )
+/* Overview of uppercase letter constraints:
+ A: Addresses (constraint len == 3)
+ Ac4: sh4 cache operations
+ Ac5: sh5 cache operations
+ Bxx: miscellaneous constraints
+ Bsc: SCRATCH - for the scratch register in movsi_ie in the
+ fldi0 / fldi0 cases
+ C: Constants other than only CONST_INT (constraint len == 3)
+ C16: 16 bit constant, literal or symbolic
+ Csy: label or symbol
+ Cpg: non-explicit constants that can be directly loaded into a general
+ purpose register in PIC code. like 's' except we don't allow
+ PIC_DIRECT_ADDR_P
+ IJKLMNOP: CONT_INT constants
+ Ixx: signed xx bit
+ J16: 0xffffffff00000000 | 0x00000000ffffffff
+ Kxx: unsigned xx bit
+ M: 1
+ N: 0
+ P27: 1 | 2 | 8 | 16
+ Q: pc relative load operand
+ Rxx: reserved for exotic register classes.
+ S: extra memory (storage) constraints (constraint len == 3)
+ Sua: unaligned memory operations
+ W: vector
+ Z: zero in any mode
+
+ unused CONST_INT constraint letters: LO
+ unused EXTRA_CONSTRAINT letters: D T U Y */
+
+#if 1 /* check that the transistion went well. */
+#define CONSTRAINT_LEN(C,STR) \
+ (((C) == 'L' || (C) == 'O' || (C) == 'D' || (C) == 'T' || (C) == 'U' \
+ || (C) == 'Y' \
+ || ((C) == 'I' && (((STR)[1] != '0' && (STR)[1] != '1') || ! isdigit ((STR)[2]))) \
+ || ((C) == 'B' && ((STR)[1] != 's' || (STR)[2] != 'c')) \
+ || ((C) == 'J' && ((STR)[1] != '1' || (STR)[2] != '6')) \
+ || ((C) == 'K' && ((STR)[1] != '0' || (STR)[2] != '8')) \
+ || ((C) == 'P' && ((STR)[1] != '2' || (STR)[2] != '7'))) \
+ ? -1 \
+ : ((C) == 'A' || (C) == 'B' || (C) == 'C' \
+ || (C) == 'I' || (C) == 'J' || (C) == 'K' || (C) == 'P' \
+ || (C) == 'R' || (C) == 'S') \
+ ? 3 \
+ : DEFAULT_CONSTRAINT_LEN ((C), (STR)))
+#else
+#define CONSTRAINT_LEN(C,STR) \
+ (((C) == 'A' || (C) == 'B' || (C) == 'C' \
+ || (C) == 'I' || (C) == 'J' || (C) == 'K' || (C) == 'P' \
+ || (C) == 'R' || (C) == 'S') \
+ ? 3 : DEFAULT_CONSTRAINT_LEN ((C), (STR)))
+#endif
+
/* The letters I, J, K, L and M in a register constraint string
can be used to stand for particular ranges of immediate operands.
This macro defines what the ranges are.
C is the letter, and VALUE is a constant value.
Return 1 if VALUE is in the range specified by C.
- I: arithmetic operand -127..128, as used in add, sub, etc
- J: arithmetic operand -32768..32767, as used in SHmedia movi and shori
- K: shift operand 1,2,8 or 16
- L: logical operand 0..255, as used in and, or, etc.
+ I08: arithmetic operand -127..128, as used in add, sub, etc
+ I16: arithmetic operand -32768..32767, as used in SHmedia movi and shori
+ P27: shift operand 1,2,8 or 16
+ K08: logical operand 0..255, as used in and, or, etc.
M: constant 1
N: constant 0
- O: arithmetic operand -32..31, as used in SHmedia beqi, bnei and xori
- P: arithmetic operand -512..511, as used in SHmedia andi, ori
+ I06: arithmetic operand -32..31, as used in SHmedia beqi, bnei and xori
+ I10: arithmetic operand -512..511, as used in SHmedia andi, ori
*/
-#define CONST_OK_FOR_I(VALUE) (((HOST_WIDE_INT)(VALUE))>= -128 \
- && ((HOST_WIDE_INT)(VALUE)) <= 127)
-#define CONST_OK_FOR_J(VALUE) (((HOST_WIDE_INT)(VALUE)) >= -32768 \
- && ((HOST_WIDE_INT)(VALUE)) <= 32767)
-#define CONST_OK_FOR_K(VALUE) ((VALUE)==1||(VALUE)==2||(VALUE)==8||(VALUE)==16)
-#define CONST_OK_FOR_L(VALUE) (((HOST_WIDE_INT)(VALUE))>= 0 \
- && ((HOST_WIDE_INT)(VALUE)) <= 255)
+#define CONST_OK_FOR_I06(VALUE) (((HOST_WIDE_INT)(VALUE)) >= -32 \
+ && ((HOST_WIDE_INT)(VALUE)) <= 31)
+#define CONST_OK_FOR_I08(VALUE) (((HOST_WIDE_INT)(VALUE))>= -128 \
+ && ((HOST_WIDE_INT)(VALUE)) <= 127)
+#define CONST_OK_FOR_I10(VALUE) (((HOST_WIDE_INT)(VALUE)) >= -512 \
+ && ((HOST_WIDE_INT)(VALUE)) <= 511)
+#define CONST_OK_FOR_I16(VALUE) (((HOST_WIDE_INT)(VALUE)) >= -32768 \
+ && ((HOST_WIDE_INT)(VALUE)) <= 32767)
+#define CONST_OK_FOR_I(VALUE, STR) \
+ ((STR)[1] == '0' && (STR)[2] == 6 ? CONST_OK_FOR_I06 (VALUE) \
+ : (STR)[1] == '0' && (STR)[2] == '8' ? CONST_OK_FOR_I08 (VALUE) \
+ : (STR)[1] == '1' && (STR)[2] == '0' ? CONST_OK_FOR_I10 (VALUE) \
+ : (STR)[1] == '1' && (STR)[2] == '6' ? CONST_OK_FOR_I16 (VALUE) \
+ : 0)
+
+#define CONST_OK_FOR_J16(VALUE) \
+ (HOST_BITS_PER_WIDE_INT >= 64 && (VALUE) == (HOST_WIDE_INT) 0xffffffff \
+ || (HOST_BITS_PER_WIDE_INT >= 64 && (VALUE) == (HOST_WIDE_INT) -1 << 32))
+#define CONST_OK_FOR_J(VALUE, STR) \
+ ((STR)[1] == '1' && (STR)[2] == '6' ? CONST_OK_FOR_J16 (VALUE) \
+ : 0)
+
+#define CONST_OK_FOR_K08(VALUE) (((HOST_WIDE_INT)(VALUE))>= 0 \
+ && ((HOST_WIDE_INT)(VALUE)) <= 255)
+#define CONST_OK_FOR_K(VALUE, STR) \
+ ((STR)[1] == '0' && (STR)[2] == '8' ? CONST_OK_FOR_K08 (VALUE) \
+ : 0)
+#define CONST_OK_FOR_P27(VALUE) \
+ ((VALUE)==1||(VALUE)==2||(VALUE)==8||(VALUE)==16)
+#define CONST_OK_FOR_P(VALUE, STR) \
+ ((STR)[1] == '2' && (STR)[2] == '7' ? CONST_OK_FOR_P27 (VALUE) \
+ : 0)
#define CONST_OK_FOR_M(VALUE) ((VALUE)==1)
#define CONST_OK_FOR_N(VALUE) ((VALUE)==0)
-#define CONST_OK_FOR_O(VALUE) (((HOST_WIDE_INT)(VALUE)) >= -32 \
- && ((HOST_WIDE_INT)(VALUE)) <= 31)
-#define CONST_OK_FOR_P(VALUE) (((HOST_WIDE_INT)(VALUE)) >= -512 \
- && ((HOST_WIDE_INT)(VALUE)) <= 511)
-#define CONST_OK_FOR_LETTER_P(VALUE, C) \
- ((C) == 'I' ? CONST_OK_FOR_I (VALUE) \
- : (C) == 'J' ? CONST_OK_FOR_J (VALUE) \
- : (C) == 'K' ? CONST_OK_FOR_K (VALUE) \
- : (C) == 'L' ? CONST_OK_FOR_L (VALUE) \
- : (C) == 'M' ? CONST_OK_FOR_M (VALUE) \
- : (C) == 'N' ? CONST_OK_FOR_N (VALUE) \
- : (C) == 'O' ? CONST_OK_FOR_O (VALUE) \
- : (C) == 'P' ? CONST_OK_FOR_P (VALUE) \
+#define CONST_OK_FOR_CONSTRAINT_P(VALUE, C, STR) \
+ ((C) == 'I' ? CONST_OK_FOR_I ((VALUE), (STR)) \
+ : (C) == 'J' ? CONST_OK_FOR_J ((VALUE), (STR)) \
+ : (C) == 'K' ? CONST_OK_FOR_K ((VALUE), (STR)) \
+ : (C) == 'M' ? CONST_OK_FOR_M (VALUE) \
+ : (C) == 'N' ? CONST_OK_FOR_N (VALUE) \
+ : (C) == 'P' ? CONST_OK_FOR_P ((VALUE), (STR)) \
: 0)
/* Similar, but for floating constants, and defining letters G and H.
@@ -1403,7 +1508,7 @@ extern enum reg_class reg_class_from_letter[];
|| GET_CODE (X) == PLUS)) \
? GENERAL_REGS \
: CLASS == FPUL_REGS && immediate_operand ((X), (MODE)) \
- ? (GET_CODE (X) == CONST_INT && CONST_OK_FOR_I (INTVAL (X)) \
+ ? (GET_CODE (X) == CONST_INT && CONST_OK_FOR_I08 (INTVAL (X)) \
? GENERAL_REGS \
: R0_REGS) \
: (CLASS == FPSCR_REGS \
@@ -1762,20 +1867,12 @@ struct sh_args {
(CUM).outgoing = 0; \
} while (0)
-#define OLD_ARG_MODE(MODE, TYPE) \
- (((TYPE) \
- && (TREE_CODE (TYPE) == RECORD_TYPE || TREE_CODE (TYPE) == UNION_TYPE) \
- && (MODE) != BLKmode && GET_MODE_CLASS (MODE) != MODE_INT) \
- ? int_mode_for_mode (MODE) : (MODE))
-
/* Update the data in CUM to advance over an argument
of mode MODE and data type TYPE.
(TYPE is null for libcalls where that information may not be
available.) */
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
-do { \
- enum machine_mode MODE_ = OLD_ARG_MODE ((MODE), (TYPE));\
if ((CUM).force_mem) \
(CUM).force_mem = 0; \
else if (TARGET_SH5) \
@@ -1783,17 +1880,17 @@ do { \
tree TYPE_ = ((CUM).byref && (TYPE) \
? TREE_TYPE (TYPE) \
: (TYPE)); \
- int dwords, numregs; \
+ enum machine_mode MODE_ = ((CUM).byref && (TYPE) \
+ ? TYPE_MODE (TYPE_) \
+ : (MODE)); \
+ int dwords = (((CUM).byref \
+ ? (CUM).byref \
+ : (MODE_) == BLKmode \
+ ? int_size_in_bytes (TYPE_) \
+ : GET_MODE_SIZE (MODE_)) + 7) / 8; \
+ int numregs = MIN (dwords, NPARM_REGS (SImode) \
+ - (CUM).arg_count[(int) SH_ARG_INT]); \
\
- MODE_ = ((CUM).byref && (TYPE) \
- ? TYPE_MODE (TYPE_) : (MODE_)); \
- dwords = (((CUM).byref \
- ? (CUM).byref \
- : (MODE_) == BLKmode \
- ? int_size_in_bytes (TYPE_) \
- : GET_MODE_SIZE (MODE_)) + 7) / 8; \
- numregs = MIN (dwords, NPARM_REGS (SImode) \
- - (CUM).arg_count[(int) SH_ARG_INT]); \
if (numregs) \
{ \
(CUM).arg_count[(int) SH_ARG_INT] += numregs; \
@@ -1885,13 +1982,12 @@ do { \
} \
} \
} \
- else if (! TARGET_SH4 || PASS_IN_REG_P ((CUM), (MODE_), (TYPE))) \
- ((CUM).arg_count[(int) GET_SH_ARG_CLASS (MODE_)] \
- = (ROUND_REG ((CUM), (MODE_)) \
- + ((MODE_) == BLKmode \
+ else if (! TARGET_SH4 || PASS_IN_REG_P ((CUM), (MODE), (TYPE))) \
+ ((CUM).arg_count[(int) GET_SH_ARG_CLASS (MODE)] \
+ = (ROUND_REG ((CUM), (MODE)) \
+ + ((MODE) == BLKmode \
? ROUND_ADVANCE (int_size_in_bytes (TYPE)) \
- : ROUND_ADVANCE (GET_MODE_SIZE (MODE_))))); \
-} while (0)
+ : ROUND_ADVANCE (GET_MODE_SIZE (MODE)))))
/* Return boolean indicating arg of mode MODE will be passed in a reg.
This macro is only used in this file. */
@@ -1911,6 +2007,24 @@ do { \
<= NPARM_REGS (MODE))) \
: ROUND_REG ((CUM), (MODE)) < NPARM_REGS (MODE)))
+/* By accident we got stuck with passing SCmode on SH4 little endian
+ in two registers that are nominally successive - which is different from
+ two single SFmode values, where we take endianness translation into
+ account. That does not work at all if an odd number of registers is
+ already in use, so that got fixed, but library functions are still more
+ likely to use complex numbers without mixing them with SFmode arguments
+ (which in C would have to be structures), so for the sake of ABI
+ compatibility the way SCmode values are passed when an even number of
+ FP registers is in use remains different from a pair of SFmode values for
+ now.
+ I.e.:
+ foo (double); a: fr5,fr4
+ foo (float a, float b); a: fr5 b: fr4
+ foo (__complex float a); a.real fr4 a.imag: fr5 - for consistency,
+ this should be the other way round...
+ foo (float a, __complex float b); a: fr5 b.real: fr4 b.imag: fr7 */
+#define FUNCTION_ARG_SCmode_WART 1
+
/* Define where to put the arguments to a function.
Value is zero to push the argument on the stack,
or a hard register in which to store the argument.
@@ -1930,29 +2044,44 @@ do { \
its data type forbids. */
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
- FUNCTION_ARG_1 ((CUM), OLD_ARG_MODE ((MODE), (TYPE)), (MODE), (TYPE), (NAMED))
-
-#define FUNCTION_ARG_1(CUM, MODE, NEW_MODE, TYPE, NAMED) \
((! TARGET_SH5 \
&& PASS_IN_REG_P ((CUM), (MODE), (TYPE)) \
&& ((NAMED) || !TARGET_HITACHI)) \
- ? gen_rtx_REG ((NEW_MODE), \
- ((BASE_ARG_REG (MODE) + ROUND_REG ((CUM), (MODE))) \
- ^ ((MODE) == SFmode && TARGET_SH4 \
- && TARGET_LITTLE_ENDIAN != 0))) \
+ ? (((MODE) == SCmode && TARGET_SH4 && TARGET_LITTLE_ENDIAN \
+ && (! FUNCTION_ARG_SCmode_WART || (ROUND_REG ((CUM), (MODE)) & 1)))\
+ ? (gen_rtx_PARALLEL \
+ (SCmode, \
+ (gen_rtvec \
+ (2, \
+ (gen_rtx_EXPR_LIST \
+ (VOIDmode, \
+ gen_rtx_REG (SFmode, \
+ BASE_ARG_REG (MODE) \
+ + ROUND_REG ((CUM), (MODE)) ^ 1), \
+ const0_rtx)), \
+ (gen_rtx_EXPR_LIST \
+ (VOIDmode, \
+ gen_rtx_REG (SFmode, \
+ BASE_ARG_REG (MODE) \
+ + (ROUND_REG ((CUM), (MODE)) + 1) ^ 1), \
+ GEN_INT (4))))))) \
+ : gen_rtx_REG ((MODE), \
+ ((BASE_ARG_REG (MODE) + ROUND_REG ((CUM), (MODE))) \
+ ^ ((MODE) == SFmode && TARGET_SH4 \
+ && TARGET_LITTLE_ENDIAN != 0)))) \
: TARGET_SH5 \
? ((MODE) == VOIDmode && TARGET_SHCOMPACT \
? GEN_INT ((CUM).call_cookie) \
/* The following test assumes unnamed arguments are promoted to \
DFmode. */ \
: (MODE) == SFmode && (CUM).free_single_fp_reg \
- ? SH5_PROTOTYPED_FLOAT_ARG ((CUM), (NEW_MODE), (CUM).free_single_fp_reg) \
+ ? SH5_PROTOTYPED_FLOAT_ARG ((CUM), (MODE), (CUM).free_single_fp_reg) \
: (GET_SH_ARG_CLASS (MODE) == SH_ARG_FLOAT \
&& ((NAMED) || ! (CUM).prototype_p) \
&& (CUM).arg_count[(int) SH_ARG_FLOAT] < NPARM_REGS (SFmode)) \
? ((! (CUM).prototype_p && TARGET_SHMEDIA) \
- ? SH5_PROTOTYPELESS_FLOAT_ARG ((CUM), (NEW_MODE)) \
- : SH5_PROTOTYPED_FLOAT_ARG ((CUM), (NEW_MODE), \
+ ? SH5_PROTOTYPELESS_FLOAT_ARG ((CUM), (MODE)) \
+ : SH5_PROTOTYPED_FLOAT_ARG ((CUM), (MODE), \
FIRST_FP_PARM_REG \
+ (CUM).arg_count[(int) SH_ARG_FLOAT])) \
: ((CUM).arg_count[(int) SH_ARG_INT] < NPARM_REGS (SImode) \
@@ -1960,7 +2089,7 @@ do { \
|| (! SHCOMPACT_FORCE_ON_STACK ((MODE), (TYPE)) \
&& ! SH5_WOULD_BE_PARTIAL_NREGS ((CUM), (MODE), \
(TYPE), (NAMED))))) \
- ? gen_rtx_REG ((NEW_MODE), (FIRST_PARM_REG \
+ ? gen_rtx_REG ((MODE), (FIRST_PARM_REG \
+ (CUM).arg_count[(int) SH_ARG_INT])) \
: 0) \
: 0)
@@ -1971,7 +2100,7 @@ do { \
loads them into the full 64-bits registers. */
#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM,MODE,TYPE,NAMED) \
(MUST_PASS_IN_STACK ((MODE), (TYPE)) \
- || SHCOMPACT_BYREF ((CUM), OLD_ARG_MODE ((MODE), (TYPE)), (TYPE), (NAMED)))
+ || SHCOMPACT_BYREF ((CUM), (MODE), (TYPE), (NAMED)))
#define SHCOMPACT_BYREF(CUM, MODE, TYPE, NAMED) \
((CUM).byref \
@@ -2085,7 +2214,9 @@ do { \
: 0)
#define SH5_WOULD_BE_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- (TARGET_SH5 && ((MODE) == BLKmode || (MODE) == TImode) \
+ (TARGET_SH5 \
+ && ((MODE) == BLKmode || (MODE) == TImode || (MODE) == CDImode \
+ || (MODE) == DCmode) \
&& ((CUM).arg_count[(int) SH_ARG_INT] \
+ (int_size_in_bytes (TYPE) + 7) / 8) > NPARM_REGS (SImode))
@@ -2300,8 +2431,19 @@ while (0)
&& GET_CODE (XEXP (XEXP (XEXP ((OP), 0), 0), 0)) == LABEL_REF \
&& GET_CODE (XEXP (XEXP (XEXP ((OP), 0), 0), 1)) == CONST_INT)))
-/* The `S' constraint is a 16-bit constant, literal or symbolic. */
-#define EXTRA_CONSTRAINT_S(OP) \
+/* Extra address constraints. */
+#define EXTRA_CONSTRAINT_A(OP, STR) 0
+
+/* Constraint for selecting FLDI0 or FLDI1 instruction. If the clobber
+ operand is not SCRATCH (i.e. REG) then R0 is probably being
+ used, hence mova is being used, hence do not select this pattern */
+#define EXTRA_CONSTRAINT_Bsc(OP) (GET_CODE(OP) == SCRATCH)
+#define EXTRA_CONSTRAINT_B(OP, STR) \
+ ((STR)[1] == 's' && (STR)[2] == 'c' ? EXTRA_CONSTRAINT_Bsc (OP) \
+ : 0)
+
+/* The `C16' constraint is a 16-bit constant, literal or symbolic. */
+#define EXTRA_CONSTRAINT_C16(OP) \
(GET_CODE (OP) == CONST \
&& GET_CODE (XEXP ((OP), 0)) == SIGN_EXTEND \
&& GET_MODE (XEXP ((OP), 0)) == DImode \
@@ -2350,6 +2492,14 @@ while (0)
(GET_CODE (OP) == CONST && GET_CODE (XEXP ((OP), 0)) == UNSPEC \
&& XINT (XEXP ((OP), 0), 1) == UNSPEC_PIC)
+#define PIC_OFFSET_P(OP) \
+ (PIC_ADDR_P (OP) \
+ && GET_CODE (XVECEXP (XEXP ((OP), 0), 0, 0)) == MINUS \
+ && reg_mentioned_p (pc_rtx, XEXP (XVECEXP (XEXP ((OP), 0), 0, 0), 1)))
+
+#define PIC_DIRECT_ADDR_P(OP) \
+ (PIC_ADDR_P (OP) && GET_CODE (XVECEXP (XEXP ((OP), 0), 0, 0)) != MINUS)
+
#define NON_PIC_REFERENCE_P(OP) \
(GET_CODE (OP) == LABEL_REF || GET_CODE (OP) == SYMBOL_REF \
|| DATALABEL_REF_P (OP) \
@@ -2363,14 +2513,17 @@ while (0)
|| GOTOFF_P (OP) || PIC_ADDR_P (OP))
#define MOVI_SHORI_BASE_OPERAND_P(OP) \
- (flag_pic ? PIC_REFERENCE_P (OP) : NON_PIC_REFERENCE_P (OP))
+ (flag_pic \
+ ? (GOT_ENTRY_P (OP) || GOTPLT_ENTRY_P (OP) || GOTOFF_P (OP) \
+ || PIC_OFFSET_P (OP)) \
+ : NON_PIC_REFERENCE_P (OP))
-/* The `T' constraint is a label or a symbol. */
-#define EXTRA_CONSTRAINT_T(OP) \
- (NON_PIC_REFERENCE_P (OP))
+/* The `Csy' constraint is a label or a symbol. */
+#define EXTRA_CONSTRAINT_Csy(OP) \
+ (NON_PIC_REFERENCE_P (OP) || PIC_DIRECT_ADDR_P (OP))
/* A zero in any shape or form. */
-#define EXTRA_CONSTRAINT_U(OP) \
+#define EXTRA_CONSTRAINT_Z(OP) \
((OP) == CONST0_RTX (GET_MODE (OP)))
/* Any vector constant we can handle. */
@@ -2381,16 +2534,36 @@ while (0)
? sh_const_vec ((OP), VOIDmode) \
: sh_1el_vec ((OP), VOIDmode))))
-#define EXTRA_CONSTRAINT_Z(OP) \
- (GET_CODE (OP) == CONST_INT \
- && (INTVAL (OP) == (unsigned) 0xffffffff \
- || INTVAL (OP) == (HOST_WIDE_INT) -1 << 32))
+/* A non-explicit constant that can be loaded directly into a general purpose
+ register. This is like 's' except we don't allow PIC_DIRECT_ADDR_P. */
+#define EXTRA_CONSTRAINT_Cpg(OP) \
+ (CONSTANT_P (OP) \
+ && GET_CODE (OP) != CONST_INT \
+ && GET_CODE (OP) != CONST_DOUBLE \
+ && (!flag_pic \
+ || (LEGITIMATE_PIC_OPERAND_P (OP) \
+ && (! PIC_ADDR_P (OP) || PIC_OFFSET_P (OP)) \
+ && GET_CODE (OP) != LABEL_REF)))
+#define EXTRA_CONSTRAINT_C(OP, STR) \
+ ((STR)[1] == '1' && (STR)[2] == '6' ? EXTRA_CONSTRAINT_C16 (OP) \
+ : (STR)[1] == 's' && (STR)[2] == 'y' ? EXTRA_CONSTRAINT_Csy (OP) \
+ : (STR)[1] == 'p' && (STR)[2] == 'g' ? EXTRA_CONSTRAINT_Cpg (OP) \
+ : 0)
-#define EXTRA_CONSTRAINT(OP, C) \
+#define EXTRA_MEMORY_CONSTRAINT(C,STR) ((C) == 'S')
+#define EXTRA_CONSTRAINT_Sr0(OP) \
+ (memory_operand((OP), GET_MODE (OP)) \
+ && ! refers_to_regno_p (R0_REG, R0_REG + 1, OP, (rtx *)0))
+#define EXTRA_CONSTRAINT_S(OP, STR) \
+ ((STR)[1] == 'r' && (STR)[2] == '0' ? EXTRA_CONSTRAINT_Sr0 (OP) \
+ : 0)
+
+#define EXTRA_CONSTRAINT_STR(OP, C, STR) \
((C) == 'Q' ? EXTRA_CONSTRAINT_Q (OP) \
- : (C) == 'S' ? EXTRA_CONSTRAINT_S (OP) \
- : (C) == 'T' ? EXTRA_CONSTRAINT_T (OP) \
- : (C) == 'U' ? EXTRA_CONSTRAINT_U (OP) \
+ : (C) == 'A' ? EXTRA_CONSTRAINT_A ((OP), (STR)) \
+ : (C) == 'B' ? EXTRA_CONSTRAINT_B ((OP), (STR)) \
+ : (C) == 'C' ? EXTRA_CONSTRAINT_C ((OP), (STR)) \
+ : (C) == 'S' ? EXTRA_CONSTRAINT_S ((OP), (STR)) \
: (C) == 'W' ? EXTRA_CONSTRAINT_W (OP) \
: (C) == 'Z' ? EXTRA_CONSTRAINT_Z (OP) \
: 0)
@@ -2774,10 +2947,11 @@ while (0)
/* We can't directly access anything that contains a symbol,
nor can we indirect via the constant pool. */
#define LEGITIMATE_PIC_OPERAND_P(X) \
- (! nonpic_symbol_mentioned_p (X) \
- && (GET_CODE (X) != SYMBOL_REF \
- || ! CONSTANT_POOL_ADDRESS_P (X) \
- || ! nonpic_symbol_mentioned_p (get_pool_constant (X))))
+ ((! nonpic_symbol_mentioned_p (X) \
+ && (GET_CODE (X) != SYMBOL_REF \
+ || ! CONSTANT_POOL_ADDRESS_P (X) \
+ || ! nonpic_symbol_mentioned_p (get_pool_constant (X)))) \
+ || (TARGET_SHMEDIA && GET_CODE (X) == LABEL_REF))
#define SYMBOLIC_CONST_P(X) \
((GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == LABEL_REF) \
@@ -2819,10 +2993,6 @@ while (0)
the end of the line. */
#define ASM_COMMENT_START "!"
-/* The text to go at the start of the assembler file. */
-#define ASM_FILE_START(STREAM) \
- output_file_start (STREAM)
-
#define ASM_APP_ON ""
#define ASM_APP_OFF ""
#define FILE_ASM_OP "\t.file\n"
@@ -3136,7 +3306,7 @@ extern enum mdep_reorg_phase_e mdep_reorg_phase;
#define TARGET_MEM_FUNCTIONS
-/* Handle Hitachi compiler's pragmas. */
+/* Handle Renesas compiler's pragmas. */
#define REGISTER_TARGET_PRAGMAS() do { \
c_register_pragma (0, "interrupt", sh_pr_interrupt); \
c_register_pragma (0, "trapa", sh_pr_trapa); \
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index f662dc6efb4..1d72db6cb89 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -1,4 +1,4 @@
-;;- Machine description for Hitachi / SuperH SH.
+;;- Machine description for Renesas / SuperH SH.
;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
;; Free Software Foundation, Inc.
;; Contributed by Steve Chamberlain (sac@cygnus.com).
@@ -628,7 +628,7 @@
(define_insn ""
[(set (reg:SI T_REG)
(eq:SI (and:SI (match_operand:SI 0 "arith_reg_operand" "z,r")
- (match_operand:SI 1 "arith_operand" "L,r"))
+ (match_operand:SI 1 "arith_operand" "K08,r"))
(const_int 0)))]
"TARGET_SH1"
"tst %1,%0"
@@ -643,7 +643,7 @@
(define_insn "cmpeqsi_t"
[(set (reg:SI T_REG)
(eq:SI (match_operand:SI 0 "arith_reg_operand" "r,z,r")
- (match_operand:SI 1 "arith_operand" "N,rI,r")))]
+ (match_operand:SI 1 "arith_operand" "N,rI08,r")))]
"TARGET_SH1"
"@
tst %0,%0
@@ -997,7 +997,7 @@
(define_insn "*adddi3_media"
[(set (match_operand:DI 0 "arith_reg_operand" "=r,r")
(plus:DI (match_operand:DI 1 "arith_reg_operand" "%r,r")
- (match_operand:DI 2 "arith_operand" "r,P")))]
+ (match_operand:DI 2 "arith_operand" "r,I10")))]
"TARGET_SHMEDIA"
"@
add %1, %2, %0
@@ -1079,7 +1079,7 @@
(define_insn "addsi3_media"
[(set (match_operand:SI 0 "arith_reg_operand" "=r,r")
(plus:SI (match_operand:SI 1 "extend_reg_operand" "%r,r")
- (match_operand:SI 2 "arith_operand" "r,P")))]
+ (match_operand:SI 2 "arith_operand" "r,I10")))]
"TARGET_SHMEDIA"
"@
add.l %1, %2, %0
@@ -1089,7 +1089,7 @@
(define_insn "*addsi3_compact"
[(set (match_operand:SI 0 "arith_reg_operand" "=r")
(plus:SI (match_operand:SI 1 "arith_operand" "%0")
- (match_operand:SI 2 "arith_operand" "rI")))]
+ (match_operand:SI 2 "arith_operand" "rI08")))]
"TARGET_SH1"
"add %2,%0"
[(set_attr "type" "arith")])
@@ -1950,7 +1950,7 @@
(define_insn "*andsi3_compact"
[(set (match_operand:SI 0 "arith_reg_operand" "=r,z")
(and:SI (match_operand:SI 1 "arith_reg_operand" "%0,0")
- (match_operand:SI 2 "logical_operand" "r,L")))]
+ (match_operand:SI 2 "logical_operand" "r,K08")))]
"TARGET_SH1"
"and %2,%0"
[(set_attr "type" "arith")])
@@ -1976,7 +1976,7 @@
(define_insn_and_split "anddi3"
[(set (match_operand:DI 0 "arith_reg_operand" "=r,r,r")
(and:DI (match_operand:DI 1 "arith_reg_operand" "%r,r,r")
- (match_operand:DI 2 "and_operand" "r,P,Z")))]
+ (match_operand:DI 2 "and_operand" "r,I10,J16")))]
"TARGET_SHMEDIA"
"@
and %1, %2, %0
@@ -2006,7 +2006,7 @@
(define_insn "iorsi3"
[(set (match_operand:SI 0 "arith_reg_operand" "=r,z")
(ior:SI (match_operand:SI 1 "arith_reg_operand" "%0,0")
- (match_operand:SI 2 "logical_operand" "r,L")))]
+ (match_operand:SI 2 "logical_operand" "r,K08")))]
"TARGET_SH1"
"or %2,%0"
[(set_attr "type" "arith")])
@@ -2014,7 +2014,7 @@
(define_insn "iordi3"
[(set (match_operand:DI 0 "arith_reg_operand" "=r,r")
(ior:DI (match_operand:DI 1 "arith_reg_operand" "%r,r")
- (match_operand:DI 2 "logical_operand" "r,P")))]
+ (match_operand:DI 2 "logical_operand" "r,I10")))]
"TARGET_SHMEDIA"
"@
or %1, %2, %0
@@ -2024,7 +2024,7 @@
(define_insn "xorsi3"
[(set (match_operand:SI 0 "arith_reg_operand" "=z,r")
(xor:SI (match_operand:SI 1 "arith_reg_operand" "%0,0")
- (match_operand:SI 2 "logical_operand" "L,r")))]
+ (match_operand:SI 2 "logical_operand" "K08,r")))]
"TARGET_SH1"
"xor %2,%0"
[(set_attr "type" "arith")])
@@ -2032,7 +2032,7 @@
(define_insn "xordi3"
[(set (match_operand:DI 0 "arith_reg_operand" "=r,r")
(xor:DI (match_operand:DI 1 "arith_reg_operand" "%r,r")
- (match_operand:DI 2 "shmedia_6bit_operand" "r,O")))]
+ (match_operand:DI 2 "shmedia_6bit_operand" "r,I06")))]
"TARGET_SHMEDIA"
"@
xor %1, %2, %0
@@ -2224,11 +2224,11 @@
(define_insn_and_split "ashlsi3_std"
[(set (match_operand:SI 0 "arith_reg_operand" "=r,r,r,r")
(ashift:SI (match_operand:SI 1 "arith_reg_operand" "0,0,0,0")
- (match_operand:SI 2 "nonmemory_operand" "r,M,K,?ri")))
+ (match_operand:SI 2 "nonmemory_operand" "r,M,P27,?ri")))
(clobber (match_scratch:SI 3 "=X,X,X,&r"))]
"TARGET_SH3
|| (TARGET_SH1 && GET_CODE (operands[2]) == CONST_INT
- && CONST_OK_FOR_K (INTVAL (operands[2])))"
+ && CONST_OK_FOR_P27 (INTVAL (operands[2])))"
"@
shld %2,%0
add %0,%0
@@ -2237,7 +2237,7 @@
"TARGET_SH3
&& reload_completed
&& GET_CODE (operands[2]) == CONST_INT
- && ! CONST_OK_FOR_K (INTVAL (operands[2]))"
+ && ! CONST_OK_FOR_P27 (INTVAL (operands[2]))"
[(set (match_dup 3) (match_dup 2))
(parallel
[(set (match_dup 0) (ashift:SI (match_dup 1) (match_dup 3)))
@@ -2249,8 +2249,8 @@
(define_insn "ashlhi3_k"
[(set (match_operand:HI 0 "arith_reg_operand" "=r,r")
(ashift:HI (match_operand:HI 1 "arith_reg_operand" "0,0")
- (match_operand:HI 2 "const_int_operand" "M,K")))]
- "TARGET_SH1 && CONST_OK_FOR_K (INTVAL (operands[2]))"
+ (match_operand:HI 2 "const_int_operand" "M,P27")))]
+ "TARGET_SH1 && CONST_OK_FOR_P27 (INTVAL (operands[2]))"
"@
add %0,%0
shll%O2 %0"
@@ -2494,8 +2494,8 @@
(define_insn "lshrsi3_k"
[(set (match_operand:SI 0 "arith_reg_operand" "=r")
(lshiftrt:SI (match_operand:SI 1 "arith_reg_operand" "0")
- (match_operand:SI 2 "const_int_operand" "K")))]
- "TARGET_SH1 && CONST_OK_FOR_K (INTVAL (operands[2]))
+ (match_operand:SI 2 "const_int_operand" "P27")))]
+ "TARGET_SH1 && CONST_OK_FOR_P27 (INTVAL (operands[2]))
&& ! CONST_OK_FOR_M (INTVAL (operands[2]))"
"shlr%O2 %0"
[(set_attr "type" "arith")])
@@ -3343,7 +3343,7 @@
(define_expand "push_fpscr"
[(const_int 0)]
- "TARGET_SH3E"
+ "TARGET_SH2E"
"
{
rtx insn = emit_insn (gen_fpu_switch (gen_rtx (MEM, PSImode,
@@ -3356,7 +3356,7 @@
(define_expand "pop_fpscr"
[(const_int 0)]
- "TARGET_SH3E"
+ "TARGET_SH2E"
"
{
rtx insn = emit_insn (gen_fpu_switch (get_fpscr_rtx (),
@@ -3385,8 +3385,10 @@
;; (set (subreg:SI (mem:QI (plus:SI (reg:SI SP_REG) (const_int 12)) 0) 0)
;; (made from (set (subreg:SI (reg:QI ###) 0) ) into T.
(define_insn "movsi_i"
- [(set (match_operand:SI 0 "general_movdst_operand" "=r,r,t,r,r,r,r,m,<,<,x,l,x,l,r")
- (match_operand:SI 1 "general_movsrc_operand" "Q,rI,r,mr,x,l,t,r,x,l,r,r,>,>,i"))]
+ [(set (match_operand:SI 0 "general_movdst_operand"
+ "=r,r,t,r,r,r,r,m,<,<,x,l,x,l,r")
+ (match_operand:SI 1 "general_movsrc_operand"
+ "Q,rI08,r,mr,x,l,t,r,x,l,r,r,>,>,i"))]
"TARGET_SH1
&& ! TARGET_SH2E
&& (register_operand (operands[0], SImode)
@@ -3417,8 +3419,10 @@
;; ??? We can't include f/f because we need the proper FPSCR setting when
;; TARGET_FMOVD is in effect, and mode switching is done before reload.
(define_insn "movsi_ie"
- [(set (match_operand:SI 0 "general_movdst_operand" "=r,r,t,r,r,r,r,m,<,<,x,l,x,l,y,<,r,y,r,*f,y,*f,y")
- (match_operand:SI 1 "general_movsrc_operand" "Q,rI,r,mr,x,l,t,r,x,l,r,r,>,>,>,y,i,r,y,y,*f,*f,y"))]
+ [(set (match_operand:SI 0 "general_movdst_operand"
+ "=r,r,t,r,r,r,r,m,<,<,x,l,x,l,y,<,r,y,r,*f,y,*f,y")
+ (match_operand:SI 1 "general_movsrc_operand"
+ "Q,rI08,r,mr,x,l,t,r,x,l,r,r,>,>,>,y,i,r,y,y,*f,*f,y"))]
"TARGET_SH2E
&& (register_operand (operands[0], SImode)
|| register_operand (operands[1], SImode))"
@@ -3452,7 +3456,7 @@
(define_insn "movsi_i_lowpart"
[(set (strict_low_part (match_operand:SI 0 "general_movdst_operand" "+r,r,r,r,r,r,m,r"))
- (match_operand:SI 1 "general_movsrc_operand" "Q,rI,mr,x,l,t,r,i"))]
+ (match_operand:SI 1 "general_movsrc_operand" "Q,rI08,mr,x,l,t,r,i"))]
"TARGET_SH1
&& (register_operand (operands[0], SImode)
|| register_operand (operands[1], SImode))"
@@ -3468,8 +3472,10 @@
[(set_attr "type" "pcload,move,load,move,prget,move,store,pcload")])
(define_insn "*movsi_media"
- [(set (match_operand:SI 0 "general_movdst_operand" "=r,r,r,r,m,f,m,f,r,f,*b,r,b")
- (match_operand:SI 1 "general_movsrc_operand" "r,JS,ns,m,rU,m,f,rU,f,f,r,*b,T"))]
+ [(set (match_operand:SI 0 "general_movdst_operand"
+ "=r,r,r,r,m,f,m,f,r,f,*b,r,b")
+ (match_operand:SI 1 "general_movsrc_operand"
+ "r,I16C16,nCpg,m,rZ,m,f,rZ,f,f,r,*b,Csy"))]
"TARGET_SHMEDIA_FPU
&& (register_operand (operands[0], SImode)
|| sh_register_operand (operands[1], SImode))"
@@ -3491,8 +3497,10 @@
(set_attr "length" "4,4,8,4,4,4,4,4,4,4,4,4,12")])
(define_insn "*movsi_media_nofpu"
- [(set (match_operand:SI 0 "general_movdst_operand" "=r,r,r,r,m,*b,r,b")
- (match_operand:SI 1 "general_movsrc_operand" "r,JS,ns,m,rU,r,*b,T"))]
+ [(set (match_operand:SI 0 "general_movdst_operand"
+ "=r,r,r,r,m,*b,r,b")
+ (match_operand:SI 1 "general_movsrc_operand"
+ "r,I16C16,nCpg,m,rZ,r,*b,Csy"))]
"TARGET_SHMEDIA
&& (register_operand (operands[0], SImode)
|| sh_register_operand (operands[1], SImode))"
@@ -3525,7 +3533,7 @@
(match_operand:SI 1 "immediate_operand" ""))]
"TARGET_SHMEDIA && reload_completed
&& ((GET_CODE (operands[1]) == CONST_INT
- && ! CONST_OK_FOR_J (INTVAL (operands[1])))
+ && ! CONST_OK_FOR_I16 (INTVAL (operands[1])))
|| GET_CODE (operands[1]) == CONST_DOUBLE)"
[(set (subreg:DI (match_dup 0) 0) (match_dup 1))])
@@ -3641,7 +3649,7 @@
(define_insn "*movqi_media"
[(set (match_operand:QI 0 "general_movdst_operand" "=r,r,r,m")
- (match_operand:QI 1 "general_movsrc_operand" "r,JS,m,rU"))]
+ (match_operand:QI 1 "general_movsrc_operand" "r,I16C16,m,rZ"))]
"TARGET_SHMEDIA
&& (arith_reg_operand (operands[0], QImode)
|| arith_reg_or_0_operand (operands[1], QImode))"
@@ -3674,12 +3682,17 @@
operands[3] = gen_rtx_REG (DImode, REGNO (operands[2]));
}")
+/* When storing r0, we have to avoid reg+reg addressing. */
(define_insn "movhi_i"
- [(set (match_operand:HI 0 "general_movdst_operand" "=r,r,r,r,m,r,l,r")
- (match_operand:HI 1 "general_movsrc_operand" "Q,rI,m,t,r,l,r,i"))]
+ [(set (match_operand:HI 0 "general_movdst_operand" "=r,r,r,r,m,r,l,r")
+ (match_operand:HI 1 "general_movsrc_operand" "Q,rI08,m,t,r,l,r,i"))]
"TARGET_SH1
&& (arith_reg_operand (operands[0], HImode)
- || arith_reg_operand (operands[1], HImode))"
+ || arith_reg_operand (operands[1], HImode))
+ && (GET_CODE (operands[0]) != MEM
+ || GET_CODE (XEXP (operands[0], 0)) != PLUS
+ || GET_CODE (XEXP (XEXP (operands[0], 0), 1)) != REG
+ || ! refers_to_regno_p (R0_REG, R0_REG + 1, operands[1], (rtx *)0))"
"@
mov.w %1,%0
mov %1,%0
@@ -3692,8 +3705,8 @@
[(set_attr "type" "pcload,move,load,move,store,move,move,pcload")])
(define_insn "*movhi_media"
- [(set (match_operand:HI 0 "general_movdst_operand" "=r,r,r,r,m")
- (match_operand:HI 1 "general_movsrc_operand" "r,JS,n,m,rU"))]
+ [(set (match_operand:HI 0 "general_movdst_operand" "=r,r,r,r,m")
+ (match_operand:HI 1 "general_movsrc_operand" "r,I16C16,n,m,rZ"))]
"TARGET_SHMEDIA
&& (arith_reg_operand (operands[0], HImode)
|| arith_reg_or_0_operand (operands[1], HImode))"
@@ -3709,7 +3722,7 @@
[(set (match_operand:HI 0 "register_operand" "")
(match_operand:HI 1 "immediate_operand" ""))]
"TARGET_SHMEDIA && reload_completed
- && ! CONST_OK_FOR_J (INTVAL (operands[1]))"
+ && ! CONST_OK_FOR_I16 (INTVAL (operands[1]))"
[(set (subreg:DI (match_dup 0) 0) (match_dup 1))])
(define_expand "movhi"
@@ -3738,7 +3751,7 @@
;; compiled with -m2 -ml -O3 -funroll-loops
(define_insn "*movdi_i"
[(set (match_operand:DI 0 "general_movdst_operand" "=r,r,r,m,r,r,r,*!x")
- (match_operand:DI 1 "general_movsrc_operand" "Q,r,m,r,I,i,x,r"))]
+ (match_operand:DI 1 "general_movsrc_operand" "Q,r,m,r,I08,i,x,r"))]
"TARGET_SH1
&& (arith_reg_operand (operands[0], DImode)
|| arith_reg_operand (operands[1], DImode))"
@@ -3796,8 +3809,10 @@
}")
(define_insn "*movdi_media"
- [(set (match_operand:DI 0 "general_movdst_operand" "=r,r,r,rl,m,f,m,f,r,f,*b,r,b")
- (match_operand:DI 1 "general_movsrc_operand" "r,JS,iF,m,rlU,m,f,rU,f,f,r,*b,T"))]
+ [(set (match_operand:DI 0 "general_movdst_operand"
+ "=r,r,r,rl,m,f,m,f,r,f,*b,r,b")
+ (match_operand:DI 1 "general_movsrc_operand"
+ "r,I16C16,nCpgF,m,rlZ,m,f,rZ,f,f,r,*b,Csy"))]
"TARGET_SHMEDIA_FPU
&& (register_operand (operands[0], DImode)
|| sh_register_operand (operands[1], DImode))"
@@ -3820,7 +3835,7 @@
(define_insn "*movdi_media_nofpu"
[(set (match_operand:DI 0 "general_movdst_operand" "=r,r,r,rl,m,*b,r,b")
- (match_operand:DI 1 "general_movsrc_operand" "r,JS,iF,m,rlU,r,*b,T"))]
+ (match_operand:DI 1 "general_movsrc_operand" "r,I16C16,nCpgF,m,rlZ,r,*b,Csy"))]
"TARGET_SHMEDIA
&& (register_operand (operands[0], DImode)
|| sh_register_operand (operands[1], DImode))"
@@ -3935,7 +3950,7 @@
(match_operand:DI 1 "immediate_operand" ""))]
"TARGET_SHMEDIA && reload_completed
&& GET_CODE (operands[1]) == CONST_INT
- && ! CONST_OK_FOR_J (INTVAL (operands[1]))"
+ && ! CONST_OK_FOR_I16 (INTVAL (operands[1]))"
[(set (match_dup 0) (match_dup 2))
(match_dup 1)]
"
@@ -3961,7 +3976,7 @@
{
/* If we can't generate the constant with a two-insn movi / shori
sequence, try some other strategies. */
- if (! CONST_OK_FOR_J (high))
+ if (! CONST_OK_FOR_I16 (high))
{
/* Try constant load / left shift. We know VAL != 0. */
val2 = val ^ (val-1);
@@ -3969,9 +3984,9 @@
{
int trailing_zeroes = exact_log2 ((val2 >> 16) + 1) + 15;
- if (CONST_OK_FOR_J (val >> trailing_zeroes)
- || (! CONST_OK_FOR_J (high >> 16)
- && CONST_OK_FOR_J (val >> (trailing_zeroes + 16))))
+ if (CONST_OK_FOR_I16 (val >> trailing_zeroes)
+ || (! CONST_OK_FOR_I16 (high >> 16)
+ && CONST_OK_FOR_I16 (val >> (trailing_zeroes + 16))))
{
val2 = (HOST_WIDE_INT) val >> trailing_zeroes;
operands[1] = gen_ashldi3_media (operands[0], operands[0],
@@ -3986,7 +4001,7 @@
int shift = 49 - exact_log2 (val2);
val2 = trunc_int_for_mode (val << shift, DImode);
- if (CONST_OK_FOR_J (val2))
+ if (CONST_OK_FOR_I16 (val2))
{
operands[1] = gen_lshrdi3_media (operands[0], operands[0],
GEN_INT (shift));
@@ -4014,7 +4029,7 @@
}
/* Try movi / mshflo.l w/ r63. */
val2 = val + ((HOST_WIDE_INT) -1 << 32);
- if ((HOST_WIDE_INT) val2 < 0 && CONST_OK_FOR_J (val2))
+ if ((HOST_WIDE_INT) val2 < 0 && CONST_OK_FOR_I16 (val2))
{
operands[1] = gen_mshflo_l_di (operands[0], operands[0],
GEN_INT (0));
@@ -4074,7 +4089,7 @@
(const_int 16))
(zero_extend:DI
(truncate:HI
- (match_operand:DI 2 "immediate_operand" "JS,nF")))))]
+ (match_operand:DI 2 "immediate_operand" "I16C16,nF")))))]
"TARGET_SHMEDIA"
"@
shori %u2, %0
@@ -4089,7 +4104,7 @@
(define_insn "movdf_media"
[(set (match_operand:DF 0 "general_movdst_operand" "=f,f,r,r,r,f,m,r,m")
- (match_operand:DF 1 "general_movsrc_operand" "f,rU,f,r,F,m,f,m,rU"))]
+ (match_operand:DF 1 "general_movsrc_operand" "f,rZ,f,r,F,m,f,m,rZ"))]
"TARGET_SHMEDIA_FPU
&& (register_operand (operands[0], DFmode)
|| sh_register_operand (operands[1], DFmode))"
@@ -4107,7 +4122,7 @@
(define_insn "movdf_media_nofpu"
[(set (match_operand:DF 0 "general_movdst_operand" "=r,r,r,m")
- (match_operand:DF 1 "general_movsrc_operand" "r,F,m,rU"))]
+ (match_operand:DF 1 "general_movsrc_operand" "r,F,m,rZ"))]
"TARGET_SHMEDIA
&& (register_operand (operands[0], DFmode)
|| sh_register_operand (operands[1], DFmode))"
@@ -4632,7 +4647,7 @@
(define_insn_and_split "movv2sf_i"
[(set (match_operand:V2SF 0 "general_movdst_operand" "=f,rf,r,m,mf")
- (match_operand:V2SF 1 "general_operand" "fm,rfm?,F?,f,rfU?"))]
+ (match_operand:V2SF 1 "general_operand" "fm,rfm?,F?,f,rfZ?"))]
"TARGET_SHMEDIA_FPU"
"#"
"TARGET_SHMEDIA_FPU && reload_completed"
@@ -4699,7 +4714,7 @@
(define_insn_and_split "*movv4sf_i"
[(set (match_operand:V4SF 0 "nonimmediate_operand" "=f,f,m")
- (match_operand:V4SF 1 "general_operand" "fU,m,fU"))]
+ (match_operand:V4SF 1 "general_operand" "fZ,m,fZ"))]
"TARGET_SHMEDIA_FPU"
"#"
"&& reload_completed"
@@ -4797,7 +4812,7 @@
(define_insn "movsf_media"
[(set (match_operand:SF 0 "general_movdst_operand" "=f,f,r,r,r,f,m,r,m")
- (match_operand:SF 1 "general_movsrc_operand" "f,rU,f,r,F,m,f,m,rU"))]
+ (match_operand:SF 1 "general_movsrc_operand" "f,rZ,f,r,F,m,f,m,rZ"))]
"TARGET_SHMEDIA_FPU
&& (register_operand (operands[0], SFmode)
|| sh_register_operand (operands[1], SFmode))"
@@ -4815,7 +4830,7 @@
(define_insn "movsf_media_nofpu"
[(set (match_operand:SF 0 "general_movdst_operand" "=r,r,r,m")
- (match_operand:SF 1 "general_movsrc_operand" "r,F,m,rU"))]
+ (match_operand:SF 1 "general_movsrc_operand" "r,F,m,rZ"))]
"TARGET_SHMEDIA
&& (register_operand (operands[0], SFmode)
|| sh_register_operand (operands[1], SFmode))"
@@ -4846,7 +4861,7 @@
(define_insn "movsf_i"
[(set (match_operand:SF 0 "general_movdst_operand" "=r,r,r,r,m,l,r")
- (match_operand:SF 1 "general_movsrc_operand" "r,I,FQ,mr,r,r,l"))]
+ (match_operand:SF 1 "general_movsrc_operand" "r,G,FQ,mr,r,r,l"))]
"TARGET_SH1
&& (! TARGET_SH2E
/* ??? We provide some insn so that direct_{load,store}[SFmode] get set */
@@ -4856,7 +4871,7 @@
|| arith_reg_operand (operands[1], SFmode))"
"@
mov %1,%0
- mov %1,%0
+ mov #0,%0
mov.l %1,%0
mov.l %1,%0
mov.l %1,%0
@@ -4873,7 +4888,7 @@
(match_operand:SF 1 "general_movsrc_operand"
"f,r,G,H,FQ,mf,f,FQ,mr,r,y,f,>,fr,y,r,y,>,y"))
(use (match_operand:PSI 2 "fpscr_operand" "c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c"))
- (clobber (match_scratch:SI 3 "=X,X,X,X,&z,X,X,X,X,X,X,X,X,y,X,X,X,X,X"))]
+ (clobber (match_scratch:SI 3 "=X,X,Bsc,Bsc,&z,X,X,X,X,X,X,X,X,y,X,X,X,X,X"))]
"TARGET_SH2E
&& (arith_reg_operand (operands[0], SFmode)
@@ -4973,7 +4988,7 @@
(define_insn "*movsi_y"
[(set (match_operand:SI 0 "register_operand" "=y,y")
- (match_operand:SI 1 "immediate_operand" "Qi,I"))
+ (match_operand:SI 1 "immediate_operand" "Qi,I08"))
(clobber (match_scratch:SI 2 "=&z,r"))]
"TARGET_SH2E
&& (reload_in_progress || reload_completed)"
@@ -5059,7 +5074,7 @@
(define_expand "beq_media"
[(set (pc)
(if_then_else (eq (match_operand:DI 1 "arith_reg_operand" "r,r")
- (match_operand:DI 2 "arith_operand" "r,O"))
+ (match_operand:DI 2 "arith_operand" "r,I06"))
(label_ref:DI (match_operand 0 "" ""))
(pc)))]
"TARGET_SHMEDIA"
@@ -5069,7 +5084,7 @@
[(set (pc)
(if_then_else (match_operator 3 "equality_comparison_operator"
[(match_operand:DI 1 "arith_reg_operand" "r,r")
- (match_operand:DI 2 "arith_operand" "r,O")])
+ (match_operand:DI 2 "arith_operand" "r,I06")])
(match_operand:DI 0 "target_operand" "b,b")
(pc)))]
"TARGET_SHMEDIA"
@@ -5081,7 +5096,7 @@
(define_expand "bne_media"
[(set (pc)
(if_then_else (ne (match_operand:DI 1 "arith_reg_operand" "r,r")
- (match_operand:DI 2 "arith_operand" "r,O"))
+ (match_operand:DI 2 "arith_operand" "r,I06"))
(label_ref:DI (match_operand 0 "" ""))
(pc)))]
"TARGET_SHMEDIA"
@@ -6622,25 +6637,12 @@
}
")
-;; When generating PIC, we must match label_refs especially, because
-;; they do not satisfy LEGITIMATE_PIC_OPERAND_P(), and we don't want
-;; them to do, because they can't be loaded directly into
-;; non-branch-target registers.
-(define_insn "*pt"
- [(set (match_operand:DI 0 "target_reg_operand" "=b")
- (match_operand:DI 1 "" "T"))]
- "TARGET_SHMEDIA && flag_pic
- && EXTRA_CONSTRAINT_T (operands[1])"
- "pt %1, %0"
- [(set_attr "type" "pt_media")
- (set_attr "length" "*")])
-
(define_insn "*ptb"
[(set (match_operand:DI 0 "target_reg_operand" "=b")
- (const:DI (unspec:DI [(match_operand:DI 1 "" "T")]
+ (const:DI (unspec:DI [(match_operand:DI 1 "" "Csy")]
UNSPEC_DATALABEL)))]
"TARGET_SHMEDIA && flag_pic
- && EXTRA_CONSTRAINT_T (operands[1])"
+ && EXTRA_CONSTRAINT_Csy (operands[1])"
"ptb/u datalabel %1, %0"
[(set_attr "type" "pt_media")
(set_attr "length" "*")])
@@ -7222,6 +7224,12 @@ mov.l\\t1f,r0\\n\\
"blink %0, r63"
[(set_attr "type" "jump_media")])
+(define_insn "return_media_rte"
+ [(return)]
+ "TARGET_SHMEDIA && reload_completed && current_function_interrupt"
+ "rte"
+ [(set_attr "type" "jump_media")])
+
(define_expand "return_media"
[(return)]
"TARGET_SHMEDIA && reload_completed"
@@ -7230,6 +7238,11 @@ mov.l\\t1f,r0\\n\\
int tr_regno = sh_media_register_for_return ();
rtx tr;
+ if (current_function_interrupt)
+ {
+ emit_jump_insn (gen_return_media_rte ());
+ DONE;
+ }
if (tr_regno < 0)
{
rtx r18 = gen_rtx_REG (DImode, PR_MEDIA_REG);
@@ -8080,7 +8093,7 @@ mov.l\\t1f,r0\\n\\
(define_insn "fpu_switch"
[(set (match_operand:PSI 0 "general_movdst_operand" "=c,c,r,c,c,r,m,r,<")
(match_operand:PSI 1 "general_movsrc_operand" "c,>,m,m,r,r,r,!c,c"))]
- "TARGET_SH3E
+ "TARGET_SH2E
&& (! reload_completed
|| true_regnum (operands[0]) != FPSCR_REG
|| GET_CODE (operands[1]) != MEM
@@ -9349,7 +9362,7 @@ mov.l\\t1f,r0\\n\\
(define_insn "movv8qi_i"
[(set (match_operand:V8QI 0 "general_movdst_operand" "=r,r,r,rl,m")
- (match_operand:V8QI 1 "general_movsrc_operand" "r,JSU,nW,m,rlU"))]
+ (match_operand:V8QI 1 "general_movsrc_operand" "r,I16C16Z,nW,m,rlZ"))]
"TARGET_SHMEDIA
&& (register_operand (operands[0], V8QImode)
|| sh_register_operand (operands[1], V8QImode))"
@@ -9441,7 +9454,7 @@ mov.l\\t1f,r0\\n\\
(define_insn "movv2hi_i"
[(set (match_operand:V2HI 0 "general_movdst_operand" "=r,r,r,rl,m")
- (match_operand:V2HI 1 "general_movsrc_operand" "r,JSU,nW,m,rlU"))]
+ (match_operand:V2HI 1 "general_movsrc_operand" "r,I16C16Z,nW,m,rlZ"))]
"TARGET_SHMEDIA
&& (register_operand (operands[0], V2HImode)
|| sh_register_operand (operands[1], V2HImode))"
@@ -9462,7 +9475,7 @@ mov.l\\t1f,r0\\n\\
(define_insn "movv4hi_i"
[(set (match_operand:V4HI 0 "general_movdst_operand" "=r,r,r,rl,m")
- (match_operand:V4HI 1 "general_movsrc_operand" "r,JSU,nW,m,rlU"))]
+ (match_operand:V4HI 1 "general_movsrc_operand" "r,I16C16Z,nW,m,rlZ"))]
"TARGET_SHMEDIA
&& (register_operand (operands[0], V4HImode)
|| sh_register_operand (operands[1], V4HImode))"
@@ -9483,7 +9496,7 @@ mov.l\\t1f,r0\\n\\
(define_insn "movv2si_i"
[(set (match_operand:V2SI 0 "general_movdst_operand" "=r,r,r,rl,m")
- (match_operand:V2SI 1 "general_movsrc_operand" "r,JSU,nW,m,rlU"))]
+ (match_operand:V2SI 1 "general_movsrc_operand" "r,I16C16Z,nW,m,rlZ"))]
"TARGET_SHMEDIA
&& (register_operand (operands[0], V2SImode)
|| sh_register_operand (operands[1], V2SImode))"
@@ -9554,55 +9567,55 @@ mov.l\\t1f,r0\\n\\
(define_insn "negcmpeqv8qi"
[(set (match_operand:V8QI 0 "arith_reg_dest" "=r")
- (neg:V8QI (eq:V8QI (match_operand:V8QI 1 "arith_reg_or_0_operand" "%rU")
- (match_operand:V8QI 2 "arith_reg_or_0_operand" "rU"))))]
+ (neg:V8QI (eq:V8QI (match_operand:V8QI 1 "arith_reg_or_0_operand" "%rZ")
+ (match_operand:V8QI 2 "arith_reg_or_0_operand" "rZ"))))]
"TARGET_SHMEDIA"
"mcmpeq.b %N1, %N2, %0"
[(set_attr "type" "mcmp_media")])
(define_insn "negcmpeqv2si"
[(set (match_operand:V2SI 0 "arith_reg_dest" "=r")
- (neg:V2SI (eq:V2SI (match_operand:V2SI 1 "arith_reg_or_0_operand" "%rU")
- (match_operand:V2SI 2 "arith_reg_or_0_operand" "rU"))))]
+ (neg:V2SI (eq:V2SI (match_operand:V2SI 1 "arith_reg_or_0_operand" "%rZ")
+ (match_operand:V2SI 2 "arith_reg_or_0_operand" "rZ"))))]
"TARGET_SHMEDIA"
"mcmpeq.l %N1, %N2, %0"
[(set_attr "type" "mcmp_media")])
(define_insn "negcmpeqv4hi"
[(set (match_operand:V4HI 0 "arith_reg_dest" "=r")
- (neg:V4HI (eq:V4HI (match_operand:V4HI 1 "arith_reg_or_0_operand" "%rU")
- (match_operand:V4HI 2 "arith_reg_or_0_operand" "rU"))))]
+ (neg:V4HI (eq:V4HI (match_operand:V4HI 1 "arith_reg_or_0_operand" "%rZ")
+ (match_operand:V4HI 2 "arith_reg_or_0_operand" "rZ"))))]
"TARGET_SHMEDIA"
"mcmpeq.w %N1, %N2, %0"
[(set_attr "type" "mcmp_media")])
(define_insn "negcmpgtuv8qi"
[(set (match_operand:V8QI 0 "arith_reg_dest" "=r")
- (neg:V8QI (gtu:V8QI (match_operand:V8QI 1 "arith_reg_or_0_operand" "%rU")
- (match_operand:V8QI 2 "arith_reg_or_0_operand" "rU"))))]
+ (neg:V8QI (gtu:V8QI (match_operand:V8QI 1 "arith_reg_or_0_operand" "%rZ")
+ (match_operand:V8QI 2 "arith_reg_or_0_operand" "rZ"))))]
"TARGET_SHMEDIA"
"mcmpgt.ub %N1, %N2, %0"
[(set_attr "type" "mcmp_media")])
(define_insn "negcmpgtv2si"
[(set (match_operand:V2SI 0 "arith_reg_dest" "=r")
- (neg:V2SI (gt:V2SI (match_operand:V2SI 1 "arith_reg_or_0_operand" "%rU")
- (match_operand:V2SI 2 "arith_reg_or_0_operand" "rU"))))]
+ (neg:V2SI (gt:V2SI (match_operand:V2SI 1 "arith_reg_or_0_operand" "%rZ")
+ (match_operand:V2SI 2 "arith_reg_or_0_operand" "rZ"))))]
"TARGET_SHMEDIA"
"mcmpgt.l %N1, %N2, %0"
[(set_attr "type" "mcmp_media")])
(define_insn "negcmpgtv4hi"
[(set (match_operand:V4HI 0 "arith_reg_dest" "=r")
- (neg:V4HI (gt:V4HI (match_operand:V4HI 1 "arith_reg_or_0_operand" "%rU")
- (match_operand:V4HI 2 "arith_reg_or_0_operand" "rU"))))]
+ (neg:V4HI (gt:V4HI (match_operand:V4HI 1 "arith_reg_or_0_operand" "%rZ")
+ (match_operand:V4HI 2 "arith_reg_or_0_operand" "rZ"))))]
"TARGET_SHMEDIA"
"mcmpgt.w %N1, %N2, %0"
[(set_attr "type" "mcmp_media")])
(define_insn "mcmv"
[(set (match_operand:DI 0 "arith_reg_dest" "=r")
- (ior:DI (and:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
+ (ior:DI (and:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rZ")
(match_operand:DI 2 "arith_reg_operand" "r"))
(and:DI (match_operand:DI 3 "arith_reg_operand" "0")
(not:DI (match_dup 2)))))]
@@ -9613,8 +9626,8 @@ mov.l\\t1f,r0\\n\\
(define_insn "mcnvs_lw"
[(set (match_operand:V4HI 0 "arith_reg_dest" "=r")
(vec_concat:V4HI
- (ss_truncate:V2HI (match_operand:V2SI 1 "arith_reg_or_0_operand" "rU"))
- (ss_truncate:V2HI (match_operand:V2SI 2 "arith_reg_or_0_operand" "rU"))))]
+ (ss_truncate:V2HI (match_operand:V2SI 1 "arith_reg_or_0_operand" "rZ"))
+ (ss_truncate:V2HI (match_operand:V2SI 2 "arith_reg_or_0_operand" "rZ"))))]
"TARGET_SHMEDIA"
"mcnvs.lw %N1, %N2, %0"
[(set_attr "type" "mcmp_media")])
@@ -9622,8 +9635,8 @@ mov.l\\t1f,r0\\n\\
(define_insn "mcnvs_wb"
[(set (match_operand:V8QI 0 "arith_reg_dest" "=r")
(vec_concat:V8QI
- (ss_truncate:V4QI (match_operand:V4HI 1 "arith_reg_or_0_operand" "rU"))
- (ss_truncate:V4QI (match_operand:V4HI 2 "arith_reg_or_0_operand" "rU"))))]
+ (ss_truncate:V4QI (match_operand:V4HI 1 "arith_reg_or_0_operand" "rZ"))
+ (ss_truncate:V4QI (match_operand:V4HI 2 "arith_reg_or_0_operand" "rZ"))))]
"TARGET_SHMEDIA"
"mcnvs.wb %N1, %N2, %0"
[(set_attr "type" "mcmp_media")])
@@ -9631,17 +9644,17 @@ mov.l\\t1f,r0\\n\\
(define_insn "mcnvs_wub"
[(set (match_operand:V8QI 0 "arith_reg_dest" "=r")
(vec_concat:V8QI
- (us_truncate:V4QI (match_operand:V4HI 1 "arith_reg_or_0_operand" "rU"))
- (us_truncate:V4QI (match_operand:V4HI 2 "arith_reg_or_0_operand" "rU"))))]
+ (us_truncate:V4QI (match_operand:V4HI 1 "arith_reg_or_0_operand" "rZ"))
+ (us_truncate:V4QI (match_operand:V4HI 2 "arith_reg_or_0_operand" "rZ"))))]
"TARGET_SHMEDIA"
"mcnvs.wub %N1, %N2, %0"
[(set_attr "type" "mcmp_media")])
(define_insn "mextr_rl"
[(set (match_operand:DI 0 "arith_reg_dest" "=r")
- (ior:DI (lshiftrt:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
+ (ior:DI (lshiftrt:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rZ")
(match_operand:HI 3 "mextr_bit_offset" "i"))
- (ashift:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rU")
+ (ashift:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rZ")
(match_operand:HI 4 "mextr_bit_offset" "i"))))]
"TARGET_SHMEDIA && INTVAL (operands[3]) + INTVAL (operands[4]) == 64"
"*
@@ -9656,9 +9669,9 @@ mov.l\\t1f,r0\\n\\
(define_insn "*mextr_lr"
[(set (match_operand:DI 0 "arith_reg_dest" "=r")
- (ior:DI (ashift:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
+ (ior:DI (ashift:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rZ")
(match_operand:HI 3 "mextr_bit_offset" "i"))
- (lshiftrt:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rU")
+ (lshiftrt:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rZ")
(match_operand:HI 4 "mextr_bit_offset" "i"))))]
"TARGET_SHMEDIA && INTVAL (operands[3]) + INTVAL (operands[4]) == 64"
"*
@@ -9675,8 +9688,8 @@ mov.l\\t1f,r0\\n\\
; vector then varies depending on endianness.
(define_expand "mextr1"
[(match_operand:DI 0 "arith_reg_dest" "")
- (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:DI 2 "arith_reg_or_0_operand" "rU")]
+ (match_operand:DI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:DI 2 "arith_reg_or_0_operand" "rZ")]
"TARGET_SHMEDIA"
"
{
@@ -9687,8 +9700,8 @@ mov.l\\t1f,r0\\n\\
(define_expand "mextr2"
[(match_operand:DI 0 "arith_reg_dest" "")
- (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:DI 2 "arith_reg_or_0_operand" "rU")]
+ (match_operand:DI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:DI 2 "arith_reg_or_0_operand" "rZ")]
"TARGET_SHMEDIA"
"
{
@@ -9699,8 +9712,8 @@ mov.l\\t1f,r0\\n\\
(define_expand "mextr3"
[(match_operand:DI 0 "arith_reg_dest" "")
- (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:DI 2 "arith_reg_or_0_operand" "rU")]
+ (match_operand:DI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:DI 2 "arith_reg_or_0_operand" "rZ")]
"TARGET_SHMEDIA"
"
{
@@ -9711,8 +9724,8 @@ mov.l\\t1f,r0\\n\\
(define_expand "mextr4"
[(match_operand:DI 0 "arith_reg_dest" "")
- (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:DI 2 "arith_reg_or_0_operand" "rU")]
+ (match_operand:DI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:DI 2 "arith_reg_or_0_operand" "rZ")]
"TARGET_SHMEDIA"
"
{
@@ -9723,8 +9736,8 @@ mov.l\\t1f,r0\\n\\
(define_expand "mextr5"
[(match_operand:DI 0 "arith_reg_dest" "")
- (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:DI 2 "arith_reg_or_0_operand" "rU")]
+ (match_operand:DI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:DI 2 "arith_reg_or_0_operand" "rZ")]
"TARGET_SHMEDIA"
"
{
@@ -9735,8 +9748,8 @@ mov.l\\t1f,r0\\n\\
(define_expand "mextr6"
[(match_operand:DI 0 "arith_reg_dest" "")
- (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:DI 2 "arith_reg_or_0_operand" "rU")]
+ (match_operand:DI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:DI 2 "arith_reg_or_0_operand" "rZ")]
"TARGET_SHMEDIA"
"
{
@@ -9747,8 +9760,8 @@ mov.l\\t1f,r0\\n\\
(define_expand "mextr7"
[(match_operand:DI 0 "arith_reg_dest" "")
- (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:DI 2 "arith_reg_or_0_operand" "rU")]
+ (match_operand:DI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:DI 2 "arith_reg_or_0_operand" "rZ")]
"TARGET_SHMEDIA"
"
{
@@ -9957,7 +9970,7 @@ mov.l\\t1f,r0\\n\\
(define_expand "mperm_w"
[(match_operand:V4HI 0 "arith_reg_dest" "=r")
(match_operand:V4HI 1 "arith_reg_operand" "r")
- (match_operand:QI 2 "extend_reg_or_0_operand" "rU")]
+ (match_operand:QI 2 "extend_reg_or_0_operand" "rZ")]
"TARGET_SHMEDIA"
"
{
@@ -9973,7 +9986,7 @@ mov.l\\t1f,r0\\n\\
(vec_select:V4HI
(match_operand:V4HI 1 "arith_reg_operand" "r")
(parallel
- [(zero_extract:QI (match_operand:QI 2 "extend_reg_or_0_operand" "rU")
+ [(zero_extract:QI (match_operand:QI 2 "extend_reg_or_0_operand" "rZ")
(const_int 2) (const_int 0))
(zero_extract:QI (match_dup 2) (const_int 2) (const_int 2))
(zero_extract:QI (match_dup 2) (const_int 2) (const_int 4))
@@ -9988,7 +10001,7 @@ mov.l\\t1f,r0\\n\\
(match_operand:V4HI 1 "arith_reg_operand" "r")
(parallel
[(zero_extract:QI (not:QI (match_operand:QI 2
- "extend_reg_or_0_operand" "rU"))
+ "extend_reg_or_0_operand" "rZ"))
(const_int 2) (const_int 0))
(zero_extract:QI (not:QI (match_dup 2)) (const_int 2) (const_int 2))
(zero_extract:QI (not:QI (match_dup 2)) (const_int 2) (const_int 4))
@@ -10029,9 +10042,9 @@ mov.l\\t1f,r0\\n\\
(abs:DI (vec_select:DI
(minus:V8DI
(zero_extend:V8DI
- (match_operand:V8QI 2 "arith_reg_or_0_operand" "r"))
+ (match_operand:V8QI 2 "arith_reg_or_0_operand" "rZ"))
(zero_extend:V8DI
- (match_operand:V8QI 3 "arith_reg_or_0_operand" "r")))
+ (match_operand:V8QI 3 "arith_reg_or_0_operand" "rZ")))
(parallel [(const_int 0)]))))
(abs:DI (vec_select:DI (minus:V8DI (zero_extend:V8DI (match_dup 2))
(zero_extend:V8DI (match_dup 3)))
@@ -10104,15 +10117,15 @@ mov.l\\t1f,r0\\n\\
[(set (match_operand:HI 0 "arith_reg_dest" "=r")
(ss_truncate:HI
(ashiftrt:DI (match_operand:DI 1 "arith_reg_operand" "r")
- (match_operand:DI 2 "arith_reg_or_0_operand" "rU"))))]
+ (match_operand:DI 2 "arith_reg_or_0_operand" "rZ"))))]
"TARGET_SHMEDIA"
"mshards.q %1, %N2, %0"
[(set_attr "type" "mcmp_media")])
(define_expand "mshfhi_b"
[(match_operand:V8QI 0 "arith_reg_dest" "")
- (match_operand:V8QI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:V8QI 2 "arith_reg_or_0_operand" "rU")]
+ (match_operand:V8QI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:V8QI 2 "arith_reg_or_0_operand" "rZ")]
"TARGET_SHMEDIA"
"
{
@@ -10123,8 +10136,8 @@ mov.l\\t1f,r0\\n\\
(define_expand "mshflo_b"
[(match_operand:V8QI 0 "arith_reg_dest" "")
- (match_operand:V8QI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:V8QI 2 "arith_reg_or_0_operand" "rU")]
+ (match_operand:V8QI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:V8QI 2 "arith_reg_or_0_operand" "rZ")]
"TARGET_SHMEDIA"
"
{
@@ -10137,8 +10150,8 @@ mov.l\\t1f,r0\\n\\
[(set
(match_operand:V8QI 0 "arith_reg_dest" "=r")
(vec_select:V8QI
- (vec_concat:V16QI (match_operand:V8QI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:V8QI 2 "arith_reg_or_0_operand" "rU"))
+ (vec_concat:V16QI (match_operand:V8QI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:V8QI 2 "arith_reg_or_0_operand" "rZ"))
(parallel [(const_int 4) (const_int 12) (const_int 5) (const_int 13)
(const_int 6) (const_int 14) (const_int 7) (const_int 15)])))]
"TARGET_SHMEDIA"
@@ -10151,8 +10164,8 @@ mov.l\\t1f,r0\\n\\
[(set
(match_operand:V8QI 0 "arith_reg_dest" "=r")
(vec_select:V8QI
- (vec_concat:V16QI (match_operand:V8QI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:V8QI 2 "arith_reg_or_0_operand" "rU"))
+ (vec_concat:V16QI (match_operand:V8QI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:V8QI 2 "arith_reg_or_0_operand" "rZ"))
(parallel [(const_int 0) (const_int 8) (const_int 1) (const_int 9)
(const_int 2) (const_int 10) (const_int 3) (const_int 11)])))]
"TARGET_SHMEDIA"
@@ -10163,8 +10176,8 @@ mov.l\\t1f,r0\\n\\
(define_expand "mshfhi_l"
[(match_operand:V2SI 0 "arith_reg_dest" "")
- (match_operand:V2SI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:V2SI 2 "arith_reg_or_0_operand" "rU")]
+ (match_operand:V2SI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:V2SI 2 "arith_reg_or_0_operand" "rZ")]
"TARGET_SHMEDIA"
"
{
@@ -10175,8 +10188,8 @@ mov.l\\t1f,r0\\n\\
(define_expand "mshflo_l"
[(match_operand:V2SI 0 "arith_reg_dest" "")
- (match_operand:V2SI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:V2SI 2 "arith_reg_or_0_operand" "rU")]
+ (match_operand:V2SI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:V2SI 2 "arith_reg_or_0_operand" "rZ")]
"TARGET_SHMEDIA"
"
{
@@ -10188,8 +10201,8 @@ mov.l\\t1f,r0\\n\\
(define_insn "mshf4_l"
[(set (match_operand:V2SI 0 "arith_reg_dest" "=r")
(vec_select:V2SI
- (vec_concat:V4SI (match_operand:V2SI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:V2SI 2 "arith_reg_or_0_operand" "rU"))
+ (vec_concat:V4SI (match_operand:V2SI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:V2SI 2 "arith_reg_or_0_operand" "rZ"))
(parallel [(const_int 1) (const_int 3)])))]
"TARGET_SHMEDIA"
"* return (TARGET_LITTLE_ENDIAN
@@ -10200,8 +10213,8 @@ mov.l\\t1f,r0\\n\\
(define_insn "mshf0_l"
[(set (match_operand:V2SI 0 "arith_reg_dest" "=r")
(vec_select:V2SI
- (vec_concat:V4SI (match_operand:V2SI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:V2SI 2 "arith_reg_or_0_operand" "rU"))
+ (vec_concat:V4SI (match_operand:V2SI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:V2SI 2 "arith_reg_or_0_operand" "rZ"))
(parallel [(const_int 0) (const_int 2)])))]
"TARGET_SHMEDIA"
"* return (TARGET_LITTLE_ENDIAN
@@ -10211,8 +10224,8 @@ mov.l\\t1f,r0\\n\\
(define_expand "mshfhi_w"
[(match_operand:V4HI 0 "arith_reg_dest" "")
- (match_operand:V4HI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:V4HI 2 "arith_reg_or_0_operand" "rU")]
+ (match_operand:V4HI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:V4HI 2 "arith_reg_or_0_operand" "rZ")]
"TARGET_SHMEDIA"
"
{
@@ -10223,8 +10236,8 @@ mov.l\\t1f,r0\\n\\
(define_expand "mshflo_w"
[(match_operand:V4HI 0 "arith_reg_dest" "")
- (match_operand:V4HI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:V4HI 2 "arith_reg_or_0_operand" "rU")]
+ (match_operand:V4HI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:V4HI 2 "arith_reg_or_0_operand" "rZ")]
"TARGET_SHMEDIA"
"
{
@@ -10236,8 +10249,8 @@ mov.l\\t1f,r0\\n\\
(define_insn "mshf4_w"
[(set (match_operand:V4HI 0 "arith_reg_dest" "=r")
(vec_select:V4HI
- (vec_concat:V8HI (match_operand:V4HI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:V4HI 2 "arith_reg_or_0_operand" "rU"))
+ (vec_concat:V8HI (match_operand:V4HI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:V4HI 2 "arith_reg_or_0_operand" "rZ"))
(parallel [(const_int 2) (const_int 6) (const_int 3) (const_int 7)])))]
"TARGET_SHMEDIA"
"* return (TARGET_LITTLE_ENDIAN
@@ -10248,8 +10261,8 @@ mov.l\\t1f,r0\\n\\
(define_insn "mshf0_w"
[(set (match_operand:V4HI 0 "arith_reg_dest" "=r")
(vec_select:V4HI
- (vec_concat:V8HI (match_operand:V4HI 1 "arith_reg_or_0_operand" "rU")
- (match_operand:V4HI 2 "arith_reg_or_0_operand" "rU"))
+ (vec_concat:V8HI (match_operand:V4HI 1 "arith_reg_or_0_operand" "rZ")
+ (match_operand:V4HI 2 "arith_reg_or_0_operand" "rZ"))
(parallel [(const_int 0) (const_int 4) (const_int 1) (const_int 5)])))]
"TARGET_SHMEDIA"
"* return (TARGET_LITTLE_ENDIAN
@@ -10260,8 +10273,8 @@ mov.l\\t1f,r0\\n\\
(define_insn "mshflo_w_x"
[(set (match_operand:V4HI 0 "arith_reg_dest" "=r")
(vec_select:V4HI
- (vec_concat:V4HI (match_operand:V2HI 1 "extend_reg_or_0_operand" "rU")
- (match_operand:V2HI 2 "extend_reg_or_0_operand" "rU"))
+ (vec_concat:V4HI (match_operand:V2HI 1 "extend_reg_or_0_operand" "rZ")
+ (match_operand:V2HI 2 "extend_reg_or_0_operand" "rZ"))
(parallel [(const_int 2) (const_int 0) (const_int 3) (const_int 1)])))]
"TARGET_SHMEDIA"
"mshflo.w %N1, %N2, %0"
@@ -10270,9 +10283,9 @@ mov.l\\t1f,r0\\n\\
/* These are useful to expand ANDs and as combiner patterns. */
(define_insn_and_split "mshfhi_l_di"
[(set (match_operand:DI 0 "arith_reg_dest" "=r,f")
- (ior:DI (lshiftrt:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rU,f")
+ (ior:DI (lshiftrt:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rZ,f")
(const_int 32))
- (and:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rU,?f")
+ (and:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rZ,?f")
(const_int -4294967296))))]
"TARGET_SHMEDIA"
"@
@@ -10293,9 +10306,9 @@ mov.l\\t1f,r0\\n\\
(define_insn "*mshfhi_l_di_rev"
[(set (match_operand:DI 0 "arith_reg_dest" "=r")
- (ior:DI (and:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
+ (ior:DI (and:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rZ")
(const_int -4294967296))
- (lshiftrt:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rU")
+ (lshiftrt:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rZ")
(const_int 32))))]
"TARGET_SHMEDIA"
"mshfhi.l %N2, %N1, %0"
@@ -10322,9 +10335,9 @@ mov.l\\t1f,r0\\n\\
(define_insn "mshflo_l_di"
[(set (match_operand:DI 0 "arith_reg_dest" "=r")
- (ior:DI (and:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
+ (ior:DI (and:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rZ")
(const_int 4294967295))
- (ashift:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rU")
+ (ashift:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rZ")
(const_int 32))))]
"TARGET_SHMEDIA"
@@ -10333,9 +10346,9 @@ mov.l\\t1f,r0\\n\\
(define_insn "*mshflo_l_di_rev"
[(set (match_operand:DI 0 "arith_reg_dest" "=r")
- (ior:DI (ashift:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
+ (ior:DI (ashift:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rZ")
(const_int 32))
- (and:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rU")
+ (and:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rZ")
(const_int 4294967295))))]
"TARGET_SHMEDIA"
@@ -10368,8 +10381,8 @@ mov.l\\t1f,r0\\n\\
(define_insn "*mshflo_l_di_x"
[(set (match_operand:DI 0 "arith_reg_dest" "=r")
(ior:DI (zero_extend:DI (match_operand:SI 1 "extend_reg_or_0_operand"
- "rU"))
- (ashift:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rU")
+ "rZ"))
+ (ashift:DI (match_operand:DI 2 "arith_reg_or_0_operand" "rZ")
(const_int 32))))]
"TARGET_SHMEDIA"
@@ -10378,9 +10391,9 @@ mov.l\\t1f,r0\\n\\
(define_insn_and_split "concat_v2sf"
[(set (match_operand:V2SF 0 "register_operand" "=r,f,f?")
-;; (vec_concat:V2SF (match_operand:SF 1 "register_operand" "rU,0,f")
- (vec_concat:V2SF (match_operand:SF 1 "register_operand" "rU,f,f")
- (match_operand:SF 2 "register_operand" "rU,f,f")))]
+;; (vec_concat:V2SF (match_operand:SF 1 "register_operand" "rZ,0,f")
+ (vec_concat:V2SF (match_operand:SF 1 "register_operand" "rZ,f,f")
+ (match_operand:SF 2 "register_operand" "rZ,f,f")))]
"TARGET_SHMEDIA"
"@
@@ -10400,9 +10413,9 @@ mov.l\\t1f,r0\\n\\
(define_insn "*mshflo_l_di_x_rev"
[(set (match_operand:DI 0 "arith_reg_dest" "=r")
- (ior:DI (ashift:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rU")
+ (ior:DI (ashift:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rZ")
(const_int 32))
- (zero_extend:DI (match_operand:SI 2 "extend_reg_or_0_operand" "rU"))))]
+ (zero_extend:DI (match_operand:SI 2 "extend_reg_or_0_operand" "rZ"))))]
"TARGET_SHMEDIA"
"mshflo.l %N2, %N1, %0"
@@ -10442,7 +10455,7 @@ mov.l\\t1f,r0\\n\\
(define_insn "subv2si3"
[(set (match_operand:V2SI 0 "arith_reg_dest" "=r")
- (minus:V2SI (match_operand:V2SI 1 "arith_reg_or_0_operand" "rU")
+ (minus:V2SI (match_operand:V2SI 1 "arith_reg_or_0_operand" "rZ")
(match_operand:V2SI 2 "arith_reg_operand" "r")))]
"TARGET_SHMEDIA"
"msub.l %N1, %2, %0"
@@ -10450,7 +10463,7 @@ mov.l\\t1f,r0\\n\\
(define_insn "subv4hi3"
[(set (match_operand:V4HI 0 "arith_reg_dest" "=r")
- (minus:V4HI (match_operand:V4HI 1 "arith_reg_or_0_operand" "rU")
+ (minus:V4HI (match_operand:V4HI 1 "arith_reg_or_0_operand" "rZ")
(match_operand:V4HI 2 "arith_reg_operand" "r")))]
"TARGET_SHMEDIA"
"msub.w %N1, %2, %0"
@@ -10458,7 +10471,7 @@ mov.l\\t1f,r0\\n\\
(define_insn "sssubv2si3"
[(set (match_operand:V2SI 0 "arith_reg_dest" "=r")
- (ss_minus:V2SI (match_operand:V2SI 1 "arith_reg_or_0_operand" "rU")
+ (ss_minus:V2SI (match_operand:V2SI 1 "arith_reg_or_0_operand" "rZ")
(match_operand:V2SI 2 "arith_reg_operand" "r")))]
"TARGET_SHMEDIA"
"msubs.l %N1, %2, %0"
@@ -10474,7 +10487,7 @@ mov.l\\t1f,r0\\n\\
(define_insn "sssubv4hi3"
[(set (match_operand:V4HI 0 "arith_reg_dest" "=r")
- (ss_minus:V4HI (match_operand:V4HI 1 "arith_reg_or_0_operand" "rU")
+ (ss_minus:V4HI (match_operand:V4HI 1 "arith_reg_or_0_operand" "rZ")
(match_operand:V4HI 2 "arith_reg_operand" "r")))]
"TARGET_SHMEDIA"
"msubs.w %N1, %2, %0"
diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
index 92353cff87e..b5fb3d54061 100644
--- a/gcc/config/sol2.h
+++ b/gcc/config/sol2.h
@@ -2,20 +2,20 @@
Solaris 2 system.
Copyright 2002 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/aout.h b/gcc/config/sparc/aout.h
index b4727b624cd..1031048df69 100644
--- a/gcc/config/sparc/aout.h
+++ b/gcc/config/sparc/aout.h
@@ -1,21 +1,21 @@
-/* Definitions of target machine for GNU compiler, for SPARC using a.out.
+/* Definitions of target machine for GCC, for SPARC using a.out.
Copyright (C) 1994, 1996, 2002 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
@@ -59,8 +59,6 @@ do { \
This is needed for SunOS 4.0, and should not hurt for 3.2
versions either. */
-#define ASM_OUTPUT_SOURCE_LINE(file, line) \
- { static int sym_lineno = 1; \
- fprintf (file, ".stabn 68,0,%d,LM%d\nLM%d:\n", \
- line, sym_lineno, sym_lineno); \
- sym_lineno += 1; }
+#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
+ fprintf (file, ".stabn 68,0,%d,LM%d\nLM%d:\n", \
+ line, counter, counter)
diff --git a/gcc/config/sparc/biarch64.h b/gcc/config/sparc/biarch64.h
index f85111ab7eb..b825f4f3e5b 100644
--- a/gcc/config/sparc/biarch64.h
+++ b/gcc/config/sparc/biarch64.h
@@ -1,21 +1,21 @@
-/* Definitions of target machine for GNU compiler, for Sun SPARC.
+/* Definitions of target machine for GCC, for Sun SPARC.
Copyright (C) 2001 Free Software Foundation, Inc.
Contributed by David E. O'Brien <obrien@FreeBSD.org>.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/cypress.md b/gcc/config/sparc/cypress.md
index e9bff6d77a7..c2345940fb7 100644
--- a/gcc/config/sparc/cypress.md
+++ b/gcc/config/sparc/cypress.md
@@ -1,20 +1,20 @@
;; Scheduling description for SPARC Cypress.
;; Copyright (C) 2002 Free Software Foundation, Inc.
;;
-;; This file is part of GNU CC.
+;; This file is part of GCC.
;;
-;; GNU CC is free software; you can redistribute it and/or modify
+;; GCC 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,
+;; GCC 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
+;; along with GCC; see the file COPYING. If not, write to
;; the Free Software Foundation, 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
diff --git a/gcc/config/sparc/elf.h b/gcc/config/sparc/elf.h
index 04e7b632f3f..8ba256c398a 100644
--- a/gcc/config/sparc/elf.h
+++ b/gcc/config/sparc/elf.h
@@ -1,21 +1,21 @@
-/* Definitions of target machine for GNU compiler,
+/* Definitions of target machine for GCC,
for SPARC running in an embedded environment using the ELF file format.
Copyright (C) 1997 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/freebsd.h b/gcc/config/sparc/freebsd.h
index 4d3e0a63994..f308263d36d 100644
--- a/gcc/config/sparc/freebsd.h
+++ b/gcc/config/sparc/freebsd.h
@@ -2,20 +2,20 @@
Copyright (C) 2001, 2002 Free Software Foundation, Inc.
Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* FreeBSD needs the platform name (sparc64) defined.
diff --git a/gcc/config/sparc/hypersparc.md b/gcc/config/sparc/hypersparc.md
index d80e51e9848..d617efd9fc8 100644
--- a/gcc/config/sparc/hypersparc.md
+++ b/gcc/config/sparc/hypersparc.md
@@ -1,20 +1,20 @@
;; Scheduling description for HyperSPARC.
;; Copyright (C) 2002 Free Software Foundation, Inc.
;;
-;; This file is part of GNU CC.
+;; This file is part of GCC.
;;
-;; GNU CC is free software; you can redistribute it and/or modify
+;; GCC 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,
+;; GCC 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
+;; along with GCC; see the file COPYING. If not, write to
;; the Free Software Foundation, 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index f6616a77dd3..d2f016d1794 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -2,20 +2,20 @@
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
Contributed by Eddie C. Dost (ecd@skynet.be)
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
index d4835dd34e3..10c83960b38 100644
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -2,20 +2,20 @@
Copyright 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc.
Contributed by David S. Miller (davem@caip.rutgers.edu)
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/lite.h b/gcc/config/sparc/lite.h
index b314f43deb8..9b1875ac8ac 100644
--- a/gcc/config/sparc/lite.h
+++ b/gcc/config/sparc/lite.h
@@ -1,21 +1,21 @@
-/* Definitions of target machine for GNU compiler, for SPARClite w/o FPU.
+/* Definitions of target machine for GCC, for SPARClite w/o FPU.
Copyright (C) 1993, 1996 Free Software Foundation, Inc.
Contributed by Jim Wilson (wilson@cygnus.com).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/litecoff.h b/gcc/config/sparc/litecoff.h
index 65f065d64ab..e31a0b40553 100644
--- a/gcc/config/sparc/litecoff.h
+++ b/gcc/config/sparc/litecoff.h
@@ -1,21 +1,21 @@
-/* Definitions of target machine for GNU compiler, for SPARClite w/o FPU, COFF.
+/* Definitions of target machine for GCC, for SPARClite w/o FPU, COFF.
Copyright (C) 1994, 1996, 2000, 2002 Free Software Foundation, Inc.
Written by Ken Raeburn (raeburn@cygnus.com).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/liteelf.h b/gcc/config/sparc/liteelf.h
index 41b49e35116..6d5cce120d6 100644
--- a/gcc/config/sparc/liteelf.h
+++ b/gcc/config/sparc/liteelf.h
@@ -1,21 +1,21 @@
-/* Definitions of target machine for GNU compiler, for SPARClite w/o FPU.
+/* Definitions of target machine for GCC, for SPARClite w/o FPU, ELF.
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
Contributed by Stan Cox (scox@cygnus.com).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/netbsd-elf.h b/gcc/config/sparc/netbsd-elf.h
index 06783f3bf5c..94706b48301 100644
--- a/gcc/config/sparc/netbsd-elf.h
+++ b/gcc/config/sparc/netbsd-elf.h
@@ -1,22 +1,22 @@
-/* Definitions of target machine for GNU compiler, for ELF on NetBSD/sparc
+/* Definitions of target machine for GCC, for ELF on NetBSD/sparc
and NetBSD/sparc64.
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Contributed by Matthew Green (mrg@eterna.com.au).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/openbsd.h b/gcc/config/sparc/openbsd.h
index 187a41a8b3c..6717e222151 100644
--- a/gcc/config/sparc/openbsd.h
+++ b/gcc/config/sparc/openbsd.h
@@ -1,20 +1,20 @@
/* Configuration file for sparc OpenBSD target.
Copyright (C) 1999, 2002 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/pbd.h b/gcc/config/sparc/pbd.h
index 45675b138b5..e3b591a6316 100644
--- a/gcc/config/sparc/pbd.h
+++ b/gcc/config/sparc/pbd.h
@@ -140,10 +140,8 @@ Boston, MA 02111-1307, USA. */
/* This is needed for SunOS 4.0, and should not hurt for 3.2
versions either. */
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line) \
- { static int sym_lineno = 1; \
- fprintf (file, ".stabn 68,0,%d,.LM%d\n.LM%d:\n", \
- line, sym_lineno, sym_lineno); \
- sym_lineno += 1; }
+#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
+ fprintf (file, ".stabn 68,0,%d,.LM%d\n.LM%d:\n", \
+ line, counter, counter)
#define ASM_INT_OP "\t.long "
diff --git a/gcc/config/sparc/rtemself.h b/gcc/config/sparc/rtemself.h
index 208292911fe..ffb2a7233bd 100644
--- a/gcc/config/sparc/rtemself.h
+++ b/gcc/config/sparc/rtemself.h
@@ -2,20 +2,20 @@
Copyright (C) 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/sol2-64.h b/gcc/config/sparc/sol2-64.h
index fa04e73ee7c..d53747a6eb0 100644
--- a/gcc/config/sparc/sol2-64.h
+++ b/gcc/config/sparc/sol2-64.h
@@ -1,4 +1,4 @@
-/* Definitions of target machine for GNU compiler, for bi-arch SPARC
+/* Definitions of target machine for GCC, for bi-arch SPARC
running Solaris 2, defaulting to 64-bit code generation. */
#undef TARGET_DEFAULT
diff --git a/gcc/config/sparc/sol2-bi.h b/gcc/config/sparc/sol2-bi.h
index 8c0d4725eb3..7b6ee855272 100644
--- a/gcc/config/sparc/sol2-bi.h
+++ b/gcc/config/sparc/sol2-bi.h
@@ -1,4 +1,4 @@
-/* Definitions of target machine for GNU compiler, for bi-arch SPARC
+/* Definitions of target machine for GCC, for bi-arch SPARC
running Solaris 2 using the system assembler and linker. */
/* The default code model. */
diff --git a/gcc/config/sparc/sol2-gas-bi.h b/gcc/config/sparc/sol2-gas-bi.h
index 2198fbeeaf9..88b3954f820 100644
--- a/gcc/config/sparc/sol2-gas-bi.h
+++ b/gcc/config/sparc/sol2-gas-bi.h
@@ -1,4 +1,4 @@
-/* Definitions of target machine for GNU compiler, for bi-arch SPARC
+/* Definitions of target machine for GCC, for bi-arch SPARC
running Solaris 2 using the GNU assembler. */
#undef AS_SPARC64_FLAG
diff --git a/gcc/config/sparc/sol2-gld-bi.h b/gcc/config/sparc/sol2-gld-bi.h
index 81a1ff2395d..eab63a9a7c7 100644
--- a/gcc/config/sparc/sol2-gld-bi.h
+++ b/gcc/config/sparc/sol2-gld-bi.h
@@ -1,4 +1,4 @@
-/* Definitions of target machine for GNU compiler, for bi-arch SPARC
+/* Definitions of target machine for GCC, for bi-arch SPARC
running Solaris 2 using the GNU linker. */
#undef LINK_ARCH_SPEC
diff --git a/gcc/config/sparc/sol2-gld.h b/gcc/config/sparc/sol2-gld.h
index 76e034e46f1..aed94e5c475 100644
--- a/gcc/config/sparc/sol2-gld.h
+++ b/gcc/config/sparc/sol2-gld.h
@@ -1,4 +1,4 @@
-/* Definitions of target machine for GNU compiler, for SPARC running Solaris 2
+/* Definitions of target machine for GCC, for SPARC running Solaris 2
using the GNU linker. */
/* Undefine this so that attribute((init_priority)) works. */
diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
index b02635602a5..efb49c8adde 100644
--- a/gcc/config/sparc/sol2.h
+++ b/gcc/config/sparc/sol2.h
@@ -1,23 +1,23 @@
-/* Definitions of target machine for GNU compiler, for SPARC running Solaris 2
+/* Definitions of target machine for GCC, for SPARC running Solaris 2
Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@netcom.com).
Additional changes by David V. Henkel-Wallace (gumby@cygnus.com).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/sp64-aout.h b/gcc/config/sparc/sp64-aout.h
index 1af9dea39a2..376cfa883e9 100644
--- a/gcc/config/sparc/sp64-aout.h
+++ b/gcc/config/sparc/sp64-aout.h
@@ -1,21 +1,21 @@
-/* Definitions of target machine for GNU compiler, for SPARC64, a.out.
+/* Definitions of target machine for GCC, for SPARC64, a.out.
Copyright (C) 1994, 1996, 1997, 1998 Free Software Foundation, Inc.
Contributed by Doug Evans, dje@cygnus.com.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/sp64-elf.h b/gcc/config/sparc/sp64-elf.h
index 2782d688c51..650c3ff907b 100644
--- a/gcc/config/sparc/sp64-elf.h
+++ b/gcc/config/sparc/sp64-elf.h
@@ -1,22 +1,22 @@
-/* Definitions of target machine for GNU compiler, for SPARC64, ELF.
+/* Definitions of target machine for GCC, for SPARC64, ELF.
Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000
Free Software Foundation, Inc.
Contributed by Doug Evans, dje@cygnus.com.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/sp86x-elf.h b/gcc/config/sparc/sp86x-elf.h
index a3107b50a57..2a8f6a1034e 100644
--- a/gcc/config/sparc/sp86x-elf.h
+++ b/gcc/config/sparc/sp86x-elf.h
@@ -1,21 +1,21 @@
-/* Definitions of target machine for GNU compiler, for sparclite 86x w/o FPU.
+/* Definitions of target machine for GCC, for sparclite 86x w/o FPU.
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
Contributed by Stan Cox (scox@cygnus.com).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/sparc-modes.def b/gcc/config/sparc/sparc-modes.def
index 3ebf9c8660d..612ff0dbf85 100644
--- a/gcc/config/sparc/sparc-modes.def
+++ b/gcc/config/sparc/sparc-modes.def
@@ -1,23 +1,23 @@
-/* Definitions of target machine for GNU compiler, for Sun SPARC.
+/* Definitions of target machine for GCC, for Sun SPARC.
Copyright (C) 2002 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.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h
index d12e9ef09ef..0de1e128551 100644
--- a/gcc/config/sparc/sparc-protos.h
+++ b/gcc/config/sparc/sparc-protos.h
@@ -1,23 +1,23 @@
-/* Prototypes of target machine for GNU compiler, for Sun SPARC.
+/* Prototypes of target machine for GCC, for Sun SPARC.
Copyright (C) 1999, 2000 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.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 52373932912..148bcee53f4 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -1,24 +1,24 @@
/* Subroutines for insn-output.c for Sun SPARC.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003 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.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
@@ -47,6 +47,7 @@ Boston, MA 02111-1307, USA. */
#include "debug.h"
#include "target.h"
#include "target-def.h"
+#include "cfglayout.h"
/* 1 if the caller has placed an "unimp" insn immediately after the call.
This is used in v8 code when calling a function that returns a structure.
@@ -5328,6 +5329,7 @@ sparc_va_arg (valist, type)
{
indirect = 1;
size = rsize = UNITS_PER_WORD;
+ align = 0;
}
/* SPARC v9 ABI states that structures up to 8 bytes in size are
given one 8 byte slot. */
@@ -8587,10 +8589,11 @@ sparc_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
rtx this, insn, funexp, delta_rtx, tmp;
reload_completed = 1;
+ epilogue_completed = 1;
no_new_pseudos = 1;
current_function_uses_only_leaf_regs = 1;
- emit_note (NULL, NOTE_INSN_PROLOGUE_END);
+ emit_note (NOTE_INSN_PROLOGUE_END);
/* Find the "this" pointer. Normally in %o0, but in ARCH64 if the function
returns a structure, the structure return pointer is there instead. */
@@ -8639,6 +8642,7 @@ sparc_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
final_end_function ();
reload_completed = 0;
+ epilogue_completed = 0;
no_new_pseudos = 0;
}
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index fdbd0fdbaf6..872f224c8c5 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -2668,10 +2668,6 @@ do { \
/* Control the assembler format that we output. */
-/* Output at beginning of assembler file. */
-
-#define ASM_FILE_START(file)
-
/* A C string constant describing how to begin a comment in the target
assembler language. The compiler assumes that the comment will end at
the end of the line. */
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index ebe9d2b3d50..81fbebffcf1 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -1,24 +1,24 @@
-;; Machine description for SPARC chip for GNU C compiler
+;; Machine description for SPARC chip for GCC
;; Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
;; 1999, 2000, 2001, 2002 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.
-;; This file is part of GNU CC.
+;; This file is part of GCC.
-;; GNU CC is free software; you can redistribute it and/or modify
+;; GCC 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,
+;; GCC 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
+;; along with GCC; see the file COPYING. If not, write to
;; the Free Software Foundation, 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
diff --git a/gcc/config/sparc/sparclet.md b/gcc/config/sparc/sparclet.md
index 080090c3ead..15020ba113e 100644
--- a/gcc/config/sparc/sparclet.md
+++ b/gcc/config/sparc/sparclet.md
@@ -1,20 +1,20 @@
;; Scheduling description for SPARClet.
;; Copyright (C) 2002 Free Software Foundation, Inc.
;;
-;; This file is part of GNU CC.
+;; This file is part of GCC.
;;
-;; GNU CC is free software; you can redistribute it and/or modify
+;; GCC 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,
+;; GCC 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
+;; along with GCC; see the file COPYING. If not, write to
;; the Free Software Foundation, 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
diff --git a/gcc/config/sparc/supersparc.md b/gcc/config/sparc/supersparc.md
index ea328868e60..93e4cf77923 100644
--- a/gcc/config/sparc/supersparc.md
+++ b/gcc/config/sparc/supersparc.md
@@ -1,20 +1,20 @@
;; Scheduling description for SuperSPARC.
;; Copyright (C) 2002 Free Software Foundation, Inc.
;;
-;; This file is part of GNU CC.
+;; This file is part of GCC.
;;
-;; GNU CC is free software; you can redistribute it and/or modify
+;; GCC 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,
+;; GCC 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
+;; along with GCC; see the file COPYING. If not, write to
;; the Free Software Foundation, 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
diff --git a/gcc/config/sparc/sysv4-only.h b/gcc/config/sparc/sysv4-only.h
index a283a22ad39..da265a0c0df 100644
--- a/gcc/config/sparc/sysv4-only.h
+++ b/gcc/config/sparc/sysv4-only.h
@@ -1,4 +1,4 @@
-/* Target macros for GNU compiler for SPARC running System V.4
+/* Target macros for GCC for SPARC running System V.4
Copyright (C) 2003
Free Software Foundation, Inc.
diff --git a/gcc/config/sparc/sysv4.h b/gcc/config/sparc/sysv4.h
index 80defea56fc..776debc1a9a 100644
--- a/gcc/config/sparc/sysv4.h
+++ b/gcc/config/sparc/sysv4.h
@@ -3,20 +3,20 @@
Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@monkeys.com).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
@@ -154,11 +154,6 @@ do { ASM_OUTPUT_ALIGN ((FILE), Pmode == SImode ? 2 : 3); \
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION sparc_elf_asm_named_section
-/* A C statement (sans semicolon) to output to the stdio stream
- FILE the assembler definition of uninitialized global DECL named
- NAME whose size is SIZE bytes and alignment is ALIGN bytes.
- Try to use asm_output_aligned_bss to implement this macro. */
-
#undef ASM_OUTPUT_ALIGNED_BSS
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
diff --git a/gcc/config/sparc/ultra1_2.md b/gcc/config/sparc/ultra1_2.md
index 2194be7ad78..46601ae2fe2 100644
--- a/gcc/config/sparc/ultra1_2.md
+++ b/gcc/config/sparc/ultra1_2.md
@@ -1,20 +1,20 @@
;; Scheduling description for UltraSPARC-I/II.
;; Copyright (C) 2002 Free Software Foundation, Inc.
;;
-;; This file is part of GNU CC.
+;; This file is part of GCC.
;;
-;; GNU CC is free software; you can redistribute it and/or modify
+;; GCC 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,
+;; GCC 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
+;; along with GCC; see the file COPYING. If not, write to
;; the Free Software Foundation, 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
diff --git a/gcc/config/sparc/ultra3.md b/gcc/config/sparc/ultra3.md
index cebc9f2aa80..0d69e6b913b 100644
--- a/gcc/config/sparc/ultra3.md
+++ b/gcc/config/sparc/ultra3.md
@@ -1,20 +1,20 @@
;; Scheduling description for UltraSPARC-III.
;; Copyright (C) 2002 Free Software Foundation, Inc.
;;
-;; This file is part of GNU CC.
+;; This file is part of GCC.
;;
-;; GNU CC is free software; you can redistribute it and/or modify
+;; GCC 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,
+;; GCC 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
+;; along with GCC; see the file COPYING. If not, write to
;; the Free Software Foundation, 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
diff --git a/gcc/config/svr3.h b/gcc/config/svr3.h
index 434118db87b..21595eac273 100644
--- a/gcc/config/svr3.h
+++ b/gcc/config/svr3.h
@@ -3,34 +3,22 @@
Copyright (C) 1991, 1996, 2000, 2002 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@monkeys.com).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
-
- To use this file, make up a file with a name like:
-
- ?????svr3.h
-
- where ????? is replaced by the name of the basic hardware that you
- are targeting for. Then, in the file ?????svr3.h, put something
- like:
-
- #include "?????.h"
- #include "svr3.h"
-*/
+Boston, MA 02111-1307, USA. */
/* Define a symbol indicating that we are using svr3.h. */
#define USING_SVR3_H
@@ -41,13 +29,8 @@ Boston, MA 02111-1307, USA.
/* Assembler, linker, library, and startfile spec's. */
-/* Output at beginning of assembler file. */
/* The .file command should always begin the output. */
-
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- do { output_file_directive ((FILE), main_input_filename); \
- } while (0)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
/* This says how to output an assembler line
to define a global common symbol. */
@@ -77,23 +60,6 @@ Boston, MA 02111-1307, USA.
fprintf ((FILE), "\t.set .,.+%u\n", (int)(ROUNDED)); \
} while (0)
-#if 0 /* For now, let's leave these machine-specific. */
-/* Use crt1.o as a startup file and crtn.o as a closing file. */
-
-#define STARTFILE_SPEC \
- "%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}"
-
-#ifdef CROSS_COMPILE
-#define LIB_SPEC "-lc crtn.o%s"
-#else
-#define LIB_SPEC "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} -lc crtn.o%s"
-#endif
-
-/* Special flags for the linker. I don't know what they do. */
-
-#define LINK_SPEC "%{T*} %{z:-lm}"
-#endif
-
/* Output #ident as a .ident. */
#undef ASM_OUTPUT_IDENT
diff --git a/gcc/config/svr4.h b/gcc/config/svr4.h
index 3f85e944dee..d865959f3c9 100644
--- a/gcc/config/svr4.h
+++ b/gcc/config/svr4.h
@@ -4,20 +4,20 @@
2000, 2001 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@monkeys.com).
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
diff --git a/gcc/config/usegas.h b/gcc/config/usegas.h
index cf20c558e36..54fa9bd6285 100644
--- a/gcc/config/usegas.h
+++ b/gcc/config/usegas.h
@@ -1,19 +1,19 @@
/* Copyright (C) 2001 Free Software Foundation, Inc.
- This file is part of GNU CC.
+ This file is part of GCC.
- GNU CC is free software; you can redistribute it and/or modify
+ GCC 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,
+ GCC 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
+ along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/config/v850/v850-protos.h b/gcc/config/v850/v850-protos.h
index f12e22a49af..f96abbd5c3e 100644
--- a/gcc/config/v850/v850-protos.h
+++ b/gcc/config/v850/v850-protos.h
@@ -35,7 +35,6 @@ extern void zdata_section PARAMS ((void));
extern void rozdata_section PARAMS ((void));
extern void zbss_section PARAMS ((void));
extern int v850_handle_pragma PARAMS ((int (*)(void), void (*)(int), char *));
-extern void asm_file_start PARAMS ((FILE *));
extern void override_options PARAMS ((void));
extern int compute_register_save_size PARAMS ((long *));
extern int compute_frame_size PARAMS ((int, long *));
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index e0fc724ecb0..4db79a99d3b 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -105,6 +105,9 @@ static int v850_interrupt_p = FALSE;
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO v850_encode_section_info
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS v850_rtx_costs
#undef TARGET_ADDRESS_COST
@@ -159,15 +162,6 @@ override_options ()
}
-/* Output assembly code for the start of the file. */
-
-void
-asm_file_start (file)
- FILE *file;
-{
- output_file_directive (file, main_input_filename);
-}
-
/* Return an RTX to represent where a value with mode MODE will be returned
from a function. If the result is 0, the argument is pushed. */
diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h
index 68c0d3f4748..52e631334e5 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -1144,10 +1144,6 @@ zbss_section () \
#define ZCOMMON_ASM_OP "\t.zcomm\t"
#define TCOMMON_ASM_OP "\t.tcomm\t"
-/* Output at beginning/end of assembler file. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) asm_file_start(FILE)
-
#define ASM_COMMENT_START "#"
/* Output to assembler file text saying following lines
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index 66b943be5f8..fea970e0eda 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -43,6 +43,7 @@ Boston, MA 02111-1307, USA. */
static int follows_p PARAMS ((rtx, rtx));
static void vax_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
+static void vax_file_start PARAMS ((void));
static void vax_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
static int vax_address_cost_1 PARAMS ((rtx));
@@ -57,6 +58,11 @@ static bool vax_rtx_costs PARAMS ((rtx, int, int, int *));
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE vax_output_function_prologue
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START vax_file_start
+#undef TARGET_ASM_FILE_START_APP_OFF
+#define TARGET_ASM_FILE_START_APP_OFF true
+
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK vax_output_mi_thunk
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
@@ -126,6 +132,18 @@ vax_output_function_prologue (file, size)
asm_fprintf (file, "\tsubl2 $%wd,%Rsp\n", size);
}
+/* When debugging with stabs, we want to output an extra dummy label
+ so that gas can distinguish between D_float and G_float prior to
+ processing the .stabs directive identifying type double. */
+static void
+vax_file_start ()
+{
+ default_file_start ();
+
+ if (write_symbols == DBX_DEBUG)
+ fprintf (asm_out_file, "___vax_%c_doubles:\n", ASM_DOUBLE_CHAR);
+}
+
/* This is like nonimmediate_operand with a restriction on the type of MEM. */
void
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index 731a8bdc05b..bb1450dbb01 100644
--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -938,19 +938,6 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
/* Control the assembler format that we output. */
-/* Output at beginning of assembler file. */
-/* When debugging, we want to output an extra dummy label so that gas
- can distinguish between D_float and G_float prior to processing the
- .stabs directive identifying type double. */
-
-#define ASM_FILE_START(FILE) \
- do { \
- fputs (ASM_APP_OFF, FILE); \
- if (write_symbols == DBX_DEBUG) \
- fprintf (FILE, "___vax_%c_doubles:\n", ASM_DOUBLE_CHAR); \
- } while (0)
-
-
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
diff --git a/gcc/config/vax/vaxv.h b/gcc/config/vax/vaxv.h
index 5e8c24987f0..c85cf4a8a2f 100644
--- a/gcc/config/vax/vaxv.h
+++ b/gcc/config/vax/vaxv.h
@@ -40,9 +40,7 @@ Boston, MA 02111-1307, USA. */
#undef LIB_SPEC
/* The .file command should always begin the output. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-output_file_directive ((FILE), main_input_filename)
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
#undef ASM_OUTPUT_ALIGN
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h
index 75aae79d68e..339acecc20c 100644
--- a/gcc/config/vxworks.h
+++ b/gcc/config/vxworks.h
@@ -1,21 +1,21 @@
-/* Common VxWorks target definitions for GNU compiler.
+/* Common VxWorks target definitions for GCC.
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Wind River Systems.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
diff --git a/gcc/configure b/gcc/configure
index 17a1a241105..9c33a296def 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1412,94 +1412,21 @@ EOF
;;
esac
-echo $ac_n "checking for volatile""... $ac_c" 1>&6
-echo "configure:1417: 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 1422 "configure"
-#include "confdefs.h"
-
-int main() {
-volatile int foo;
-; return 0; }
-EOF
-if { (eval echo configure:1429: \"$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
-
-
-echo $ac_n "checking for long double""... $ac_c" 1>&6
-echo "configure:1451: checking for long double" >&5
-if eval "test \"`echo '$''{'gcc_cv_c_long_double'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$GCC" = yes; then
- gcc_cv_c_long_double=yes
-else
-cat > conftest.$ac_ext <<EOF
-#line 1459 "configure"
-#include "confdefs.h"
-
-int main() {
-/* The Stardent Vistra knows sizeof(long double), but does not support it. */
-long double foo = 0.0;
-/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
-switch (0) case 0: case (sizeof(long double) >= sizeof(double)):;
-; return 0; }
-EOF
-if { (eval echo configure:1469: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- gcc_cv_c_long_double=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- gcc_cv_c_long_double=no
-fi
-rm -f conftest*
-fi
-fi
-
-echo "$ac_t""$gcc_cv_c_long_double" 1>&6
-if test $gcc_cv_c_long_double = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_LONG_DOUBLE 1
-EOF
-
-fi
echo $ac_n "checking for long long int""... $ac_c" 1>&6
-echo "configure:1491: checking for long long int" >&5
+echo "configure:1418: checking for long long int" >&5
if eval "test \"`echo '$''{'ac_cv_c_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1496 "configure"
+#line 1423 "configure"
#include "confdefs.h"
int main() {
long long int i;
; return 0; }
EOF
-if { (eval echo configure:1503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_long_long=yes
else
@@ -1519,19 +1446,19 @@ EOF
fi
echo $ac_n "checking for __int64""... $ac_c" 1>&6
-echo "configure:1523: checking for __int64" >&5
+echo "configure:1450: checking for __int64" >&5
if eval "test \"`echo '$''{'ac_cv_c___int64'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1528 "configure"
+#line 1455 "configure"
#include "confdefs.h"
int main() {
__int64 i;
; return 0; }
EOF
-if { (eval echo configure:1535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1462: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c___int64=yes
else
@@ -1552,19 +1479,19 @@ EOF
fi
echo $ac_n "checking for built-in _Bool""... $ac_c" 1>&6
-echo "configure:1556: checking for built-in _Bool" >&5
+echo "configure:1483: checking for built-in _Bool" >&5
if eval "test \"`echo '$''{'gcc_cv_c__bool'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1561 "configure"
+#line 1488 "configure"
#include "confdefs.h"
int main() {
_Bool foo;
; return 0; }
EOF
-if { (eval echo configure:1568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1495: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_c__bool=yes
else
@@ -1588,13 +1515,13 @@ fi
# sizeof(char) is 1 by definition.
echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:1592: checking size of short" >&5
+echo "configure:1519: checking size of short" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 1598 "configure"
+#line 1525 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -1604,7 +1531,7 @@ int main() {
switch (0) case 0: case (sizeof (short) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:1608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_short=$ac_size
else
@@ -1627,13 +1554,13 @@ EOF
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:1631: checking size of int" >&5
+echo "configure:1558: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 1637 "configure"
+#line 1564 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -1643,7 +1570,7 @@ int main() {
switch (0) case 0: case (sizeof (int) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:1647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_int=$ac_size
else
@@ -1666,13 +1593,13 @@ EOF
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:1670: checking size of long" >&5
+echo "configure:1597: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 1676 "configure"
+#line 1603 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -1682,7 +1609,7 @@ int main() {
switch (0) case 0: case (sizeof (long) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:1686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_long=$ac_size
else
@@ -1706,13 +1633,13 @@ EOF
if test $ac_cv_c_long_long = yes; then
echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:1710: checking size of long long" >&5
+echo "configure:1637: checking size of long long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 1716 "configure"
+#line 1643 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -1722,7 +1649,7 @@ int main() {
switch (0) case 0: case (sizeof (long long) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:1726: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_long_long=$ac_size
else
@@ -1747,13 +1674,13 @@ EOF
fi
if test $ac_cv_c___int64 = yes; then
echo $ac_n "checking size of __int64""... $ac_c" 1>&6
-echo "configure:1751: checking size of __int64" >&5
+echo "configure:1678: checking size of __int64" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof___int64'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 1757 "configure"
+#line 1684 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -1763,7 +1690,7 @@ int main() {
switch (0) case 0: case (sizeof (__int64) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:1767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1694: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof___int64=$ac_size
else
@@ -1787,58 +1714,6 @@ EOF
fi
-echo $ac_n "checking execution character set""... $ac_c" 1>&6
-echo "configure:1792: checking execution character set" >&5
-if eval "test \"`echo '$''{'ac_cv_c_charset'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1797 "configure"
-#include "confdefs.h"
-#if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \
- && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21
-ASCII
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "ASCII" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_c_charset=ASCII
-fi
-rm -f conftest*
-
- if test x${ac_cv_c_charset+set} != xset; then
- cat > conftest.$ac_ext <<EOF
-#line 1813 "configure"
-#include "confdefs.h"
-#if '\n' == 0x15 && ' ' == 0x40 && '0' == 0xF0 \
- && 'A' == 0xC1 && 'a' == 0x81 && '!' == 0x5A
-EBCDIC
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "EBCDIC" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_c_charset=EBCDIC
-fi
-rm -f conftest*
-
- fi
- if test x${ac_cv_c_charset+set} != xset; then
- ac_cv_c_charset=unknown
- fi
-fi
-
-echo "$ac_t""$ac_cv_c_charset" 1>&6
-if test $ac_cv_c_charset = unknown; then
- { echo "configure: error: *** Cannot determine host character set." 1>&2; exit 1; }
-elif test $ac_cv_c_charset = EBCDIC; then
- cat >> confdefs.h <<\EOF
-#define HOST_EBCDIC 1
-EOF
-
-fi
-
# -----------------
# Find Ada compiler
# -----------------
@@ -1854,7 +1729,7 @@ fi
# Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args.
set dummy ${ac_tool_prefix}gnatbind; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1858: checking for $ac_word" >&5
+echo "configure:1733: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1886,7 +1761,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "gnatbind", so it can be a program name with args.
set dummy gnatbind; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1890: checking for $ac_word" >&5
+echo "configure:1765: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1919,7 +1794,7 @@ fi
fi
echo $ac_n "checking for compiler driver that understands Ada""... $ac_c" 1>&6
-echo "configure:1923: checking for compiler driver that understands Ada" >&5
+echo "configure:1798: checking for compiler driver that understands Ada" >&5
if eval "test \"`echo '$''{'gcc_cv_prog_adac'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1962,7 +1837,7 @@ fi
if test x$have_gnat != xno ; then
echo $ac_n "checking whether ${ADAC} accepts -Wno-long-long""... $ac_c" 1>&6
-echo "configure:1966: checking whether ${ADAC} accepts -Wno-long-long" >&5
+echo "configure:1841: checking whether ${ADAC} accepts -Wno-long-long" >&5
if eval "test \"`echo '$''{'ac_cv_prog_adac_no_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2100,9 +1975,9 @@ if test x$ac_checking_valgrind != x ; then
# It is certainly possible that there's valgrind but no valgrind.h.
# GCC relies on making annotations so we must have both.
echo $ac_n "checking for VALGRIND_DISCARD in <memcheck.h>""... $ac_c" 1>&6
-echo "configure:2104: checking for VALGRIND_DISCARD in <memcheck.h>" >&5
+echo "configure:1979: checking for VALGRIND_DISCARD in <memcheck.h>" >&5
cat > conftest.$ac_ext <<EOF
-#line 2106 "configure"
+#line 1981 "configure"
#include "confdefs.h"
#include <memcheck.h>
#ifndef VALGRIND_DISCARD
@@ -2110,7 +1985,7 @@ echo "configure:2104: checking for VALGRIND_DISCARD in <memcheck.h>" >&5
#endif
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2126,17 +2001,17 @@ rm -f conftest*
echo "$ac_t""$gcc_cv_header_memcheck_h" 1>&6
ac_safe=`echo "valgrind.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for valgrind.h""... $ac_c" 1>&6
-echo "configure:2130: checking for valgrind.h" >&5
+echo "configure:2005: checking for valgrind.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 2135 "configure"
+#line 2010 "configure"
#include "confdefs.h"
#include <valgrind.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2015: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2161,7 +2036,7 @@ fi
# Extract the first word of "valgrind", so it can be a program name with args.
set dummy valgrind; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2165: checking for $ac_word" >&5
+echo "configure:2040: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_valgrind_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2412,7 +2287,7 @@ fi
# -------------------------
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:2416: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:2291: 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
@@ -2445,7 +2320,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:2449: checking for $ac_word" >&5
+echo "configure:2324: 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
@@ -2475,7 +2350,7 @@ test -n "$AWK" && break
done
echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:2479: checking whether ln works" >&5
+echo "configure:2354: checking whether ln works" >&5
if eval "test \"`echo '$''{'gcc_cv_prog_LN'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2507,7 +2382,7 @@ else
fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:2511: checking whether ln -s works" >&5
+echo "configure:2386: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'gcc_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2541,7 +2416,7 @@ 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:2545: checking for $ac_word" >&5
+echo "configure:2420: 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
@@ -2579,7 +2454,7 @@ fi
# 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:2583: checking for a BSD compatible install" >&5
+echo "configure:2458: 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
@@ -2633,7 +2508,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# Extract the first word of "mktemp", so it can be a program name with args.
set dummy mktemp; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2637: checking for $ac_word" >&5
+echo "configure:2512: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_have_mktemp_command'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2672,7 +2547,7 @@ else
# Extract the first word of "makeinfo", so it can be a program name with args.
set dummy makeinfo; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2676: checking for $ac_word" >&5
+echo "configure:2551: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2701,13 +2576,13 @@ fi
if test -n "$MAKEINFO"; then
# Found it, now check the version.
echo $ac_n "checking for modern makeinfo""... $ac_c" 1>&6
-echo "configure:2705: checking for modern makeinfo" >&5
+echo "configure:2580: checking for modern makeinfo" >&5
if eval "test \"`echo '$''{'gcc_cv_prog_makeinfo_modern'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_prog_version=`$MAKEINFO --version 2>&1 |
sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
- echo "configure:2711: version of makeinfo is $ac_prog_version" >&5
+ echo "configure:2586: version of makeinfo is $ac_prog_version" >&5
case $ac_prog_version in
'') gcc_cv_prog_makeinfo_modern=no;;
4.[2-9]*)
@@ -2735,7 +2610,7 @@ fi
# Is pod2man recent enough to regenerate manpages?
echo $ac_n "checking for recent Pod::Man""... $ac_c" 1>&6
-echo "configure:2739: checking for recent Pod::Man" >&5
+echo "configure:2614: checking for recent Pod::Man" >&5
if (perl -e 'use 1.10 Pod::Man') >/dev/null 2>&1; then
echo "$ac_t""yes" 1>&6
GENERATED_MANPAGES=generated-manpages
@@ -2749,7 +2624,7 @@ fi
# "if cmp --ignore-initial=2 t1 t2 && ! cmp --ignore-initial=1 t1 t2"
# but we need to sink errors and handle broken shells.
echo $ac_n "checking for cmp's capabilities""... $ac_c" 1>&6
-echo "configure:2753: checking for cmp's capabilities" >&5
+echo "configure:2628: checking for cmp's capabilities" >&5
echo abfoo >t1
echo cdfoo >t2
if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
@@ -2772,7 +2647,7 @@ else
# 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:2776: checking for $ac_word" >&5
+echo "configure:2651: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2809,7 +2684,7 @@ else
# Extract the first word of "bison", so it can be a program name with args.
set dummy bison; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2813: checking for $ac_word" >&5
+echo "configure:2688: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2843,12 +2718,12 @@ fi
# --------------------
echo $ac_n "checking for GNU C library""... $ac_c" 1>&6
-echo "configure:2847: checking for GNU C library" >&5
+echo "configure:2722: checking for GNU C library" >&5
if eval "test \"`echo '$''{'gcc_cv_glibc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2852 "configure"
+#line 2727 "configure"
#include "confdefs.h"
#include <features.h>
int main() {
@@ -2858,7 +2733,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:2862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_glibc=yes
else
@@ -2879,12 +2754,12 @@ EOF
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2883: checking for ANSI C header files" >&5
+echo "configure:2758: 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 2888 "configure"
+#line 2763 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2892,7 +2767,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2909,7 +2784,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 2913 "configure"
+#line 2788 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2927,7 +2802,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 2931 "configure"
+#line 2806 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2948,7 +2823,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2952 "configure"
+#line 2827 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2959,7 +2834,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2983,12 +2858,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2987: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:2862: 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 2992 "configure"
+#line 2867 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -2997,7 +2872,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:3001: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2876: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -3018,19 +2893,19 @@ EOF
fi
echo $ac_n "checking for working stdbool.h""... $ac_c" 1>&6
-echo "configure:3022: checking for working stdbool.h" >&5
+echo "configure:2897: checking for working stdbool.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdbool_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3027 "configure"
+#line 2902 "configure"
#include "confdefs.h"
#include <stdbool.h>
int main() {
bool foo = false;
; return 0; }
EOF
-if { (eval echo configure:3034: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2909: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_stdbool_h=yes
else
@@ -3051,12 +2926,12 @@ EOF
fi
echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6
-echo "configure:3055: checking whether string.h and strings.h may both be included" >&5
+echo "configure:2930: 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 3060 "configure"
+#line 2935 "configure"
#include "confdefs.h"
#include <string.h>
#include <strings.h>
@@ -3064,7 +2939,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:3068: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_header_string=yes
else
@@ -3085,12 +2960,12 @@ EOF
fi
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:3089: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:2964: 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 3094 "configure"
+#line 2969 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -3106,7 +2981,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:3110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -3133,17 +3008,17 @@ for ac_hdr in limits.h stddef.h string.h strings.h stdlib.h time.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3137: checking for $ac_hdr" >&5
+echo "configure:3012: 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 3142 "configure"
+#line 3017 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3173,17 +3048,17 @@ done
# Check for thread headers.
ac_safe=`echo "thread.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for thread.h""... $ac_c" 1>&6
-echo "configure:3177: checking for thread.h" >&5
+echo "configure:3052: checking for thread.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 3182 "configure"
+#line 3057 "configure"
#include "confdefs.h"
#include <thread.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3187: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3207,17 +3082,17 @@ fi
ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for pthread.h""... $ac_c" 1>&6
-echo "configure:3211: checking for pthread.h" >&5
+echo "configure:3086: checking for pthread.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 3216 "configure"
+#line 3091 "configure"
#include "confdefs.h"
#include <pthread.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3096: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3242,12 +3117,12 @@ fi
# These tests can't be done till we know if we have limits.h.
echo $ac_n "checking for CHAR_BIT""... $ac_c" 1>&6
-echo "configure:3246: checking for CHAR_BIT" >&5
+echo "configure:3121: checking for CHAR_BIT" >&5
if eval "test \"`echo '$''{'gcc_cv_decl_char_bit'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3251 "configure"
+#line 3126 "configure"
#include "confdefs.h"
#ifdef HAVE_LIMITS_H
#include <limits.h>
@@ -3272,7 +3147,7 @@ fi
echo "$ac_t""$gcc_cv_decl_char_bit" 1>&6
if test $gcc_cv_decl_char_bit = no; then
echo $ac_n "checking number of bits in a byte""... $ac_c" 1>&6
-echo "configure:3276: checking number of bits in a byte" >&5
+echo "configure:3151: checking number of bits in a byte" >&5
if eval "test \"`echo '$''{'gcc_cv_c_nbby'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3280,7 +3155,7 @@ else
gcc_cv_c_nbby=
while test $i -lt 65; do
cat > conftest.$ac_ext <<EOF
-#line 3284 "configure"
+#line 3159 "configure"
#include "confdefs.h"
int main() {
@@ -3290,7 +3165,7 @@ switch(0) {
; }
; return 0; }
EOF
-if { (eval echo configure:3294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3169: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_c_nbby=$i; break
else
@@ -3315,14 +3190,14 @@ EOF
fi
fi
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3319: checking whether byte ordering is bigendian" >&5
+echo "configure:3194: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
-#line 3326 "configure"
+#line 3201 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3333,11 +3208,11 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3212: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
# It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF
-#line 3341 "configure"
+#line 3216 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3348,7 +3223,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -3368,7 +3243,7 @@ if test "$cross_compiling" = yes; then
echo $ac_n "cross-compiling... " 2>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3372 "configure"
+#line 3247 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -3381,7 +3256,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:3385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian=no
else
@@ -3399,7 +3274,7 @@ fi
echo "$ac_t""$ac_cv_c_bigendian" 1>&6
if test $ac_cv_c_bigendian = unknown; then
echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6
-echo "configure:3403: checking to probe for byte ordering" >&5
+echo "configure:3278: checking to probe for byte ordering" >&5
cat >conftest.c <<EOF
short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
@@ -3479,7 +3354,7 @@ esac
# These libraries may be used by collect2.
# We may need a special search path to get them linked.
echo $ac_n "checking for collect2 libraries""... $ac_c" 1>&6
-echo "configure:3483: checking for collect2 libraries" >&5
+echo "configure:3358: checking for collect2 libraries" >&5
if eval "test \"`echo '$''{'gcc_cv_collect2_libs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3490,7 +3365,7 @@ for libs in '' -lld -lmld \
do
LIBS="$libs"
cat > conftest.$ac_ext <<EOF
-#line 3494 "configure"
+#line 3369 "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
@@ -3501,7 +3376,7 @@ int main() {
ldopen()
; return 0; }
EOF
-if { (eval echo configure:3505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gcc_cv_collect2_libs="$libs"; break
else
@@ -3527,14 +3402,14 @@ save_LIBS="$LIBS"
LIBS=
echo $ac_n "checking for library containing exc_resume""... $ac_c" 1>&6
-echo "configure:3531: checking for library containing exc_resume" >&5
+echo "configure:3406: checking for library containing exc_resume" >&5
if eval "test \"`echo '$''{'ac_cv_search_exc_resume'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_exc_resume="no"
cat > conftest.$ac_ext <<EOF
-#line 3538 "configure"
+#line 3413 "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
@@ -3545,7 +3420,7 @@ int main() {
exc_resume()
; return 0; }
EOF
-if { (eval echo configure:3549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_exc_resume="none required"
else
@@ -3556,7 +3431,7 @@ rm -f conftest*
test "$ac_cv_search_exc_resume" = "no" && for i in exc; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3560 "configure"
+#line 3435 "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
@@ -3567,7 +3442,7 @@ int main() {
exc_resume()
; return 0; }
EOF
-if { (eval echo configure:3571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_exc_resume="-l$i"
break
@@ -3597,14 +3472,14 @@ save_LIBS="$LIBS"
LIBS=
echo $ac_n "checking for library containing ldexp""... $ac_c" 1>&6
-echo "configure:3601: checking for library containing ldexp" >&5
+echo "configure:3476: checking for library containing ldexp" >&5
if eval "test \"`echo '$''{'ac_cv_search_ldexp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_ldexp="no"
cat > conftest.$ac_ext <<EOF
-#line 3608 "configure"
+#line 3483 "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
@@ -3615,7 +3490,7 @@ int main() {
ldexp()
; return 0; }
EOF
-if { (eval echo configure:3619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_ldexp="none required"
else
@@ -3626,7 +3501,7 @@ rm -f conftest*
test "$ac_cv_search_ldexp" = "no" && for i in m; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3630 "configure"
+#line 3505 "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
@@ -3637,7 +3512,7 @@ int main() {
ldexp()
; return 0; }
EOF
-if { (eval echo configure:3641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_ldexp="-l$i"
break
@@ -3661,55 +3536,15 @@ LDEXP_LIB="$LIBS"
LIBS="$save_LIBS"
-# See if the stage1 system preprocessor understands the ANSI C
-# preprocessor stringification operator. (Used by symcat.h.)
-
-
-echo $ac_n "checking for preprocessor stringizing operator""... $ac_c" 1>&6
-echo "configure:3670: checking for preprocessor stringizing operator" >&5
-if eval "test \"`echo '$''{'ac_cv_c_stringize'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 3675 "configure"
-#include "confdefs.h"
-
-#define x(y) #y
-
-char *s = x(teststring);
-
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "#teststring" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_c_stringize=no
-else
- rm -rf conftest*
- ac_cv_c_stringize=yes
-fi
-rm -f conftest*
-
-fi
-
-if test "${ac_cv_c_stringize}" = yes
-then
- cat >> confdefs.h <<\EOF
-#define HAVE_STRINGIZE 1
-EOF
-
-fi
-echo "$ac_t""${ac_cv_c_stringize}" 1>&6
-
-
# 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:3708: checking for inttypes.h" >&5
+echo "configure:3543: 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 3713 "configure"
+#line 3548 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <inttypes.h>
@@ -3717,7 +3552,7 @@ int main() {
intmax_t i = -1;
; return 0; }
EOF
-if { (eval echo configure:3721: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_header_inttypes_h=yes
else
@@ -3744,12 +3579,12 @@ for ac_func in times clock dup2 kill getrlimit setrlimit atoll atoq \
scandir alphasort gettimeofday mbstowcs wcswidth mmap mincore
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3748: checking for $ac_func" >&5
+echo "configure:3583: 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 3753 "configure"
+#line 3588 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3772,7 +3607,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3799,7 +3634,7 @@ done
if test x$ac_cv_func_mbstowcs = xyes; then
echo $ac_n "checking whether mbstowcs works""... $ac_c" 1>&6
-echo "configure:3803: checking whether mbstowcs works" >&5
+echo "configure:3638: checking whether mbstowcs works" >&5
if eval "test \"`echo '$''{'gcc_cv_func_mbstowcs_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3807,7 +3642,7 @@ else
gcc_cv_func_mbstowcs_works=yes
else
cat > conftest.$ac_ext <<EOF
-#line 3811 "configure"
+#line 3646 "configure"
#include "confdefs.h"
#include <stdlib.h>
int main()
@@ -3816,7 +3651,7 @@ int main()
return 0;
}
EOF
-if { (eval echo configure:3820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gcc_cv_func_mbstowcs_works=yes
else
@@ -3840,12 +3675,12 @@ EOF
fi
echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:3844: checking for ssize_t" >&5
+echo "configure:3679: checking for ssize_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3849 "configure"
+#line 3684 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -3876,12 +3711,12 @@ fi
# Try to determine the array type of the second argument of getgroups
# for the target system (int or gid_t).
echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3880: checking for uid_t in sys/types.h" >&5
+echo "configure:3715: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3885 "configure"
+#line 3720 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -3910,7 +3745,7 @@ EOF
fi
echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:3914: checking type of array argument to getgroups" >&5
+echo "configure:3749: checking type of array argument to getgroups" >&5
if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3918,7 +3753,7 @@ else
ac_cv_type_getgroups=cross
else
cat > conftest.$ac_ext <<EOF
-#line 3922 "configure"
+#line 3757 "configure"
#include "confdefs.h"
/* Thanks to Mike Rendell for this test. */
@@ -3943,7 +3778,7 @@ main()
}
EOF
-if { (eval echo configure:3947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_type_getgroups=gid_t
else
@@ -3957,7 +3792,7 @@ fi
if test $ac_cv_type_getgroups = cross; then
cat > conftest.$ac_ext <<EOF
-#line 3961 "configure"
+#line 3796 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -3998,7 +3833,7 @@ fi
echo $ac_n "checking whether the printf functions support %p""... $ac_c" 1>&6
-echo "configure:4002: checking whether the printf functions support %p" >&5
+echo "configure:3837: 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
@@ -4006,7 +3841,7 @@ else
gcc_cv_func_printf_ptr=no
else
cat > conftest.$ac_ext <<EOF
-#line 4010 "configure"
+#line 3845 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4019,7 +3854,7 @@ int main()
return (p != q);
}
EOF
-if { (eval echo configure:4023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gcc_cv_func_printf_ptr=yes
else
@@ -4049,7 +3884,7 @@ if test $ac_cv_header_sys_mman_h != yes \
gcc_cv_func_mmap_anon=no
else
echo $ac_n "checking whether read-only mmap of a plain file works""... $ac_c" 1>&6
-echo "configure:4053: checking whether read-only mmap of a plain file works" >&5
+echo "configure:3888: checking whether read-only mmap of a plain file works" >&5
if eval "test \"`echo '$''{'gcc_cv_func_mmap_file'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4068,7 +3903,7 @@ fi
echo "$ac_t""$gcc_cv_func_mmap_file" 1>&6
echo $ac_n "checking whether mmap from /dev/zero works""... $ac_c" 1>&6
-echo "configure:4072: checking whether mmap from /dev/zero works" >&5
+echo "configure:3907: checking whether mmap from /dev/zero works" >&5
if eval "test \"`echo '$''{'gcc_cv_func_mmap_dev_zero'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4094,12 +3929,12 @@ echo "$ac_t""$gcc_cv_func_mmap_dev_zero" 1>&6
# Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for.
echo $ac_n "checking for MAP_ANON(YMOUS)""... $ac_c" 1>&6
-echo "configure:4098: checking for MAP_ANON(YMOUS)" >&5
+echo "configure:3933: checking for MAP_ANON(YMOUS)" >&5
if eval "test \"`echo '$''{'gcc_cv_decl_map_anon'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4103 "configure"
+#line 3938 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/mman.h>
@@ -4113,7 +3948,7 @@ int main() {
int n = MAP_ANONYMOUS;
; return 0; }
EOF
-if { (eval echo configure:4117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_decl_map_anon=yes
else
@@ -4131,7 +3966,7 @@ echo "$ac_t""$gcc_cv_decl_map_anon" 1>&6
gcc_cv_func_mmap_anon=no
else
echo $ac_n "checking whether mmap with MAP_ANON(YMOUS) works""... $ac_c" 1>&6
-echo "configure:4135: checking whether mmap with MAP_ANON(YMOUS) works" >&5
+echo "configure:3970: checking whether mmap with MAP_ANON(YMOUS) works" >&5
if eval "test \"`echo '$''{'gcc_cv_func_mmap_anon'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4186,12 +4021,12 @@ case "${host}" in
;;
esac
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:4190: checking for pid_t" >&5
+echo "configure:4025: 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 4195 "configure"
+#line 4030 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -4220,17 +4055,17 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:4224: checking for vfork.h" >&5
+echo "configure:4059: 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 4229 "configure"
+#line 4064 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4255,18 +4090,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:4259: checking for working vfork" >&5
+echo "configure:4094: 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:4265: checking for vfork" >&5
+echo "configure:4100: 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 4270 "configure"
+#line 4105 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -4289,7 +4124,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:4293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vfork=yes"
else
@@ -4311,7 +4146,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 4315 "configure"
+#line 4150 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -4406,7 +4241,7 @@ main() {
}
}
EOF
-if { (eval echo configure:4410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_vfork_works=yes
else
@@ -4445,7 +4280,7 @@ fi
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:4449: checking for iconv" >&5
+echo "configure:4284: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4453,7 +4288,7 @@ else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 4457 "configure"
+#line 4292 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -4463,7 +4298,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:4467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
@@ -4475,7 +4310,7 @@ rm -f conftest*
am_save_LIBS="$LIBS"
LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
cat > conftest.$ac_ext <<EOF
-#line 4479 "configure"
+#line 4314 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -4485,7 +4320,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:4489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_lib_iconv=yes
am_cv_func_iconv=yes
@@ -4506,13 +4341,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:4510: checking for iconv declaration" >&5
+echo "configure:4345: checking for iconv declaration" >&5
if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4516 "configure"
+#line 4351 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -4531,7 +4366,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
@@ -4569,12 +4404,12 @@ for ac_func in getenv atol sbrk abort atof getcwd getwd \
do
ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
-echo "configure:4573: checking whether $ac_func is declared" >&5
+echo "configure:4408: checking whether $ac_func is declared" >&5
if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4578 "configure"
+#line 4413 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -4588,7 +4423,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:4592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4427: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -4690,12 +4525,12 @@ for ac_func in getrlimit setrlimit getrusage
do
ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
-echo "configure:4694: checking whether $ac_func is declared" >&5
+echo "configure:4529: checking whether $ac_func is declared" >&5
if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4699 "configure"
+#line 4534 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -4713,7 +4548,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:4717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4552: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -4752,7 +4587,7 @@ fi
cat > conftest.$ac_ext <<EOF
-#line 4756 "configure"
+#line 4591 "configure"
#include "confdefs.h"
#include "ansidecl.h"
@@ -4765,7 +4600,7 @@ int main() {
rlim_t l = 0;
; return 0; }
EOF
-if { (eval echo configure:4769: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
:
else
echo "configure: failed program was:" >&5
@@ -4782,12 +4617,12 @@ for ac_func in ldgetname
do
ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
-echo "configure:4786: checking whether $ac_func is declared" >&5
+echo "configure:4621: checking whether $ac_func is declared" >&5
if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4791 "configure"
+#line 4626 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -4805,7 +4640,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:4809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -4841,12 +4676,12 @@ for ac_func in times
do
ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
-echo "configure:4845: checking whether $ac_func is declared" >&5
+echo "configure:4680: checking whether $ac_func is declared" >&5
if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4850 "configure"
+#line 4685 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -4864,7 +4699,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:4868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -4898,13 +4733,13 @@ fi
# More time-related stuff.
echo $ac_n "checking for struct tms""... $ac_c" 1>&6
-echo "configure:4902: checking for struct tms" >&5
+echo "configure:4737: checking for struct tms" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tms'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4908 "configure"
+#line 4743 "configure"
#include "confdefs.h"
#include "ansidecl.h"
@@ -4917,7 +4752,7 @@ int main() {
struct tms tms;
; return 0; }
EOF
-if { (eval echo configure:4921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4756: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tms=yes
else
@@ -4940,13 +4775,13 @@ fi
# use gcc_cv_* here because this doesn't match the behavior of AC_CHECK_TYPE.
# revisit after autoconf 2.50.
echo $ac_n "checking for clock_t""... $ac_c" 1>&6
-echo "configure:4944: checking for clock_t" >&5
+echo "configure:4779: checking for clock_t" >&5
if eval "test \"`echo '$''{'gcc_cv_type_clock_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4950 "configure"
+#line 4785 "configure"
#include "confdefs.h"
#include "ansidecl.h"
@@ -4956,7 +4791,7 @@ int main() {
clock_t x;
; return 0; }
EOF
-if { (eval echo configure:4960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_type_clock_t=yes
else
@@ -4977,12 +4812,12 @@ EOF
fi
echo $ac_n "checking for uchar""... $ac_c" 1>&6
-echo "configure:4981: checking for uchar" >&5
+echo "configure:4816: checking for uchar" >&5
if eval "test \"`echo '$''{'gcc_cv_type_uchar'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4986 "configure"
+#line 4821 "configure"
#include "confdefs.h"
#include "ansidecl.h"
@@ -4993,7 +4828,7 @@ if ((uchar *)0) return 0;
if (sizeof(uchar)) return 0;
; return 0; }
EOF
-if { (eval echo configure:4997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4832: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_uchar=yes
else
@@ -5023,7 +4858,7 @@ if test "${enable_initfini_array+set}" = set; then
else
echo $ac_n "checking for .preinit_array/.init_array/.fini_array support""... $ac_c" 1>&6
-echo "configure:5027: checking for .preinit_array/.init_array/.fini_array support" >&5
+echo "configure:4862: checking for .preinit_array/.init_array/.fini_array support" >&5
if eval "test \"`echo '$''{'gcc_cv_initfini_array'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5031,7 +4866,7 @@ else
gcc_cv_initfini_array=no
else
cat > conftest.$ac_ext <<EOF
-#line 5035 "configure"
+#line 4870 "configure"
#include "confdefs.h"
static int x = -1;
@@ -5039,7 +4874,7 @@ int main (void) { return x; }
int foo (void) { x = 0; }
int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
EOF
-if { (eval echo configure:5043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gcc_cv_initfini_array=yes
else
@@ -5067,12 +4902,12 @@ fi
# mkdir takes a single argument on some systems.
echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6
-echo "configure:5071: checking if mkdir takes one argument" >&5
+echo "configure:4906: checking if mkdir takes one argument" >&5
if eval "test \"`echo '$''{'gcc_cv_mkdir_takes_one_arg'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5076 "configure"
+#line 4911 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -5089,7 +4924,7 @@ int main() {
mkdir ("foo", 0);
; return 0; }
EOF
-if { (eval echo configure:5093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4928: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_mkdir_takes_one_arg=no
else
@@ -5129,7 +4964,7 @@ fi
echo $ac_n "checking for main in -lunwind""... $ac_c" 1>&6
-echo "configure:5133: checking for main in -lunwind" >&5
+echo "configure:4968: checking for main in -lunwind" >&5
ac_lib_var=`echo unwind'_'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
@@ -5137,14 +4972,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lunwind $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5141 "configure"
+#line 4976 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:5148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5446,14 +5281,14 @@ fi
echo $ac_n "checking for library containing strerror""... $ac_c" 1>&6
-echo "configure:5450: checking for library containing strerror" >&5
+echo "configure:5285: checking for library containing strerror" >&5
if eval "test \"`echo '$''{'ac_cv_search_strerror'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_strerror="no"
cat > conftest.$ac_ext <<EOF
-#line 5457 "configure"
+#line 5292 "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
@@ -5464,7 +5299,7 @@ int main() {
strerror()
; return 0; }
EOF
-if { (eval echo configure:5468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_strerror="none required"
else
@@ -5475,7 +5310,7 @@ rm -f conftest*
test "$ac_cv_search_strerror" = "no" && for i in cposix; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5479 "configure"
+#line 5314 "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
@@ -5486,7 +5321,7 @@ int main() {
strerror()
; return 0; }
EOF
-if { (eval echo configure:5490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_strerror="-l$i"
break
@@ -5509,12 +5344,12 @@ fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:5513: checking for working const" >&5
+echo "configure:5348: 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 5518 "configure"
+#line 5353 "configure"
#include "confdefs.h"
int main() {
@@ -5563,7 +5398,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:5567: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -5584,12 +5419,12 @@ EOF
fi
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:5588: checking for off_t" >&5
+echo "configure:5423: 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 5593 "configure"
+#line 5428 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -5617,12 +5452,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:5621: checking for size_t" >&5
+echo "configure:5456: 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 5626 "configure"
+#line 5461 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -5652,19 +5487,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:5656: checking for working alloca.h" >&5
+echo "configure:5491: 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 5661 "configure"
+#line 5496 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:5668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -5685,12 +5520,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:5689: checking for alloca" >&5
+echo "configure:5524: 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 5694 "configure"
+#line 5529 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -5718,7 +5553,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:5722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -5750,12 +5585,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:5754: checking whether alloca needs Cray hooks" >&5
+echo "configure:5589: 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 5759 "configure"
+#line 5594 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -5780,12 +5615,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:5784: checking for $ac_func" >&5
+echo "configure:5619: 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 5789 "configure"
+#line 5624 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5808,7 +5643,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -5835,7 +5670,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:5839: checking stack direction for C alloca" >&5
+echo "configure:5674: 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
@@ -5843,7 +5678,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 5847 "configure"
+#line 5682 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -5862,7 +5697,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:5866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -5885,12 +5720,12 @@ fi
echo $ac_n "checking whether we are using the GNU C Library 2.1 or newer""... $ac_c" 1>&6
-echo "configure:5889: checking whether we are using the GNU C Library 2.1 or newer" >&5
+echo "configure:5724: checking whether we are using the GNU C Library 2.1 or newer" >&5
if eval "test \"`echo '$''{'ac_cv_gnu_library_2_1'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5894 "configure"
+#line 5729 "configure"
#include "confdefs.h"
#include <features.h>
@@ -5926,17 +5761,17 @@ stdlib.h string.h 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:5930: checking for $ac_hdr" >&5
+echo "configure:5765: 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 5935 "configure"
+#line 5770 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5940: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5967,12 +5802,12 @@ getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
strdup strtoul tsearch __argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5971: checking for $ac_func" >&5
+echo "configure:5806: 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 5976 "configure"
+#line 5811 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5995,7 +5830,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6036,7 +5871,7 @@ fi
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:6040: checking for iconv" >&5
+echo "configure:5875: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6044,7 +5879,7 @@ else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 6048 "configure"
+#line 5883 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -6054,7 +5889,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:6058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
@@ -6066,7 +5901,7 @@ rm -f conftest*
am_save_LIBS="$LIBS"
LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
cat > conftest.$ac_ext <<EOF
-#line 6070 "configure"
+#line 5905 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -6076,7 +5911,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:6080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_lib_iconv=yes
am_cv_func_iconv=yes
@@ -6097,13 +5932,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:6101: checking for iconv declaration" >&5
+echo "configure:5936: checking for iconv declaration" >&5
if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6107 "configure"
+#line 5942 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -6122,7 +5957,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:6126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5961: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
@@ -6151,19 +5986,19 @@ EOF
echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6
-echo "configure:6155: checking for nl_langinfo and CODESET" >&5
+echo "configure:5990: checking for nl_langinfo and CODESET" >&5
if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6160 "configure"
+#line 5995 "configure"
#include "confdefs.h"
#include <langinfo.h>
int main() {
char* cs = nl_langinfo(CODESET);
; return 0; }
EOF
-if { (eval echo configure:6167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_langinfo_codeset=yes
else
@@ -6186,19 +6021,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:6190: checking for LC_MESSAGES" >&5
+echo "configure:6025: 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 6195 "configure"
+#line 6030 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:6202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
@@ -6219,7 +6054,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:6223: checking whether NLS is requested" >&5
+echo "configure:6058: 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"
@@ -6242,7 +6077,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:6246: checking whether included gettext is requested" >&5
+echo "configure:6081: 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"
@@ -6262,17 +6097,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:6266: checking for libintl.h" >&5
+echo "configure:6101: 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 6271 "configure"
+#line 6106 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6276: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -6293,12 +6128,12 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
EOF
echo $ac_n "checking for GNU gettext in libc""... $ac_c" 1>&6
-echo "configure:6297: checking for GNU gettext in libc" >&5
+echo "configure:6132: checking for GNU gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6302 "configure"
+#line 6137 "configure"
#include "confdefs.h"
#include <libintl.h>
extern int _nl_msg_cat_cntr;
@@ -6307,7 +6142,7 @@ bindtextdomain ("", "");
return (int) gettext ("") + _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:6311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gnugettext1_libc=yes
else
@@ -6323,14 +6158,14 @@ echo "$ac_t""$gt_cv_func_gnugettext1_libc" 1>&6
if test "$gt_cv_func_gnugettext1_libc" != "yes"; then
echo $ac_n "checking for GNU gettext in libintl""... $ac_c" 1>&6
-echo "configure:6327: checking for GNU gettext in libintl" >&5
+echo "configure:6162: checking for GNU gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
gt_save_LIBS="$LIBS"
LIBS="$LIBS -lintl $LIBICONV"
cat > conftest.$ac_ext <<EOF
-#line 6334 "configure"
+#line 6169 "configure"
#include "confdefs.h"
#include <libintl.h>
extern int _nl_msg_cat_cntr;
@@ -6339,7 +6174,7 @@ bindtextdomain ("", "");
return (int) gettext ("") + _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:6343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gnugettext1_libintl=yes
else
@@ -6372,12 +6207,12 @@ EOF
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6376: checking for $ac_func" >&5
+echo "configure:6211: 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 6381 "configure"
+#line 6216 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6400,7 +6235,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6429,7 +6264,7 @@ done
# 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:6433: checking for $ac_word" >&5
+echo "configure:6268: 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
@@ -6463,7 +6298,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:6467: checking for $ac_word" >&5
+echo "configure:6302: 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
@@ -6500,7 +6335,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:6504: checking for $ac_word" >&5
+echo "configure:6339: 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
@@ -6550,7 +6385,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:6554: checking for $ac_word" >&5
+echo "configure:6389: 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
@@ -6584,7 +6419,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:6588: checking for $ac_word" >&5
+echo "configure:6423: 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
@@ -6620,7 +6455,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:6624: checking for $ac_word" >&5
+echo "configure:6459: 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
@@ -6692,7 +6527,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:6696: checking for $ac_word" >&5
+echo "configure:6531: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_INTLBISON'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6725,7 +6560,7 @@ done
ac_verc_fail=yes
else
echo $ac_n "checking version of bison""... $ac_c" 1>&6
-echo "configure:6729: checking version of bison" >&5
+echo "configure:6564: checking version of bison" >&5
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
@@ -6770,7 +6605,7 @@ EOF
if test "x$CATOBJEXT" != x; then
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:6774: checking for catalogs to be installed" >&5
+echo "configure:6609: checking for catalogs to be installed" >&5
# Look for .po and .gmo files in the source directory.
CATALOGS=
XLINGUAS=
@@ -6828,7 +6663,7 @@ fi
case $host_os in
win32 | pe | cygwin* | mingw32* | uwin*)
echo $ac_n "checking whether windows registry support is requested""... $ac_c" 1>&6
-echo "configure:6832: checking whether windows registry support is requested" >&5
+echo "configure:6667: checking whether windows registry support is requested" >&5
if test "x$enable_win32_registry" != xno; then
cat >> confdefs.h <<\EOF
#define ENABLE_WIN32_REGISTRY 1
@@ -6837,14 +6672,14 @@ EOF
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for library containing RegOpenKeyExA""... $ac_c" 1>&6
-echo "configure:6841: checking for library containing RegOpenKeyExA" >&5
+echo "configure:6676: checking for library containing RegOpenKeyExA" >&5
if eval "test \"`echo '$''{'ac_cv_search_RegOpenKeyExA'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_RegOpenKeyExA="no"
cat > conftest.$ac_ext <<EOF
-#line 6848 "configure"
+#line 6683 "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
@@ -6855,7 +6690,7 @@ int main() {
RegOpenKeyExA()
; return 0; }
EOF
-if { (eval echo configure:6859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_RegOpenKeyExA="none required"
else
@@ -6866,7 +6701,7 @@ rm -f conftest*
test "$ac_cv_search_RegOpenKeyExA" = "no" && for i in advapi32; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6870 "configure"
+#line 6705 "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
@@ -6877,7 +6712,7 @@ int main() {
RegOpenKeyExA()
; return 0; }
EOF
-if { (eval echo configure:6881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_RegOpenKeyExA="-l$i"
break
@@ -6919,7 +6754,7 @@ esac
if test "x$enable_win32_registry" != xno; then
echo $ac_n "checking registry key on windows hosts""... $ac_c" 1>&6
-echo "configure:6923: checking registry key on windows hosts" >&5
+echo "configure:6758: checking registry key on windows hosts" >&5
cat >> confdefs.h <<EOF
#define WIN32_REGISTRY_KEY "$gcc_cv_win32_registry_key"
EOF
@@ -7079,7 +6914,7 @@ fi
# These are the normal (build=host) settings:
BUILD_PREFIX=
BUILD_PREFIX_1=ignore-
-BUILD_CC='$(CC)'
+CC_FOR_BUILD='$(CC)'
BUILD_CFLAGS='$(ALL_CFLAGS)'
STMP_FIXINC=stmp-fixinc
@@ -7090,7 +6925,6 @@ if test x$build != x$host
then
BUILD_PREFIX=build-
BUILD_PREFIX_1=build-
- BUILD_CC='$(CC_FOR_BUILD)'
BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) $(XCFLAGS)'
if test "x$TARGET_SYSTEM_ROOT" = x; then
@@ -7130,7 +6964,7 @@ esac
# build->target assembler and hope that it will have the same features
# as the host->target assembler we'll be using.
echo $ac_n "checking what assembler to use""... $ac_c" 1>&6
-echo "configure:7134: checking what assembler to use" >&5
+echo "configure:6968: checking what assembler to use" >&5
in_tree_gas=no
gcc_cv_as=
gcc_cv_gas_major_version=
@@ -7163,6 +6997,13 @@ gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.[0-9]*\.
rm -f as$host_exeext
$symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null
+ in_tree_gas_is_elf=no
+ if grep 'obj_format = elf' ../gas/Makefile > /dev/null \
+ || (grep 'obj_format = multi' ../gas/Makefile \
+ && grep 'extra_objects =.* obj-elf' ../gas/Makefile) > /dev/null
+ then
+ in_tree_gas_is_elf=yes
+ fi
fi
if test "x$gcc_cv_as" = x; then
@@ -7241,7 +7082,7 @@ esac
# build->target linker and hope that it will have the same features
# as the host->target linker we'll be using.
echo $ac_n "checking what linker to use""... $ac_c" 1>&6
-echo "configure:7245: checking what linker to use" >&5
+echo "configure:7086: checking what linker to use" >&5
in_tree_ld=no
gcc_cv_ld=
gcc_cv_gld_major_version=
@@ -7259,6 +7100,11 @@ elif test -f $gcc_cv_ld_gld_srcdir/configure.in \
&& test -f ../ld/Makefile; then
# Single tree build which includes ld.
in_tree_ld=yes
+ in_tree_ld_is_elf=no
+ if (grep 'EMUL = .*elf' ../ld/Makefile \
+ || grep 'EMUL = .*linux' ../ld/Makefile) > /dev/null; then
+ in_tree_ld_is_elf=yes
+ fi
for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in
do
gcc_cv_gld_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
@@ -7344,7 +7190,7 @@ esac
# Figure out what nm we will be using.
gcc_cv_binutils_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/binutils
echo $ac_n "checking what nm to use""... $ac_c" 1>&6
-echo "configure:7348: checking what nm to use" >&5
+echo "configure:7194: checking what nm to use" >&5
in_tree_nm=no
if test -x nm$host_exeext; then
gcc_cv_nm=./nm$host_exeext
@@ -7367,7 +7213,7 @@ esac
# Figure out what objdump we will be using.
echo $ac_n "checking what objdump to use""... $ac_c" 1>&6
-echo "configure:7371: checking what objdump to use" >&5
+echo "configure:7217: checking what objdump to use" >&5
in_tree_objdump=no
if test -x objdump$host_exeext; then
gcc_cv_objdump=./objdump$host_exeext
@@ -7392,7 +7238,7 @@ esac
# Figure out what assembler alignment features are present.
echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6
-echo "configure:7396: checking assembler alignment features" >&5
+echo "configure:7242: checking assembler alignment features" >&5
gcc_cv_as_alignment_features=none
if test $in_tree_gas = yes; then
# Gas version 2.6 and later support for .balign and .p2align.
@@ -7453,7 +7299,7 @@ fi
echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6
echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6
-echo "configure:7457: checking assembler subsection support" >&5
+echo "configure:7303: checking assembler subsection support" >&5
gcc_cv_as_subsections=no
if test $in_tree_gas = yes ; then
if test $gcc_cv_gas_major_version -eq 2 \
@@ -7461,9 +7307,8 @@ if test $in_tree_gas = yes ; then
|| test $gcc_cv_gas_major_version -gt 2 ; then
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
- gcc_cv_as_subsections="working .subsection -1"
- fi
+ test $in_tree_gas_is_elf = yes \
+ && gcc_cv_as_subsections="working .subsection -1"
fi
@@ -7502,7 +7347,7 @@ fi
echo "$ac_t""$gcc_cv_as_subsections" 1>&6
echo $ac_n "checking assembler weak support""... $ac_c" 1>&6
-echo "configure:7506: checking assembler weak support" >&5
+echo "configure:7351: checking assembler weak support" >&5
gcc_cv_as_weak=no
if test $in_tree_gas = yes ; then
if test $gcc_cv_gas_major_version -eq 2 \
@@ -7532,7 +7377,7 @@ fi
echo "$ac_t""$gcc_cv_as_weak" 1>&6
echo $ac_n "checking assembler hidden support""... $ac_c" 1>&6
-echo "configure:7536: checking assembler hidden support" >&5
+echo "configure:7381: checking assembler hidden support" >&5
gcc_cv_as_hidden=no
if test $in_tree_gas = yes ; then
if test $gcc_cv_gas_major_version -eq 2 \
@@ -7542,9 +7387,7 @@ if test $in_tree_gas = yes ; then
|| test $gcc_cv_gas_major_version -gt 2 ; then
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
- gcc_cv_as_hidden="yes"
- fi
+ test $in_tree_gas_is_elf = yes && gcc_cv_as_hidden="yes"
fi
@@ -7563,7 +7406,13 @@ elif test x$gcc_cv_as != x; then
# the date string after the version number.
ld_ver=`$gcc_cv_ld --version 2>/dev/null | head -1`
if echo "$ld_ver" | grep GNU > /dev/null; then
- ld_vers=`echo $ld_ver | sed -n 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\(\|\.[0-9][0-9]*\(\|\.[0-9][0-9]*\)\)\)\([ ].*\|\)$,\1,p'`
+ ld_vers=`echo $ld_ver | sed -n \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p'`
ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
if test 0"$ld_date" -lt 20020404; then
if test -n "$ld_date"; then
@@ -7613,7 +7462,7 @@ libgcc_visibility=$gcc_cv_as_hidden
echo $ac_n "checking assembler leb128 support""... $ac_c" 1>&6
-echo "configure:7617: checking assembler leb128 support" >&5
+echo "configure:7466: checking assembler leb128 support" >&5
gcc_cv_as_leb128=no
if test $in_tree_gas = yes ; then
if test $gcc_cv_gas_major_version -eq 2 \
@@ -7621,9 +7470,7 @@ if test $in_tree_gas = yes ; then
|| test $gcc_cv_gas_major_version -gt 2 ; then
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
- gcc_cv_as_leb128="yes"
- fi
+ test $in_tree_gas_is_elf = yes && gcc_cv_as_leb128="yes"
fi
@@ -7667,7 +7514,7 @@ fi
echo "$ac_t""$gcc_cv_as_leb128" 1>&6
echo $ac_n "checking assembler eh_frame optimization""... $ac_c" 1>&6
-echo "configure:7671: checking assembler eh_frame optimization" >&5
+echo "configure:7518: checking assembler eh_frame optimization" >&5
gcc_cv_as_eh_frame=no
if test $in_tree_gas = yes ; then
if test $gcc_cv_gas_major_version -eq 2 \
@@ -7675,9 +7522,7 @@ if test $in_tree_gas = yes ; then
|| test $gcc_cv_gas_major_version -gt 2 ; then
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
- gcc_cv_as_eh_frame="yes"
- fi
+ test $in_tree_gas_is_elf = yes && gcc_cv_as_eh_frame="yes"
fi
@@ -7757,7 +7602,7 @@ fi
echo "$ac_t""$gcc_cv_as_eh_frame" 1>&6
echo $ac_n "checking assembler section merging support""... $ac_c" 1>&6
-echo "configure:7761: checking assembler section merging support" >&5
+echo "configure:7606: checking assembler section merging support" >&5
gcc_cv_as_shf_merge=no
if test $in_tree_gas = yes ; then
if test $gcc_cv_gas_major_version -eq 2 \
@@ -7765,9 +7610,7 @@ if test $in_tree_gas = yes ; then
|| test $gcc_cv_gas_major_version -gt 2 ; then
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
- gcc_cv_as_shf_merge=yes
- fi
+ test $in_tree_gas_is_elf = yes && gcc_cv_as_shf_merge="yes"
fi
@@ -7789,7 +7632,7 @@ fi
echo "$ac_t""$gcc_cv_as_shf_merge" 1>&6
echo $ac_n "checking assembler thread-local storage support""... $ac_c" 1>&6
-echo "configure:7793: checking assembler thread-local storage support" >&5
+echo "configure:7636: checking assembler thread-local storage support" >&5
gcc_cv_as_tls=no
conftest_s=
tls_first_major=
@@ -7999,7 +7842,7 @@ case "$target" in
# All TARGET_ABI_OSF targets.
alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
echo $ac_n "checking assembler supports explicit relocations""... $ac_c" 1>&6
-echo "configure:8003: checking assembler supports explicit relocations" >&5
+echo "configure:7846: checking assembler supports explicit relocations" >&5
if eval "test \"`echo '$''{'gcc_cv_as_explicit_relocs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8052,7 +7895,7 @@ EOF
;;
sparc*-*-*)
echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6
-echo "configure:8056: checking assembler .register pseudo-op support" >&5
+echo "configure:7899: checking assembler .register pseudo-op support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_register_pseudo_op'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8080,7 +7923,7 @@ EOF
fi
echo $ac_n "checking assembler supports -relax""... $ac_c" 1>&6
-echo "configure:8084: checking assembler supports -relax" >&5
+echo "configure:7927: checking assembler supports -relax" >&5
if eval "test \"`echo '$''{'gcc_cv_as_relax_opt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8108,7 +7951,7 @@ EOF
fi
echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6
-echo "configure:8112: checking assembler and linker support unaligned pc related relocs" >&5
+echo "configure:7955: checking assembler and linker support unaligned pc related relocs" >&5
if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8135,7 +7978,7 @@ EOF
fi
echo $ac_n "checking assembler and linker support unaligned pc related relocs against hidden symbols""... $ac_c" 1>&6
-echo "configure:8139: checking assembler and linker support unaligned pc related relocs against hidden symbols" >&5
+echo "configure:7982: checking assembler and linker support unaligned pc related relocs against hidden symbols" >&5
if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel_hidden'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8175,7 +8018,7 @@ EOF
fi
echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c" 1>&6
-echo "configure:8179: checking for assembler offsetable %lo() support" >&5
+echo "configure:8022: checking for assembler offsetable %lo() support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_offsetable_lo10'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8214,7 +8057,7 @@ EOF
i[34567]86-*-* | x86_64-*-*)
echo $ac_n "checking assembler instructions""... $ac_c" 1>&6
-echo "configure:8218: checking assembler instructions" >&5
+echo "configure:8061: checking assembler instructions" >&5
gcc_cv_as_instructions=
if test $in_tree_gas = yes ; then
if test $gcc_cv_gas_major_version -eq 2 \
@@ -8248,7 +8091,7 @@ EOF
echo "$ac_t""$gcc_cv_as_instructions" 1>&6
echo $ac_n "checking assembler GOTOFF in data directives""... $ac_c" 1>&6
-echo "configure:8252: checking assembler GOTOFF in data directives" >&5
+echo "configure:8095: checking assembler GOTOFF in data directives" >&5
gcc_cv_as_gotoff_in_data=no
if test $in_tree_gas = yes ; then
if test $gcc_cv_gas_major_version -eq 2 \
@@ -8282,7 +8125,7 @@ EOF
ia64*-*-*)
echo $ac_n "checking assembler supports ltoffx and ldxmov""... $ac_c" 1>&6
-echo "configure:8286: checking assembler supports ltoffx and ldxmov" >&5
+echo "configure:8129: checking assembler supports ltoffx and ldxmov" >&5
if eval "test \"`echo '$''{'gcc_cv_as_ltoffx_ldxmov_relocs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8327,7 +8170,7 @@ EOF
esac
echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6
-echo "configure:8331: checking assembler dwarf2 debug_line support" >&5
+echo "configure:8174: checking assembler dwarf2 debug_line support" >&5
gcc_cv_as_dwarf2_debug_line=no
# ??? Not all targets support dwarf2 debug_line, even within a version
# of gas. Moreover, we need to emit a valid instruction to trigger any
@@ -8354,10 +8197,8 @@ if test $in_tree_gas = yes ; then
|| test $gcc_cv_gas_major_version -gt 2 ; then
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null \
- && test x"$insn" != x ; then
- gcc_cv_as_dwarf2_debug_line="yes"
- fi
+ test $in_tree_gas_is_elf = yes && test x"$insn" != x \
+ && gcc_cv_as_dwarf2_debug_line="yes"
fi
@@ -8393,7 +8234,7 @@ fi
echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6
echo $ac_n "checking assembler --gdwarf2 support""... $ac_c" 1>&6
-echo "configure:8397: checking assembler --gdwarf2 support" >&5
+echo "configure:8238: checking assembler --gdwarf2 support" >&5
gcc_cv_as_gdwarf2_flag=no
if test $in_tree_gas = yes ; then
if test $gcc_cv_gas_major_version -eq 2 \
@@ -8401,10 +8242,8 @@ if test $in_tree_gas = yes ; then
|| test $gcc_cv_gas_major_version -gt 2 ; then
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null \
- && test x"$insn" != x ; then
- gcc_cv_as_gdwarf2_flag="yes"
- fi
+ test $in_tree_gas_is_elf = yes && test x"$insn" != x \
+ && gcc_cv_as_gdwarf2_flag="yes"
fi
@@ -8427,7 +8266,7 @@ fi
echo "$ac_t""$gcc_cv_as_gdwarf2_flag" 1>&6
echo $ac_n "checking assembler --gstabs support""... $ac_c" 1>&6
-echo "configure:8431: checking assembler --gstabs support" >&5
+echo "configure:8270: checking assembler --gstabs support" >&5
gcc_cv_as_gstabs_flag=no
if test $in_tree_gas = yes ; then
if test $gcc_cv_gas_major_version -eq 2 \
@@ -8435,10 +8274,8 @@ if test $in_tree_gas = yes ; then
|| test $gcc_cv_gas_major_version -gt 2 ; then
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null \
- && test x"$insn" != x ; then
- gcc_cv_as_gstabs_flag="yes"
- fi
+ test $in_tree_gas_is_elf = yes && test x"$insn" != x \
+ && gcc_cv_as_gstabs_flag="yes"
fi
@@ -8448,6 +8285,13 @@ elif test x$gcc_cv_as != x -a x"$insn" != x ; then
# ??? This fails with non-gnu grep.
if $gcc_cv_as --gstabs -o conftest.o conftest.s > /dev/null 2>&1 ; then
gcc_cv_as_gstabs_flag="yes"
+ # The native Solaris 9/Intel assembler doesn't understand --gstabs
+ # and warns about it, but still exits successfully. So check for
+ # this.
+ if $gcc_cv_as --gstabs -o conftest.o conftest.s 2>&1 | \
+ grep -i warning > /dev/null ; then
+ gcc_cv_as_gstabs_flag="no"
+ fi
fi
rm -f conftest.s conftest.o
fi
@@ -8460,10 +8304,11 @@ fi
echo "$ac_t""$gcc_cv_as_gstabs_flag" 1>&6
echo $ac_n "checking linker read-only and read-write section mixing""... $ac_c" 1>&6
-echo "configure:8464: checking linker read-only and read-write section mixing" >&5
+echo "configure:8308: checking linker read-only and read-write section mixing" >&5
gcc_cv_ld_ro_rw_mix=unknown
if test $in_tree_ld = yes ; then
- if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 \
+ && test $in_tree_ld_is_elf = yes; then
gcc_cv_ld_ro_rw_mix=read-write
fi
elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x ; then
@@ -8498,10 +8343,11 @@ fi
echo "$ac_t""$gcc_cv_ld_ro_rw_mix" 1>&6
echo $ac_n "checking linker PT_GNU_EH_FRAME support""... $ac_c" 1>&6
-echo "configure:8502: checking linker PT_GNU_EH_FRAME support" >&5
+echo "configure:8347: checking linker PT_GNU_EH_FRAME support" >&5
gcc_cv_ld_eh_frame_hdr=no
if test $in_tree_ld = yes ; then
- if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 \
+ && test $in_tree_ld_is_elf = yes; then
gcc_cv_ld_eh_frame_hdr=yes
fi
elif test x$gcc_cv_ld != x; then
@@ -8519,10 +8365,11 @@ fi
echo "$ac_t""$gcc_cv_ld_eh_frame_hdr" 1>&6
echo $ac_n "checking linker position independent executable support""... $ac_c" 1>&6
-echo "configure:8523: checking linker position independent executable support" >&5
+echo "configure:8369: checking linker position independent executable support" >&5
gcc_cv_ld_pie=no
if test $in_tree_ld = yes ; then
- if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 15 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 15 -o "$gcc_cv_gld_major_version" -gt 2 \
+ && test $in_tree_ld_is_elf = yes; then
gcc_cv_ld_pie=yes
fi
elif test x$gcc_cv_ld != x; then
@@ -8543,7 +8390,7 @@ echo "$ac_t""$gcc_cv_ld_pie" 1>&6
case "$target" in
mips*-*-*)
echo $ac_n "checking whether libgloss uses STARTUP directives consistently""... $ac_c" 1>&6
-echo "configure:8547: checking whether libgloss uses STARTUP directives consistently" >&5
+echo "configure:8394: checking whether libgloss uses STARTUP directives consistently" >&5
gcc_cv_mips_libgloss_startup=no
gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss
if test "x$exec_prefix" = xNONE; then
@@ -8571,7 +8418,7 @@ EOF
echo "$ac_t""$gcc_cv_mips_libgloss_startup" 1>&6
echo $ac_n "checking whether the assembler has explicit relocation support""... $ac_c" 1>&6
-echo "configure:8575: checking whether the assembler has explicit relocation support" >&5
+echo "configure:8422: checking whether the assembler has explicit relocation support" >&5
if test x$gcc_cv_mips_explicit_relocs = x; then
gcc_cv_mips_explicit_relocs=no
if test $in_tree_gas = yes; then
@@ -8777,7 +8624,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:8781: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:8628: checking whether to enable maintainer-specific portions of Makefiles" >&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
@@ -9337,7 +9184,7 @@ s%@SYSTEM_HEADER_DIR@%$SYSTEM_HEADER_DIR%g
s%@inhibit_libc@%$inhibit_libc%g
s%@BUILD_PREFIX@%$BUILD_PREFIX%g
s%@BUILD_PREFIX_1@%$BUILD_PREFIX_1%g
-s%@BUILD_CC@%$BUILD_CC%g
+s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
s%@BUILD_CFLAGS@%$BUILD_CFLAGS%g
s%@STMP_FIXINC@%$STMP_FIXINC%g
s%@STMP_FIXPROTO@%$STMP_FIXPROTO%g
diff --git a/gcc/configure.in b/gcc/configure.in
index 30119ea49a8..4932e2cc3ab 100644
--- a/gcc/configure.in
+++ b/gcc/configure.in
@@ -244,9 +244,7 @@ CFLAGS="$save_CFLAGS"])
AC_PROG_CPP
AC_C_INLINE
-gcc_AC_C_VOLATILE
-gcc_AC_C_LONG_DOUBLE
gcc_AC_C_LONG_LONG
gcc_AC_C__BOOL
@@ -261,8 +259,6 @@ if test $ac_cv_c___int64 = yes; then
AC_COMPILE_CHECK_SIZEOF(__int64)
fi
-gcc_AC_C_CHARSET
-
# -----------------
# Find Ada compiler
# -----------------
@@ -765,10 +761,6 @@ LDEXP_LIB="$LIBS"
LIBS="$save_LIBS"
AC_SUBST(LDEXP_LIB)
-# See if the stage1 system preprocessor understands the ANSI C
-# preprocessor stringification operator. (Used by symcat.h.)
-AC_C_STRINGIZE
-
# Use <inttypes.h> only if it exists,
# doesn't clash with <sys/types.h>, and declares intmax_t.
AC_MSG_CHECKING(for inttypes.h)
@@ -1423,7 +1415,7 @@ AC_SUBST(inhibit_libc)
# These are the normal (build=host) settings:
BUILD_PREFIX= AC_SUBST(BUILD_PREFIX)
BUILD_PREFIX_1=ignore- AC_SUBST(BUILD_PREFIX_1)
-BUILD_CC='$(CC)' AC_SUBST(BUILD_CC)
+CC_FOR_BUILD='$(CC)' AC_SUBST(CC_FOR_BUILD)
BUILD_CFLAGS='$(ALL_CFLAGS)' AC_SUBST(BUILD_CFLAGS)
STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_FIXINC)
@@ -1434,7 +1426,6 @@ if test x$build != x$host
then
BUILD_PREFIX=build-
BUILD_PREFIX_1=build-
- BUILD_CC='$(CC_FOR_BUILD)'
BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) $(XCFLAGS)'
if test "x$TARGET_SYSTEM_ROOT" = x; then
@@ -1493,6 +1484,13 @@ elif test -f $gcc_cv_as_gas_srcdir/configure.in \
_gcc_COMPUTE_GAS_VERSION
rm -f as$host_exeext
$symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null
+ in_tree_gas_is_elf=no
+ if grep 'obj_format = elf' ../gas/Makefile > /dev/null \
+ || (grep 'obj_format = multi' ../gas/Makefile \
+ && grep 'extra_objects =.* obj-elf' ../gas/Makefile) > /dev/null
+ then
+ in_tree_gas_is_elf=yes
+ fi
fi
if test "x$gcc_cv_as" = x; then
@@ -1588,6 +1586,11 @@ elif test -f $gcc_cv_ld_gld_srcdir/configure.in \
&& test -f ../ld/Makefile; then
# Single tree build which includes ld.
in_tree_ld=yes
+ in_tree_ld_is_elf=no
+ if (grep 'EMUL = .*elf' ../ld/Makefile \
+ || grep 'EMUL = .*linux' ../ld/Makefile) > /dev/null; then
+ in_tree_ld_is_elf=yes
+ fi
for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in
do
changequote(,)dnl
@@ -1760,9 +1763,8 @@ AC_MSG_CHECKING(assembler subsection support)
gcc_cv_as_subsections=no
if test $in_tree_gas = yes ; then
gcc_GAS_VERSION_GTE_IFELSE(2,9,0,[
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
- gcc_cv_as_subsections="working .subsection -1"
- fi
+ test $in_tree_gas_is_elf = yes \
+ && gcc_cv_as_subsections="working .subsection -1"
])
elif test x$gcc_cv_as != x; then
# Check if we have .subsection
@@ -1819,9 +1821,7 @@ AC_MSG_CHECKING(assembler hidden support)
gcc_cv_as_hidden=no
if test $in_tree_gas = yes ; then
gcc_GAS_VERSION_GTE_IFELSE(2,12,1,[
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
- gcc_cv_as_hidden="yes"
- fi
+ test $in_tree_gas_is_elf = yes && gcc_cv_as_hidden="yes"
])
elif test x$gcc_cv_as != x; then
# Check if we have .hidden
@@ -1838,7 +1838,13 @@ elif test x$gcc_cv_as != x; then
ld_ver=`$gcc_cv_ld --version 2>/dev/null | head -1`
if echo "$ld_ver" | grep GNU > /dev/null; then
changequote(,)dnl
- ld_vers=`echo $ld_ver | sed -n 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\(\|\.[0-9][0-9]*\(\|\.[0-9][0-9]*\)\)\)\([ ].*\|\)$,\1,p'`
+ ld_vers=`echo $ld_ver | sed -n \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p'`
ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
if test 0"$ld_date" -lt 20020404; then
if test -n "$ld_date"; then
@@ -1890,9 +1896,7 @@ AC_MSG_CHECKING(assembler leb128 support)
gcc_cv_as_leb128=no
if test $in_tree_gas = yes ; then
gcc_GAS_VERSION_GTE_IFELSE(2,11,0,[
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
- gcc_cv_as_leb128="yes"
- fi
+ test $in_tree_gas_is_elf = yes && gcc_cv_as_leb128="yes"
])
elif test x$gcc_cv_as != x; then
# Check if we have .[us]leb128, and support symbol arithmetic with it.
@@ -1936,9 +1940,7 @@ AC_MSG_CHECKING(assembler eh_frame optimization)
gcc_cv_as_eh_frame=no
if test $in_tree_gas = yes ; then
gcc_GAS_VERSION_GTE_IFELSE(2,12,0,[
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
- gcc_cv_as_eh_frame="yes"
- fi
+ test $in_tree_gas_is_elf = yes && gcc_cv_as_eh_frame="yes"
])
elif test x$gcc_cv_as != x; then
# Check if this is GAS.
@@ -2016,9 +2018,7 @@ AC_MSG_CHECKING(assembler section merging support)
gcc_cv_as_shf_merge=no
if test $in_tree_gas = yes ; then
gcc_GAS_VERSION_GTE_IFELSE(2,12,0,[
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
- gcc_cv_as_shf_merge=yes
- fi
+ test $in_tree_gas_is_elf = yes && gcc_cv_as_shf_merge="yes"
])
elif test x$gcc_cv_as != x; then
# Check if we support SHF_MERGE sections
@@ -2494,10 +2494,8 @@ case "$target" in
esac
if test $in_tree_gas = yes ; then
gcc_GAS_VERSION_GTE_IFELSE(2,11,0,[
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null \
- && test x"$insn" != x ; then
- gcc_cv_as_dwarf2_debug_line="yes"
- fi
+ test $in_tree_gas_is_elf = yes && test x"$insn" != x \
+ && gcc_cv_as_dwarf2_debug_line="yes"
])
elif test x$gcc_cv_as != x -a x"$insn" != x ; then
echo ' .file 1 "conftest.s"' > conftest.s
@@ -2532,10 +2530,8 @@ AC_MSG_CHECKING(assembler --gdwarf2 support)
gcc_cv_as_gdwarf2_flag=no
if test $in_tree_gas = yes ; then
gcc_GAS_VERSION_GTE_IFELSE(2,11,0,[
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null \
- && test x"$insn" != x ; then
- gcc_cv_as_gdwarf2_flag="yes"
- fi
+ test $in_tree_gas_is_elf = yes && test x"$insn" != x \
+ && gcc_cv_as_gdwarf2_flag="yes"
])
elif test x$gcc_cv_as != x -a x"$insn" != x ; then
echo '' > conftest.s
@@ -2556,16 +2552,21 @@ AC_MSG_CHECKING(assembler --gstabs support)
gcc_cv_as_gstabs_flag=no
if test $in_tree_gas = yes ; then
gcc_GAS_VERSION_GTE_IFELSE(2,11,0,[
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null \
- && test x"$insn" != x ; then
- gcc_cv_as_gstabs_flag="yes"
- fi
+ test $in_tree_gas_is_elf = yes && test x"$insn" != x \
+ && gcc_cv_as_gstabs_flag="yes"
])
elif test x$gcc_cv_as != x -a x"$insn" != x ; then
echo '' > conftest.s
# ??? This fails with non-gnu grep.
if $gcc_cv_as --gstabs -o conftest.o conftest.s > /dev/null 2>&1 ; then
gcc_cv_as_gstabs_flag="yes"
+ # The native Solaris 9/Intel assembler doesn't understand --gstabs
+ # and warns about it, but still exits successfully. So check for
+ # this.
+ if $gcc_cv_as --gstabs -o conftest.o conftest.s 2>&1 | \
+ grep -i warning > /dev/null ; then
+ gcc_cv_as_gstabs_flag="no"
+ fi
fi
rm -f conftest.s conftest.o
fi
@@ -2578,7 +2579,8 @@ AC_MSG_RESULT($gcc_cv_as_gstabs_flag)
AC_MSG_CHECKING(linker read-only and read-write section mixing)
gcc_cv_ld_ro_rw_mix=unknown
if test $in_tree_ld = yes ; then
- if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 \
+ && test $in_tree_ld_is_elf = yes; then
gcc_cv_ld_ro_rw_mix=read-write
fi
elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x ; then
@@ -2616,7 +2618,8 @@ AC_MSG_RESULT($gcc_cv_ld_ro_rw_mix)
AC_MSG_CHECKING(linker PT_GNU_EH_FRAME support)
gcc_cv_ld_eh_frame_hdr=no
if test $in_tree_ld = yes ; then
- if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 \
+ && test $in_tree_ld_is_elf = yes; then
gcc_cv_ld_eh_frame_hdr=yes
fi
elif test x$gcc_cv_ld != x; then
@@ -2634,7 +2637,8 @@ AC_MSG_RESULT($gcc_cv_ld_eh_frame_hdr)
AC_MSG_CHECKING(linker position independent executable support)
gcc_cv_ld_pie=no
if test $in_tree_ld = yes ; then
- if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 15 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 15 -o "$gcc_cv_gld_major_version" -gt 2 \
+ && test $in_tree_ld_is_elf = yes; then
gcc_cv_ld_pie=yes
fi
elif test x$gcc_cv_ld != x; then
diff --git a/gcc/convert.c b/gcc/convert.c
index 4ac23a7f44c..28326284946 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -1,4 +1,4 @@
-/* Utility routines for data type conversion for GNU C.
+/* Utility routines for data type conversion for GCC.
Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1997, 1998,
2000, 2001, 2002, 2003 Free Software Foundation, Inc.
diff --git a/gcc/coverage.c b/gcc/coverage.c
index 49cf14a2689..11f5a76ed80 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -81,7 +81,7 @@ static unsigned prg_ctr_mask; /* Mask of counter types generated. */
static unsigned prg_n_ctrs[GCOV_COUNTERS]; /* Total counters allocated. */
/* Counter information for current function. */
-static unsigned fn_ctr_mask; /* Mask of counters used. */
+static unsigned fn_ctr_mask; /* Mask of counters used. */
static unsigned fn_n_ctrs[GCOV_COUNTERS]; /* Counters allocated. */
static unsigned fn_b_ctrs[GCOV_COUNTERS]; /* Allocation base. */
@@ -305,7 +305,7 @@ get_coverage_counts (unsigned counter, unsigned expected,
{
counts_entry_t *entry, elt;
- /* No hash table, no counts. */
+ /* No hash table, no counts. */
if (!counts_hash)
{
static int warned = 0;
@@ -386,7 +386,7 @@ coverage_counter_ref (unsigned counter, unsigned no)
}
/* Generate a checksum for a string. CHKSUM is the current
- checksum. */
+ checksum. */
static unsigned
checksum_string (unsigned chksum, const char *string)
@@ -866,7 +866,7 @@ create_coverage ()
emit_library_call (gcov_init_libfunc, LCT_NORMAL, VOIDmode, 1,
gcov_info_address, Pmode);
- expand_function_end (input_filename, input_line, 0);
+ expand_function_end ();
(*lang_hooks.decls.poplevel) (1, 0, 1);
rest_of_compilation (ctor);
@@ -881,7 +881,7 @@ create_coverage ()
}
/* Perform file-level initialization. Read in data file, generate name
- of graph file. */
+ of graph file. */
void
coverage_init (filename)
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 11c73b9b786..d0ecbdb7b72 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,292 @@
+2003-06-26 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11332
+ * typeck.c (build_static_cast): Avoid returning expressions with
+ reference type.
+
+2003-06-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ * call.c (build_op_delete_call): Use strip_array_call. Correct
+ error message to say 'delete' or 'delete[]'.
+
+2003-06-26 Giovanni Bajo <giovannibajo@libero.it>
+
+ PR c++/8266
+ * pt.c (check_explicit_specialization): When looking up a
+ template function from an identifier outside class-scope, bind
+ it to CP_DECL_CONTEXT.
+
+2003-06-25 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10990
+ * search.c (lookup_base_r): Rely on accessible_p, rather than
+ trying to emulate that logic here.
+
+ PR c++/10931
+ * call.c (convert_like): Pass issue_conversion_warnings.
+ (convert_like_with_context): Likewise.
+ (convert_like_real): Add issue_conversion_warnings parameter.
+ (perform_direct_initialization_if_possible): New function.
+ * cp-tree.h (perform_direct_initialization_if_possible): Declare it.
+ * typeck.c (check_for_casting_away_constness): New function.
+ (build_static_cast): Rewrite.
+
+2003-06-24 Nathan Sidwell <nathan@codesourcery.com>
+
+ * call.c (enforce_access): Assert we get a binfo.
+ (build_op_delete_call): Pass a binfo to
+ perform_or_defer_access_check.
+ * class.c (alter_access): Likewise.
+ * decl.c (make_typename_type): Likewise.
+ (make_unbound_class_template): Likewise.
+ * lex.c (do_identifier): Likewise.
+ * method.c (hack_identifier): Likewise.
+ * parser.c (cp_parser_lookup_name): Likewise.
+ * search.c (lookup_member): Likewise. Move IDENTIFIER_CLASS_VALUE
+ test.
+ * semantics.c (finish_non_static_data_member): Likewise.
+ (perform_or_defer_access_check): Expect a binfo.
+ * typeck.c (comptypes): Expect types.
+
+ * mangle.c (find_substitution): Don't pass a non-type to same_type_p
+ * friend.c (make_friend_class): Likewise.
+ * pt.c (check_default_tmpl_args): Likewise.
+ (lookup_template_class): Likewise.
+
+Tue Jun 24 15:30:05 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * method.c (thunk_labelno): Move outside ifdef block to make garbage
+ collector happy.
+
+Tue Jun 24 13:52:34 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * class.c (build_vtable): Make vtables.
+ * cp-tree.h (DECL_VTABLE_OR_VTT_P): New macro.
+ * decl2.c (output_vtable_inherit): Rename to ...
+ (prepare_assemble_variable): ... this one; change interface.
+ (maybe_emit_vtables): Do not call output_vtable_inherit.
+ * cp-lang.c (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): Define.
+ * cp-tree.h (prepare_assemble_variable): New.
+
+2003-06-23 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * method.c: add prototype for make_alias_for_thunk.
+ (thunk_labelno, make_alias_for_thunk): only define
+ if ASM_OUTPUT_DEF is defined.
+
+2003-06-23 Jakub Jelinek <jakub@redhat.com>
+
+ * method.c (thunk_labelno): New variable.
+ (make_alias_for_thunk): New function.
+ (use_thunk): Use it if defined ASM_OUTPUT_DEF. Put the thunk
+ into the same section as the function it is calling.
+ Include gt-cp-method.h.
+ * Make-lang.in (gt-cp-method.h): Depend on s-gtype.
+ (cp/method.o): Depend on gt-cp-method.h.
+ * config-lang.in (gtfiles): Add $(srcdir)/cp/method.c.
+
+Mon Jun 23 19:41:27 CEST 2003 Jan Hubicka <jh@suse.cz>
+
+ * decl.c (register_dtor_fn): Mark cleanup as used.
+ * decl2.c (mark_vtable_entries): Skip nops.
+ * rtti.c (get_tinfo_ptr): Mark tinfo as used.
+ (build_dynamic_cast_1): Likewise.
+ (tinfo_base_init): Likewise.
+ (emit_tinfo_decl): Likewise.
+
+2003-06-23 Jakub Jelinek <jakub@redhat.com>
+
+ * mangle.c (hash_type): Val is the TREE_LIST itself, not a pointer
+ to it.
+
+2003-06-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/10784
+ * call.c (joust): Warn about choosing conversion sequence only if
+ -Wconversion.
+
+2003-06-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/10864
+ * call.c (op_error): Tidy.
+ * error.c (dump_expr): Properly format 'T()' when T is an
+ aggregate type.
+
+2003-06-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/10915
+ * decl.c (grok_op_properties): Warn possible confusing conversion
+ only if -Wconversion.
+
+2003-06-20 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10749
+ * parser.c (cp_parser_class_head): See through dependent names
+ when parsing a class-head.
+
+ PR c++/10845
+ * pt.c (try_class_unification): Correct handling of member class
+ templates.
+
+2003-06-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ * semantics.c (genrtl_finish_function): Adjust
+ expand_function_end call.
+
+2003-06-19 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10939
+ * pt.c (tsubst_decl): Do not try to substitute into non-dependent
+ functions.
+ (value_dependent_expression_p): Correct logic for FUNCTION_DECLs.
+
+ PR c++/9649
+ * cp-tree.h (pushdecl_class_level): Change prototype.
+ (push_class_level_binding): Likewise.
+ * decl.c (add_binding): Reject duplicate static data members.
+ (pushdecl_class_level): Return a value indicating whether or not
+ the binding was valid.
+ (push_class_level_binding): Likewise.
+ * semantics.c (finish_member_declaration): Don't keep invalid
+ declarations.
+
+ PR c++/11041
+ * call.c (initialize_reference): Do not use cp_finish_decl to emit
+ temporary variables.
+ * cp-tree.h (static_aggregates): Declare.
+ (pushdecl_top_level_and_finish): Likewise.
+ * decl.c (pushdecl_top_level_1): New function.
+ (pushdecl_top_level): Use it.
+ (pushdecl_top_level_and_finish): New function.
+ (initialize_local_var): Remove redundant code.
+ (cp_finish_decl): Remove support for RESULT_DECLs. Don't check
+ building_stmt_tree.
+ * decl.h (static_aggregates): Remove.
+ * decl2.c (get_guard): Use pushdecl_top_level_and_finish.
+ * rtti.c (get_tinfo_decl): Use pushdecl_top_level_and_finish.
+ (tinfo_base_init): Likewise.
+
+2003-06-19 Matt Austern <austern@apple.com>
+
+ PR c++/11228
+ * init.c (build_zero_init): Assert that number of array elements
+ is an integer constant.
+ (build_default_init) Don't use build_zero_init for arrays with
+ variable number of elements.
+
+2003-06-19 Andreas Jaeger <aj@suse.de>
+
+ * cp-tree.h: Remove duplicated declarations.
+
+2003-06-18 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * pt.c: Convert to ISO C.
+ * semantics.c: Convert to ISO C.
+
+2003-06-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (comp_except_specs, compparms, cp_has_mutable_p,
+ at_least_as_qualified_p, more_qualified_p): Return bool.
+ * typeck.c: ANSIFY function definitions.
+ (comp_array_types): Take redeclaration bool parameter.
+ (comptypes): Rearrange STRICT handling.
+ (at_least_as_qualified_p, more_qualified_p,
+ comp_cv_qualification): Cache cv quals.
+ (compparms): Rearrange loop.
+
+2003-06-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (COMPARE_RELAXED): Rename to ...
+ (COMPARE_DERIVED): ... here. Adjust comment.
+ (resolve_typename_type_in_current_instantiation): Remove.
+ (cp_tree_equal, comptypes): Return a bool.
+ * cvt.c (convert_to_reference): Adjust comptypes call.
+ * pt.c (template_args_equal, unify,): Adjust cp_tree_equal call.
+ (resolve_typename_type_in_current_instantiation): Remove.
+ * tree.c (cp_tree_equal): Return bool. Cope with TEMPLATE_DECLs and
+ IDENTIFIER_NODEs. Abort if undeciderable. Adjust recursive
+ calls. Refactor code.
+ * typeck.c (comp_array_types): Return bool. Lose callback.
+ parameter. Adjust cp_tree_equal calls.
+ (comptypes): Return bool. Adjust strict handling. Remove relaxed
+ enumeration and java type handling. Deal with typename types here.
+ Adjust recursive and cp_tree_equals calls. Adjust base and derived
+ checking.
+ (comp_target_types): Remove unreachable code. Adjust
+ same_or_base_type_p calls.
+ (ptr_reasonably_similar): Adjust base and derived check.
+
+ * typeck.c (maybe_warn_about_returning_address_of_local): Remove
+ unused calculation.
+ (check_return_expr): Adjust error messages.
+ * cp-tree.def (SCOPE_REF): Correct comment.
+
+2003-06-17 Mark Mitchell <mark@codesourcery.com>
+
+ * mangle.c (mangle_conv_op_name_for_type): Correct sprintf format
+ string again.
+
+2003-06-17 Robert Abeles <rabeles@archaelogic.com>
+
+ * optimize.c (dump_function): Form complete flag name by
+ prefixing 'fdump-' to string returned by dump_flag_name().
+
+2003-06-17 Mark Mitchell <mark@codesourcery.com>
+
+ * mangle.c (mangle_conv_op_name_for_type): Correct sprintf format
+ string.
+
+2003-06-17 Jason Merrill <jason@redhat.com>
+
+ PR c++/10929
+ * decl.c (grokfndecl): Don't mark a function inline for
+ -finline-functions if it isn't defined.
+
+2003-06-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10712
+ * class.c (handle_using_decl): Robustify.
+
+ PR c++/11105
+ * cp-tree.h (DECL_CONV_FN_TYPE): New method.
+ * mangle.c (struct globals): Remove internal_mangling_p.
+ (write_unqualified_name): Use DECL_CONV_FN_TYPE.
+ (write_template_parm): Don't write out the level number.
+ (conv_type_names): New variable.
+ (hash_type): New function.
+ (compare_type): Likewise.
+ (mangle_conv_op_name_for_type): Don't try to mangle conversion
+ operator names.
+ * search.c (lookup_conversion_operator): New function.
+ (lookup_fnfields_1): Use it.
+
+2003-06-17 Andreas Jaeger <aj@suse.de>
+
+ * except.c: Remove duplicate declaration of push_eh_cleanup.
+
+ * call.c: Remove extra declaration of inhibit_warnings.
+
+2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ 2003-06-16 Jens-Michael Hoffmann <jensmh@gmx.de>
+ * mangle.c: Convert to ISO C.
+
+2003-06-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * cp/decl.c, cp/pt.c, cp/search.c, cp/tree.c: Don't use the PTR
+ macro.
+
+2003-06-16 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * tree.c: Convert to ISO C.
+
+2003-06-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cp-tree.h: Follow spelling conventions.
+ * mangle.c: Likewise.
+ * method.c: Likewise.
+ * parser.c: Likewise.
+
2003-06-14 Nathan Sidwell <nathan@codesourcery.com>
* decl.c (start_function): Adjust init_function_start call.
@@ -36,7 +325,7 @@
2003-06-11 Roger Sayle <roger@eyesopen.com>
- * decl2.c (generate_ctor_or_dtor_function): Avoid expanding a
+ * decl2.c (generate_ctor_or_dtor_function): Avoid expanding a
global static constructor/destructor if it will be empty, i.e.
either doesn't call any ctors/dtors or only calls pure or const
ctors/dtors.
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index ddada02bd6b..e340987c08f 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -103,7 +103,7 @@ $(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf
$(srcdir)/cp/cfns.gperf > $(srcdir)/cp/cfns.h
gtype-cp.h gt-cp-call.h gt-cp-decl.h gt-cp-decl2.h : s-gtype; @true
-gt-cp-pt.h gt-cp-repo.h gt-cp-parser.h : s-gtype; @true
+gt-cp-pt.h gt-cp-repo.h gt-cp-parser.h gt-cp-method.h : s-gtype; @true
gt-cp-tree.h gt-cp-mangle.h gt-cp-name-lookup.h: s-gtype; @true
#
@@ -253,7 +253,7 @@ cp/friend.o: cp/friend.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) toplev.h $(EXPR_
cp/init.o: cp/init.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \
except.h
cp/method.o: cp/method.c $(CXX_TREE_H) $(TM_H) toplev.h $(RTL_H) $(EXPR_H) \
- $(TM_P_H) $(TARGET_H)
+ $(TM_P_H) $(TARGET_H) gt-cp-method.h
cp/cvt.o: cp/cvt.c $(CXX_TREE_H) $(TM_H) cp/decl.h flags.h toplev.h convert.h
cp/search.o: cp/search.c $(CXX_TREE_H) $(TM_H) stack.h flags.h toplev.h $(RTL_H)
cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) \
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index d40a60cc7a1..ddc6b4b8609 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -38,8 +38,6 @@ Boston, MA 02111-1307, USA. */
#include "diagnostic.h"
#include "intl.h"
-extern int inhibit_warnings;
-
static tree build_field_call (tree, tree, tree);
static struct z_candidate * tourney (struct z_candidate *);
static int equal_functions (tree, tree);
@@ -47,11 +45,13 @@ static int joust (struct z_candidate *, struct z_candidate *, bool);
static int compare_ics (tree, tree);
static tree build_over_call (struct z_candidate *, int);
static tree build_java_interface_fn_ref (tree, tree);
-#define convert_like(CONV, EXPR) \
- convert_like_real ((CONV), (EXPR), NULL_TREE, 0, 0)
-#define convert_like_with_context(CONV, EXPR, FN, ARGNO) \
- convert_like_real ((CONV), (EXPR), (FN), (ARGNO), 0)
-static tree convert_like_real (tree, tree, tree, int, int);
+#define convert_like(CONV, EXPR) \
+ convert_like_real ((CONV), (EXPR), NULL_TREE, 0, 0, \
+ /*issue_conversion_warnings=*/true)
+#define convert_like_with_context(CONV, EXPR, FN, ARGNO) \
+ convert_like_real ((CONV), (EXPR), (FN), (ARGNO), 0, \
+ /*issue_conversion_warnings=*/true)
+static tree convert_like_real (tree, tree, tree, int, int, bool);
static void op_error (enum tree_code, enum tree_code, tree, tree,
tree, const char *);
static tree build_object_call (tree, tree);
@@ -3132,23 +3132,27 @@ op_error (enum tree_code code, enum tree_code code2,
switch (code)
{
case COND_EXPR:
- error ("%s for `%T ? %T : %T' operator", problem,
- error_type (arg1), error_type (arg2), error_type (arg3));
+ error ("%s for ternary 'operator?:' in '%E ? %E : %E'",
+ problem, arg1, arg2, arg3);
break;
+
case POSTINCREMENT_EXPR:
case POSTDECREMENT_EXPR:
- error ("%s for `%T %s' operator", problem, error_type (arg1), opname);
+ error ("%s for 'operator%s' in '%E%s'", problem, opname, arg1, opname);
break;
+
case ARRAY_REF:
- error ("%s for `%T [%T]' operator", problem,
- error_type (arg1), error_type (arg2));
+ error ("%s for 'operator[]' in '%E[%E]'", problem, arg1, arg2);
break;
+
default:
if (arg2)
- error ("%s for `%T %s %T' operator", problem,
- error_type (arg1), opname, error_type (arg2));
+ error ("%s for 'operator%s' in '%E %s %E'",
+ problem, opname, arg1, opname, arg2);
else
- error ("%s for `%s %T' operator", problem, opname, error_type (arg1));
+ error ("%s for 'operator%s' in '%s%E'",
+ problem, opname, opname, arg1);
+ break;
}
}
@@ -3959,9 +3963,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
if (addr == error_mark_node)
return error_mark_node;
- type = TREE_TYPE (TREE_TYPE (addr));
- while (TREE_CODE (type) == ARRAY_TYPE)
- type = TREE_TYPE (type);
+ type = strip_array_types (TREE_TYPE (TREE_TYPE (addr)));
fnname = ansi_opname (code);
@@ -4014,7 +4016,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
addr = cp_convert (ptr_type_node, addr);
/* We make two tries at finding a matching `operator delete'. On
- the first pass, we look for an one-operator (or placement)
+ the first pass, we look for a one-operator (or placement)
operator delete. If we're not doing placement delete, then on
the second pass we look for a two-argument delete. */
for (pass = 0; pass < (placement ? 1 : 2); ++pass)
@@ -4069,7 +4071,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
/* If the FN is a member function, make sure that it is
accessible. */
if (DECL_CLASS_SCOPE_P (fn))
- perform_or_defer_access_check (type, fn);
+ perform_or_defer_access_check (TYPE_BINFO (type), fn);
if (pass == 0)
args = tree_cons (NULL_TREE, addr, args);
@@ -4085,7 +4087,8 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
if (placement)
return NULL_TREE;
- error ("no suitable `operator delete' for `%T'", type);
+ error ("no suitable `operator %s' for `%T'",
+ operator_name_info[(int)code].name, type);
return error_mark_node;
}
@@ -4096,6 +4099,8 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
bool
enforce_access (tree basetype_path, tree decl)
{
+ my_friendly_assert (TREE_CODE (basetype_path) == TREE_VEC, 20030624);
+
if (!accessible_p (basetype_path, decl))
{
if (TREE_PRIVATE (decl))
@@ -4111,14 +4116,17 @@ enforce_access (tree basetype_path, tree decl)
return true;
}
-/* Perform the conversions in CONVS on the expression EXPR.
- FN and ARGNUM are used for diagnostics. ARGNUM is zero based, -1
+/* Perform the conversions in CONVS on the expression EXPR. FN and
+ ARGNUM are used for diagnostics. ARGNUM is zero based, -1
indicates the `this' argument of a method. INNER is nonzero when
being called to continue a conversion chain. It is negative when a
- reference binding will be applied, positive otherwise. */
+ reference binding will be applied, positive otherwise. If
+ ISSUE_CONVERSION_WARNINGS is true, warnings about suspicious
+ conversions will be emitted if appropriate. */
static tree
-convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner)
+convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner,
+ bool issue_conversion_warnings)
{
int savew, savee;
@@ -4134,11 +4142,13 @@ convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner)
{
if (TREE_CODE (t) == USER_CONV || !ICS_BAD_FLAG (t))
{
- expr = convert_like_real (t, expr, fn, argnum, 1);
+ expr = convert_like_real (t, expr, fn, argnum, 1,
+ /*issue_conversion_warnings=*/false);
break;
}
else if (TREE_CODE (t) == AMBIG_CONV)
- return convert_like_real (t, expr, fn, argnum, 1);
+ return convert_like_real (t, expr, fn, argnum, 1,
+ /*issue_conversion_warnings=*/false);
else if (TREE_CODE (t) == IDENTITY_CONV)
break;
}
@@ -4148,7 +4158,7 @@ convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner)
return cp_convert (totype, expr);
}
- if (!inner)
+ if (issue_conversion_warnings)
expr = dubious_conversion_warnings
(totype, expr, "argument", fn, argnum);
switch (TREE_CODE (convs))
@@ -4246,7 +4256,8 @@ convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner)
};
expr = convert_like_real (TREE_OPERAND (convs, 0), expr, fn, argnum,
- TREE_CODE (convs) == REF_BIND ? -1 : 1);
+ TREE_CODE (convs) == REF_BIND ? -1 : 1,
+ /*issue_conversion_warnings=*/false);
if (expr == error_mark_node)
return error_mark_node;
@@ -5805,7 +5816,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn)
if (!give_warning)
/*NOP*/;
- else if (warn)
+ else if (warn && warn_conversion)
{
tree source = source_type (TREE_VEC_ELT (w->convs, 0));
if (! DECL_CONSTRUCTOR_P (w->fn))
@@ -6054,6 +6065,25 @@ perform_implicit_conversion (tree type, tree expr)
return convert_like (conv, expr);
}
+/* Convert EXPR to TYPE (as a direct-initialization) if that is
+ permitted. If the conversion is valid, the converted expression is
+ returned. Otherwise, NULL_TREE is returned. */
+
+tree
+perform_direct_initialization_if_possible (tree type, tree expr)
+{
+ tree conv;
+
+ if (type == error_mark_node || error_operand_p (expr))
+ return error_mark_node;
+ conv = implicit_conversion (type, TREE_TYPE (expr), expr,
+ LOOKUP_NORMAL);
+ if (!conv || ICS_BAD_FLAG (conv))
+ return NULL_TREE;
+ return convert_like_real (conv, expr, NULL_TREE, 0, 0,
+ /*issue_conversion_warnings=*/false);
+}
+
/* DECL is a VAR_DECL whose type is a REFERENCE_TYPE. The reference
is being bound to a temporary. Create and return a new VAR_DECL
with the indicated TYPE; this variable will store the value to
@@ -6146,7 +6176,7 @@ initialize_reference (tree type, tree expr, tree decl)
T t;
const S& s = t;
- we can extend the lifetime of the returnn value of the conversion
+ we can extend the lifetime of the return value of the conversion
operator. */
my_friendly_assert (TREE_CODE (conv) == REF_BIND, 20030302);
if (decl)
@@ -6169,13 +6199,33 @@ initialize_reference (tree type, tree expr, tree decl)
expr = convert_like (conv, expr);
if (!real_non_cast_lvalue_p (expr))
{
+ tree init;
+ tree type;
+
/* Create the temporary variable. */
- var = make_temporary_var_for_ref_to_temp (decl, TREE_TYPE (expr));
- DECL_INITIAL (var) = expr;
- cp_finish_decl (var, expr, NULL_TREE,
- LOOKUP_ONLYCONVERTING|DIRECT_BIND);
+ type = TREE_TYPE (expr);
+ var = make_temporary_var_for_ref_to_temp (decl, type);
+ layout_decl (var, 0);
+ if (at_function_scope_p ())
+ {
+ tree cleanup;
+
+ add_decl_stmt (var);
+ cleanup = cxx_maybe_build_cleanup (var);
+ if (cleanup)
+ finish_decl_cleanup (var, cleanup);
+ }
+ else
+ {
+ rest_of_decl_compilation (var, NULL, /*toplev=*/1, at_eof);
+ if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type))
+ static_aggregates = tree_cons (NULL_TREE, var,
+ static_aggregates);
+ }
+ init = build (INIT_EXPR, type, var, expr);
/* Use its address to initialize the reference variable. */
expr = build_address (var);
+ expr = build (COMPOUND_EXPR, TREE_TYPE (expr), init, expr);
}
else
/* Take the address of EXPR. */
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index c4887f1bb8d..b5eb245f4f2 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -530,6 +530,7 @@ build_vtable (tree class_type, tree name, tree vtable_type)
TREE_READONLY (decl) = 1;
DECL_VIRTUAL_P (decl) = 1;
DECL_ALIGN (decl) = TARGET_VTABLE_ENTRY_ALIGN;
+ DECL_VTABLE_OR_VTT_P (decl) = 1;
/* At one time the vtable info was grabbed 2 words at a time. This
fails on sparc unless you have 8-byte alignment. (tiemann) */
@@ -1063,8 +1064,7 @@ alter_access (tree t, tree fdecl, tree access)
if (!DECL_LANG_SPECIFIC (fdecl))
retrofit_lang_decl (fdecl);
- if (DECL_DISCRIMINATOR_P (fdecl))
- abort ();
+ my_friendly_assert (!DECL_DISCRIMINATOR_P (fdecl), 20030624);
elem = purpose_member (t, DECL_ACCESS (fdecl));
if (elem)
@@ -1086,7 +1086,7 @@ alter_access (tree t, tree fdecl, tree access)
}
else
{
- perform_or_defer_access_check (t, fdecl);
+ perform_or_defer_access_check (TYPE_BINFO (t), fdecl);
DECL_ACCESS (fdecl) = tree_cons (t, access, DECL_ACCESS (fdecl));
return 1;
}
@@ -1108,6 +1108,9 @@ handle_using_decl (tree using_decl, tree t)
tree flist = NULL_TREE;
tree old_value;
+ if (ctype == error_mark_node)
+ return;
+
binfo = lookup_base (t, ctype, ba_any, NULL);
if (! binfo)
{
diff --git a/gcc/cp/config-lang.in b/gcc/cp/config-lang.in
index 2927606c12c..8ba5506e8fb 100644
--- a/gcc/cp/config-lang.in
+++ b/gcc/cp/config-lang.in
@@ -34,4 +34,4 @@ stagestuff="g++\$(exeext) g++-cross\$(exeext) cc1plus\$(exeext)"
target_libs="target-libstdc++-v3 target-gperf"
-gtfiles="\$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/lex.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c"
+gtfiles="\$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/lex.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c"
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index 7914d81c5f6..c79943727f3 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -145,6 +145,9 @@ static bool cp_var_mod_type_p (tree);
#undef LANG_HOOKS_EXPR_SIZE
#define LANG_HOOKS_EXPR_SIZE cp_expr_size
+#undef LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE
+#define LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE prepare_assemble_variable
+
#undef LANG_HOOKS_MAKE_TYPE
#define LANG_HOOKS_MAKE_TYPE cxx_make_type
#undef LANG_HOOKS_TYPE_FOR_MODE
diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def
index 2d340f3d8d6..7d657317031 100644
--- a/gcc/cp/cp-tree.def
+++ b/gcc/cp/cp-tree.def
@@ -62,8 +62,7 @@ DEFTREECODE (DELETE_EXPR, "dl_expr", 'e', 2)
DEFTREECODE (VEC_DELETE_EXPR, "vec_dl_expr", 'e', 2)
/* Value is reference to particular overloaded class method.
- Operand 0 is the class name (an IDENTIFIER_NODE);
- operand 1 is the field (also an IDENTIFIER_NODE).
+ Operand 0 is the class, operand 1 is the field
The COMPLEXITY field holds the class level (usually 0). */
DEFTREECODE (SCOPE_REF, "scope_ref", 'r', 2)
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 244eb1a3add..0e3a97115f4 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -73,6 +73,7 @@ struct diagnostic_context;
NEED_TEMPORARY_P (in REF_BIND, BASE_CONV)
IDENTIFIER_TYPENAME_P (in IDENTIFIER_NODE)
5: C_IS_RESERVED_WORD (in IDENTIFIER_NODE)
+ DECL_VTABLE_OR_VTT_P (in VAR_DECL)
6: For future expansion
Usage of TYPE_LANG_FLAG_?:
@@ -849,7 +850,7 @@ struct language_function GTY(())
#define doing_semantic_analysis_p() (!expanding_p)
-/* Non-zero if we are processing a base initializer. Zero elsewhere. */
+/* Nonzero if we are processing a base initializer. Zero elsewhere. */
#define in_base_initializer cp_function_chain->in_base_initializer
#define in_function_try_handler cp_function_chain->in_function_try_handler
@@ -1856,6 +1857,11 @@ struct lang_decl GTY(())
#define DECL_CONV_FN_P(NODE) \
(IDENTIFIER_TYPENAME_P (DECL_NAME (NODE)))
+/* If FN is a conversion operator, the type to which it converts.
+ Otherwise, NULL_TREE. */
+#define DECL_CONV_FN_TYPE(FN) \
+ (DECL_CONV_FN_P (FN) ? TREE_TYPE (DECL_NAME (FN)) : NULL_TREE)
+
/* Nonzero if NODE, which is a TEMPLATE_DECL, is a template
conversion operator to a type dependent on the innermost template
args. */
@@ -2051,6 +2057,9 @@ struct lang_decl GTY(())
(DECL_CONTEXT (NODE) \
&& TREE_CODE (DECL_CONTEXT (NODE)) == FUNCTION_DECL)
+/* 1 iff VAR_DECL node NODE is virtual table or VTT. */
+#define DECL_VTABLE_OR_VTT_P(NODE) TREE_LANG_FLAG_5 (VAR_DECL_CHECK (NODE))
+
/* 1 iff NODE is function-local, but for types. */
#define LOCAL_CLASS_P(NODE) \
(decl_function_context (TYPE_MAIN_DECL (NODE)) != NULL_TREE)
@@ -3258,6 +3267,12 @@ extern GTY(()) varray_type local_classes;
extern int at_eof;
+/* A list of namespace-scope objects which have constructors or
+ destructors which reside in the global scope. The decl is stored
+ in the TREE_VALUE slot and the initializer is stored in the
+ TREE_PURPOSE slot. */
+extern GTY(()) tree static_aggregates;
+
/* Functions called along with real static constructors and destructors. */
extern GTY(()) tree static_ctors;
@@ -3362,15 +3377,9 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
#define COMPARE_STRICT 0 /* Just check if the types are the
same. */
#define COMPARE_BASE 1 /* Check to see if the second type is
- derived from the first, or if both
- are pointers (or references) and
- the types pointed to by the second
- type is derived from the pointed to
- by the first. */
-#define COMPARE_RELAXED 2 /* Like COMPARE_DERIVED, but in
- reverse. Also treat enumeration
- types as the same as integer types
- of the same width. */
+ derived from the first. */
+#define COMPARE_DERIVED 2 /* Like COMPARE_BASE, but in
+ reverse. */
#define COMPARE_REDECLARATION 4 /* The comparsion is being done when
another declaration of an existing
entity is seen. */
@@ -3516,6 +3525,7 @@ extern tree initialize_reference (tree, tree, tree);
extern tree make_temporary_var_for_ref_to_temp (tree, tree);
extern tree strip_top_quals (tree);
extern tree perform_implicit_conversion (tree, tree);
+extern tree perform_direct_initialization_if_possible (tree, tree);
extern tree in_charge_arg_for_name (tree);
extern tree build_cxx_call (tree, tree, tree);
@@ -3588,7 +3598,6 @@ extern int global_bindings_p (void);
extern int kept_level_p (void);
extern tree getdecls (void);
extern void pushlevel (int);
-extern tree poplevel (int,int, int);
extern void insert_block (tree);
extern void set_block (tree);
extern tree pushdecl (tree);
@@ -3633,11 +3642,12 @@ extern void clear_anon_tags (void);
extern int decls_match (tree, tree);
extern int duplicate_decls (tree, tree);
extern tree pushdecl_top_level (tree);
-extern void pushdecl_class_level (tree);
+extern tree pushdecl_top_level_and_finish (tree, tree);
+extern bool pushdecl_class_level (tree);
extern tree pushdecl_namespace_level (tree);
extern tree push_using_decl (tree, tree);
extern tree push_using_directive (tree);
-extern void push_class_level_binding (tree, tree);
+extern bool push_class_level_binding (tree, tree);
extern tree implicitly_declare (tree);
extern tree declare_local_label (tree);
extern tree define_label (const char *, int, tree);
@@ -3763,9 +3773,7 @@ extern void comdat_linkage (tree);
extern void import_export_vtable (tree, tree, int);
extern void import_export_decl (tree);
extern void import_export_tinfo (tree, tree, bool);
-extern tree build_cleanup (tree);
extern void finish_file (void);
-extern tree build_expr_from_tree (tree);
extern tree build_cleanup (tree);
extern tree build_expr_from_tree (tree);
extern tree build_offset_ref_call_from_tree (tree, tree);
@@ -3791,17 +3799,18 @@ extern tree build_artificial_parm (tree, tree);
extern tree get_guard (tree);
extern tree get_guard_cond (tree);
extern tree set_guard (tree);
+extern void prepare_assemble_variable (tree);
extern void cp_error_at (const char *msgid, ...);
extern void cp_warning_at (const char *msgid, ...);
extern void cp_pedwarn_at (const char *msgid, ...);
/* XXX Not i18n clean. */
-#define cp_deprecated(STR) \
- do { \
- if (warn_deprecated) \
- warning ("%s is deprecated, please see the documentation for details", \
- (STR)); \
+#define cp_deprecated(STR) \
+ do { \
+ if (warn_deprecated) \
+ warning ("%s is deprecated, please see the documentation for details", \
+ (STR)); \
} while (0)
/* in error.c */
@@ -3977,7 +3986,6 @@ extern bool dependent_template_p (tree);
extern bool type_dependent_expression_p (tree);
extern bool value_dependent_expression_p (tree);
extern tree resolve_typename_type (tree, bool);
-extern tree resolve_typename_type_in_current_instantiation (tree);
extern tree template_for_substitution (tree);
/* in repo.c */
@@ -4199,7 +4207,7 @@ extern tree error_type (tree);
extern tree build_zc_wrapper (struct z_candidate *);
extern int varargs_function_p (tree);
extern int really_overloaded_fn (tree);
-extern int cp_tree_equal (tree, tree);
+extern bool cp_tree_equal (tree, tree);
extern tree no_linkage_check (tree);
extern void debug_binfo (tree);
extern tree build_dummy_object (tree);
@@ -4241,10 +4249,10 @@ extern tree complete_type_or_diagnostic (tree, tree, int);
extern int type_unknown_p (tree);
extern tree commonparms (tree, tree);
extern tree original_type (tree);
-extern int comp_except_specs (tree, tree, int);
-extern int comptypes (tree, tree, int);
+extern bool comp_except_specs (tree, tree, bool);
+extern bool comptypes (tree, tree, int);
extern int comp_target_types (tree, tree, int);
-extern int compparms (tree, tree);
+extern bool compparms (tree, tree);
extern int comp_cv_qualification (tree, tree);
extern int comp_cv_qual_signature (tree, tree);
extern tree expr_sizeof (tree);
@@ -4277,9 +4285,9 @@ extern int comp_ptr_ttypes (tree, tree);
extern int ptr_reasonably_similar (tree, tree);
extern tree build_ptrmemfunc (tree, tree, int);
extern int cp_type_quals (tree);
-extern int cp_has_mutable_p (tree);
-extern int at_least_as_qualified_p (tree, tree);
-extern int more_qualified_p (tree, tree);
+extern bool cp_has_mutable_p (tree);
+extern bool at_least_as_qualified_p (tree, tree);
+extern bool more_qualified_p (tree, tree);
extern tree build_ptrmemfunc1 (tree, tree, tree);
extern void expand_ptrmemfunc_cst (tree, tree *, tree *);
extern tree pfn_from_ptrmemfunc (tree);
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index c62edf09cb8..2078a67b016 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -507,10 +507,10 @@ convert_to_reference (tree reftype, tree expr, int convtype,
/* B* bp; A& ar = (A&)bp; is valid, but it's probably not what they
meant. */
if (TREE_CODE (intype) == POINTER_TYPE
- && (comptypes (TREE_TYPE (intype), type,
- COMPARE_BASE | COMPARE_RELAXED )))
+ && (comptypes (TREE_TYPE (intype), type,
+ COMPARE_BASE | COMPARE_DERIVED)))
warning ("casting `%T' to `%T' does not dereference pointer",
- intype, reftype);
+ intype, reftype);
rval = build_unary_op (ADDR_EXPR, expr, 0);
if (rval != error_mark_node)
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 454e1ef901e..b9c59af6cc7 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -964,11 +964,18 @@ add_binding (tree id, tree decl)
type to which it already refers. */
ok = 0;
/* There can be two block-scope declarations of the same variable,
- so long as they are `extern' declarations. */
+ so long as they are `extern' declarations. However, there cannot
+ be two declarations of the same static data member:
+
+ [class.mem]
+
+ A member shall not be declared twice in the
+ member-specification. */
else if (TREE_CODE (decl) == VAR_DECL
&& TREE_CODE (BINDING_VALUE (binding)) == VAR_DECL
&& DECL_EXTERNAL (decl)
- && DECL_EXTERNAL (BINDING_VALUE (binding)))
+ && DECL_EXTERNAL (BINDING_VALUE (binding))
+ && !DECL_CLASS_SCOPE_P (decl))
{
duplicate_decls (decl, BINDING_VALUE (binding));
ok = 0;
@@ -4143,24 +4150,47 @@ pushdecl_namespace_level (tree x)
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
}
-/* Like pushdecl, only it places X in the global scope if appropriate. */
+/* Like pushdecl, only it places X in the global scope if appropriate.
+ Calls cp_finish_decl to register the variable, initializing it with
+ *INIT, if INIT is non-NULL. */
-tree
-pushdecl_top_level (tree x)
+static tree
+pushdecl_top_level_1 (tree x, tree *init)
{
timevar_push (TV_NAME_LOOKUP);
push_to_top_level ();
x = pushdecl_namespace_level (x);
+ if (init)
+ cp_finish_decl (x, *init, NULL_TREE, 0);
pop_from_top_level ();
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, x);
}
+/* Like pushdecl, only it places X in the global scope if appropriate. */
+
+tree
+pushdecl_top_level (tree x)
+{
+ return pushdecl_top_level_1 (x, NULL);
+}
+
+/* Like pushdecl, only it places X in the global scope if
+ appropriate. Calls cp_finish_decl to register the variable,
+ initializing it with INIT. */
+
+tree
+pushdecl_top_level_and_finish (tree x, tree init)
+{
+ return pushdecl_top_level_1 (x, &init);
+}
+
/* Make the declaration of X appear in CLASS scope. */
-void
+bool
pushdecl_class_level (tree x)
{
tree name;
+ bool is_valid = true;
timevar_push (TV_NAME_LOOKUP);
/* Get the name of X. */
@@ -4171,7 +4201,7 @@ pushdecl_class_level (tree x)
if (name)
{
- push_class_level_binding (name, x);
+ is_valid = push_class_level_binding (name, x);
if (TREE_CODE (x) == TYPE_DECL)
set_identifier_type_value (name, TREE_TYPE (x));
}
@@ -4183,9 +4213,16 @@ pushdecl_class_level (tree x)
tree f;
for (f = TYPE_FIELDS (TREE_TYPE (x)); f; f = TREE_CHAIN (f))
- pushdecl_class_level (f);
+ {
+ push_srcloc (DECL_SOURCE_FILE (f), DECL_SOURCE_LINE (f));
+ if (!pushdecl_class_level (f))
+ is_valid = false;
+ pop_srcloc ();
+ }
}
timevar_pop (TV_NAME_LOOKUP);
+
+ return is_valid;
}
/* Enter DECL into the symbol table, if that's appropriate. Returns
@@ -4217,21 +4254,19 @@ maybe_push_decl (tree decl)
return pushdecl (decl);
}
-/* Make the declaration(s) of X appear in CLASS scope
- under the name NAME. */
+/* Make the declaration(s) of X appear in CLASS scope under the name
+ NAME. Returns true if the binding is valid. */
-void
+bool
push_class_level_binding (tree name, tree x)
{
cxx_binding *binding;
+
timevar_push (TV_NAME_LOOKUP);
/* The class_binding_level will be NULL if x is a template
parameter name in a member template. */
if (!class_binding_level)
- {
- timevar_pop (TV_NAME_LOOKUP);
- return;
- }
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, true);
/* Make sure that this new member does not have the same name
as a template parameter. */
@@ -4281,8 +4316,7 @@ push_class_level_binding (tree name, tree x)
INHERITED_VALUE_BINDING_P (binding) = 0;
TREE_TYPE (shadow) = x;
IDENTIFIER_CLASS_VALUE (name) = x;
- timevar_pop (TV_NAME_LOOKUP);
- return;
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, true);
}
}
@@ -4296,8 +4330,10 @@ push_class_level_binding (tree name, tree x)
/* Record the value we are binding NAME to so that we can know
what to pop later. */
TREE_TYPE (class_binding_level->class_shadowed) = x;
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, true);
}
- timevar_pop (TV_NAME_LOOKUP);
+
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, false);
}
/* Insert another USING_DECL into the current binding level, returning
@@ -5384,7 +5420,7 @@ build_typename_type (tree context, tree name, tree fullname)
{
tree t;
tree d;
- PTR *e;
+ void **e;
if (typename_htab == NULL)
{
@@ -5489,7 +5525,7 @@ make_typename_type (tree context, tree name, tsubst_flags_t complain)
}
if (complain & tf_error)
- perform_or_defer_access_check (context, tmpl);
+ perform_or_defer_access_check (TYPE_BINFO (context), tmpl);
return lookup_template_class (tmpl,
TREE_OPERAND (fullname, 1),
@@ -5519,7 +5555,7 @@ make_typename_type (tree context, tree name, tsubst_flags_t complain)
}
if (complain & tf_error)
- perform_or_defer_access_check (context, t);
+ perform_or_defer_access_check (TYPE_BINFO (context), t);
if (DECL_ARTIFICIAL (t) || !(complain & tf_keep_type_decl))
t = TREE_TYPE (t);
@@ -5576,7 +5612,7 @@ make_unbound_class_template (tree context, tree name, tsubst_flags_t complain)
}
if (complain & tf_error)
- perform_or_defer_access_check (context, tmpl);
+ perform_or_defer_access_check (TYPE_BINFO (context), tmpl);
return tmpl;
}
@@ -7903,6 +7939,7 @@ static void
initialize_local_var (tree decl, tree init)
{
tree type = TREE_TYPE (decl);
+ tree cleanup;
my_friendly_assert (TREE_CODE (decl) == VAR_DECL
|| TREE_CODE (decl) == RESULT_DECL,
@@ -7952,17 +7989,9 @@ initialize_local_var (tree decl, tree init)
}
/* Generate a cleanup, if necessary. */
- if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type))
- {
- tree cleanup;
-
- /* Compute the cleanup. */
- cleanup = cxx_maybe_build_cleanup (decl);
-
- /* Record the cleanup required for this declaration. */
- if (DECL_SIZE (decl) && cleanup)
- finish_decl_cleanup (decl, cleanup);
- }
+ cleanup = cxx_maybe_build_cleanup (decl);
+ if (DECL_SIZE (decl) && cleanup)
+ finish_decl_cleanup (decl, cleanup);
}
/* Finish processing of a declaration;
@@ -7991,6 +8020,8 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
return;
}
+ my_friendly_assert (TREE_CODE (decl) != RESULT_DECL, 20030619);
+
/* If a name was specified, get the string. */
if (global_scope_p (current_binding_level))
asmspec_tree = maybe_apply_renaming_pragma (decl, asmspec_tree);
@@ -8031,8 +8062,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
if (processing_template_decl)
{
/* Add this declaration to the statement-tree. */
- if (at_function_scope_p ()
- && TREE_CODE (decl) != RESULT_DECL)
+ if (at_function_scope_p ())
add_decl_stmt (decl);
if (init && DECL_INITIAL (decl))
@@ -8089,8 +8119,6 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
SET_DECL_ASSEMBLER_NAME (decl, get_identifier (asmspec));
make_decl_rtl (decl, asmspec);
}
- else if (TREE_CODE (decl) == RESULT_DECL)
- init = check_initializer (decl, init, flags);
else if (TREE_CODE (decl) == VAR_DECL)
{
/* Only PODs can have thread-local storage. Other types may require
@@ -8146,9 +8174,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
/* Add this declaration to the statement-tree. This needs to happen
after the call to check_initializer so that the DECL_STMT for a
reference temp is added before the DECL_STMT for the reference itself. */
- if (building_stmt_tree ()
- && at_function_scope_p ()
- && TREE_CODE (decl) != RESULT_DECL)
+ if (at_function_scope_p ())
add_decl_stmt (decl);
if (TREE_CODE (decl) == VAR_DECL)
@@ -8157,8 +8183,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
/* Output the assembler code and/or RTL code for variables and functions,
unless the type is an undefined structure or union.
If not, it will get done when the type is completed. */
- if (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == FUNCTION_DECL
- || TREE_CODE (decl) == RESULT_DECL)
+ if (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == FUNCTION_DECL)
{
if (TREE_CODE (decl) == VAR_DECL)
maybe_commonize_var (decl);
@@ -8461,6 +8486,7 @@ register_dtor_fn (tree decl)
/* Call atexit with the cleanup function. */
cxx_mark_addressable (cleanup);
+ mark_used (cleanup);
cleanup = build_unary_op (ADDR_EXPR, cleanup, 0);
if (flag_use_cxa_atexit)
{
@@ -8883,7 +8909,7 @@ grokfndecl (tree ctype,
the user explicitly asks us to, all functions. */
if (DECL_DECLARED_INLINE_P (decl))
DECL_INLINE (decl) = 1;
- if (flag_inline_trees == 2 && !DECL_INLINE (decl))
+ if (flag_inline_trees == 2 && !DECL_INLINE (decl) && funcdef_flag)
{
DID_INLINE_FUNC (decl) = 1;
DECL_INLINE (decl) = 1;
@@ -12346,7 +12372,7 @@ grok_op_properties (tree decl, int friendp)
&& DERIVED_FROM_P (t, current_class_type))
what = "a base class";
- if (what)
+ if (what && warn_conversion)
warning ("conversion to %s%s will never use a type conversion operator",
ref ? "a reference to " : "", what);
}
diff --git a/gcc/cp/decl.h b/gcc/cp/decl.h
index b942687407f..2a7a7659e1b 100644
--- a/gcc/cp/decl.h
+++ b/gcc/cp/decl.h
@@ -37,12 +37,6 @@ extern tree grokdeclarator (tree, tree, enum decl_context, int, tree*);
or a chain or parameter decls here. */
extern GTY(()) tree last_function_parms;
-/* A list of objects which have constructors or destructors
- which reside in the global scope. The decl is stored in
- the TREE_VALUE slot and the initializer is stored
- in the TREE_PURPOSE slot. */
-extern GTY(()) tree static_aggregates;
-
#ifdef DEBUG_CP_BINDING_LEVELS
/* Purely for debugging purposes. */
extern int debug_bindings_indentation;
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 1413f3944b9..9a960000468 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -66,7 +66,6 @@ static void add_using_namespace (tree, tree, bool);
static cxx_binding *ambiguous_decl (tree, cxx_binding *, cxx_binding *, int);
static tree build_anon_union_vars (tree);
static bool acceptable_java_type (tree);
-static void output_vtable_inherit (tree);
static tree start_objects (int, int);
static void finish_objects (int, int, tree);
static tree merge_functions (tree, tree);
@@ -1393,7 +1392,9 @@ mark_vtable_entries (tree decl)
{
tree fnaddr = TREE_VALUE (entries);
tree fn;
-
+
+ STRIP_NOPS (fnaddr);
+
if (TREE_CODE (fnaddr) != ADDR_EXPR
&& TREE_CODE (fnaddr) != FDESC_EXPR)
/* This entry is an offset: a virtual base class offset, a
@@ -1604,12 +1605,16 @@ import_export_class (tree ctype)
/* We need to describe to the assembler the relationship between
a vtable and the vtable of the parent class. */
-static void
-output_vtable_inherit (tree vars)
+void
+prepare_assemble_variable (tree vars)
{
tree parent;
rtx child_rtx, parent_rtx;
+ if (!flag_vtable_gc || TREE_CODE (vars) != VAR_DECL
+ || !DECL_VTABLE_OR_VTT_P (vars))
+ return;
+
child_rtx = XEXP (DECL_RTL (vars), 0); /* strip the mem ref */
parent = binfo_for_vtable (vars);
@@ -1706,9 +1711,6 @@ maybe_emit_vtables (tree ctype)
rest_of_decl_compilation (vtbl, NULL, 1, 1);
- if (flag_vtable_gc)
- output_vtable_inherit (vtbl);
-
/* Because we're only doing syntax-checking, we'll never end up
actually marking the variable as written. */
if (flag_syntax_only)
@@ -1886,8 +1888,7 @@ get_guard (tree decl)
DECL_ARTIFICIAL (guard) = 1;
TREE_USED (guard) = 1;
- pushdecl_top_level (guard);
- cp_finish_decl (guard, NULL_TREE, NULL_TREE, 0);
+ pushdecl_top_level_and_finish (guard, NULL_TREE);
}
return guard;
}
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index b8576be061a..70c446d7c59 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -44,7 +44,6 @@ static tree build_eh_type_type (tree);
static tree do_begin_catch (void);
static int dtor_nothrow (tree);
static tree do_end_catch (tree);
-static void push_eh_cleanup (tree);
static bool decl_is_java_type (tree decl, int err);
static void initialize_handler_parm (tree, tree);
static tree do_allocate_exception (tree);
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index 3ecd3177195..0a0e82c7fcd 100644
--- a/gcc/cp/friend.c
+++ b/gcc/cp/friend.c
@@ -264,17 +264,34 @@ make_friend_class (type, friend_type)
if (is_template_friend)
friend_type = CLASSTYPE_TI_TEMPLATE (friend_type);
- classes = CLASSTYPE_FRIEND_CLASSES (type);
- while (classes
- /* Stop if we find the same type on the list. */
- && !(TREE_CODE (TREE_VALUE (classes)) == TEMPLATE_DECL ?
- friend_type == TREE_VALUE (classes) :
- same_type_p (TREE_VALUE (classes), friend_type)))
- classes = TREE_CHAIN (classes);
- if (classes)
- warning ("`%T' is already a friend of `%T'",
- TREE_VALUE (classes), type);
- else
+ /* See if it is already a friend. */
+ for (classes = CLASSTYPE_FRIEND_CLASSES (type);
+ classes;
+ classes = TREE_CHAIN (classes))
+ {
+ tree probe = TREE_VALUE (classes);
+
+ if (TREE_CODE (friend_type) == TEMPLATE_DECL)
+ {
+ if (friend_type == probe)
+ {
+ warning ("`%D' is already a friend of `%T'",
+ probe, type);
+ break;
+ }
+ }
+ else if (TREE_CODE (probe) != TEMPLATE_DECL)
+ {
+ if (same_type_p (probe, friend_type))
+ {
+ warning ("`%T' is already a friend of `%T'",
+ probe, type);
+ break;
+ }
+ }
+ }
+
+ if (!classes)
{
maybe_add_class_template_decl_list (type, friend_type, /*friend_p=*/1);
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 59395eed1d0..710f6174413 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -180,6 +180,9 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
-- if T is a reference type, no initialization is performed. */
+ my_friendly_assert (nelts == NULL_TREE || TREE_CODE (nelts) == INTEGER_CST,
+ 20030618);
+
if (type == error_mark_node)
;
else if (static_storage_p && zero_init_p (type))
@@ -232,6 +235,8 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
/* Iterate over the array elements, building initializations. */
inits = NULL_TREE;
max_index = nelts ? nelts : array_type_nelts (type);
+ my_friendly_assert (TREE_CODE (max_index) == INTEGER_CST, 20030618);
+
for (index = size_zero_node;
!tree_int_cst_lt (max_index, index);
index = size_binop (PLUS_EXPR, index, size_one_node))
@@ -291,7 +296,8 @@ build_default_init (tree type, tree nelts)
standard says we should have generated would be precisely the
same as that obtained by calling build_zero_init below, so things
work out OK. */
- if (TYPE_NEEDS_CONSTRUCTING (type))
+ if (TYPE_NEEDS_CONSTRUCTING (type)
+ || (nelts && TREE_CODE (nelts) != INTEGER_CST))
return NULL_TREE;
/* At this point, TYPE is either a POD class type, an array of POD
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 1f8cb0672a3..b378dc1724a 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -777,7 +777,7 @@ do_identifier (register tree token, tree args)
{
/* Check access. */
if (IDENTIFIER_CLASS_VALUE (token) == id)
- perform_or_defer_access_check (CP_DECL_CONTEXT(id), id);
+ perform_or_defer_access_check (TYPE_BINFO (DECL_CONTEXT (id)), id);
if (!processing_template_decl || DECL_TEMPLATE_PARM_P (id))
id = DECL_INITIAL (id);
}
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 33df093fdb5..b5d0a645af4 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -102,11 +102,6 @@ static struct globals
/* The entity that is being mangled. */
tree entity;
- /* We are mangling an internal symbol. It is important to keep those
- involving template parmeters distinct by distinguishing their level
- and, for non-type parms, their type. */
- bool internal_mangling_p;
-
/* True if the mangling will be different in a future version of the
ABI. */
bool need_abi_warning;
@@ -148,71 +143,74 @@ integer_type_codes[itk_none] =
'y' /* itk_unsigned_long_long */
};
-static int decl_is_template_id PARAMS ((tree, tree*));
+static int decl_is_template_id (const tree, tree* const);
/* Functions for handling substitutions. */
-static inline tree canonicalize_for_substitution PARAMS ((tree));
-static void add_substitution PARAMS ((tree));
-static inline int is_std_substitution PARAMS ((tree, substitution_identifier_index_t));
-static inline int is_std_substitution_char PARAMS ((tree, substitution_identifier_index_t));
-static int find_substitution PARAMS ((tree));
-static void mangle_call_offset PARAMS ((tree, tree));
+static inline tree canonicalize_for_substitution (tree);
+static void add_substitution (tree);
+static inline int is_std_substitution (const tree,
+ const substitution_identifier_index_t);
+static inline int is_std_substitution_char (const tree,
+ const substitution_identifier_index_t);
+static int find_substitution (tree);
+static void mangle_call_offset (const tree, const tree);
/* Functions for emitting mangled representations of things. */
-static void write_mangled_name PARAMS ((tree));
-static void write_encoding PARAMS ((tree));
-static void write_name PARAMS ((tree, int));
-static void write_unscoped_name PARAMS ((tree));
-static void write_unscoped_template_name PARAMS ((tree));
-static void write_nested_name PARAMS ((tree));
-static void write_prefix PARAMS ((tree));
-static void write_template_prefix PARAMS ((tree));
-static void write_unqualified_name PARAMS ((tree));
-static void write_conversion_operator_name (tree);
-static void write_source_name PARAMS ((tree));
-static int hwint_to_ascii PARAMS ((unsigned HOST_WIDE_INT, unsigned int, char *, unsigned));
-static void write_number PARAMS ((unsigned HOST_WIDE_INT, int,
- unsigned int));
-static void write_integer_cst PARAMS ((tree));
-static void write_real_cst PARAMS ((tree));
-static void write_identifier PARAMS ((const char *));
-static void write_special_name_constructor PARAMS ((tree));
-static void write_special_name_destructor PARAMS ((tree));
-static void write_type PARAMS ((tree));
-static int write_CV_qualifiers_for_type PARAMS ((tree));
-static void write_builtin_type PARAMS ((tree));
-static void write_function_type PARAMS ((tree));
-static void write_bare_function_type PARAMS ((tree, int, tree));
-static void write_method_parms PARAMS ((tree, int, tree));
-static void write_class_enum_type PARAMS ((tree));
-static void write_template_args PARAMS ((tree));
-static void write_expression PARAMS ((tree));
-static void write_template_arg_literal PARAMS ((tree));
-static void write_template_arg PARAMS ((tree));
-static void write_template_template_arg PARAMS ((tree));
-static void write_array_type PARAMS ((tree));
-static void write_pointer_to_member_type PARAMS ((tree));
-static void write_template_param PARAMS ((tree));
-static void write_template_template_param PARAMS ((tree));
-static void write_substitution PARAMS ((int));
-static int discriminator_for_local_entity PARAMS ((tree));
-static int discriminator_for_string_literal PARAMS ((tree, tree));
-static void write_discriminator PARAMS ((int));
-static void write_local_name PARAMS ((tree, tree, tree));
-static void dump_substitution_candidates PARAMS ((void));
-static const char *mangle_decl_string PARAMS ((tree));
+static void write_mangled_name (const tree);
+static void write_encoding (const tree);
+static void write_name (tree, const int);
+static void write_unscoped_name (const tree);
+static void write_unscoped_template_name (const tree);
+static void write_nested_name (const tree);
+static void write_prefix (const tree);
+static void write_template_prefix (const tree);
+static void write_unqualified_name (const tree);
+static void write_conversion_operator_name (const tree);
+static void write_source_name (tree);
+static int hwint_to_ascii (unsigned HOST_WIDE_INT, const unsigned int, char *,
+ const unsigned int);
+static void write_number (unsigned HOST_WIDE_INT, const int,
+ const unsigned int);
+static void write_integer_cst (const tree);
+static void write_real_cst (const tree);
+static void write_identifier (const char *);
+static void write_special_name_constructor (const tree);
+static void write_special_name_destructor (const tree);
+static void write_type (tree);
+static int write_CV_qualifiers_for_type (const tree);
+static void write_builtin_type (tree);
+static void write_function_type (const tree);
+static void write_bare_function_type (const tree, const int, const tree);
+static void write_method_parms (tree, const int, const tree);
+static void write_class_enum_type (const tree);
+static void write_template_args (tree);
+static void write_expression (tree);
+static void write_template_arg_literal (const tree);
+static void write_template_arg (tree);
+static void write_template_template_arg (const tree);
+static void write_array_type (const tree);
+static void write_pointer_to_member_type (const tree);
+static void write_template_param (const tree);
+static void write_template_template_param (const tree);
+static void write_substitution (const int);
+static int discriminator_for_local_entity (tree);
+static int discriminator_for_string_literal (tree, tree);
+static void write_discriminator (const int);
+static void write_local_name (const tree, const tree, const tree);
+static void dump_substitution_candidates (void);
+static const char *mangle_decl_string (const tree);
/* Control functions. */
-static inline void start_mangling (tree);
-static inline const char *finish_mangling (bool);
-static tree mangle_special_for_type PARAMS ((tree, const char *));
+static inline void start_mangling (const tree);
+static inline const char *finish_mangling (const bool);
+static tree mangle_special_for_type (const tree, const char *);
/* Foreign language functions. */
-static void write_java_integer_type_codes PARAMS ((tree));
+static void write_java_integer_type_codes (const tree);
/* Append a single character to the end of the mangled
representation. */
@@ -249,15 +247,13 @@ static void write_java_integer_type_codes PARAMS ((tree));
Otherwise return zero. */
static int
-decl_is_template_id (decl, template_info)
- tree decl;
- tree* template_info;
+decl_is_template_id (const tree decl, tree* const template_info)
{
if (TREE_CODE (decl) == TYPE_DECL)
{
/* TYPE_DECLs are handled specially. Look at its type to decide
if this is a template instantiation. */
- tree type = TREE_TYPE (decl);
+ const tree type = TREE_TYPE (decl);
if (CLASS_TYPE_P (type) && CLASSTYPE_TEMPLATE_ID_P (type))
{
@@ -328,8 +324,7 @@ dump_substitution_candidates ()
and substitution candidates and finding matches. */
static inline tree
-canonicalize_for_substitution (node)
- tree node;
+canonicalize_for_substitution (tree node)
{
/* For a TYPE_DECL, use the type instead. */
if (TREE_CODE (node) == TYPE_DECL)
@@ -344,8 +339,7 @@ canonicalize_for_substitution (node)
the list of candidates. */
static void
-add_substitution (node)
- tree node;
+add_substitution (tree node)
{
tree c;
@@ -366,7 +360,7 @@ add_substitution (node)
int i;
for (i = VARRAY_ACTIVE_SIZE (G.substitutions); --i >= 0; )
{
- tree candidate = VARRAY_TREE (G.substitutions, i);
+ const tree candidate = VARRAY_TREE (G.substitutions, i);
if ((DECL_P (node)
&& node == candidate)
|| (TYPE_P (node)
@@ -389,9 +383,8 @@ add_substitution (node)
name of substitution_index[INDEX] in the ::std namespace. */
static inline int
-is_std_substitution (node, index)
- tree node;
- substitution_identifier_index_t index;
+is_std_substitution (const tree node,
+ const substitution_identifier_index_t index)
{
tree type = NULL;
tree decl = NULL;
@@ -423,9 +416,8 @@ is_std_substitution (node, index)
substitution_index[INDEX]. */
static inline int
-is_std_substitution_char (node, index)
- tree node;
- substitution_identifier_index_t index;
+is_std_substitution_char (const tree node,
+ const substitution_identifier_index_t index)
{
tree args;
/* Check NODE's name is ::std::identifier. */
@@ -480,11 +472,10 @@ is_std_substitution_char (node, index)
return nonzero. If none is found, just return zero. */
static int
-find_substitution (node)
- tree node;
+find_substitution (tree node)
{
int i;
- int size = VARRAY_ACTIVE_SIZE (G.substitutions);
+ const int size = VARRAY_ACTIVE_SIZE (G.substitutions);
tree decl;
tree type;
@@ -555,6 +546,7 @@ find_substitution (node)
args <char, std::char_traits<char> > . */
tree args = CLASSTYPE_TI_ARGS (type);
if (TREE_VEC_LENGTH (args) == 2
+ && TYPE_P (TREE_VEC_ELT (args, 0))
&& same_type_p (TREE_VEC_ELT (args, 0), char_type_node)
&& is_std_substitution_char (TREE_VEC_ELT (args, 1),
SUBID_CHAR_TRAITS))
@@ -613,8 +605,7 @@ find_substitution (node)
/* <mangled-name> ::= _Z <encoding> */
static inline void
-write_mangled_name (decl)
- tree decl;
+write_mangled_name (const tree decl)
{
MANGLE_TRACE_TREE ("mangled-name", decl);
@@ -639,8 +630,7 @@ write_mangled_name (decl)
::= <data name> */
static void
-write_encoding (decl)
- tree decl;
+write_encoding (const tree decl)
{
MANGLE_TRACE_TREE ("encoding", decl);
@@ -686,9 +676,7 @@ write_encoding (decl)
production, to avoid an infinite recursion. */
static void
-write_name (decl, ignore_local_scope)
- tree decl;
- int ignore_local_scope;
+write_name (tree decl, const int ignore_local_scope)
{
tree context;
@@ -770,8 +758,7 @@ write_name (decl, ignore_local_scope)
::= St <unqualified-name> # ::std:: */
static void
-write_unscoped_name (decl)
- tree decl;
+write_unscoped_name (const tree decl)
{
tree context = CP_DECL_CONTEXT (decl);
@@ -797,8 +784,7 @@ write_unscoped_name (decl)
::= <substitution> */
static void
-write_unscoped_template_name (decl)
- tree decl;
+write_unscoped_template_name (const tree decl)
{
MANGLE_TRACE_TREE ("unscoped-template-name", decl);
@@ -816,8 +802,7 @@ write_unscoped_template_name (decl)
<CV-qualifiers> ::= [r] [V] [K] */
static void
-write_nested_name (decl)
- tree decl;
+write_nested_name (const tree decl)
{
tree template_info;
@@ -858,8 +843,7 @@ write_nested_name (decl)
::= <substitution> */
static void
-write_prefix (node)
- tree node;
+write_prefix (const tree node)
{
tree decl;
/* Non-NULL if NODE represents a template-id. */
@@ -924,8 +908,7 @@ write_prefix (node)
::= <substitution> */
static void
-write_template_prefix (node)
- tree node;
+write_template_prefix (const tree node)
{
tree decl = DECL_P (node) ? node : TYPE_NAME (node);
tree type = DECL_P (node) ? TREE_TYPE (node) : node;
@@ -1000,8 +983,7 @@ write_template_prefix (node)
::= <source-name> */
static void
-write_unqualified_name (decl)
- tree decl;
+write_unqualified_name (const tree decl)
{
MANGLE_TRACE_TREE ("unqualified-name", decl);
@@ -1020,7 +1002,7 @@ write_unqualified_name (decl)
type = TREE_TYPE (fn_type);
}
else
- type = TREE_TYPE (DECL_NAME (decl));
+ type = DECL_CONV_FN_TYPE (decl);
write_conversion_operator_name (type);
}
else if (DECL_OVERLOADED_OPERATOR_P (decl))
@@ -1040,7 +1022,7 @@ write_unqualified_name (decl)
/* Write the unqualified-name for a conversion operator to TYPE. */
static void
-write_conversion_operator_name (tree type)
+write_conversion_operator_name (const tree type)
{
write_string ("cv");
write_type (type);
@@ -1051,8 +1033,7 @@ write_conversion_operator_name (tree type)
<source-name> ::= </length/ number> <identifier> */
static void
-write_source_name (identifier)
- tree identifier;
+write_source_name (tree identifier)
{
MANGLE_TRACE_TREE ("source-name", identifier);
@@ -1072,11 +1053,8 @@ write_source_name (identifier)
BUFFER points). */
static int
-hwint_to_ascii (number, base, buffer, min_digits)
- unsigned HOST_WIDE_INT number;
- unsigned int base;
- char *buffer;
- unsigned min_digits;
+hwint_to_ascii (unsigned HOST_WIDE_INT number, const unsigned int base,
+ char *buffer, const unsigned int min_digits)
{
static const char base_digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
unsigned digits = 0;
@@ -1102,10 +1080,8 @@ hwint_to_ascii (number, base, buffer, min_digits)
<number> ::= [n] </decimal integer/> */
static void
-write_number (number, unsigned_p, base)
- unsigned HOST_WIDE_INT number;
- int unsigned_p;
- unsigned int base;
+write_number (unsigned HOST_WIDE_INT number, const int unsigned_p,
+ const unsigned int base)
{
char buffer[sizeof (HOST_WIDE_INT) * 8];
unsigned count = 0;
@@ -1124,8 +1100,7 @@ write_number (number, unsigned_p, base)
bigger than that, which we must deal with. */
static inline void
-write_integer_cst (cst)
- tree cst;
+write_integer_cst (const tree cst)
{
int sign = tree_int_cst_sgn (cst);
@@ -1168,7 +1143,7 @@ write_integer_cst (cst)
tree d = fold (build (FLOOR_DIV_EXPR, type, n, base));
tree tmp = fold (build (MULT_EXPR, type, d, base));
unsigned c;
-
+
done = integer_zerop (d);
tmp = fold (build (MINUS_EXPR, type, n, tmp));
c = hwint_to_ascii (TREE_INT_CST_LOW (tmp), 10, ptr,
@@ -1215,8 +1190,7 @@ write_integer_cst (cst)
Caller is responsible for the Lx and the E. */
static void
-write_real_cst (value)
- tree value;
+write_real_cst (const tree value)
{
if (abi_version_at_least (2))
{
@@ -1265,8 +1239,7 @@ write_real_cst (value)
<identifier> ::= </unqualified source code identifier> */
static void
-write_identifier (identifier)
- const char *identifier;
+write_identifier (const char *identifier)
{
MANGLE_TRACE ("identifier", identifier);
write_string (identifier);
@@ -1286,8 +1259,7 @@ write_identifier (identifier)
append *INTERNAL* to that, to make sure we never emit it. */
static void
-write_special_name_constructor (ctor)
- tree ctor;
+write_special_name_constructor (const tree ctor)
{
if (DECL_COMPLETE_CONSTRUCTOR_P (ctor)
/* Even though we don't ever emit a definition of the
@@ -1313,8 +1285,7 @@ write_special_name_constructor (ctor)
append *INTERNAL* to that, to make sure we never emit it. */
static void
-write_special_name_destructor (dtor)
- tree dtor;
+write_special_name_destructor (const tree dtor)
{
if (DECL_DELETING_DESTRUCTOR_P (dtor))
write_string ("D0");
@@ -1335,14 +1306,12 @@ write_special_name_destructor (dtor)
entities with the same name in the same FUNCTION. */
static int
-discriminator_for_local_entity (entity)
- tree entity;
+discriminator_for_local_entity (tree entity)
{
tree *type;
- int discriminator;
/* Assume this is the only local entity with this name. */
- discriminator = 0;
+ int discriminator = 0;
if (DECL_DISCRIMINATOR_P (entity) && DECL_LANG_SPECIFIC (entity))
discriminator = DECL_DISCRIMINATOR (entity);
@@ -1379,8 +1348,7 @@ discriminator_for_string_literal (function, string)
n - 2, if this is the nth occurrence, in lexical order. */
static void
-write_discriminator (discriminator)
- int discriminator;
+write_discriminator (const int discriminator)
{
/* If discriminator is zero, don't write anything. Otherwise... */
if (discriminator > 0)
@@ -1400,10 +1368,8 @@ write_discriminator (discriminator)
:= Z <function encoding> E s [<discriminator>] */
static void
-write_local_name (function, local_entity, entity)
- tree function;
- tree local_entity;
- tree entity;
+write_local_name (const tree function, const tree local_entity,
+ const tree entity)
{
MANGLE_TRACE_TREE ("local-name", entity);
@@ -1445,8 +1411,7 @@ write_local_name (function, local_entity, entity)
TYPE is a type node. */
static void
-write_type (type)
- tree type;
+write_type (tree type)
{
/* This gets set to nonzero if TYPE turns out to be a (possibly
CV-qualified) builtin type. */
@@ -1574,8 +1539,7 @@ write_type (type)
<CV-qualifiers> ::= [r] [V] [K] */
static int
-write_CV_qualifiers_for_type (type)
- tree type;
+write_CV_qualifiers_for_type (const tree type)
{
int num_qualifiers = 0;
@@ -1633,8 +1597,7 @@ write_CV_qualifiers_for_type (type)
::= u <source-name> # vendor extended type */
static void
-write_builtin_type (type)
- tree type;
+write_builtin_type (tree type)
{
switch (TREE_CODE (type))
{
@@ -1717,8 +1680,7 @@ write_builtin_type (type)
<function-type> ::= F [Y] <bare-function-type> E */
static void
-write_function_type (type)
- tree type;
+write_function_type (const tree type)
{
MANGLE_TRACE_TREE ("function-type", type);
@@ -1759,10 +1721,8 @@ write_function_type (type)
<bare-function-type> ::= </signature/ type>+ */
static void
-write_bare_function_type (type, include_return_type_p, decl)
- tree type;
- int include_return_type_p;
- tree decl;
+write_bare_function_type (const tree type, const int include_return_type_p,
+ const tree decl)
{
MANGLE_TRACE_TREE ("bare-function-type", type);
@@ -1783,10 +1743,7 @@ write_bare_function_type (type, include_return_type_p, decl)
parameters are being emitted. */
static void
-write_method_parms (parm_types, method_p, decl)
- tree decl;
- tree parm_types;
- int method_p;
+write_method_parms (tree parm_types, const int method_p, const tree decl)
{
tree first_parm_type;
tree parm_decl = decl ? DECL_ARGUMENTS (decl) : NULL_TREE;
@@ -1844,8 +1801,7 @@ write_method_parms (parm_types, method_p, decl)
/* <class-enum-type> ::= <name> */
static void
-write_class_enum_type (type)
- tree type;
+write_class_enum_type (const tree type)
{
write_name (TYPE_NAME (type), /*ignore_local_scope=*/0);
}
@@ -1856,8 +1812,7 @@ write_class_enum_type (type)
<template-args> ::= I <template-arg>+ E */
static void
-write_template_args (args)
- tree args;
+write_template_args (tree args)
{
MANGLE_TRACE_TREE ("template-args", args);
@@ -1904,8 +1859,7 @@ write_template_args (args)
::= sr <type> <unqualified-name> <template-args> */
static void
-write_expression (expr)
- tree expr;
+write_expression (tree expr)
{
enum tree_code code;
@@ -2095,8 +2049,7 @@ write_expression (expr)
encoded as 0, true as 1." */
static void
-write_template_arg_literal (value)
- tree value;
+write_template_arg_literal (const tree value)
{
tree type = TREE_TYPE (value);
write_char ('L');
@@ -2134,8 +2087,7 @@ write_template_arg_literal (value)
::= X <expression> E # expression */
static void
-write_template_arg (node)
- tree node;
+write_template_arg (tree node)
{
enum tree_code code = TREE_CODE (node);
@@ -2187,7 +2139,7 @@ write_template_arg (node)
::= <substitution> */
void
-write_template_template_arg (tree decl)
+write_template_template_arg (const tree decl)
{
MANGLE_TRACE_TREE ("template-template-arg", decl);
@@ -2207,9 +2159,8 @@ write_template_template_arg (tree decl)
element type. For variable length arrays, the dimension (but not
the '_' separator) is omitted." */
-static void
-write_array_type (type)
- tree type;
+static void
+write_array_type (const tree type)
{
write_char ('A');
if (TYPE_DOMAIN (type))
@@ -2241,8 +2192,7 @@ write_array_type (type)
<pointer-to-member-type> ::= M </class/ type> </member/ type> */
static void
-write_pointer_to_member_type (type)
- tree type;
+write_pointer_to_member_type (const tree type)
{
write_char ('M');
write_type (TYPE_PTRMEM_CLASS_TYPE (type));
@@ -2263,8 +2213,7 @@ write_pointer_to_member_type (type)
This is used by mangle_conv_op_name_for_type. */
static void
-write_template_param (parm)
- tree parm;
+write_template_param (const tree parm)
{
int parm_index;
int parm_level;
@@ -2297,15 +2246,6 @@ write_template_param (parm)
if (parm_index > 0)
write_unsigned_number (parm_index - 1);
write_char ('_');
- if (G.internal_mangling_p)
- {
- if (parm_level > 0)
- write_unsigned_number (parm_level - 1);
- write_char ('_');
- if (parm_type)
- write_type (parm_type);
- write_char ('_');
- }
}
/* <template-template-param>
@@ -2313,8 +2253,7 @@ write_template_param (parm)
::= <substitution> */
static void
-write_template_template_param (parm)
- tree parm;
+write_template_template_param (const tree parm)
{
tree template = NULL_TREE;
@@ -2342,8 +2281,7 @@ write_template_template_param (parm)
::= S_ */
static void
-write_substitution (seq_id)
- int seq_id;
+write_substitution (const int seq_id)
{
MANGLE_TRACE ("substitution", "");
@@ -2356,7 +2294,7 @@ write_substitution (seq_id)
/* Start mangling ENTITY. */
static inline void
-start_mangling (tree entity)
+start_mangling (const tree entity)
{
G.entity = entity;
G.need_abi_warning = false;
@@ -2369,7 +2307,7 @@ start_mangling (tree entity)
future version of the ABI, issue a warning. */
static inline const char *
-finish_mangling (bool warn)
+finish_mangling (const bool warn)
{
if (warn_abi && warn && G.need_abi_warning)
warning ("the mangled name of `%D' will change in a future "
@@ -2405,8 +2343,7 @@ init_mangle ()
/* Generate the mangled name of DECL. */
static const char *
-mangle_decl_string (decl)
- tree decl;
+mangle_decl_string (const tree decl)
{
const char *result;
@@ -2446,8 +2383,7 @@ mangle_decl_string (decl)
/* Create an identifier for the external mangled name of DECL. */
void
-mangle_decl (decl)
- tree decl;
+mangle_decl (const tree decl)
{
tree id = get_identifier (mangle_decl_string (decl));
@@ -2457,8 +2393,7 @@ mangle_decl (decl)
/* Generate the mangled representation of TYPE. */
const char *
-mangle_type_string (type)
- tree type;
+mangle_type_string (const tree type)
{
const char *result;
@@ -2473,8 +2408,7 @@ mangle_type_string (type)
/* Create an identifier for the mangled representation of TYPE. */
tree
-mangle_type (type)
- tree type;
+mangle_type (const tree type)
{
return get_identifier (mangle_type_string (type));
}
@@ -2484,9 +2418,7 @@ mangle_type (type)
component. */
static tree
-mangle_special_for_type (type, code)
- tree type;
- const char *code;
+mangle_special_for_type (const tree type, const char *code)
{
const char *result;
@@ -2512,8 +2444,7 @@ mangle_special_for_type (type, code)
structure for TYPE. */
tree
-mangle_typeinfo_for_type (type)
- tree type;
+mangle_typeinfo_for_type (const tree type)
{
return mangle_special_for_type (type, "TI");
}
@@ -2522,8 +2453,7 @@ mangle_typeinfo_for_type (type)
the mangled name of TYPE. */
tree
-mangle_typeinfo_string_for_type (type)
- tree type;
+mangle_typeinfo_string_for_type (const tree type)
{
return mangle_special_for_type (type, "TS");
}
@@ -2531,8 +2461,7 @@ mangle_typeinfo_string_for_type (type)
/* Create an identifier for the mangled name of the vtable for TYPE. */
tree
-mangle_vtbl_for_type (type)
- tree type;
+mangle_vtbl_for_type (const tree type)
{
return mangle_special_for_type (type, "TV");
}
@@ -2540,8 +2469,7 @@ mangle_vtbl_for_type (type)
/* Returns an identifier for the mangled name of the VTT for TYPE. */
tree
-mangle_vtt_for_type (type)
- tree type;
+mangle_vtt_for_type (const tree type)
{
return mangle_special_for_type (type, "TT");
}
@@ -2561,9 +2489,7 @@ mangle_vtt_for_type (type)
<special-name> ::= CT <type> <offset number> _ <base type> */
tree
-mangle_ctor_vtbl_for_type (type, binfo)
- tree type;
- tree binfo;
+mangle_ctor_vtbl_for_type (const tree type, const tree binfo)
{
const char *result;
@@ -2588,9 +2514,7 @@ mangle_ctor_vtbl_for_type (type, binfo)
::= v <fixed offset number> _ <virtual offset number> _ */
static void
-mangle_call_offset (fixed_offset, virtual_offset)
- tree fixed_offset;
- tree virtual_offset;
+mangle_call_offset (const tree fixed_offset, const tree virtual_offset)
{
write_char (virtual_offset ? 'v' : 'h');
@@ -2610,7 +2534,7 @@ mangle_call_offset (fixed_offset, virtual_offset)
covariant thunk to FN_DECL. FIXED_OFFSET is the initial adjustment
to this used to find the vptr. If VIRTUAL_OFFSET is non-NULL, this
is a virtual thunk, and it is the vtbl offset in
- bytes. THIS_ADJUSTING is non-zero for a this adjusting thunk and
+ bytes. THIS_ADJUSTING is nonzero for a this adjusting thunk and
zero for a covariant thunk. Note, that FN_DECL might be a covariant
thunk itself. A covariant thunk name always includes the adjustment
for the this pointer, even if there is none.
@@ -2621,11 +2545,8 @@ mangle_call_offset (fixed_offset, virtual_offset)
*/
tree
-mangle_thunk (fn_decl, this_adjusting, fixed_offset, virtual_offset)
- tree fn_decl;
- int this_adjusting;
- tree fixed_offset;
- tree virtual_offset;
+mangle_thunk (tree fn_decl, const int this_adjusting, tree fixed_offset,
+ tree virtual_offset)
{
const char *result;
@@ -2666,41 +2587,52 @@ mangle_thunk (fn_decl, this_adjusting, fixed_offset, virtual_offset)
return get_identifier (result);
}
+/* This hash table maps TYPEs to the IDENTIFIER for a conversion
+ operator to TYPE. The nodes are TREE_LISTs whose TREE_PURPOSE is
+ the TYPE and whose TREE_VALUE is the IDENTIFIER. */
+
+static GTY ((param_is (union tree_node))) htab_t conv_type_names;
+
+/* Hash a node (VAL1) in the table. */
+
+static hashval_t
+hash_type (const void *val)
+{
+ return htab_hash_pointer (TREE_PURPOSE ((tree) val));
+}
+
+/* Compare VAL1 (a node in the table) with VAL2 (a TYPE). */
+
+static int
+compare_type (const void *val1, const void *val2)
+{
+ return TREE_PURPOSE ((tree) val1) == (tree) val2;
+}
+
/* Return an identifier for the mangled unqualified name for a
conversion operator to TYPE. This mangling is not specified by the
ABI spec; it is only used internally. */
tree
-mangle_conv_op_name_for_type (type)
- tree type;
+mangle_conv_op_name_for_type (const tree type)
{
+ void **slot;
tree identifier;
- const char *mangled_type;
- char *op_name;
+ char buffer[64];
- /* Build the internal mangling for TYPE. */
- G.internal_mangling_p = true;
- mangled_type = mangle_type_string (type);
- G.internal_mangling_p = false;
-
- /* Allocate a temporary buffer for the complete name. */
- op_name = concat ("operator ", mangled_type, NULL);
- /* Find or create an identifier. */
- identifier = get_identifier (op_name);
- /* Done with the temporary buffer. */
- free (op_name);
-
- /* It had better be a unique mangling for the type. */
- if (IDENTIFIER_TYPENAME_P (identifier)
- && !same_type_p (type, TREE_TYPE (identifier)))
- {
- /* In G++ 3.2, the name mangling scheme was ambiguous. In later
- versions of the ABI, this problem has been fixed. */
- if (abi_version_at_least (2))
- abort ();
- error ("due to a defect in the G++ 3.2 ABI, G++ has assigned the "
- "same mangled name to two different types");
- }
+ if (conv_type_names == NULL)
+ conv_type_names = htab_create_ggc (31, &hash_type, &compare_type, NULL);
+
+ slot = htab_find_slot_with_hash (conv_type_names, type,
+ htab_hash_pointer (type), INSERT);
+ if (*slot)
+ return TREE_VALUE ((tree) *slot);
+
+ /* Create a unique name corresponding to TYPE. */
+ sprintf (buffer, "operator %lu",
+ (unsigned long) htab_elements (conv_type_names));
+ identifier = get_identifier (buffer);
+ *slot = build_tree_list (type, identifier);
/* Set bits on the identifier so we know later it's a conversion. */
IDENTIFIER_OPNAME_P (identifier) = 1;
@@ -2716,8 +2648,7 @@ mangle_conv_op_name_for_type (type)
variable for indicated VARIABLE. */
tree
-mangle_guard_variable (variable)
- tree variable;
+mangle_guard_variable (const tree variable)
{
start_mangling (variable);
write_string ("_ZGV");
@@ -2735,8 +2666,7 @@ mangle_guard_variable (variable)
as well call them something readable. */
tree
-mangle_ref_init_variable (variable)
- tree variable;
+mangle_ref_init_variable (const tree variable)
{
start_mangling (variable);
write_string ("_ZGR");
@@ -2750,8 +2680,7 @@ mangle_ref_init_variable (variable)
/* How to write the type codes for the integer Java type. */
static void
-write_java_integer_type_codes (type)
- tree type;
+write_java_integer_type_codes (const tree type)
{
if (type == java_int_type_node)
write_char ('i');
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index ef801aceb19..cb2c864bfca 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -62,6 +62,9 @@ static tree synthesize_exception_spec (tree, tree (*) (tree, void *), void *);
static tree locate_dtor (tree, void *);
static tree locate_ctor (tree, void *);
static tree locate_copy (tree, void *);
+#ifdef ASM_OUTPUT_DEF
+static tree make_alias_for_thunk (tree);
+#endif
/* Called once to initialize method.c. */
@@ -179,7 +182,7 @@ hack_identifier (tree value, tree name)
{
tree path;
path = currently_open_derived_class (DECL_CONTEXT (value));
- perform_or_defer_access_check (path, value);
+ perform_or_defer_access_check (TYPE_BINFO (path), value);
}
}
else if (TREE_CODE (value) == TREE_LIST
@@ -309,7 +312,7 @@ finish_thunk (tree thunk)
/* Adjust PTR by the constant FIXED_OFFSET, and by the vtable
offset indicated by VIRTUAL_OFFSET, if that is
- non-null. THIS_ADJUSTING is non-zero for a this adjusting thunk and
+ non-null. THIS_ADJUSTING is nonzero for a this adjusting thunk and
zero for a result adjusting thunk. */
static tree
@@ -351,6 +354,57 @@ thunk_adjust (tree ptr, bool this_adjusting,
return ptr;
}
+/* Garbage collector tables contains thunk_labelno even when places
+ inside ifdef block. */
+static GTY (()) int thunk_labelno;
+#ifdef ASM_OUTPUT_DEF
+
+/* Create a static alias to function. */
+
+static tree
+make_alias_for_thunk (tree function)
+{
+ tree alias;
+ char buf[256];
+
+ ASM_GENERATE_INTERNAL_LABEL (buf, "LTHUNK", thunk_labelno);
+ thunk_labelno++;
+ alias = build_decl (FUNCTION_DECL, get_identifier (buf),
+ TREE_TYPE (function));
+ DECL_LANG_SPECIFIC (alias) = DECL_LANG_SPECIFIC (function);
+ cxx_dup_lang_specific_decl (alias);
+ DECL_CONTEXT (alias) = NULL;
+ TREE_READONLY (alias) = TREE_READONLY (function);
+ TREE_THIS_VOLATILE (alias) = TREE_THIS_VOLATILE (function);
+ TREE_PUBLIC (alias) = 0;
+ DECL_INTERFACE_KNOWN (alias) = 1;
+ DECL_NOT_REALLY_EXTERN (alias) = 1;
+ DECL_THIS_STATIC (alias) = 1;
+ DECL_SAVED_FUNCTION_DATA (alias) = NULL;
+ DECL_DESTRUCTOR_P (alias) = 0;
+ DECL_CONSTRUCTOR_P (alias) = 0;
+ DECL_CLONED_FUNCTION (alias) = NULL_TREE;
+ DECL_EXTERNAL (alias) = 0;
+ DECL_ARTIFICIAL (alias) = 1;
+ DECL_NO_STATIC_CHAIN (alias) = 1;
+ DECL_PENDING_INLINE_P (alias) = 0;
+ DECL_INLINE (alias) = 0;
+ DECL_DECLARED_INLINE_P (alias) = 0;
+ DECL_DEFERRED_FN (alias) = 0;
+ DECL_USE_TEMPLATE (alias) = 0;
+ DECL_TEMPLATE_INSTANTIATED (alias) = 0;
+ DECL_TEMPLATE_INFO (alias) = NULL;
+ DECL_INITIAL (alias) = error_mark_node;
+ TREE_ADDRESSABLE (alias) = 1;
+ TREE_USED (alias) = 1;
+ SET_DECL_ASSEMBLER_NAME (alias, DECL_NAME (alias));
+ TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (alias)) = 1;
+ if (!flag_syntax_only)
+ assemble_alias (alias, DECL_ASSEMBLER_NAME (function));
+ return alias;
+}
+#endif
+
/* Emit the definition of a C++ multiple inheritance or covariant
return vtable thunk. If EMIT_P is nonzero, the thunk is emitted
immediately. */
@@ -358,7 +412,7 @@ thunk_adjust (tree ptr, bool this_adjusting,
void
use_thunk (tree thunk_fndecl, bool emit_p)
{
- tree function;
+ tree function, alias;
tree virtual_offset;
HOST_WIDE_INT fixed_offset, virtual_value;
bool this_adjusting = DECL_THIS_THUNK_P (thunk_fndecl);
@@ -386,6 +440,12 @@ use_thunk (tree thunk_fndecl, bool emit_p)
if (!emit_p)
return;
+#ifdef ASM_OUTPUT_DEF
+ alias = make_alias_for_thunk (function);
+#else
+ alias = function;
+#endif
+
fixed_offset = THUNK_FIXED_OFFSET (thunk_fndecl);
virtual_offset = THUNK_VIRTUAL_OFFSET (thunk_fndecl);
@@ -415,6 +475,21 @@ use_thunk (tree thunk_fndecl, bool emit_p)
push_to_top_level ();
+#ifdef ASM_OUTPUT_DEF
+ if (targetm.have_named_sections)
+ {
+ resolve_unique_section (function, 0, flag_function_sections);
+
+ if (DECL_SECTION_NAME (function) != NULL && DECL_ONE_ONLY (function))
+ {
+ resolve_unique_section (thunk_fndecl, 0, flag_function_sections);
+
+ /* Output the thunk into the same section as function. */
+ DECL_SECTION_NAME (thunk_fndecl) = DECL_SECTION_NAME (function);
+ }
+ }
+#endif
+
/* The back-end expects DECL_INITIAL to contain a BLOCK, so we
create one. */
DECL_INITIAL (thunk_fndecl) = make_node (BLOCK);
@@ -422,7 +497,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
if (this_adjusting
&& targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset,
- virtual_value, function))
+ virtual_value, alias))
{
const char *fnname;
current_function_decl = thunk_fndecl;
@@ -434,7 +509,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
assemble_start_function (thunk_fndecl, fnname);
targetm.asm_out.output_mi_thunk (asm_out_file, thunk_fndecl,
- fixed_offset, virtual_value, function);
+ fixed_offset, virtual_value, alias);
assemble_end_function (thunk_fndecl, fnname);
current_function_decl = 0;
@@ -486,7 +561,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
for (a = TREE_CHAIN (a); a; a = TREE_CHAIN (a))
t = tree_cons (NULL_TREE, a, t);
t = nreverse (t);
- t = build_call (function, t);
+ t = build_call (alias, t);
if (!this_adjusting)
t = thunk_adjust (t, /*this_adjusting=*/0,
fixed_offset, virtual_offset);
@@ -1054,3 +1129,5 @@ skip_artificial_parms_for (tree fn, tree list)
list = TREE_CHAIN (list);
return list;
}
+
+#include "gt-cp-method.h"
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index 2c1c15d003e..b5d0f8f28de 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -288,7 +288,7 @@ dump_function (enum tree_dump_index phase, tree fn)
decl_as_string (fn, TFF_DECL_SPECIFIERS));
fprintf (stream, " (%s)\n",
decl_as_string (DECL_ASSEMBLER_NAME (fn), 0));
- fprintf (stream, ";; enabled by -%s\n", dump_flag_name (phase));
+ fprintf (stream, ";; enabled by -fdump-%s\n", dump_flag_name (phase));
fprintf (stream, "\n");
dump_node (fn, TDF_SLIM | flags, stream);
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 19172f00ea2..6240c244607 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -384,7 +384,7 @@ cp_lexer_new_from_tokens (cp_token_cache *tokens)
return lexer;
}
-/* Returns non-zero if debugging information should be output. */
+/* Returns nonzero if debugging information should be output. */
static inline bool
cp_lexer_debugging_p (cp_lexer *lexer)
@@ -419,7 +419,7 @@ cp_lexer_next_token (cp_lexer* lexer, cp_token* token)
return token;
}
-/* Non-zero if we are presently saving tokens. */
+/* nonzero if we are presently saving tokens. */
static int
cp_lexer_saving_tokens (const cp_lexer* lexer)
@@ -1756,7 +1756,7 @@ static bool cp_parser_is_keyword
static tree cp_parser_scope_through_which_access_occurs
(tree, tree, tree);
-/* Returns non-zero if we are parsing tentatively. */
+/* Returns nonzero if we are parsing tentatively. */
static inline bool
cp_parser_parsing_tentatively (cp_parser* parser)
@@ -1764,7 +1764,7 @@ cp_parser_parsing_tentatively (cp_parser* parser)
return parser->context->next != NULL;
}
-/* Returns non-zero if TOKEN is a string literal. */
+/* Returns nonzero if TOKEN is a string literal. */
static bool
cp_parser_is_string_literal (cp_token* token)
@@ -1772,7 +1772,7 @@ cp_parser_is_string_literal (cp_token* token)
return (token->type == CPP_STRING || token->type == CPP_WSTRING);
}
-/* Returns non-zero if TOKEN is the indicated KEYWORD. */
+/* Returns nonzero if TOKEN is the indicated KEYWORD. */
static bool
cp_parser_is_keyword (cp_token* token, enum rid keyword)
@@ -11634,7 +11634,7 @@ cp_parser_class_head (cp_parser* parser,
nested_name_specifier
= cp_parser_nested_name_specifier_opt (parser,
/*typename_keyword_p=*/false,
- /*check_dependency_p=*/true,
+ /*check_dependency_p=*/false,
/*type_p=*/false);
/* If there was a nested-name-specifier, then there *must* be an
identifier. */
@@ -13353,7 +13353,7 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
object_type,
parser->scope);
if (qualifying_type)
- perform_or_defer_access_check (qualifying_type, decl);
+ perform_or_defer_access_check (TYPE_BINFO (qualifying_type), decl);
}
return decl;
@@ -14632,7 +14632,7 @@ cp_parser_committed_to_tentative_parse (cp_parser* parser)
&& parser->context->status == CP_PARSER_STATUS_KIND_COMMITTED);
}
-/* Returns non-zero iff an error has occurred during the most recent
+/* Returns nonzero iff an error has occurred during the most recent
tentative parse. */
static bool
@@ -14642,7 +14642,7 @@ cp_parser_error_occurred (cp_parser* parser)
&& parser->context->status == CP_PARSER_STATUS_KIND_ERROR);
}
-/* Returns non-zero if GNU extensions are allowed. */
+/* Returns nonzero if GNU extensions are allowed. */
static bool
cp_parser_allow_gnu_extensions_p (cp_parser* parser)
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 926b26d5c55..282c788180f 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -45,7 +45,7 @@ Boston, MA 02111-1307, USA. */
/* The type of functions taking a tree, and some additional data, and
returning an int. */
-typedef int (*tree_fn_t) PARAMS ((tree, void*));
+typedef int (*tree_fn_t) (tree, void*);
/* The PENDING_TEMPLATES is a TREE_LIST of templates whose
instantiations have been deferred, either because their definitions
@@ -88,88 +88,83 @@ static htab_t local_specializations;
#define GTB_IGNORE_TYPE 2 /* We don't need to try to unify the current
type with the desired type. */
-static void push_access_scope_real PARAMS ((tree, tree, tree));
-static void push_access_scope PARAMS ((tree));
-static void pop_access_scope PARAMS ((tree));
-static int resolve_overloaded_unification PARAMS ((tree, tree, tree, tree,
- unification_kind_t, int));
-static int try_one_overload PARAMS ((tree, tree, tree, tree, tree,
- unification_kind_t, int));
-static int unify PARAMS ((tree, tree, tree, tree, int));
-static void add_pending_template PARAMS ((tree));
-static void reopen_tinst_level PARAMS ((tree));
-static tree classtype_mangled_name PARAMS ((tree));
-static char *mangle_class_name_for_template PARAMS ((const char *,
- tree, tree));
-static tree tsubst_initializer_list PARAMS ((tree, tree));
-static int list_eq PARAMS ((tree, tree));
-static tree get_class_bindings PARAMS ((tree, tree, tree));
-static tree coerce_template_parms PARAMS ((tree, tree, tree,
- tsubst_flags_t, int));
-static void tsubst_enum PARAMS ((tree, tree, tree));
-static tree add_to_template_args PARAMS ((tree, tree));
-static tree add_outermost_template_args PARAMS ((tree, tree));
-static bool check_instantiated_args PARAMS ((tree, tree, tsubst_flags_t));
-static int maybe_adjust_types_for_deduction PARAMS ((unification_kind_t, tree*,
- tree*));
-static int type_unification_real PARAMS ((tree, tree, tree, tree,
- int, unification_kind_t, int, int));
-static void note_template_header PARAMS ((int));
-static tree maybe_fold_nontype_arg PARAMS ((tree));
-static void maybe_fold_nontype_args PARAMS ((tree));
-static tree convert_nontype_argument PARAMS ((tree, tree));
-static tree convert_template_argument PARAMS ((tree, tree, tree,
- tsubst_flags_t, int, tree));
-static tree get_bindings_overload PARAMS ((tree, tree, tree));
-static int for_each_template_parm PARAMS ((tree, tree_fn_t, void*, htab_t));
-static tree build_template_parm_index PARAMS ((int, int, int, tree, tree));
-static int inline_needs_template_parms PARAMS ((tree));
-static void push_inline_template_parms_recursive PARAMS ((tree, int));
-static tree retrieve_specialization PARAMS ((tree, tree));
-static tree retrieve_local_specialization PARAMS ((tree));
-static tree register_specialization PARAMS ((tree, tree, tree));
-static void register_local_specialization PARAMS ((tree, tree));
-static int unregister_specialization PARAMS ((tree, tree));
-static tree reduce_template_parm_level PARAMS ((tree, tree, int));
-static tree build_template_decl PARAMS ((tree, tree));
-static int mark_template_parm PARAMS ((tree, void *));
-static int template_parm_this_level_p PARAMS ((tree, void *));
-static tree tsubst_friend_function PARAMS ((tree, tree));
-static tree tsubst_friend_class PARAMS ((tree, tree));
-static int can_complete_type_without_circularity PARAMS ((tree));
-static tree get_bindings_real PARAMS ((tree, tree, tree, int, int, int));
-static int template_decl_level PARAMS ((tree));
-static int check_cv_quals_for_unify PARAMS ((int, tree, tree));
-static tree tsubst_template_arg_vector PARAMS ((tree, tree, tsubst_flags_t));
-static tree tsubst_template_parms PARAMS ((tree, tree, tsubst_flags_t));
-static void regenerate_decl_from_template PARAMS ((tree, tree));
-static tree most_specialized PARAMS ((tree, tree, tree));
-static tree most_specialized_class PARAMS ((tree, tree));
-static int template_class_depth_real PARAMS ((tree, int));
-static tree tsubst_aggr_type PARAMS ((tree, tree, tsubst_flags_t, tree, int));
-static tree tsubst_decl PARAMS ((tree, tree, tree, tsubst_flags_t));
-static tree tsubst_arg_types PARAMS ((tree, tree, tsubst_flags_t, tree));
-static tree tsubst_function_type PARAMS ((tree, tree, tsubst_flags_t, tree));
-static void check_specialization_scope PARAMS ((void));
-static tree process_partial_specialization PARAMS ((tree));
-static void set_current_access_from_decl PARAMS ((tree));
-static void check_default_tmpl_args PARAMS ((tree, tree, int, int));
-static tree tsubst_call_declarator_parms PARAMS ((tree, tree,
- tsubst_flags_t, tree));
-static tree get_template_base_recursive PARAMS ((tree, tree,
- tree, tree, tree, int));
-static tree get_template_base PARAMS ((tree, tree, tree, tree));
-static int verify_class_unification PARAMS ((tree, tree, tree));
-static tree try_class_unification PARAMS ((tree, tree, tree, tree));
-static int coerce_template_template_parms PARAMS ((tree, tree, tsubst_flags_t,
- tree, tree));
-static tree determine_specialization PARAMS ((tree, tree, tree *, int));
-static int template_args_equal PARAMS ((tree, tree));
-static void tsubst_default_arguments PARAMS ((tree));
-static tree for_each_template_parm_r PARAMS ((tree *, int *, void *));
-static tree copy_default_args_to_explicit_spec_1 PARAMS ((tree, tree));
-static void copy_default_args_to_explicit_spec PARAMS ((tree));
-static int invalid_nontype_parm_type_p PARAMS ((tree, tsubst_flags_t));
+static void push_access_scope_real (tree, tree, tree);
+static void push_access_scope (tree);
+static void pop_access_scope (tree);
+static int resolve_overloaded_unification (tree, tree, tree, tree,
+ unification_kind_t, int);
+static int try_one_overload (tree, tree, tree, tree, tree,
+ unification_kind_t, int);
+static int unify (tree, tree, tree, tree, int);
+static void add_pending_template (tree);
+static void reopen_tinst_level (tree);
+static tree classtype_mangled_name (tree);
+static char* mangle_class_name_for_template (const char *, tree, tree);
+static tree tsubst_initializer_list (tree, tree);
+static int list_eq (tree, tree);
+static tree get_class_bindings (tree, tree, tree);
+static tree coerce_template_parms (tree, tree, tree, tsubst_flags_t, int);
+static void tsubst_enum (tree, tree, tree);
+static tree add_to_template_args (tree, tree);
+static tree add_outermost_template_args (tree, tree);
+static bool check_instantiated_args (tree, tree, tsubst_flags_t);
+static int maybe_adjust_types_for_deduction (unification_kind_t, tree*, tree*);
+static int type_unification_real (tree, tree, tree, tree,
+ int, unification_kind_t, int, int);
+static void note_template_header (int);
+static tree maybe_fold_nontype_arg (tree);
+static void maybe_fold_nontype_args (tree);
+static tree convert_nontype_argument (tree, tree);
+static tree convert_template_argument (tree, tree, tree,
+ tsubst_flags_t, int, tree);
+static tree get_bindings_overload (tree, tree, tree);
+static int for_each_template_parm (tree, tree_fn_t, void*, htab_t);
+static tree build_template_parm_index (int, int, int, tree, tree);
+static int inline_needs_template_parms (tree);
+static void push_inline_template_parms_recursive (tree, int);
+static tree retrieve_specialization (tree, tree);
+static tree retrieve_local_specialization (tree);
+static tree register_specialization (tree, tree, tree);
+static void register_local_specialization (tree, tree);
+static int unregister_specialization (tree, tree);
+static tree reduce_template_parm_level (tree, tree, int);
+static tree build_template_decl (tree, tree);
+static int mark_template_parm (tree, void *);
+static int template_parm_this_level_p (tree, void *);
+static tree tsubst_friend_function (tree, tree);
+static tree tsubst_friend_class (tree, tree);
+static int can_complete_type_without_circularity (tree);
+static tree get_bindings_real (tree, tree, tree, int, int, int);
+static int template_decl_level (tree);
+static int check_cv_quals_for_unify (int, tree, tree);
+static tree tsubst_template_arg_vector (tree, tree, tsubst_flags_t);
+static tree tsubst_template_parms (tree, tree, tsubst_flags_t);
+static void regenerate_decl_from_template (tree, tree);
+static tree most_specialized (tree, tree, tree);
+static tree most_specialized_class (tree, tree);
+static int template_class_depth_real (tree, int);
+static tree tsubst_aggr_type (tree, tree, tsubst_flags_t, tree, int);
+static tree tsubst_decl (tree, tree, tree, tsubst_flags_t);
+static tree tsubst_arg_types (tree, tree, tsubst_flags_t, tree);
+static tree tsubst_function_type (tree, tree, tsubst_flags_t, tree);
+static void check_specialization_scope (void);
+static tree process_partial_specialization (tree);
+static void set_current_access_from_decl (tree);
+static void check_default_tmpl_args (tree, tree, int, int);
+static tree tsubst_call_declarator_parms (tree, tree, tsubst_flags_t, tree);
+static tree get_template_base_recursive (tree, tree, tree, tree, tree, int);
+static tree get_template_base (tree, tree, tree, tree);
+static int verify_class_unification (tree, tree, tree);
+static tree try_class_unification (tree, tree, tree, tree);
+static int coerce_template_template_parms (tree, tree, tsubst_flags_t,
+ tree, tree);
+static tree determine_specialization (tree, tree, tree *, int);
+static int template_args_equal (tree, tree);
+static void tsubst_default_arguments (tree);
+static tree for_each_template_parm_r (tree *, int *, void *);
+static tree copy_default_args_to_explicit_spec_1 (tree, tree);
+static void copy_default_args_to_explicit_spec (tree);
+static int invalid_nontype_parm_type_p (tree, tsubst_flags_t);
static int eq_local_specializations (const void *, const void *);
static bool dependent_type_p_r (tree);
static bool dependent_template_id_p (tree, tree);
@@ -186,8 +181,7 @@ static tree tsubst_copy_and_build (tree, tree, tsubst_flags_t, tree);
this is used instead of the context of T. */
void
-push_access_scope_real (t, args, context)
- tree t, args, context;
+push_access_scope_real (tree t, tree args, tree context)
{
if (TREE_CODE (t) == FUNCTION_DECL || DECL_FUNCTION_TEMPLATE_P (t))
{
@@ -234,8 +228,7 @@ push_access_scope_real (t, args, context)
/* Like push_access_scope_real, but always uses DECL_CONTEXT. */
void
-push_access_scope (t)
- tree t;
+push_access_scope (tree t)
{
push_access_scope_real (t, NULL_TREE, NULL_TREE);
}
@@ -244,8 +237,7 @@ push_access_scope (t)
are processing. */
void
-pop_access_scope (t)
- tree t;
+pop_access_scope (tree t)
{
if (TREE_CODE (t) == FUNCTION_DECL || DECL_FUNCTION_TEMPLATE_P (t))
{
@@ -265,8 +257,7 @@ pop_access_scope (t)
itself is returned. */
tree
-finish_member_template_decl (decl)
- tree decl;
+finish_member_template_decl (tree decl)
{
if (decl == error_mark_node)
return error_mark_node;
@@ -326,9 +317,7 @@ finish_member_template_decl (decl)
always safe. */
static int
-template_class_depth_real (type, count_specializations)
- tree type;
- int count_specializations;
+template_class_depth_real (tree type, int count_specializations)
{
int depth;
@@ -365,8 +354,7 @@ template_class_depth_real (type, count_specializations)
the depth. */
int
-template_class_depth (type)
- tree type;
+template_class_depth (tree type)
{
return template_class_depth_real (type, /*count_specializations=*/0);
}
@@ -375,8 +363,7 @@ template_class_depth (type)
needs us to push template parms. */
static int
-inline_needs_template_parms (decl)
- tree decl;
+inline_needs_template_parms (tree decl)
{
if (! DECL_TEMPLATE_INFO (decl))
return 0;
@@ -391,9 +378,7 @@ inline_needs_template_parms (decl)
innermost first. */
static void
-push_inline_template_parms_recursive (parmlist, levels)
- tree parmlist;
- int levels;
+push_inline_template_parms_recursive (tree parmlist, int levels)
{
tree parms = TREE_VALUE (parmlist);
int i;
@@ -446,8 +431,7 @@ push_inline_template_parms_recursive (parmlist, levels)
a friend template defined in a class definition. */
void
-maybe_begin_member_template_processing (decl)
- tree decl;
+maybe_begin_member_template_processing (tree decl)
{
tree parms;
int levels = 0;
@@ -479,7 +463,7 @@ maybe_begin_member_template_processing (decl)
/* Undo the effects of begin_member_template_processing. */
void
-maybe_end_member_template_processing ()
+maybe_end_member_template_processing (void)
{
int i;
@@ -513,8 +497,7 @@ maybe_end_member_template_processing ()
C<int>::f(U)' is considered a member template. */
int
-is_member_template (t)
- tree t;
+is_member_template (tree t)
{
if (!DECL_FUNCTION_TEMPLATE_P (t))
/* Anything that isn't a function or a template function is
@@ -539,8 +522,7 @@ is_member_template (t)
a member template. */
int
-is_member_template_class (t)
- tree t;
+is_member_template_class (tree t)
{
if (!DECL_CLASS_TEMPLATE_P (t))
/* Anything that isn't a class template, is certainly not a member
@@ -564,9 +546,7 @@ is_member_template_class (t)
but has as its innermost set of arguments the EXTRA_ARGS. */
static tree
-add_to_template_args (args, extra_args)
- tree args;
- tree extra_args;
+add_to_template_args (tree args, tree extra_args)
{
tree new_args;
int extra_depth;
@@ -593,9 +573,7 @@ add_to_template_args (args, extra_args)
partial instantiation. */
static tree
-add_outermost_template_args (args, extra_args)
- tree args;
- tree extra_args;
+add_outermost_template_args (tree args, tree extra_args)
{
tree new_args;
@@ -623,9 +601,7 @@ add_outermost_template_args (args, extra_args)
/* Return the N levels of innermost template arguments from the ARGS. */
tree
-get_innermost_template_args (args, n)
- tree args;
- int n;
+get_innermost_template_args (tree args, int n)
{
tree new_args;
int extra_levels;
@@ -657,7 +633,7 @@ get_innermost_template_args (args, n)
the parms. */
void
-begin_template_parm_list ()
+begin_template_parm_list (void)
{
/* We use a non-tag-transparent scope here, which causes pushtag to
put tags in this scope, rather than in the enclosing class or
@@ -683,7 +659,7 @@ begin_template_parm_list ()
invalid to declare a specialization here, an error is reported. */
static void
-check_specialization_scope ()
+check_specialization_scope (void)
{
tree scope = current_scope ();
@@ -715,7 +691,7 @@ check_specialization_scope ()
/* We've just seen template <>. */
void
-begin_specialization ()
+begin_specialization (void)
{
begin_scope (sk_template_spec);
note_template_header (1);
@@ -726,7 +702,7 @@ begin_specialization ()
template<>. */
void
-end_specialization ()
+end_specialization (void)
{
finish_scope ();
reset_specialization ();
@@ -736,7 +712,7 @@ end_specialization ()
function specialization. */
void
-reset_specialization ()
+reset_specialization (void)
{
processing_specialization = 0;
template_header_count = 0;
@@ -746,8 +722,7 @@ reset_specialization ()
it was of the form template <>. */
static void
-note_template_header (specialization)
- int specialization;
+note_template_header (int specialization)
{
processing_specialization = specialization;
template_header_count++;
@@ -756,7 +731,7 @@ note_template_header (specialization)
/* We're beginning an explicit instantiation. */
void
-begin_explicit_instantiation ()
+begin_explicit_instantiation (void)
{
my_friendly_assert (!processing_explicit_instantiation, 20020913);
processing_explicit_instantiation = true;
@@ -764,7 +739,7 @@ begin_explicit_instantiation ()
void
-end_explicit_instantiation ()
+end_explicit_instantiation (void)
{
my_friendly_assert(processing_explicit_instantiation, 20020913);
processing_explicit_instantiation = false;
@@ -774,8 +749,7 @@ end_explicit_instantiation ()
is a partial specialization. Do appropriate error-checking. */
void
-maybe_process_partial_specialization (type)
- tree type;
+maybe_process_partial_specialization (tree type)
{
/* TYPE maybe an ERROR_MARK_NODE. */
tree context = TYPE_P (type) ? TYPE_CONTEXT (type) : NULL_TREE;
@@ -878,9 +852,7 @@ maybe_process_partial_specialization (type)
templates with more than one level of parameters. */
static tree
-retrieve_specialization (tmpl, args)
- tree tmpl;
- tree args;
+retrieve_specialization (tree tmpl, tree args)
{
tree s;
@@ -904,8 +876,7 @@ retrieve_specialization (tmpl, args)
/* Like retrieve_specialization, but for local declarations. */
static tree
-retrieve_local_specialization (tmpl)
- tree tmpl;
+retrieve_local_specialization (tree tmpl)
{
tree spec =
(tree) htab_find_with_hash (local_specializations, tmpl,
@@ -916,9 +887,7 @@ retrieve_local_specialization (tmpl)
/* Returns nonzero iff DECL is a specialization of TMPL. */
int
-is_specialization_of (decl, tmpl)
- tree decl;
- tree tmpl;
+is_specialization_of (tree decl, tree tmpl)
{
tree t;
@@ -950,10 +919,7 @@ is_specialization_of (decl, tmpl)
declaration, if available. */
static tree
-register_specialization (spec, tmpl, args)
- tree spec;
- tree tmpl;
- tree args;
+register_specialization (tree spec, tree tmpl, tree args)
{
tree s;
@@ -1063,9 +1029,7 @@ register_specialization (spec, tmpl, args)
TMPL. */
static int
-unregister_specialization (spec, tmpl)
- tree spec;
- tree tmpl;
+unregister_specialization (tree spec, tree tmpl)
{
tree* s;
@@ -1103,9 +1067,7 @@ hash_local_specialization (const void* p1)
registering SPEC, an instantiation of TMPL. */
static void
-register_local_specialization (spec, tmpl)
- tree spec;
- tree tmpl;
+register_local_specialization (tree spec, tree tmpl)
{
void **slot;
@@ -1117,8 +1079,7 @@ register_local_specialization (spec, tmpl)
/* Print the list of candidate FNS in an error message. */
void
-print_candidates (fns)
- tree fns;
+print_candidates (tree fns)
{
tree fn;
@@ -1150,12 +1111,10 @@ print_candidates (fns)
issued. The error_mark_node is returned to indicate failure. */
static tree
-determine_specialization (template_id, decl, targs_out,
- need_member_template)
- tree template_id;
- tree decl;
- tree* targs_out;
- int need_member_template;
+determine_specialization (tree template_id,
+ tree decl,
+ tree* targs_out,
+ int need_member_template)
{
tree fns;
tree targs;
@@ -1362,10 +1321,8 @@ determine_specialization (template_id, decl, targs_out,
TMPL_TYPES. */
static tree
-copy_default_args_to_explicit_spec_1 (spec_types,
- tmpl_types)
- tree spec_types;
- tree tmpl_types;
+copy_default_args_to_explicit_spec_1 (tree spec_types,
+ tree tmpl_types)
{
tree new_spec_types;
@@ -1398,8 +1355,7 @@ copy_default_args_to_explicit_spec_1 (spec_types,
is consistent with how implicit instantiations are handled. */
static void
-copy_default_args_to_explicit_spec (decl)
- tree decl;
+copy_default_args_to_explicit_spec (tree decl)
{
tree tmpl;
tree spec_types;
@@ -1516,11 +1472,10 @@ copy_default_args_to_explicit_spec (decl)
for that template. */
tree
-check_explicit_specialization (declarator, decl, template_count, flags)
- tree declarator;
- tree decl;
- int template_count;
- int flags;
+check_explicit_specialization (tree declarator,
+ tree decl,
+ int template_count,
+ int flags)
{
int have_def = flags & 2;
int is_friend = flags & 4;
@@ -1674,15 +1629,21 @@ check_explicit_specialization (declarator, decl, template_count, flags)
{
tree fns;
- my_friendly_assert (TREE_CODE (declarator) == IDENTIFIER_NODE,
- 0);
- if (!ctype)
- fns = IDENTIFIER_NAMESPACE_VALUE (dname);
- else
+ my_friendly_assert (TREE_CODE (declarator) == IDENTIFIER_NODE, 0);
+ if (ctype)
fns = dname;
+ else
+ {
+ /* If there is no class context, the explicit instantiation
+ must be at namespace scope. */
+ my_friendly_assert (DECL_NAMESPACE_SCOPE_P (decl), 20030625);
- declarator =
- lookup_template_function (fns, NULL_TREE);
+ /* Find the namespace binding, using the declaration
+ context. */
+ fns = namespace_binding (dname, CP_DECL_CONTEXT (decl));
+ }
+
+ declarator = lookup_template_function (fns, NULL_TREE);
}
if (declarator == error_mark_node)
@@ -1912,8 +1873,7 @@ check_explicit_specialization (declarator, decl, template_count, flags)
and such is reasonable. Issue error messages if not. */
void
-maybe_check_template_type (type)
- tree type;
+maybe_check_template_type (tree type)
{
if (template_header_count)
{
@@ -1956,9 +1916,7 @@ maybe_check_template_type (type)
parameters. These are represented in the same format used for
DECL_TEMPLATE_PARMS. */
-int comp_template_parms (parms1, parms2)
- tree parms1;
- tree parms2;
+int comp_template_parms (tree parms1, tree parms2)
{
tree p1;
tree p2;
@@ -2009,8 +1967,7 @@ int comp_template_parms (parms1, parms2)
scope (including nested scopes). */
void
-check_template_shadow (decl)
- tree decl;
+check_template_shadow (tree decl)
{
tree olddecl;
@@ -2051,12 +2008,11 @@ check_template_shadow (decl)
ORIG_LEVEL, DECL, and TYPE. */
static tree
-build_template_parm_index (index, level, orig_level, decl, type)
- int index;
- int level;
- int orig_level;
- tree decl;
- tree type;
+build_template_parm_index (int index,
+ int level,
+ int orig_level,
+ tree decl,
+ tree type)
{
tree t = make_node (TEMPLATE_PARM_INDEX);
TEMPLATE_PARM_IDX (t) = index;
@@ -2076,10 +2032,7 @@ build_template_parm_index (index, level, orig_level, decl, type)
new one is created. */
static tree
-reduce_template_parm_level (index, type, levels)
- tree index;
- tree type;
- int levels;
+reduce_template_parm_level (tree index, tree type, int levels)
{
if (TEMPLATE_PARM_DESCENDANTS (index) == NULL_TREE
|| (TEMPLATE_PARM_LEVEL (TEMPLATE_PARM_DESCENDANTS (index))
@@ -2112,8 +2065,7 @@ reduce_template_parm_level (index, type, levels)
LIST being built. */
tree
-process_template_parm (list, next)
- tree list, next;
+process_template_parm (tree list, tree next)
{
tree parm;
tree decl = 0;
@@ -2206,8 +2158,7 @@ process_template_parm (list, next)
as PARM_DECLs. */
tree
-end_template_parm_list (parms)
- tree parms;
+end_template_parm_list (tree parms)
{
int nparms;
tree parm, next;
@@ -2232,7 +2183,7 @@ end_template_parm_list (parms)
/* end_template_decl is called after a template declaration is seen. */
void
-end_template_decl ()
+end_template_decl (void)
{
reset_specialization ();
@@ -2250,7 +2201,7 @@ end_template_decl ()
The innermost PARMS are given first. */
tree
-current_template_args ()
+current_template_args (void)
{
tree header;
tree args = NULL_TREE;
@@ -2302,9 +2253,7 @@ current_template_args ()
template PARMS. Used by push_template_decl below. */
static tree
-build_template_decl (decl, parms)
- tree decl;
- tree parms;
+build_template_decl (tree decl, tree parms)
{
tree tmpl = build_lang_decl (TEMPLATE_DECL, DECL_NAME (decl), NULL_TREE);
DECL_TEMPLATE_PARMS (tmpl) = parms;
@@ -2352,9 +2301,7 @@ struct template_parm_data
appropriately. */
static int
-mark_template_parm (t, data)
- tree t;
- void* data;
+mark_template_parm (tree t, void* data)
{
int level;
int idx;
@@ -2385,8 +2332,7 @@ mark_template_parm (t, data)
/* Process the partial specialization DECL. */
static tree
-process_partial_specialization (decl)
- tree decl;
+process_partial_specialization (tree decl)
{
tree type = TREE_TYPE (decl);
tree maintmpl = CLASSTYPE_TI_TEMPLATE (type);
@@ -2433,10 +2379,10 @@ process_partial_specialization (decl)
or some such would have been OK. */
tpd.level = TMPL_PARMS_DEPTH (current_template_parms);
tpd.parms = alloca (sizeof (int) * ntparms);
- memset ((PTR) tpd.parms, 0, sizeof (int) * ntparms);
+ memset (tpd.parms, 0, sizeof (int) * ntparms);
tpd.arg_uses_template_parms = alloca (sizeof (int) * nargs);
- memset ((PTR) tpd.arg_uses_template_parms, 0, sizeof (int) * nargs);
+ memset (tpd.arg_uses_template_parms, 0, sizeof (int) * nargs);
for (i = 0; i < nargs; ++i)
{
tpd.current_arg = i;
@@ -2521,7 +2467,7 @@ process_partial_specialization (decl)
template, not in the specialization. */
tpd2.current_arg = i;
tpd2.arg_uses_template_parms[i] = 0;
- memset ((PTR) tpd2.parms, 0, sizeof (int) * nargs);
+ memset (tpd2.parms, 0, sizeof (int) * nargs);
for_each_template_parm (type,
&mark_template_parm,
&tpd2,
@@ -2564,11 +2510,7 @@ process_partial_specialization (decl)
IS_PARTIAL is nonzero if DECL is a partial specialization. */
static void
-check_default_tmpl_args (decl, parms, is_primary, is_partial)
- tree decl;
- tree parms;
- int is_primary;
- int is_partial;
+check_default_tmpl_args (tree decl, tree parms, int is_primary, int is_partial)
{
const char *msg;
int last_level_to_check;
@@ -2592,14 +2534,15 @@ check_default_tmpl_args (decl, parms, is_primary, is_partial)
&& DECL_LANG_SPECIFIC (decl)
/* If this is either a friend defined in the scope of the class
or a member function. */
- && ((DECL_CONTEXT (decl)
- && same_type_p (DECL_CONTEXT (decl), current_class_type))
- || (DECL_FRIEND_CONTEXT (decl)
- && same_type_p (DECL_FRIEND_CONTEXT (decl),
- current_class_type)))
+ && (DECL_FUNCTION_MEMBER_P (decl)
+ ? same_type_p (DECL_CONTEXT (decl), current_class_type)
+ : DECL_FRIEND_CONTEXT (decl)
+ ? same_type_p (DECL_FRIEND_CONTEXT (decl), current_class_type)
+ : false)
/* And, if it was a member function, it really was defined in
the scope of the class. */
- && (!DECL_FUNCTION_MEMBER_P (decl) || DECL_INITIALIZED_IN_CLASS_P (decl)))
+ && (!DECL_FUNCTION_MEMBER_P (decl)
+ || DECL_INITIALIZED_IN_CLASS_P (decl)))
/* We already checked these parameters when the template was
declared, so there's no need to do it again now. This function
was defined in class scope, but we're processing it's body now
@@ -2711,9 +2654,7 @@ check_default_tmpl_args (decl, parms, is_primary, is_partial)
parameter of that level, return nonzero. */
static int
-template_parm_this_level_p (t, data)
- tree t;
- void *data;
+template_parm_this_level_p (tree t, void* data)
{
int this_level = *(int *)data;
int level;
@@ -2733,9 +2674,7 @@ template_parm_this_level_p (t, data)
If IS_FRIEND is nonzero, DECL is a friend declaration. */
tree
-push_template_decl_real (decl, is_friend)
- tree decl;
- int is_friend;
+push_template_decl_real (tree decl, int is_friend)
{
tree tmpl;
tree args;
@@ -2980,8 +2919,7 @@ push_template_decl_real (decl, is_friend)
}
tree
-push_template_decl (decl)
- tree decl;
+push_template_decl (tree decl)
{
return push_template_decl_real (decl, 0);
}
@@ -2993,9 +2931,7 @@ push_template_decl (decl)
template <class T> struct S {}; */
void
-redeclare_class_template (type, parms)
- tree type;
- tree parms;
+redeclare_class_template (tree type, tree parms)
{
tree tmpl;
tree tmpl_parms;
@@ -3074,9 +3010,7 @@ redeclare_class_template (type, parms)
parameters. */
static tree
-convert_nontype_argument (type, expr)
- tree type;
- tree expr;
+convert_nontype_argument (tree type, tree expr)
{
tree expr_type = TREE_TYPE (expr);
@@ -3430,11 +3364,11 @@ convert_nontype_argument (type, expr)
substitute the TT parameter. */
static int
-coerce_template_template_parms (parm_parms, arg_parms, complain,
- in_decl, outer_args)
- tree parm_parms, arg_parms;
- tsubst_flags_t complain;
- tree in_decl, outer_args;
+coerce_template_template_parms (tree parm_parms,
+ tree arg_parms,
+ tsubst_flags_t complain,
+ tree in_decl,
+ tree outer_args)
{
int nparms, nargs, i;
tree parm, arg;
@@ -3508,13 +3442,12 @@ coerce_template_template_parms (parm_parms, arg_parms, complain,
the full set of template arguments deduced so far. */
static tree
-convert_template_argument (parm, arg, args, complain, i, in_decl)
- tree parm;
- tree arg;
- tree args;
- tsubst_flags_t complain;
- int i;
- tree in_decl;
+convert_template_argument (tree parm,
+ tree arg,
+ tree args,
+ tsubst_flags_t complain,
+ int i,
+ tree in_decl)
{
tree val;
tree inner_args;
@@ -3700,13 +3633,11 @@ convert_template_argument (parm, arg, args, complain, i, in_decl)
deduction for any unspecified trailing arguments. */
static tree
-coerce_template_parms (parms, args, in_decl,
- complain,
- require_all_arguments)
- tree parms, args;
- tree in_decl;
- tsubst_flags_t complain;
- int require_all_arguments;
+coerce_template_parms (tree parms,
+ tree args,
+ tree in_decl,
+ tsubst_flags_t complain,
+ int require_all_arguments)
{
int nparms, nargs, i, lost = 0;
tree inner_args;
@@ -3797,8 +3728,7 @@ coerce_template_parms (parms, args, in_decl,
/* Returns 1 if template args OT and NT are equivalent. */
static int
-template_args_equal (ot, nt)
- tree ot, nt;
+template_args_equal (tree ot, tree nt)
{
if (nt == ot)
return 1;
@@ -3811,15 +3741,14 @@ template_args_equal (ot, nt)
else if (TREE_CODE (ot) == TREE_VEC || TYPE_P (ot))
return 0;
else
- return (cp_tree_equal (ot, nt) > 0);
+ return cp_tree_equal (ot, nt);
}
/* Returns 1 iff the OLDARGS and NEWARGS are in fact identical sets
of template arguments. Returns 0 otherwise. */
int
-comp_template_args (oldargs, newargs)
- tree oldargs, newargs;
+comp_template_args (tree oldargs, tree newargs)
{
int i;
@@ -3841,9 +3770,7 @@ comp_template_args (oldargs, newargs)
for the instantiation. */
static char *
-mangle_class_name_for_template (name, parms, arglist)
- const char *name;
- tree parms, arglist;
+mangle_class_name_for_template (const char* name, tree parms, tree arglist)
{
static struct obstack scratch_obstack;
static char *scratch_firstobj;
@@ -3931,8 +3858,7 @@ mangle_class_name_for_template (name, parms, arglist)
}
static tree
-classtype_mangled_name (t)
- tree t;
+classtype_mangled_name (tree t)
{
if (CLASSTYPE_TEMPLATE_INFO (t)
/* Specializations have already had their names set up in
@@ -3960,8 +3886,7 @@ classtype_mangled_name (t)
}
static void
-add_pending_template (d)
- tree d;
+add_pending_template (tree d)
{
tree ti = (TYPE_P (d)
? CLASSTYPE_TEMPLATE_INFO (d)
@@ -4000,8 +3925,7 @@ add_pending_template (d)
documentation for TEMPLATE_ID_EXPR. */
tree
-lookup_template_function (fns, arglist)
- tree fns, arglist;
+lookup_template_function (tree fns, tree arglist)
{
tree type;
@@ -4045,8 +3969,7 @@ lookup_template_function (fns, arglist)
DECL is returned. */
tree
-maybe_get_template_decl_from_type_decl (decl)
- tree decl;
+maybe_get_template_decl_from_type_decl (tree decl)
{
return (decl != NULL_TREE
&& TREE_CODE (decl) == TYPE_DECL
@@ -4077,12 +4000,12 @@ maybe_get_template_decl_from_type_decl (decl)
being instantiated. */
tree
-lookup_template_class (d1, arglist, in_decl, context, entering_scope, complain)
- tree d1, arglist;
- tree in_decl;
- tree context;
- int entering_scope;
- tsubst_flags_t complain;
+lookup_template_class (tree d1,
+ tree arglist,
+ tree in_decl,
+ tree context,
+ int entering_scope,
+ tsubst_flags_t complain)
{
tree template = NULL_TREE, parmlist;
tree t;
@@ -4318,21 +4241,20 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope, complain)
{
tree ctx;
- /* Note that we use DECL_CONTEXT, rather than
- CP_DECL_CONTEXT, so that the termination test is
- always just `ctx'. We're not interested in namespace
- scopes. */
for (ctx = current_class_type;
ctx;
- ctx = (TYPE_P (ctx)) ? TYPE_CONTEXT (ctx) : DECL_CONTEXT (ctx))
- if (same_type_p (ctx, template_type))
- break;
+ ctx = TYPE_CONTEXT (ctx))
+ {
+ if (TREE_CODE (ctx) == NAMESPACE_DECL)
+ break;
+ if (same_type_p (ctx, template_type))
+ goto found_ctx;
+ }
- if (!ctx)
- /* We're not in the scope of the class, so the
- TEMPLATE_TYPE is not the type we want after
- all. */
- found = NULL_TREE;
+ /* We're not in the scope of the class, so the
+ TEMPLATE_TYPE is not the type we want after all. */
+ found = NULL_TREE;
+ found_ctx:;
}
}
if (found)
@@ -4539,10 +4461,7 @@ struct pair_fn_data
/* Called from for_each_template_parm via walk_tree. */
static tree
-for_each_template_parm_r (tp, walk_subtrees, d)
- tree *tp;
- int *walk_subtrees;
- void *d;
+for_each_template_parm_r (tree* tp, int* walk_subtrees, void* d)
{
tree t = *tp;
struct pair_fn_data *pfd = (struct pair_fn_data *) d;
@@ -4730,11 +4649,7 @@ for_each_template_parm_r (tp, walk_subtrees, d)
considered to be the function which always returns 1. */
static int
-for_each_template_parm (t, fn, data, visited)
- tree t;
- tree_fn_t fn;
- void* data;
- htab_t visited;
+for_each_template_parm (tree t, tree_fn_t fn, void* data, htab_t visited)
{
struct pair_fn_data pfd;
int result;
@@ -4766,8 +4681,7 @@ for_each_template_parm (t, fn, data, visited)
}
int
-uses_template_parms (t)
- tree t;
+uses_template_parms (tree t)
{
return for_each_template_parm (t, 0, 0, NULL);
}
@@ -4784,8 +4698,7 @@ static int last_template_error_tick;
for diagnostics and to restore it later. */
int
-push_tinst_level (d)
- tree d;
+push_tinst_level (tree d)
{
tree new;
@@ -4824,7 +4737,7 @@ push_tinst_level (d)
context. */
void
-pop_tinst_level ()
+pop_tinst_level (void)
{
tree old = current_tinst_level;
@@ -4844,8 +4757,7 @@ pop_tinst_level ()
is one step out from LEVEL. */
static void
-reopen_tinst_level (level)
- tree level;
+reopen_tinst_level (tree level)
{
tree t;
@@ -4861,7 +4773,7 @@ reopen_tinst_level (level)
-falt-external-templates. */
tree
-tinst_for_decl ()
+tinst_for_decl (void)
{
tree p = current_tinst_level;
@@ -4877,9 +4789,7 @@ tinst_for_decl ()
Returns an appropriate tsubst'd friend declaration. */
static tree
-tsubst_friend_function (decl, args)
- tree decl;
- tree args;
+tsubst_friend_function (tree decl, tree args)
{
tree new_friend;
location_t saved_loc = input_location;
@@ -5102,9 +5012,7 @@ tsubst_friend_function (decl, args)
failure. */
static tree
-tsubst_friend_class (friend_tmpl, args)
- tree friend_tmpl;
- tree args;
+tsubst_friend_class (tree friend_tmpl, tree args)
{
tree friend_type;
tree tmpl;
@@ -5193,8 +5101,7 @@ tsubst_friend_class (friend_tmpl, args)
Otherwise returns one. */
static int
-can_complete_type_without_circularity (type)
- tree type;
+can_complete_type_without_circularity (tree type)
{
if (type == NULL_TREE || type == error_mark_node)
return 0;
@@ -5209,8 +5116,7 @@ can_complete_type_without_circularity (type)
}
tree
-instantiate_class_template (type)
- tree type;
+instantiate_class_template (tree type)
{
tree template, args, pattern, t, member;
tree typedecl;
@@ -5594,8 +5500,7 @@ instantiate_class_template (type)
}
static int
-list_eq (t1, t2)
- tree t1, t2;
+list_eq (tree t1, tree t2)
{
if (t1 == NULL_TREE)
return t2 == NULL_TREE;
@@ -5613,8 +5518,7 @@ list_eq (t1, t2)
arguments, fold it like we weren't in the body of a template. */
static tree
-maybe_fold_nontype_arg (arg)
- tree arg;
+maybe_fold_nontype_arg (tree arg)
{
if (arg && !TYPE_P (arg) && !uses_template_parms (arg))
{
@@ -5667,10 +5571,7 @@ maybe_fold_nontype_args (tree targs)
/* Substitute ARGS into the vector of template arguments T. */
static tree
-tsubst_template_arg_vector (t, args, complain)
- tree t;
- tree args;
- tsubst_flags_t complain;
+tsubst_template_arg_vector (tree t, tree args, tsubst_flags_t complain)
{
int len = TREE_VEC_LENGTH (t), need_new = 0, i;
tree *elts = (tree *) alloca (len * sizeof (tree));
@@ -5713,10 +5614,7 @@ tsubst_template_arg_vector (t, args, complain)
result will be `template <int*, double, class V>'. */
static tree
-tsubst_template_parms (parms, args, complain)
- tree parms;
- tree args;
- tsubst_flags_t complain;
+tsubst_template_parms (tree parms, tree args, tsubst_flags_t complain)
{
tree r = NULL_TREE;
tree* new_parms;
@@ -5760,12 +5658,11 @@ tsubst_template_parms (parms, args, complain)
we are presently tsubst'ing. Return the substituted value. */
static tree
-tsubst_aggr_type (t, args, complain, in_decl, entering_scope)
- tree t;
- tree args;
- tsubst_flags_t complain;
- tree in_decl;
- int entering_scope;
+tsubst_aggr_type (tree t,
+ tree args,
+ tsubst_flags_t complain,
+ tree in_decl,
+ int entering_scope)
{
if (t == NULL_TREE)
return NULL_TREE;
@@ -5826,10 +5723,7 @@ tsubst_aggr_type (t, args, complain, in_decl, entering_scope)
FN), which has the indicated TYPE. */
tree
-tsubst_default_argument (fn, type, arg)
- tree fn;
- tree type;
- tree arg;
+tsubst_default_argument (tree fn, tree type, tree arg)
{
/* This default argument came from a template. Instantiate the
default argument here, not in tsubst. In the case of
@@ -5865,8 +5759,7 @@ tsubst_default_argument (fn, type, arg)
/* Substitute into all the default arguments for FN. */
static void
-tsubst_default_arguments (fn)
- tree fn;
+tsubst_default_arguments (tree fn)
{
tree arg;
tree tmpl_args;
@@ -5893,11 +5786,7 @@ tsubst_default_arguments (fn)
and warning messages under control of COMPLAIN. */
static tree
-tsubst_decl (t, args, type, complain)
- tree t;
- tree args;
- tree type;
- tsubst_flags_t complain;
+tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
{
location_t saved_loc;
tree r = NULL_TREE;
@@ -6026,6 +5915,17 @@ tsubst_decl (t, args, type, complain)
if (TREE_CODE (DECL_TI_TEMPLATE (t)) == TEMPLATE_DECL)
{
tree spec;
+ bool dependent_p;
+
+ /* If T is not dependent, just return it. We have to
+ increment PROCESSING_TEMPLATE_DECL because
+ value_dependent_expression_p assumes that nothing is
+ dependent when PROCESSING_TEMPLATE_DECL is zero. */
+ ++processing_template_decl;
+ dependent_p = value_dependent_expression_p (t);
+ --processing_template_decl;
+ if (!dependent_p)
+ return t;
/* Calculate the most general template of which R is a
specialization, and the complete set of arguments used to
@@ -6379,11 +6279,10 @@ tsubst_decl (t, args, type, complain)
/* Substitue into the ARG_TYPES of a function type. */
static tree
-tsubst_arg_types (arg_types, args, complain, in_decl)
- tree arg_types;
- tree args;
- tsubst_flags_t complain;
- tree in_decl;
+tsubst_arg_types (tree arg_types,
+ tree args,
+ tsubst_flags_t complain,
+ tree in_decl)
{
tree remaining_arg_types;
tree type;
@@ -6440,11 +6339,10 @@ tsubst_arg_types (arg_types, args, complain, in_decl)
results in an invalid type.] */
static tree
-tsubst_function_type (t, args, complain, in_decl)
- tree t;
- tree args;
- tsubst_flags_t complain;
- tree in_decl;
+tsubst_function_type (tree t,
+ tree args,
+ tsubst_flags_t complain,
+ tree in_decl)
{
tree return_type;
tree arg_types;
@@ -6497,11 +6395,10 @@ tsubst_function_type (t, args, complain, in_decl)
/* Substitute into the PARMS of a call-declarator. */
static tree
-tsubst_call_declarator_parms (parms, args, complain, in_decl)
- tree parms;
- tree args;
- tsubst_flags_t complain;
- tree in_decl;
+tsubst_call_declarator_parms (tree parms,
+ tree args,
+ tsubst_flags_t complain,
+ tree in_decl)
{
tree new_parms;
tree type;
@@ -6548,10 +6445,7 @@ tsubst_call_declarator_parms (parms, args, complain, in_decl)
for expressions, use tsubst_expr or tsubst_copy. */
static tree
-tsubst (t, args, complain, in_decl)
- tree t, args;
- tsubst_flags_t complain;
- tree in_decl;
+tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
{
tree type, r;
@@ -7183,10 +7077,7 @@ tsubst (t, args, complain, in_decl)
tsubst_expr. */
static tree
-tsubst_copy (t, args, complain, in_decl)
- tree t, args;
- tsubst_flags_t complain;
- tree in_decl;
+tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
{
enum tree_code code;
tree r;
@@ -7596,10 +7487,7 @@ tsubst_copy (t, args, complain, in_decl)
processing. */
static tree
-tsubst_expr (t, args, complain, in_decl)
- tree t, args;
- tsubst_flags_t complain;
- tree in_decl;
+tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
{
tree stmt, tmp;
@@ -7923,10 +7811,10 @@ tsubst_expr (t, args, complain, in_decl)
analysis. */
static tree
-tsubst_copy_and_build (t, args, complain, in_decl)
- tree t, args;
- tsubst_flags_t complain;
- tree in_decl;
+tsubst_copy_and_build (tree t,
+ tree args,
+ tsubst_flags_t complain,
+ tree in_decl)
{
if (t == NULL_TREE || t == error_mark_node)
return t;
@@ -8430,9 +8318,7 @@ tsubst_copy_and_build (t, args, complain, in_decl)
Emit an error under control of COMPLAIN, and return TRUE on error. */
static bool
-check_instantiated_args (tmpl, args, complain)
- tree tmpl, args;
- tsubst_flags_t complain;
+check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain)
{
int ix, len = DECL_NTPARMS (tmpl);
bool result = false;
@@ -8489,9 +8375,7 @@ check_instantiated_args (tmpl, args, complain)
the template arguments in TARG_PTR. */
tree
-instantiate_template (tmpl, targ_ptr, complain)
- tree tmpl, targ_ptr;
- tsubst_flags_t complain;
+instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain)
{
tree fndecl;
tree gen_tmpl;
@@ -8616,11 +8500,13 @@ instantiate_template (tmpl, targ_ptr, complain)
partial ordering in [temp.func.order]/6). */
int
-fn_type_unification (fn, explicit_targs, targs, args, return_type,
- strict, len)
- tree fn, explicit_targs, targs, args, return_type;
- unification_kind_t strict;
- int len;
+fn_type_unification (tree fn,
+ tree explicit_targs,
+ tree targs,
+ tree args,
+ tree return_type,
+ unification_kind_t strict,
+ int len)
{
tree parms;
tree fntype;
@@ -8714,10 +8600,9 @@ fn_type_unification (fn, explicit_targs, targs, args, return_type,
initialized with the result of the conversion function. */
static int
-maybe_adjust_types_for_deduction (strict, parm, arg)
- unification_kind_t strict;
- tree* parm;
- tree* arg;
+maybe_adjust_types_for_deduction (unification_kind_t strict,
+ tree* parm,
+ tree* arg)
{
int result = 0;
@@ -8821,12 +8706,14 @@ maybe_adjust_types_for_deduction (strict, parm, arg)
template). */
static int
-type_unification_real (tparms, targs, xparms, xargs, subr,
- strict, allow_incomplete, xlen)
- tree tparms, targs, xparms, xargs;
- int subr;
- unification_kind_t strict;
- int allow_incomplete, xlen;
+type_unification_real (tree tparms,
+ tree targs,
+ tree xparms,
+ tree xargs,
+ int subr,
+ unification_kind_t strict,
+ int allow_incomplete,
+ int xlen)
{
tree parm, arg;
int i;
@@ -8995,11 +8882,12 @@ type_unification_real (tparms, targs, xparms, xargs, subr,
succeeds, we go with that. Modifies TARGS and returns 0 on success. */
static int
-resolve_overloaded_unification (tparms, targs, parm, arg, strict,
- sub_strict)
- tree tparms, targs, parm, arg;
- unification_kind_t strict;
- int sub_strict;
+resolve_overloaded_unification (tree tparms,
+ tree targs,
+ tree parm,
+ tree arg,
+ unification_kind_t strict,
+ int sub_strict)
{
tree tempargs = copy_node (targs);
int good = 0;
@@ -9091,11 +8979,13 @@ resolve_overloaded_unification (tparms, targs, parm, arg, strict,
Returns 1 on success. */
static int
-try_one_overload (tparms, orig_targs, targs, parm, arg, strict,
- sub_strict)
- tree tparms, orig_targs, targs, parm, arg;
- unification_kind_t strict;
- int sub_strict;
+try_one_overload (tree tparms,
+ tree orig_targs,
+ tree targs,
+ tree parm,
+ tree arg,
+ unification_kind_t strict,
+ int sub_strict)
{
int nargs;
tree tempargs;
@@ -9173,8 +9063,7 @@ try_one_overload (tparms, orig_targs, targs, parm, arg, strict,
ARGS contains template arguments from all levels. */
static int
-verify_class_unification (targs, parms, args)
- tree targs, parms, args;
+verify_class_unification (tree targs, tree parms, tree args)
{
parms = tsubst (parms, add_outermost_template_args (args, targs),
tf_none, NULL_TREE);
@@ -9190,16 +9079,13 @@ verify_class_unification (targs, parms, args)
TARGS are as for unify. */
static tree
-try_class_unification (tparms, targs, parm, arg)
- tree tparms;
- tree targs;
- tree parm;
- tree arg;
+try_class_unification (tree tparms, tree targs, tree parm, tree arg)
{
tree copy_of_targs;
if (!CLASSTYPE_TEMPLATE_INFO (arg)
- || CLASSTYPE_TI_TEMPLATE (arg) != CLASSTYPE_TI_TEMPLATE (parm))
+ || (most_general_template (CLASSTYPE_TI_TEMPLATE (arg))
+ != most_general_template (CLASSTYPE_TI_TEMPLATE (parm))))
return NULL_TREE;
/* We need to make a new template argument vector for the call to
@@ -9247,14 +9133,12 @@ try_class_unification (tparms, targs, parm, arg)
for the base class of ARG that we are currently examining. */
static tree
-get_template_base_recursive (tparms, targs, parm,
- arg_binfo, rval, flags)
- tree tparms;
- tree targs;
- tree arg_binfo;
- tree rval;
- tree parm;
- int flags;
+get_template_base_recursive (tree tparms,
+ tree targs,
+ tree parm,
+ tree arg_binfo,
+ tree rval,
+ int flags)
{
tree binfos;
int i, n_baselinks;
@@ -9323,11 +9207,7 @@ get_template_base_recursive (tparms, targs, parm,
as well as a plain template type. Used by unify. */
static tree
-get_template_base (tparms, targs, parm, arg)
- tree tparms;
- tree targs;
- tree parm;
- tree arg;
+get_template_base (tree tparms, tree targs, tree parm, tree arg)
{
tree rval;
tree arg_binfo;
@@ -9350,8 +9230,7 @@ get_template_base (tparms, targs, parm, arg)
/* Returns the level of DECL, which declares a template parameter. */
static int
-template_decl_level (decl)
- tree decl;
+template_decl_level (tree decl)
{
switch (TREE_CODE (decl))
{
@@ -9373,10 +9252,7 @@ template_decl_level (decl)
Returns nonzero iff the unification is OK on that basis.*/
static int
-check_cv_quals_for_unify (strict, arg, parm)
- int strict;
- tree arg;
- tree parm;
+check_cv_quals_for_unify (int strict, tree arg, tree parm)
{
int arg_quals = cp_type_quals (arg);
int parm_quals = cp_type_quals (parm);
@@ -9443,9 +9319,7 @@ check_cv_quals_for_unify (strict, arg, parm)
folding PARM. */
static int
-unify (tparms, targs, parm, arg, strict)
- tree tparms, targs, parm, arg;
- int strict;
+unify (tree tparms, tree targs, tree parm, tree arg, int strict)
{
int idx;
tree targ;
@@ -9638,22 +9512,14 @@ unify (tparms, targs, parm, arg, strict)
!= template_decl_level (tparm))
/* The PARM is not one we're trying to unify. Just check
to see if it matches ARG. */
- return (TREE_CODE (arg) == TREE_CODE (parm)
- && cp_tree_equal (parm, arg) > 0) ? 0 : 1;
+ return !(TREE_CODE (arg) == TREE_CODE (parm)
+ && cp_tree_equal (parm, arg));
idx = TEMPLATE_PARM_IDX (parm);
targ = TREE_VEC_ELT (targs, idx);
if (targ)
- {
- int i = (cp_tree_equal (targ, arg) > 0);
- if (i == 1)
- return 0;
- else if (i == 0)
- return 1;
- else
- abort ();
- }
+ return !cp_tree_equal (targ, arg);
/* [temp.deduct.type] If, in the declaration of a function template
with a non-type template-parameter, the non-type
@@ -9952,9 +9818,7 @@ unify (tparms, targs, parm, arg, strict)
instantiation of RESULT has been assigned to this file. */
void
-mark_decl_instantiated (result, extern_p)
- tree result;
- int extern_p;
+mark_decl_instantiated (tree result, int extern_p)
{
/* We used to set this unconditionally; we moved that to
do_decl_instantiation so it wouldn't get set on members of
@@ -10006,10 +9870,7 @@ mark_decl_instantiated (result, extern_p)
LEN is passed through to fn_type_unification. */
int
-more_specialized (pat1, pat2, deduce, len)
- tree pat1, pat2;
- int deduce;
- int len;
+more_specialized (tree pat1, tree pat2, int deduce, int len)
{
tree targs;
int winner = 0;
@@ -10034,8 +9895,7 @@ more_specialized (pat1, pat2, deduce, len)
0 if neither is more specialized. */
int
-more_specialized_class (pat1, pat2)
- tree pat1, pat2;
+more_specialized_class (tree pat1, tree pat2)
{
tree targs;
int winner = 0;
@@ -10060,9 +9920,12 @@ more_specialized_class (pat1, pat2)
found. DEDUCE and LEN are passed through to fn_type_unification. */
static tree
-get_bindings_real (fn, decl, explicit_args, check_rettype, deduce, len)
- tree fn, decl, explicit_args;
- int check_rettype, deduce, len;
+get_bindings_real (tree fn,
+ tree decl,
+ tree explicit_args,
+ int check_rettype,
+ int deduce,
+ int len)
{
int ntparms = DECL_NTPARMS (fn);
tree targs = make_tree_vec (ntparms);
@@ -10117,8 +9980,7 @@ get_bindings_real (fn, decl, explicit_args, check_rettype, deduce, len)
/* For most uses, we want to check the return type. */
tree
-get_bindings (fn, decl, explicit_args)
- tree fn, decl, explicit_args;
+get_bindings (tree fn, tree decl, tree explicit_args)
{
return get_bindings_real (fn, decl, explicit_args, 1, DEDUCE_EXACT, -1);
}
@@ -10127,8 +9989,7 @@ get_bindings (fn, decl, explicit_args)
types. */
static tree
-get_bindings_overload (fn, decl, explicit_args)
- tree fn, decl, explicit_args;
+get_bindings_overload (tree fn, tree decl, tree explicit_args)
{
return get_bindings_real (fn, decl, explicit_args, 0, DEDUCE_EXACT, -1);
}
@@ -10149,8 +10010,7 @@ get_bindings_overload (fn, decl, explicit_args)
is bound to `double'. */
static tree
-get_class_bindings (tparms, parms, args)
- tree tparms, parms, args;
+get_class_bindings (tree tparms, tree parms, tree args)
{
int i, ntparms = TREE_VEC_LENGTH (tparms);
tree vec = make_tree_vec (ntparms);
@@ -10177,8 +10037,7 @@ get_class_bindings (tparms, parms, args)
NULL_TREE is returned. */
tree
-most_specialized_instantiation (instantiations)
- tree instantiations;
+most_specialized_instantiation (tree instantiations)
{
tree fn, champ;
int fate;
@@ -10221,8 +10080,7 @@ most_specialized_instantiation (instantiations)
arguments EXPLICIT_ARGS. */
static tree
-most_specialized (fns, decl, explicit_args)
- tree fns, decl, explicit_args;
+most_specialized (tree fns, tree decl, tree explicit_args)
{
tree candidates = NULL_TREE;
tree fn, args;
@@ -10256,8 +10114,7 @@ most_specialized (fns, decl, explicit_args)
`template <class T> template <class U> S<T*>::f(U)'. */
tree
-most_general_template (decl)
- tree decl;
+most_general_template (tree decl)
{
/* If DECL is a FUNCTION_DECL, find the TEMPLATE_DECL of which it is
an immediate specialization. */
@@ -10303,9 +10160,7 @@ most_general_template (decl)
error_mark_node if the choice is ambiguous. */
static tree
-most_specialized_class (tmpl, args)
- tree tmpl;
- tree args;
+most_specialized_class (tree tmpl, tree args)
{
tree list = NULL_TREE;
tree t;
@@ -10470,9 +10325,7 @@ do_decl_instantiation (tree decl, tree storage)
}
void
-mark_class_instantiated (t, extern_p)
- tree t;
- int extern_p;
+mark_class_instantiated (tree t, int extern_p)
{
SET_CLASSTYPE_EXPLICIT_INSTANTIATION (t);
SET_CLASSTYPE_INTERFACE_KNOWN (t);
@@ -10503,9 +10356,7 @@ bt_instantiate_type_proc (binding_entry entry, void *data)
since the standard is unclear (as detailed below). */
void
-do_type_instantiation (t, storage, complain)
- tree t, storage;
- tsubst_flags_t complain;
+do_type_instantiation (tree t, tree storage, tsubst_flags_t complain)
{
int extern_p = 0;
int nomem_p = 0;
@@ -10664,9 +10515,7 @@ do_type_instantiation (t, storage, complain)
to instantiate the DECL, we regenerate it. */
static void
-regenerate_decl_from_template (decl, tmpl)
- tree decl;
- tree tmpl;
+regenerate_decl_from_template (tree decl, tree tmpl)
{
/* The most general version of TMPL. */
tree gen_tmpl;
@@ -10799,9 +10648,7 @@ template_for_substitution (tree decl)
instantiation now; we just have to do it sometime. */
tree
-instantiate_decl (d, defer_ok)
- tree d;
- int defer_ok;
+instantiate_decl (tree d, int defer_ok)
{
tree tmpl = DECL_TI_TEMPLATE (d);
tree gen_args;
@@ -11115,7 +10962,7 @@ out:
instantiate, and instantiate any we can. */
int
-instantiate_pending_templates ()
+instantiate_pending_templates (void)
{
tree *t;
tree last = NULL_TREE;
@@ -11204,8 +11051,7 @@ instantiate_pending_templates ()
instantiate_decl. */
static tree
-tsubst_initializer_list (t, argvec)
- tree t, argvec;
+tsubst_initializer_list (tree t, tree argvec)
{
tree inits = NULL_TREE;
@@ -11246,8 +11092,7 @@ tsubst_initializer_list (t, argvec)
/* Set CURRENT_ACCESS_SPECIFIER based on the protection of DECL. */
static void
-set_current_access_from_decl (decl)
- tree decl;
+set_current_access_from_decl (tree decl)
{
if (TREE_PRIVATE (decl))
current_access_specifier = access_private_node;
@@ -11262,10 +11107,7 @@ set_current_access_from_decl (decl)
start_enum) and ARGS are the template arguments to use. */
static void
-tsubst_enum (tag, newtag, args)
- tree tag;
- tree newtag;
- tree args;
+tsubst_enum (tree tag, tree newtag, tree args)
{
tree e;
@@ -11297,8 +11139,7 @@ tsubst_enum (tag, newtag, args)
the type. */
tree
-get_mostly_instantiated_function_type (decl)
- tree decl;
+get_mostly_instantiated_function_type (tree decl)
{
tree fn_type;
tree tmpl;
@@ -11362,20 +11203,20 @@ get_mostly_instantiated_function_type (decl)
/* Return truthvalue if we're processing a template different from
the last one involved in diagnostics. */
int
-problematic_instantiation_changed ()
+problematic_instantiation_changed (void)
{
return last_template_error_tick != tinst_level_tick;
}
/* Remember current template involved in diagnostics. */
void
-record_last_problematic_instantiation ()
+record_last_problematic_instantiation (void)
{
last_template_error_tick = tinst_level_tick;
}
tree
-current_instantiation ()
+current_instantiation (void)
{
return current_tinst_level;
}
@@ -11385,9 +11226,7 @@ current_instantiation ()
warning messages under control of COMPLAIN. */
static int
-invalid_nontype_parm_type_p (type, complain)
- tree type;
- tsubst_flags_t complain;
+invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
{
if (INTEGRAL_TYPE_P (type))
return 0;
@@ -11547,8 +11386,8 @@ value_dependent_expression_p (tree expression)
/* A name declared with a dependent type. */
if (TREE_CODE (expression) == LOOKUP_EXPR
- || (DECL_P (expression)
- && dependent_type_p (TREE_TYPE (expression))))
+ || (DECL_P (expression)
+ && type_dependent_expression_p (expression)))
return true;
/* A non-type template parameter. */
if ((TREE_CODE (expression) == CONST_DECL
@@ -11618,8 +11457,7 @@ value_dependent_expression_p (tree expression)
[temp.dep.expr]. */
bool
-type_dependent_expression_p (expression)
- tree expression;
+type_dependent_expression_p (tree expression)
{
if (!processing_template_decl)
return false;
@@ -11798,13 +11636,4 @@ resolve_typename_type (tree type, bool only_current_p)
return type;
}
-tree
-resolve_typename_type_in_current_instantiation (tree type)
-{
- tree t;
-
- t = resolve_typename_type (type, /*only_current_p=*/true);
- return (t != error_mark_node) ? t : type;
-}
-
#include "gt-cp-pt.h"
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index ac117fa1ed9..74b7c90689c 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -364,9 +364,8 @@ get_tinfo_decl (tree type)
DECL_EXTERNAL (d) = 1;
SET_DECL_ASSEMBLER_NAME (d, name);
DECL_COMDAT (d) = 1;
- cp_finish_decl (d, NULL_TREE, NULL_TREE, 0);
- pushdecl_top_level (d);
+ pushdecl_top_level_and_finish (d, NULL_TREE);
if (CLASS_TYPE_P (type))
CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type)) = d;
@@ -388,8 +387,11 @@ get_tinfo_decl (tree type)
static tree
get_tinfo_ptr (tree type)
{
+ tree decl = get_tinfo_decl (type);
+
+ mark_used (decl);
return build_nop (type_info_ptr_type,
- build_address (get_tinfo_decl (type)));
+ build_address (decl));
}
/* Return the type_info object for TYPE. */
@@ -613,8 +615,12 @@ build_dynamic_cast_1 (tree type, tree expr)
target_type = TYPE_MAIN_VARIANT (TREE_TYPE (type));
static_type = TYPE_MAIN_VARIANT (TREE_TYPE (exprtype));
- td2 = build_unary_op (ADDR_EXPR, get_tinfo_decl (target_type), 0);
- td3 = build_unary_op (ADDR_EXPR, get_tinfo_decl (static_type), 0);
+ td2 = get_tinfo_decl (target_type);
+ mark_used (td2);
+ td2 = build_unary_op (ADDR_EXPR, td2, 0);
+ td3 = get_tinfo_decl (static_type);
+ mark_used (td3);
+ td3 = build_unary_op (ADDR_EXPR, td3, 0);
/* Determine how T and V are related. */
boff = get_dynamic_cast_base_type (static_type, target_type);
@@ -770,8 +776,8 @@ tinfo_base_init (tree desc, tree target)
SET_DECL_ASSEMBLER_NAME (name_decl,
mangle_typeinfo_string_for_type (target));
DECL_INITIAL (name_decl) = name_string;
- cp_finish_decl (name_decl, name_string, NULL_TREE, 0);
- pushdecl_top_level (name_decl);
+ mark_used (name_decl);
+ pushdecl_top_level_and_finish (name_decl, name_string);
}
vtable_ptr = TINFO_VTABLE_DECL (desc);
@@ -1463,6 +1469,7 @@ emit_tinfo_decl (tree decl)
DECL_COMDAT (decl) = 0;
DECL_INITIAL (decl) = var_init;
+ mark_used (decl);
cp_finish_decl (decl, var_init, NULL_TREE, 0);
/* cp_finish_decl will have dealt with linkage. */
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 7bab0b1e0ba..84df08088ee 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -188,8 +188,6 @@ lookup_base_r (tree binfo, tree base, base_access access,
found = bk_same_type;
if (is_virtual)
found = bk_via_virtual;
- if (is_non_public)
- found = bk_inaccessible;
if (!*binfo_ptr)
*binfo_ptr = binfo;
@@ -317,30 +315,62 @@ lookup_base (tree t, tree base, base_access access, base_kind *kind_ptr)
bk = lookup_base_r (t_binfo, base, access & ~ba_quiet,
0, 0, 0, &binfo);
- switch (bk)
- {
- case bk_inaccessible:
- binfo = NULL_TREE;
- if (!(access & ba_quiet))
- {
- error ("`%T' is an inaccessible base of `%T'", base, t);
- binfo = error_mark_node;
- }
- break;
- case bk_ambig:
- if (access != ba_any)
- {
- binfo = NULL_TREE;
- if (!(access & ba_quiet))
- {
- error ("`%T' is an ambiguous base of `%T'", base, t);
- binfo = error_mark_node;
- }
- }
- break;
- default:;
- }
-
+ /* Check that the base is unambiguous and accessible. */
+ if (access != ba_any)
+ switch (bk)
+ {
+ case bk_not_base:
+ break;
+
+ case bk_ambig:
+ binfo = NULL_TREE;
+ if (!(access & ba_quiet))
+ {
+ error ("`%T' is an ambiguous base of `%T'", base, t);
+ binfo = error_mark_node;
+ }
+ break;
+
+ default:
+ if (access != ba_ignore
+ /* If BASE is incomplete, then BASE and TYPE are probably
+ the same, in which case BASE is accessible. If they
+ are not the same, then TYPE is invalid. In that case,
+ there's no need to issue another error here, and
+ there's no implicit typedef to use in the code that
+ follows, so we skip the check. */
+ && COMPLETE_TYPE_P (base))
+ {
+ tree decl;
+
+ /* [class.access.base]
+
+ A base class is said to be accessible if an invented public
+ member of the base class is accessible. */
+ /* Rather than inventing a public member, we use the implicit
+ public typedef created in the scope of every class. */
+ decl = TYPE_FIELDS (base);
+ while (TREE_CODE (decl) != TYPE_DECL
+ || !DECL_ARTIFICIAL (decl)
+ || DECL_NAME (decl) != constructor_name (base))
+ decl = TREE_CHAIN (decl);
+ while (ANON_AGGR_TYPE_P (t))
+ t = TYPE_CONTEXT (t);
+ if (!accessible_p (t, decl))
+ {
+ if (!(access & ba_quiet))
+ {
+ error ("`%T' is an inaccessible base of `%T'", base, t);
+ binfo = error_mark_node;
+ }
+ else
+ binfo = NULL_TREE;
+ bk = bk_inaccessible;
+ }
+ }
+ break;
+ }
+
if (kind_ptr)
*kind_ptr = bk;
@@ -788,7 +818,7 @@ dfs_accessible_p (tree binfo, void *data)
}
/* Returns nonzero if it is OK to access DECL through an object
- indiated by BINFO in the context of DERIVED. */
+ indicated by BINFO in the context of DERIVED. */
static int
protected_accessible_p (tree decl, tree derived, tree binfo)
@@ -1226,35 +1256,31 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type)
const char *errstr = 0;
- /* Sanity check. */
- if (TREE_CODE (name) != IDENTIFIER_NODE)
- abort ();
-
- if (xbasetype == current_class_type && TYPE_BEING_DEFINED (xbasetype)
- && IDENTIFIER_CLASS_VALUE (name))
- {
- tree field = IDENTIFIER_CLASS_VALUE (name);
- if (! is_overloaded_fn (field)
- && ! (want_type && TREE_CODE (field) != TYPE_DECL))
- /* We're in the scope of this class, and the value has already
- been looked up. Just return the cached value. */
- return field;
- }
+ my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 20030624);
if (TREE_CODE (xbasetype) == TREE_VEC)
{
type = BINFO_TYPE (xbasetype);
basetype_path = xbasetype;
}
- else if (IS_AGGR_TYPE_CODE (TREE_CODE (xbasetype)))
+ else
{
+ my_friendly_assert (IS_AGGR_TYPE_CODE (TREE_CODE (xbasetype)), 20030624);
type = xbasetype;
basetype_path = TYPE_BINFO (type);
- my_friendly_assert (BINFO_INHERITANCE_CHAIN (basetype_path) == NULL_TREE,
- 980827);
+ my_friendly_assert (!BINFO_INHERITANCE_CHAIN (basetype_path), 980827);
+ }
+
+ if (type == current_class_type && TYPE_BEING_DEFINED (type)
+ && IDENTIFIER_CLASS_VALUE (name))
+ {
+ tree field = IDENTIFIER_CLASS_VALUE (name);
+ if (! is_overloaded_fn (field)
+ && ! (want_type && TREE_CODE (field) != TYPE_DECL))
+ /* We're in the scope of this class, and the value has already
+ been looked up. Just return the cached value. */
+ return field;
}
- else
- abort ();
complete_type (type);
@@ -1262,7 +1288,7 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type)
n_calls_lookup_field++;
#endif /* GATHER_STATISTICS */
- memset ((PTR) &lfi, 0, sizeof (lfi));
+ memset (&lfi, 0, sizeof (lfi));
lfi.type = type;
lfi.name = name;
lfi.want_type = want_type;
@@ -1291,7 +1317,7 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type)
In the case of overloaded function names, access control is
applied to the function selected by overloaded resolution. */
if (rval && protect && !is_overloaded_fn (rval))
- perform_or_defer_access_check (xbasetype, rval);
+ perform_or_defer_access_check (basetype_path, rval);
if (errstr && protect)
{
@@ -1338,99 +1364,144 @@ lookup_fnfields (tree xbasetype, tree name, int protect)
return rval;
}
+/* Return the index in the CLASSTYPE_METHOD_VEC for CLASS_TYPE
+ corresponding to "operator TYPE ()", or -1 if there is no such
+ operator. Only CLASS_TYPE itself is searched; this routine does
+ not scan the base classes of CLASS_TYPE. */
+
+static int
+lookup_conversion_operator (tree class_type, tree type)
+{
+ int pass;
+ int i;
+
+ tree methods = CLASSTYPE_METHOD_VEC (class_type);
+
+ for (pass = 0; pass < 2; ++pass)
+ for (i = CLASSTYPE_FIRST_CONVERSION_SLOT;
+ i < TREE_VEC_LENGTH (methods);
+ ++i)
+ {
+ tree fn = TREE_VEC_ELT (methods, i);
+ /* The size of the vector may have some unused slots at the
+ end. */
+ if (!fn)
+ break;
+
+ /* All the conversion operators come near the beginning of the
+ class. Therefore, if FN is not a conversion operator, there
+ is no matching conversion operator in CLASS_TYPE. */
+ fn = OVL_CURRENT (fn);
+ if (!DECL_CONV_FN_P (fn))
+ break;
+
+ if (pass == 0)
+ {
+ /* On the first pass we only consider exact matches. If
+ the types match, this slot is the one where the right
+ conversion operators can be found. */
+ if (TREE_CODE (fn) != TEMPLATE_DECL
+ && same_type_p (DECL_CONV_FN_TYPE (fn), type))
+ return i;
+ }
+ else
+ {
+ /* On the second pass we look for template conversion
+ operators. It may be possible to instantiate the
+ template to get the type desired. All of the template
+ conversion operators share a slot. By looking for
+ templates second we ensure that specializations are
+ preferred over templates. */
+ if (TREE_CODE (fn) == TEMPLATE_DECL)
+ return i;
+ }
+ }
+
+ return -1;
+}
+
/* TYPE is a class type. Return the index of the fields within
the method vector with name NAME, or -1 is no such field exists. */
int
lookup_fnfields_1 (tree type, tree name)
{
- tree method_vec = (CLASS_TYPE_P (type)
- ? CLASSTYPE_METHOD_VEC (type)
- : NULL_TREE);
+ tree method_vec;
+ tree *methods;
+ tree tmp;
+ int i;
+ int len;
- if (method_vec != 0)
- {
- register int i;
- register tree *methods = &TREE_VEC_ELT (method_vec, 0);
- int len = TREE_VEC_LENGTH (method_vec);
- tree tmp;
+ if (!CLASS_TYPE_P (type))
+ return -1;
-#ifdef GATHER_STATISTICS
- n_calls_lookup_fnfields_1++;
-#endif /* GATHER_STATISTICS */
+ method_vec = CLASSTYPE_METHOD_VEC (type);
+
+ if (!method_vec)
+ return -1;
+
+ methods = &TREE_VEC_ELT (method_vec, 0);
+ len = TREE_VEC_LENGTH (method_vec);
- /* Constructors are first... */
- if (name == ctor_identifier)
- return (methods[CLASSTYPE_CONSTRUCTOR_SLOT]
- ? CLASSTYPE_CONSTRUCTOR_SLOT : -1);
- /* and destructors are second. */
- if (name == dtor_identifier)
- return (methods[CLASSTYPE_DESTRUCTOR_SLOT]
- ? CLASSTYPE_DESTRUCTOR_SLOT : -1);
-
- for (i = CLASSTYPE_FIRST_CONVERSION_SLOT;
- i < len && methods[i];
- ++i)
- {
#ifdef GATHER_STATISTICS
- n_outer_fields_searched++;
+ n_calls_lookup_fnfields_1++;
#endif /* GATHER_STATISTICS */
- tmp = OVL_CURRENT (methods[i]);
- if (DECL_NAME (tmp) == name)
- return i;
-
- /* If the type is complete and we're past the conversion ops,
- switch to binary search. */
- if (! DECL_CONV_FN_P (tmp)
- && COMPLETE_TYPE_P (type))
- {
- int lo = i + 1, hi = len;
+ /* Constructors are first... */
+ if (name == ctor_identifier)
+ return (methods[CLASSTYPE_CONSTRUCTOR_SLOT]
+ ? CLASSTYPE_CONSTRUCTOR_SLOT : -1);
+ /* and destructors are second. */
+ if (name == dtor_identifier)
+ return (methods[CLASSTYPE_DESTRUCTOR_SLOT]
+ ? CLASSTYPE_DESTRUCTOR_SLOT : -1);
+ if (IDENTIFIER_TYPENAME_P (name))
+ return lookup_conversion_operator (type, TREE_TYPE (name));
+
+ /* Skip the conversion operators. */
+ i = CLASSTYPE_FIRST_CONVERSION_SLOT;
+ while (i < len && methods[i] && DECL_CONV_FN_P (OVL_CURRENT (methods[i])))
+ i++;
+
+ /* If the type is complete, use binary search. */
+ if (COMPLETE_TYPE_P (type))
+ {
+ int lo = i;
+ int hi = len;
- while (lo < hi)
- {
- i = (lo + hi) / 2;
+ while (lo < hi)
+ {
+ i = (lo + hi) / 2;
#ifdef GATHER_STATISTICS
- n_outer_fields_searched++;
+ n_outer_fields_searched++;
#endif /* GATHER_STATISTICS */
- tmp = methods[i];
- /* This slot may be empty; we allocate more slots
- than we need. In that case, the entry we're
- looking for is closer to the beginning of the
- list. */
- if (tmp)
- tmp = DECL_NAME (OVL_CURRENT (tmp));
- if (!tmp || tmp > name)
- hi = i;
- else if (tmp < name)
- lo = i + 1;
- else
- return i;
- }
- break;
- }
- }
-
- /* If we didn't find it, it might have been a template
- conversion operator to a templated type. If there are any,
- such template conversion operators will all be overloaded on
- the first conversion slot. (Note that we don't look for this
- case above so that we will always find specializations
- first.) */
- if (IDENTIFIER_TYPENAME_P (name))
- {
- i = CLASSTYPE_FIRST_CONVERSION_SLOT;
- if (i < len && methods[i])
- {
- tmp = OVL_CURRENT (methods[i]);
- if (TREE_CODE (tmp) == TEMPLATE_DECL
- && DECL_TEMPLATE_CONV_FN_P (tmp))
- return i;
- }
+ tmp = methods[i];
+ /* This slot may be empty; we allocate more slots than we
+ need. In that case, the entry we're looking for is
+ closer to the beginning of the list. */
+ if (tmp)
+ tmp = DECL_NAME (OVL_CURRENT (tmp));
+ if (!tmp || tmp > name)
+ hi = i;
+ else if (tmp < name)
+ lo = i + 1;
+ else
+ return i;
}
}
+ else
+ for (; i < len && methods[i]; ++i)
+ {
+#ifdef GATHER_STATISTICS
+ n_outer_fields_searched++;
+#endif /* GATHER_STATISTICS */
+
+ tmp = OVL_CURRENT (methods[i]);
+ if (DECL_NAME (tmp) == name)
+ return i;
+ }
return -1;
}
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 31f94242437..3272284d9c7 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -51,16 +51,16 @@
parsing into this file; that will make implementing the new parser
much easier since it will be able to make use of these routines. */
-static tree maybe_convert_cond PARAMS ((tree));
-static tree simplify_aggr_init_exprs_r PARAMS ((tree *, int *, void *));
-static void emit_associated_thunks PARAMS ((tree));
-static void genrtl_try_block PARAMS ((tree));
-static void genrtl_eh_spec_block PARAMS ((tree));
-static void genrtl_handler PARAMS ((tree));
-static void cp_expand_stmt PARAMS ((tree));
-static void genrtl_start_function PARAMS ((tree));
-static void genrtl_finish_function PARAMS ((tree));
-static tree clear_decl_rtl PARAMS ((tree *, int *, void *));
+static tree maybe_convert_cond (tree);
+static tree simplify_aggr_init_exprs_r (tree *, int *, void *);
+static void emit_associated_thunks (tree);
+static void genrtl_try_block (tree);
+static void genrtl_eh_spec_block (tree);
+static void genrtl_handler (tree);
+static void cp_expand_stmt (tree);
+static void genrtl_start_function (tree);
+static void genrtl_finish_function (tree);
+static tree clear_decl_rtl (tree *, int *, void *);
/* Finish processing the COND, the SUBSTMT condition for STMT. */
@@ -262,16 +262,18 @@ void perform_deferred_access_checks (void)
}
/* Defer checking the accessibility of DECL, when looked up in
- CLASS_TYPE. */
+ BINFO. */
-void perform_or_defer_access_check (tree class_type, tree decl)
+void perform_or_defer_access_check (tree binfo, tree decl)
{
tree check;
+ my_friendly_assert (TREE_CODE (binfo) == TREE_VEC, 20030623);
+
/* If we are not supposed to defer access checks, just check now. */
if (deferred_access_stack->deferring_access_checks_kind == dk_no_deferred)
{
- enforce_access (class_type, decl);
+ enforce_access (binfo, decl);
return;
}
/* Exit if we are in a context that no access checking is performed. */
@@ -282,13 +284,11 @@ void perform_or_defer_access_check (tree class_type, tree decl)
for (check = deferred_access_stack->deferred_access_checks;
check;
check = TREE_CHAIN (check))
- if (TREE_VALUE (check) == decl
- && TYPE_P (TREE_PURPOSE (check))
- && same_type_p (TREE_PURPOSE (check), class_type))
+ if (TREE_VALUE (check) == decl && TREE_PURPOSE (check) == binfo)
return;
/* If not, record the check. */
deferred_access_stack->deferred_access_checks
- = tree_cons (class_type, decl,
+ = tree_cons (binfo, decl,
deferred_access_stack->deferred_access_checks);
}
@@ -297,7 +297,7 @@ void perform_or_defer_access_check (tree class_type, tree decl)
at the end of the statement. */
int
-stmts_are_full_exprs_p ()
+stmts_are_full_exprs_p (void)
{
return current_stmt_tree ()->stmts_are_full_exprs_p;
}
@@ -307,7 +307,7 @@ stmts_are_full_exprs_p ()
returned. */
stmt_tree
-current_stmt_tree ()
+current_stmt_tree (void)
{
return (cfun
? &cfun->language->base.x_stmt_tree
@@ -319,8 +319,7 @@ current_stmt_tree ()
declared is not an anonymous union" [class.union]. */
int
-anon_aggr_type_p (node)
- tree node;
+anon_aggr_type_p (tree node)
{
return ANON_AGGR_TYPE_P (node);
}
@@ -328,7 +327,7 @@ anon_aggr_type_p (node)
/* Finish a scope. */
tree
-do_poplevel ()
+do_poplevel (void)
{
tree block = NULL_TREE;
@@ -369,8 +368,7 @@ do_pushlevel (scope_kind sk)
/* Finish a goto-statement. */
tree
-finish_goto_stmt (destination)
- tree destination;
+finish_goto_stmt (tree destination)
{
if (TREE_CODE (destination) == IDENTIFIER_NODE)
destination = lookup_label (destination);
@@ -396,8 +394,7 @@ finish_goto_stmt (destination)
statement. Convert it to a boolean value, if appropriate. */
tree
-maybe_convert_cond (cond)
- tree cond;
+maybe_convert_cond (tree cond)
{
/* Empty conditions remain empty. */
if (!cond)
@@ -415,8 +412,7 @@ maybe_convert_cond (cond)
/* Finish an expression-statement, whose EXPRESSION is as indicated. */
tree
-finish_expr_stmt (expr)
- tree expr;
+finish_expr_stmt (tree expr)
{
tree r = NULL_TREE;
tree expr_type = NULL_TREE;;
@@ -453,7 +449,7 @@ finish_expr_stmt (expr)
appropriate. */
tree
-begin_if_stmt ()
+begin_if_stmt (void)
{
tree r;
do_pushlevel (sk_block);
@@ -466,9 +462,7 @@ begin_if_stmt ()
IF_STMT. */
void
-finish_if_stmt_cond (cond, if_stmt)
- tree cond;
- tree if_stmt;
+finish_if_stmt_cond (tree cond, tree if_stmt)
{
cond = maybe_convert_cond (cond);
FINISH_COND (cond, if_stmt, IF_COND (if_stmt));
@@ -478,8 +472,7 @@ finish_if_stmt_cond (cond, if_stmt)
IF_STMT. */
tree
-finish_then_clause (if_stmt)
- tree if_stmt;
+finish_then_clause (tree if_stmt)
{
RECHAIN_STMTS (if_stmt, THEN_CLAUSE (if_stmt));
return if_stmt;
@@ -488,7 +481,7 @@ finish_then_clause (if_stmt)
/* Begin the else-clause of an if-statement. */
void
-begin_else_clause ()
+begin_else_clause (void)
{
}
@@ -496,8 +489,7 @@ begin_else_clause ()
IF_STMT. */
void
-finish_else_clause (if_stmt)
- tree if_stmt;
+finish_else_clause (tree if_stmt)
{
RECHAIN_STMTS (if_stmt, ELSE_CLAUSE (if_stmt));
}
@@ -505,7 +497,7 @@ finish_else_clause (if_stmt)
/* Finish an if-statement. */
void
-finish_if_stmt ()
+finish_if_stmt (void)
{
finish_stmt ();
do_poplevel ();
@@ -515,7 +507,7 @@ finish_if_stmt ()
appropriate. */
tree
-begin_while_stmt ()
+begin_while_stmt (void)
{
tree r;
r = build_stmt (WHILE_STMT, NULL_TREE, NULL_TREE);
@@ -528,9 +520,7 @@ begin_while_stmt ()
WHILE_STMT. */
void
-finish_while_stmt_cond (cond, while_stmt)
- tree cond;
- tree while_stmt;
+finish_while_stmt_cond (tree cond, tree while_stmt)
{
cond = maybe_convert_cond (cond);
if (processing_template_decl)
@@ -561,8 +551,7 @@ finish_while_stmt_cond (cond, while_stmt)
/* Finish a while-statement, which may be given by WHILE_STMT. */
void
-finish_while_stmt (while_stmt)
- tree while_stmt;
+finish_while_stmt (tree while_stmt)
{
do_poplevel ();
RECHAIN_STMTS (while_stmt, WHILE_BODY (while_stmt));
@@ -573,7 +562,7 @@ finish_while_stmt (while_stmt)
appropriate. */
tree
-begin_do_stmt ()
+begin_do_stmt (void)
{
tree r = build_stmt (DO_STMT, NULL_TREE, NULL_TREE);
add_stmt (r);
@@ -583,8 +572,7 @@ begin_do_stmt ()
/* Finish the body of a do-statement, which may be given by DO_STMT. */
void
-finish_do_body (do_stmt)
- tree do_stmt;
+finish_do_body (tree do_stmt)
{
RECHAIN_STMTS (do_stmt, DO_BODY (do_stmt));
}
@@ -593,9 +581,7 @@ finish_do_body (do_stmt)
COND is as indicated. */
void
-finish_do_stmt (cond, do_stmt)
- tree cond;
- tree do_stmt;
+finish_do_stmt (tree cond, tree do_stmt)
{
cond = maybe_convert_cond (cond);
DO_COND (do_stmt) = cond;
@@ -606,8 +592,7 @@ finish_do_stmt (cond, do_stmt)
indicated. */
tree
-finish_return_stmt (expr)
- tree expr;
+finish_return_stmt (tree expr)
{
tree r;
@@ -632,7 +617,7 @@ finish_return_stmt (expr)
/* Begin a for-statement. Returns a new FOR_STMT if appropriate. */
tree
-begin_for_stmt ()
+begin_for_stmt (void)
{
tree r;
@@ -650,8 +635,7 @@ begin_for_stmt ()
given by FOR_STMT. */
void
-finish_for_init_stmt (for_stmt)
- tree for_stmt;
+finish_for_init_stmt (tree for_stmt)
{
if (last_tree != for_stmt)
RECHAIN_STMTS (for_stmt, FOR_INIT_STMT (for_stmt));
@@ -662,9 +646,7 @@ finish_for_init_stmt (for_stmt)
FOR_STMT. */
void
-finish_for_cond (cond, for_stmt)
- tree cond;
- tree for_stmt;
+finish_for_cond (tree cond, tree for_stmt)
{
cond = maybe_convert_cond (cond);
if (processing_template_decl)
@@ -696,9 +678,7 @@ finish_for_cond (cond, for_stmt)
given by FOR_STMT. */
void
-finish_for_expr (expr, for_stmt)
- tree expr;
- tree for_stmt;
+finish_for_expr (tree expr, tree for_stmt)
{
FOR_EXPR (for_stmt) = expr;
}
@@ -708,8 +688,7 @@ finish_for_expr (expr, for_stmt)
provided. */
void
-finish_for_stmt (for_stmt)
- tree for_stmt;
+finish_for_stmt (tree for_stmt)
{
/* Pop the scope for the body of the loop. */
do_poplevel ();
@@ -722,7 +701,7 @@ finish_for_stmt (for_stmt)
/* Finish a break-statement. */
tree
-finish_break_stmt ()
+finish_break_stmt (void)
{
return add_stmt (build_break_stmt ());
}
@@ -730,7 +709,7 @@ finish_break_stmt ()
/* Finish a continue-statement. */
tree
-finish_continue_stmt ()
+finish_continue_stmt (void)
{
return add_stmt (build_continue_stmt ());
}
@@ -739,7 +718,7 @@ finish_continue_stmt ()
appropriate. */
tree
-begin_switch_stmt ()
+begin_switch_stmt (void)
{
tree r;
do_pushlevel (sk_block);
@@ -751,9 +730,7 @@ begin_switch_stmt ()
/* Finish the cond of a switch-statement. */
void
-finish_switch_cond (cond, switch_stmt)
- tree cond;
- tree switch_stmt;
+finish_switch_cond (tree cond, tree switch_stmt)
{
tree orig_type = NULL;
if (!processing_template_decl)
@@ -795,8 +772,7 @@ finish_switch_cond (cond, switch_stmt)
SWITCH_STMT. The COND to switch on is indicated. */
void
-finish_switch_stmt (switch_stmt)
- tree switch_stmt;
+finish_switch_stmt (tree switch_stmt)
{
RECHAIN_STMTS (switch_stmt, SWITCH_BODY (switch_stmt));
pop_switch ();
@@ -807,8 +783,7 @@ finish_switch_stmt (switch_stmt)
/* Generate the RTL for T, which is a TRY_BLOCK. */
static void
-genrtl_try_block (t)
- tree t;
+genrtl_try_block (tree t)
{
if (CLEANUP_P (t))
{
@@ -844,8 +819,7 @@ genrtl_try_block (t)
/* Generate the RTL for T, which is an EH_SPEC_BLOCK. */
static void
-genrtl_eh_spec_block (t)
- tree t;
+genrtl_eh_spec_block (tree t)
{
expand_eh_region_start ();
expand_stmt (EH_SPEC_STMTS (t));
@@ -860,7 +834,7 @@ genrtl_eh_spec_block (t)
appropriate. */
tree
-begin_try_block ()
+begin_try_block (void)
{
tree r = build_stmt (TRY_BLOCK, NULL_TREE, NULL_TREE);
add_stmt (r);
@@ -870,7 +844,7 @@ begin_try_block ()
/* Likewise, for a function-try-block. */
tree
-begin_function_try_block ()
+begin_function_try_block (void)
{
tree r = build_stmt (TRY_BLOCK, NULL_TREE, NULL_TREE);
FN_TRY_BLOCK_P (r) = 1;
@@ -881,8 +855,7 @@ begin_function_try_block ()
/* Finish a try-block, which may be given by TRY_BLOCK. */
void
-finish_try_block (try_block)
- tree try_block;
+finish_try_block (tree try_block)
{
RECHAIN_STMTS (try_block, TRY_STMTS (try_block));
}
@@ -891,8 +864,7 @@ finish_try_block (try_block)
TRY_BLOCK. */
void
-finish_cleanup_try_block (try_block)
- tree try_block;
+finish_cleanup_try_block (tree try_block)
{
RECHAIN_STMTS (try_block, TRY_STMTS (try_block));
}
@@ -901,9 +873,7 @@ finish_cleanup_try_block (try_block)
by CLEANUP. */
void
-finish_cleanup (cleanup, try_block)
- tree cleanup;
- tree try_block;
+finish_cleanup (tree cleanup, tree try_block)
{
TRY_HANDLERS (try_block) = cleanup;
CLEANUP_P (try_block) = 1;
@@ -912,8 +882,7 @@ finish_cleanup (cleanup, try_block)
/* Likewise, for a function-try-block. */
void
-finish_function_try_block (try_block)
- tree try_block;
+finish_function_try_block (tree try_block)
{
if (TREE_CHAIN (try_block)
&& TREE_CODE (TREE_CHAIN (try_block)) == CTOR_INITIALIZER)
@@ -932,8 +901,7 @@ finish_function_try_block (try_block)
TRY_BLOCK. */
void
-finish_handler_sequence (try_block)
- tree try_block;
+finish_handler_sequence (tree try_block)
{
RECHAIN_STMTS (try_block, TRY_HANDLERS (try_block));
check_handlers (TRY_HANDLERS (try_block));
@@ -942,8 +910,7 @@ finish_handler_sequence (try_block)
/* Likewise, for a function-try-block. */
void
-finish_function_handler_sequence (try_block)
- tree try_block;
+finish_function_handler_sequence (tree try_block)
{
in_function_try_handler = 0;
RECHAIN_STMTS (try_block, TRY_HANDLERS (try_block));
@@ -953,8 +920,7 @@ finish_function_handler_sequence (try_block)
/* Generate the RTL for T, which is a HANDLER. */
static void
-genrtl_handler (t)
- tree t;
+genrtl_handler (tree t)
{
genrtl_do_pushlevel ();
if (!processing_template_decl)
@@ -967,7 +933,7 @@ genrtl_handler (t)
/* Begin a handler. Returns a HANDLER if appropriate. */
tree
-begin_handler ()
+begin_handler (void)
{
tree r;
r = build_stmt (HANDLER, NULL_TREE, NULL_TREE);
@@ -983,9 +949,7 @@ begin_handler ()
if this is a `catch (...)' clause. */
void
-finish_handler_parms (decl, handler)
- tree decl;
- tree handler;
+finish_handler_parms (tree decl, tree handler)
{
tree type = NULL_TREE;
if (processing_template_decl)
@@ -1009,8 +973,7 @@ finish_handler_parms (decl, handler)
the return value from the matching call to finish_handler_parms. */
void
-finish_handler (handler)
- tree handler;
+finish_handler (tree handler)
{
if (!processing_template_decl)
expand_end_catch_block ();
@@ -1023,8 +986,7 @@ finish_handler (handler)
COMPOUND_STMT if appropriate. */
tree
-begin_compound_stmt (has_no_scope)
- int has_no_scope;
+begin_compound_stmt (int has_no_scope)
{
tree r;
int is_try = 0;
@@ -1057,9 +1019,7 @@ begin_compound_stmt (has_no_scope)
a scope. */
tree
-finish_compound_stmt (has_no_scope, compound_stmt)
- int has_no_scope;
- tree compound_stmt;
+finish_compound_stmt (int has_no_scope, tree compound_stmt)
{
tree r;
tree t;
@@ -1087,13 +1047,11 @@ finish_compound_stmt (has_no_scope, compound_stmt)
CLOBBERS. */
tree
-finish_asm_stmt (cv_qualifier, string, output_operands,
- input_operands, clobbers)
- tree cv_qualifier;
- tree string;
- tree output_operands;
- tree input_operands;
- tree clobbers;
+finish_asm_stmt (tree cv_qualifier,
+ tree string,
+ tree output_operands,
+ tree input_operands,
+ tree clobbers)
{
tree r;
tree t;
@@ -1176,8 +1134,7 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
/* Finish a label with the indicated NAME. */
tree
-finish_label_stmt (name)
- tree name;
+finish_label_stmt (tree name)
{
tree decl = define_label (input_filename, input_line, name);
return add_stmt (build_stmt (LABEL_STMT, decl));
@@ -1188,8 +1145,7 @@ finish_label_stmt (name)
is useful when writing code involving statement-expressions. */
void
-finish_label_decl (name)
- tree name;
+finish_label_decl (tree name)
{
tree decl = declare_local_label (name);
add_decl_stmt (decl);
@@ -1198,9 +1154,7 @@ finish_label_decl (name)
/* When DECL goes out of scope, make sure that CLEANUP is executed. */
void
-finish_decl_cleanup (decl, cleanup)
- tree decl;
- tree cleanup;
+finish_decl_cleanup (tree decl, tree cleanup)
{
add_stmt (build_stmt (CLEANUP_STMT, decl, cleanup));
}
@@ -1208,8 +1162,7 @@ finish_decl_cleanup (decl, cleanup)
/* If the current scope exits with an exception, run CLEANUP. */
void
-finish_eh_cleanup (cleanup)
- tree cleanup;
+finish_eh_cleanup (tree cleanup)
{
tree r = build_stmt (CLEANUP_STMT, NULL_TREE, cleanup);
CLEANUP_EH_ONLY (r) = 1;
@@ -1236,7 +1189,7 @@ finish_mem_initializers (tree mem_inits)
/* Returns the stack of SCOPE_STMTs for the current function. */
tree *
-current_scope_stmt_stack ()
+current_scope_stmt_stack (void)
{
return &cfun->language->base.x_scope_stmt_stack;
}
@@ -1244,8 +1197,7 @@ current_scope_stmt_stack ()
/* Finish a parenthesized expression EXPR. */
tree
-finish_parenthesized_expr (expr)
- tree expr;
+finish_parenthesized_expr (tree expr)
{
if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (expr))))
/* This inhibits warnings in c_common_truthvalue_conversion. */
@@ -1303,7 +1255,7 @@ finish_non_static_data_member (tree decl, tree qualifying_scope)
return error_mark_node;
}
- perform_or_defer_access_check (access_type, decl);
+ perform_or_defer_access_check (TYPE_BINFO (access_type), decl);
/* If the data member was named `C::M', convert `*this' to `C'
first. */
@@ -1324,7 +1276,7 @@ finish_non_static_data_member (tree decl, tree qualifying_scope)
finish_stmt_expr. */
tree
-begin_stmt_expr ()
+begin_stmt_expr (void)
{
/* If we're outside a function, we won't have a statement-tree to
work with. But, if we see a statement-expression we need to
@@ -1345,7 +1297,7 @@ begin_stmt_expr ()
function. */
tree
-begin_global_stmt_expr ()
+begin_global_stmt_expr (void)
{
if (! cfun && !last_tree)
begin_stmt_tree (&scope_chain->x_saved_tree);
@@ -1358,8 +1310,7 @@ begin_global_stmt_expr ()
/* Finish the STMT_EXPR last begun with begin_global_stmt_expr. */
tree
-finish_global_stmt_expr (stmt_expr)
- tree stmt_expr;
+finish_global_stmt_expr (tree stmt_expr)
{
stmt_expr = expand_end_stmt_expr (stmt_expr);
@@ -1376,8 +1327,7 @@ finish_global_stmt_expr (stmt_expr)
statement-expression. */
tree
-finish_stmt_expr (rtl_expr)
- tree rtl_expr;
+finish_stmt_expr (tree rtl_expr)
{
tree result;
@@ -1523,9 +1473,7 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual)
POSTDECREMENT_EXPR.) */
tree
-finish_increment_expr (expr, code)
- tree expr;
- enum tree_code code;
+finish_increment_expr (tree expr, enum tree_code code)
{
/* If we get an OFFSET_REF, turn it into what it really means (e.g.,
a COMPONENT_REF). This way if we've got, say, a reference to a
@@ -1540,7 +1488,7 @@ finish_increment_expr (expr, code)
/* Finish a use of `this'. Returns an expression for `this'. */
tree
-finish_this_expr ()
+finish_this_expr (void)
{
tree result;
@@ -1570,10 +1518,7 @@ finish_this_expr ()
FN. Returns an expression for the call. */
tree
-finish_object_call_expr (fn, object, args)
- tree fn;
- tree object;
- tree args;
+finish_object_call_expr (tree fn, tree object, tree args)
{
if (DECL_DECLARES_TYPE_P (fn))
{
@@ -1609,10 +1554,7 @@ finish_object_call_expr (fn, object, args)
arguments to FN. Returns an expression for the call. */
tree
-finish_qualified_object_call_expr (fn, object, args)
- tree fn;
- tree object;
- tree args;
+finish_qualified_object_call_expr (tree fn, tree object, tree args)
{
return build_scoped_method_call (object, TREE_OPERAND (fn, 0),
TREE_OPERAND (fn, 1), args);
@@ -1624,10 +1566,7 @@ finish_qualified_object_call_expr (fn, object, args)
was of the form `OBJECT.SCOPE::~DESTRUCTOR'. */
tree
-finish_pseudo_destructor_expr (object, scope, destructor)
- tree object;
- tree scope;
- tree destructor;
+finish_pseudo_destructor_expr (tree object, tree scope, tree destructor)
{
if (destructor == error_mark_node)
return error_mark_node;
@@ -1655,9 +1594,7 @@ finish_pseudo_destructor_expr (object, scope, destructor)
/* Finish an expression of the form CODE EXPR. */
tree
-finish_unary_op_expr (code, expr)
- enum tree_code code;
- tree expr;
+finish_unary_op_expr (enum tree_code code, tree expr)
{
tree result = build_x_unary_op (code, expr);
/* Inside a template, build_x_unary_op does not fold the
@@ -1676,9 +1613,7 @@ finish_unary_op_expr (code, expr)
the INITIALIZER_LIST is being cast. */
tree
-finish_compound_literal (type, initializer_list)
- tree type;
- tree initializer_list;
+finish_compound_literal (tree type, tree initializer_list)
{
tree compound_literal;
@@ -1724,10 +1659,7 @@ finish_fname (tree id)
valid. */
int
-begin_function_definition (decl_specs, attributes, declarator)
- tree decl_specs;
- tree attributes;
- tree declarator;
+begin_function_definition (tree decl_specs, tree attributes, tree declarator)
{
if (!start_function (decl_specs, declarator, attributes, SF_DEFAULT))
return 0;
@@ -1742,7 +1674,7 @@ begin_function_definition (decl_specs, attributes, declarator)
/* Finish a translation unit. */
void
-finish_translation_unit ()
+finish_translation_unit (void)
{
/* In case there were missing closebraces,
get us back to the global binding level. */
@@ -1758,9 +1690,7 @@ finish_translation_unit ()
Returns the parameter. */
tree
-finish_template_type_parm (aggr, identifier)
- tree aggr;
- tree identifier;
+finish_template_type_parm (tree aggr, tree identifier)
{
if (aggr != class_type_node)
{
@@ -1775,9 +1705,7 @@ finish_template_type_parm (aggr, identifier)
Returns the parameter. */
tree
-finish_template_template_parm (aggr, identifier)
- tree aggr;
- tree identifier;
+finish_template_template_parm (tree aggr, tree identifier)
{
tree decl = build_decl (TYPE_DECL, identifier, NULL_TREE);
tree tmpl = build_lang_decl (TEMPLATE_DECL, identifier, NULL_TREE);
@@ -1814,9 +1742,7 @@ check_template_template_default_arg (tree argument)
nonzero, the parameter list was terminated by a `...'. */
tree
-finish_parmlist (parms, ellipsis)
- tree parms;
- int ellipsis;
+finish_parmlist (tree parms, int ellipsis)
{
if (parms)
{
@@ -1833,8 +1759,7 @@ finish_parmlist (parms, ellipsis)
/* Begin a class definition, as indicated by T. */
tree
-begin_class_definition (t)
- tree t;
+begin_class_definition (tree t)
{
if (t == error_mark_node)
return error_mark_node;
@@ -1903,8 +1828,7 @@ begin_class_definition (t)
/* Finish the member declaration given by DECL. */
void
-finish_member_declaration (decl)
- tree decl;
+finish_member_declaration (tree decl)
{
if (decl == error_mark_node || decl == NULL_TREE)
return;
@@ -1938,8 +1862,6 @@ finish_member_declaration (decl)
if (DECL_LANG_SPECIFIC (decl) && DECL_LANGUAGE (decl) == lang_c)
SET_DECL_LANGUAGE (decl, lang_cplusplus);
- maybe_add_class_template_decl_list (current_class_type, decl, /*friend_p=*/0);
-
/* Put functions on the TYPE_METHODS list and everything else on the
TYPE_FIELDS list. Note that these are built up in reverse order.
We reverse them (to obtain declaration order) in finish_struct. */
@@ -1952,8 +1874,12 @@ finish_member_declaration (decl)
TREE_CHAIN (decl) = TYPE_METHODS (current_class_type);
TYPE_METHODS (current_class_type) = decl;
+
+ maybe_add_class_template_decl_list (current_class_type, decl,
+ /*friend_p=*/0);
}
- else
+ /* Enter the DECL into the scope of the class. */
+ else if (TREE_CODE (decl) == USING_DECL || pushdecl_class_level (decl))
{
/* All TYPE_DECLs go at the end of TYPE_FIELDS. Ordinary fields
go at the beginning. The reason is that lookup_field_1
@@ -1981,9 +1907,8 @@ finish_member_declaration (decl)
TYPE_FIELDS (current_class_type) = decl;
}
- /* Enter the DECL into the scope of the class. */
- if (TREE_CODE (decl) != USING_DECL)
- pushdecl_class_level (decl);
+ maybe_add_class_template_decl_list (current_class_type, decl,
+ /*friend_p=*/0);
}
}
@@ -1992,11 +1917,7 @@ finish_member_declaration (decl)
type. */
tree
-finish_class_definition (t, attributes, semi, pop_scope_p)
- tree t;
- tree attributes;
- int semi;
- int pop_scope_p;
+finish_class_definition (tree t, tree attributes, int semi, int pop_scope_p)
{
if (t == error_mark_node)
return error_mark_node;
@@ -2030,8 +1951,7 @@ finish_class_definition (t, attributes, semi, pop_scope_p)
TYPES whose template parameters are given by PARMS. */
tree
-finish_member_class_template (types)
- tree types;
+finish_member_class_template (tree types)
{
tree t;
@@ -2062,8 +1982,7 @@ finish_member_class_template (types)
the template parameters. */
void
-finish_template_decl (parms)
- tree parms;
+finish_template_decl (tree parms)
{
if (parms)
end_template_decl ();
@@ -2077,10 +1996,7 @@ finish_template_decl (parms)
the scope of template-id indicated. */
tree
-finish_template_type (name, args, entering_scope)
- tree name;
- tree args;
- int entering_scope;
+finish_template_type (tree name, tree args, int entering_scope)
{
tree decl;
@@ -2129,7 +2045,7 @@ finish_base_specifier (tree base, tree access, bool virtual_p)
premitted in this context, an error is issued. */
void
-check_multiple_declarators ()
+check_multiple_declarators (void)
{
/* [temp]
@@ -2154,8 +2070,7 @@ check_multiple_declarators ()
use as a type-specifier. */
tree
-finish_typeof (expr)
- tree expr;
+finish_typeof (tree expr)
{
tree type;
@@ -2184,8 +2099,7 @@ finish_typeof (expr)
/* Compute the value of the `sizeof' operator. */
tree
-finish_sizeof (t)
- tree t;
+finish_sizeof (tree t)
{
return TYPE_P (t) ? cxx_sizeof (t) : expr_sizeof (t);
}
@@ -2194,8 +2108,7 @@ finish_sizeof (t)
alignment of T, measured in bytes. */
tree
-finish_alignof (t)
- tree t;
+finish_alignof (tree t)
{
if (processing_template_decl)
return build_min (ALIGNOF_EXPR, size_type_node, t);
@@ -2207,8 +2120,7 @@ finish_alignof (t)
other statements at its nesting level. */
static void
-cp_expand_stmt (t)
- tree t;
+cp_expand_stmt (tree t)
{
switch (TREE_CODE (t))
{
@@ -2237,10 +2149,9 @@ cp_expand_stmt (t)
will equivalent CALL_EXPRs. */
static tree
-simplify_aggr_init_exprs_r (tp, walk_subtrees, data)
- tree *tp;
- int *walk_subtrees ATTRIBUTE_UNUSED;
- void *data ATTRIBUTE_UNUSED;
+simplify_aggr_init_exprs_r (tree* tp,
+ int* walk_subtrees ATTRIBUTE_UNUSED ,
+ void* data ATTRIBUTE_UNUSED )
{
tree aggr_init_expr;
tree call_expr;
@@ -2335,8 +2246,7 @@ simplify_aggr_init_exprs_r (tp, walk_subtrees, data)
/* Emit all thunks to FN that should be emitted when FN is emitted. */
static void
-emit_associated_thunks (fn)
- tree fn;
+emit_associated_thunks (tree fn)
{
/* When we use vcall offsets, we emit thunks with the virtual
functions to which they thunk. The whole point of vcall offsets
@@ -2365,8 +2275,7 @@ emit_associated_thunks (fn)
/* Generate RTL for FN. */
void
-expand_body (fn)
- tree fn;
+expand_body (tree fn)
{
location_t saved_loc;
tree saved_function;
@@ -2509,10 +2418,7 @@ expand_body (fn)
value optimization. */
tree
-nullify_returns_r (tp, walk_subtrees, data)
- tree *tp;
- int *walk_subtrees;
- void *data;
+nullify_returns_r (tree* tp, int* walk_subtrees, void* data)
{
tree nrv = (tree) data;
@@ -2533,8 +2439,7 @@ nullify_returns_r (tp, walk_subtrees, data)
/* Start generating the RTL for FN. */
static void
-genrtl_start_function (fn)
- tree fn;
+genrtl_start_function (tree fn)
{
/* Tell everybody what function we're processing. */
current_function_decl = fn;
@@ -2595,8 +2500,7 @@ genrtl_start_function (fn)
/* Finish generating the RTL for FN. */
static void
-genrtl_finish_function (fn)
- tree fn;
+genrtl_finish_function (tree fn)
{
tree t;
@@ -2638,7 +2542,7 @@ genrtl_finish_function (fn)
immediate_size_expand = 1;
/* Generate rtl for function exit. */
- expand_function_end (input_filename, input_line, 0);
+ expand_function_end ();
/* If this is a nested function (like a template instantiation that
we're compiling in the midst of compiling something else), push a
@@ -2717,10 +2621,9 @@ genrtl_finish_function (fn)
its sub-blocks. */
static tree
-clear_decl_rtl (tp, walk_subtrees, data)
- tree *tp;
- int *walk_subtrees ATTRIBUTE_UNUSED;
- void *data ATTRIBUTE_UNUSED;
+clear_decl_rtl (tree* tp,
+ int* walk_subtrees ATTRIBUTE_UNUSED ,
+ void* data ATTRIBUTE_UNUSED )
{
if (nonstatic_local_decl_p (*tp))
SET_DECL_RTL (*tp, NULL_RTX);
@@ -2731,7 +2634,7 @@ clear_decl_rtl (tp, walk_subtrees, data)
/* Perform initialization related to this module. */
void
-init_cp_semantics ()
+init_cp_semantics (void)
{
lang_expand_stmt = cp_expand_stmt;
}
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 2e907c0b837..385afcac4c9 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -35,34 +35,33 @@ Boston, MA 02111-1307, USA. */
#include "tree-inline.h"
#include "target.h"
-static tree bot_manip PARAMS ((tree *, int *, void *));
-static tree bot_replace PARAMS ((tree *, int *, void *));
-static tree build_cplus_array_type_1 PARAMS ((tree, tree));
-static int list_hash_eq PARAMS ((const void *, const void *));
-static hashval_t list_hash_pieces PARAMS ((tree, tree, tree));
-static hashval_t list_hash PARAMS ((const void *));
-static cp_lvalue_kind lvalue_p_1 PARAMS ((tree, int, int));
-static tree no_linkage_helper PARAMS ((tree *, int *, void *));
-static tree mark_local_for_remap_r PARAMS ((tree *, int *, void *));
-static tree cp_unsave_r PARAMS ((tree *, int *, void *));
-static tree build_target_expr PARAMS ((tree, tree));
-static tree count_trees_r PARAMS ((tree *, int *, void *));
-static tree verify_stmt_tree_r PARAMS ((tree *, int *, void *));
-static tree find_tree_r PARAMS ((tree *, int *, void *));
-
-static tree handle_java_interface_attribute PARAMS ((tree *, tree, tree, int, bool *));
-static tree handle_com_interface_attribute PARAMS ((tree *, tree, tree, int, bool *));
-static tree handle_init_priority_attribute PARAMS ((tree *, tree, tree, int, bool *));
+static tree bot_manip (tree *, int *, void *);
+static tree bot_replace (tree *, int *, void *);
+static tree build_cplus_array_type_1 (tree, tree);
+static int list_hash_eq (const void *, const void *);
+static hashval_t list_hash_pieces (tree, tree, tree);
+static hashval_t list_hash (const void *);
+static cp_lvalue_kind lvalue_p_1 (tree, int, int);
+static tree no_linkage_helper (tree *, int *, void *);
+static tree mark_local_for_remap_r (tree *, int *, void *);
+static tree cp_unsave_r (tree *, int *, void *);
+static tree build_target_expr (tree, tree);
+static tree count_trees_r (tree *, int *, void *);
+static tree verify_stmt_tree_r (tree *, int *, void *);
+static tree find_tree_r (tree *, int *, void *);
+
+static tree handle_java_interface_attribute (tree *, tree, tree, int, bool *);
+static tree handle_com_interface_attribute (tree *, tree, tree, int, bool *);
+static tree handle_init_priority_attribute (tree *, tree, tree, int, bool *);
/* If REF is an lvalue, returns the kind of lvalue that REF is.
Otherwise, returns clk_none. If TREAT_CLASS_RVALUES_AS_LVALUES is
nonzero, rvalues of class type are considered lvalues. */
static cp_lvalue_kind
-lvalue_p_1 (ref, treat_class_rvalues_as_lvalues, allow_cast_as_lvalue)
- tree ref;
- int treat_class_rvalues_as_lvalues;
- int allow_cast_as_lvalue;
+lvalue_p_1 (tree ref,
+ int treat_class_rvalues_as_lvalues,
+ int allow_cast_as_lvalue)
{
cp_lvalue_kind op1_lvalue_kind = clk_none;
cp_lvalue_kind op2_lvalue_kind = clk_none;
@@ -204,8 +203,7 @@ lvalue_p_1 (ref, treat_class_rvalues_as_lvalues, allow_cast_as_lvalue)
have their address taken, unless they have DECL_REGISTER. */
cp_lvalue_kind
-real_lvalue_p (ref)
- tree ref;
+real_lvalue_p (tree ref)
{
return lvalue_p_1 (ref, /*treat_class_rvalues_as_lvalues=*/ 0, /*cast*/ 1);
}
@@ -226,16 +224,14 @@ real_non_cast_lvalue_p (tree ref)
considered lvalues. */
int
-lvalue_p (ref)
- tree ref;
+lvalue_p (tree ref)
{
return
(lvalue_p_1 (ref, /*class rvalue ok*/ 1, /*cast*/ 1) != clk_none);
}
int
-non_cast_lvalue_p (ref)
- tree ref;
+non_cast_lvalue_p (tree ref)
{
return
(lvalue_p_1 (ref, /*class rvalue ok*/ 1, /*cast*/ 0) != clk_none);
@@ -245,9 +241,7 @@ non_cast_lvalue_p (ref)
otherwise, print an error message and return zero. */
int
-lvalue_or_else (ref, string)
- tree ref;
- const char *string;
+lvalue_or_else (tree ref, const char* string)
{
int ret = lvalue_p_1 (ref, /* class rvalue ok */ 1, /* cast ok */ 1);
int win = (ret != clk_none);
@@ -257,9 +251,7 @@ lvalue_or_else (ref, string)
}
int
-non_cast_lvalue_or_else (ref, string)
- tree ref;
- const char *string;
+non_cast_lvalue_or_else (tree ref, const char* string)
{
int ret = lvalue_p_1 (ref, /* class rvalue ok */ 1, /* cast ok */ 0);
int win = (ret != clk_none);
@@ -271,9 +263,7 @@ non_cast_lvalue_or_else (ref, string)
/* Build a TARGET_EXPR, initializing the DECL with the VALUE. */
static tree
-build_target_expr (decl, value)
- tree decl;
- tree value;
+build_target_expr (tree decl, tree value)
{
tree t;
@@ -296,9 +286,7 @@ build_target_expr (decl, value)
and language-specific expression expanders. */
tree
-build_cplus_new (type, init)
- tree type;
- tree init;
+build_cplus_new (tree type, tree init)
{
tree fn;
tree slot;
@@ -351,9 +339,7 @@ build_cplus_new (type, init)
indicated TYPE. */
tree
-build_target_expr_with_type (init, type)
- tree init;
- tree type;
+build_target_expr_with_type (tree init, tree type)
{
tree slot;
tree rval;
@@ -373,8 +359,7 @@ build_target_expr_with_type (init, type)
/* Like build_target_expr_with_type, but use the type of INIT. */
tree
-get_target_expr (init)
- tree init;
+get_target_expr (tree init)
{
return build_target_expr_with_type (init, TREE_TYPE (init));
}
@@ -384,8 +369,7 @@ get_target_expr (init)
containing CALL_EXPRs. */
tree
-break_out_calls (exp)
- tree exp;
+break_out_calls (tree exp)
{
register tree t1, t2 = NULL_TREE;
register enum tree_code code;
@@ -466,8 +450,7 @@ break_out_calls (exp)
are described by RETTYPE. If each type exists already, reuse it. */
tree
-build_cplus_method_type (basetype, rettype, argtypes)
- tree basetype, rettype, argtypes;
+build_cplus_method_type (tree basetype, tree rettype, tree argtypes)
{
register tree t;
tree ptype;
@@ -500,9 +483,7 @@ build_cplus_method_type (basetype, rettype, argtypes)
}
static tree
-build_cplus_array_type_1 (elt_type, index_type)
- tree elt_type;
- tree index_type;
+build_cplus_array_type_1 (tree elt_type, tree index_type)
{
tree t;
@@ -535,9 +516,7 @@ build_cplus_array_type_1 (elt_type, index_type)
}
tree
-build_cplus_array_type (elt_type, index_type)
- tree elt_type;
- tree index_type;
+build_cplus_array_type (tree elt_type, tree index_type)
{
tree t;
int type_quals = cp_type_quals (elt_type);
@@ -576,10 +555,9 @@ build_cplus_array_type (elt_type, index_type)
in a similar manner for restricting non-pointer types. */
tree
-cp_build_qualified_type_real (type, type_quals, complain)
- tree type;
- int type_quals;
- tsubst_flags_t complain;
+cp_build_qualified_type_real (tree type,
+ int type_quals,
+ tsubst_flags_t complain)
{
tree result;
int bad_quals = TYPE_UNQUALIFIED;
@@ -718,8 +696,7 @@ cp_build_qualified_type_real (type, type_quals, complain)
compatible types. */
tree
-canonical_type_variant (t)
- tree t;
+canonical_type_variant (tree t)
{
return cp_build_qualified_type (TYPE_MAIN_VARIANT (t), cp_type_quals (t));
}
@@ -739,8 +716,7 @@ canonical_type_variant (t)
dependent bases in non-instantiated templates). */
tree
-copy_base_binfos (binfo, t, prev)
- tree binfo, t, prev;
+copy_base_binfos (tree binfo, tree t, tree prev)
{
tree binfos = BINFO_BASETYPES (binfo);
int n, ix;
@@ -824,9 +800,7 @@ struct list_proxy
for a node we are thinking about adding). */
static int
-list_hash_eq (entry, data)
- const void *entry;
- const void *data;
+list_hash_eq (const void* entry, const void* data)
{
tree t = (tree) entry;
struct list_proxy *proxy = (struct list_proxy *) data;
@@ -841,10 +815,7 @@ list_hash_eq (entry, data)
TREE_COMMON slots), by adding the hash codes of the individual entries. */
static hashval_t
-list_hash_pieces (purpose, value, chain)
- tree purpose;
- tree value;
- tree chain;
+list_hash_pieces (tree purpose, tree value, tree chain)
{
hashval_t hashcode = 0;
@@ -865,8 +836,7 @@ list_hash_pieces (purpose, value, chain)
/* Hash an already existing TREE_LIST. */
static hashval_t
-list_hash (p)
- const void *p;
+list_hash (const void* p)
{
tree t = (tree) p;
return list_hash_pieces (TREE_PURPOSE (t),
@@ -879,11 +849,10 @@ list_hash (p)
new one, and record it as the canonical object. */
tree
-hash_tree_cons (purpose, value, chain)
- tree purpose, value, chain;
+hash_tree_cons (tree purpose, tree value, tree chain)
{
int hashcode = 0;
- PTR* slot;
+ void **slot;
struct list_proxy proxy;
/* Hash the list node. */
@@ -898,15 +867,14 @@ hash_tree_cons (purpose, value, chain)
INSERT);
/* If not, create a new node. */
if (!*slot)
- *slot = (PTR) tree_cons (purpose, value, chain);
+ *slot = tree_cons (purpose, value, chain);
return *slot;
}
/* Constructor for hashed lists. */
tree
-hash_tree_chain (value, chain)
- tree value, chain;
+hash_tree_chain (tree value, tree chain)
{
return hash_tree_cons (NULL_TREE, value, chain);
}
@@ -914,8 +882,7 @@ hash_tree_chain (value, chain)
/* Similar, but used for concatenating two lists. */
tree
-hash_chainon (list1, list2)
- tree list1, list2;
+hash_chainon (tree list1, tree list2)
{
if (list2 == 0)
return list1;
@@ -943,9 +910,7 @@ hash_chainon (list1, list2)
VIRTUALS are the virtual functions sitting in VTABLE. */
tree
-make_binfo (offset, binfo, vtable, virtuals)
- tree offset, binfo;
- tree vtable, virtuals;
+make_binfo (tree offset, tree binfo, tree vtable, tree virtuals)
{
tree new_binfo = make_tree_vec (BINFO_LANG_ELTS);
tree type;
@@ -978,8 +943,7 @@ make_binfo (offset, binfo, vtable, virtuals)
}
void
-debug_binfo (elem)
- tree elem;
+debug_binfo (tree elem)
{
HOST_WIDE_INT n;
tree virtuals;
@@ -1010,8 +974,7 @@ debug_binfo (elem)
}
int
-count_functions (t)
- tree t;
+count_functions (tree t)
{
int i;
if (TREE_CODE (t) == FUNCTION_DECL)
@@ -1028,8 +991,7 @@ count_functions (t)
}
int
-is_overloaded_fn (x)
- tree x;
+is_overloaded_fn (tree x)
{
/* A baselink is also considered an overloaded function. */
if (TREE_CODE (x) == OFFSET_REF)
@@ -1043,8 +1005,7 @@ is_overloaded_fn (x)
}
int
-really_overloaded_fn (x)
- tree x;
+really_overloaded_fn (tree x)
{
/* A baselink is also considered an overloaded function. */
if (TREE_CODE (x) == OFFSET_REF)
@@ -1058,8 +1019,7 @@ really_overloaded_fn (x)
}
tree
-get_first_fn (from)
- tree from;
+get_first_fn (tree from)
{
my_friendly_assert (is_overloaded_fn (from), 9);
/* A baselink is also considered an overloaded function. */
@@ -1072,8 +1032,7 @@ get_first_fn (from)
member function. */
int
-bound_pmf_p (t)
- tree t;
+bound_pmf_p (tree t)
{
return (TREE_CODE (t) == OFFSET_REF
&& TYPE_PTRMEMFUNC_P (TREE_TYPE (TREE_OPERAND (t, 1))));
@@ -1082,9 +1041,7 @@ bound_pmf_p (t)
/* Return a new OVL node, concatenating it with the old one. */
tree
-ovl_cons (decl, chain)
- tree decl;
- tree chain;
+ovl_cons (tree decl, tree chain)
{
tree result = make_node (OVERLOAD);
TREE_TYPE (result) = unknown_type_node;
@@ -1098,9 +1055,7 @@ ovl_cons (decl, chain)
just return it; otherwise, ovl_cons the _DECLs */
tree
-build_overload (decl, chain)
- tree decl;
- tree chain;
+build_overload (tree decl, tree chain)
{
if (! chain && TREE_CODE (decl) != TEMPLATE_DECL)
return decl;
@@ -1110,8 +1065,7 @@ build_overload (decl, chain)
}
int
-is_aggr_type_2 (t1, t2)
- tree t1, t2;
+is_aggr_type_2 (tree t1, tree t2)
{
if (TREE_CODE (t1) != TREE_CODE (t2))
return 0;
@@ -1121,9 +1075,7 @@ is_aggr_type_2 (t1, t2)
#define PRINT_RING_SIZE 4
const char *
-cxx_printable_name (decl, v)
- tree decl;
- int v;
+cxx_printable_name (tree decl, int v)
{
static tree decl_ring[PRINT_RING_SIZE];
static char *print_ring[PRINT_RING_SIZE];
@@ -1167,9 +1119,7 @@ cxx_printable_name (decl, v)
listed in RAISES. */
tree
-build_exception_variant (type, raises)
- tree type;
- tree raises;
+build_exception_variant (tree type, tree raises)
{
tree v = TYPE_MAIN_VARIANT (type);
int type_quals = TYPE_QUALS (type);
@@ -1190,9 +1140,7 @@ build_exception_variant (type, raises)
arguments. */
tree
-bind_template_template_parm (t, newargs)
- tree t;
- tree newargs;
+bind_template_template_parm (tree t, tree newargs)
{
tree decl = TYPE_NAME (t);
tree t2;
@@ -1219,10 +1167,9 @@ bind_template_template_parm (t, newargs)
/* Called from count_trees via walk_tree. */
static tree
-count_trees_r (tp, walk_subtrees, data)
- tree *tp ATTRIBUTE_UNUSED;
- int *walk_subtrees ATTRIBUTE_UNUSED;
- void *data;
+count_trees_r (tree* tp ATTRIBUTE_UNUSED ,
+ int* walk_subtrees ATTRIBUTE_UNUSED ,
+ void* data)
{
++ *((int*) data);
return NULL_TREE;
@@ -1232,8 +1179,7 @@ count_trees_r (tp, walk_subtrees, data)
representation. */
int
-count_trees (t)
- tree t;
+count_trees (tree t)
{
int n_trees = 0;
walk_tree_without_duplicates (&t, count_trees_r, &n_trees);
@@ -1243,10 +1189,9 @@ count_trees (t)
/* Called from verify_stmt_tree via walk_tree. */
static tree
-verify_stmt_tree_r (tp, walk_subtrees, data)
- tree *tp;
- int *walk_subtrees ATTRIBUTE_UNUSED;
- void *data;
+verify_stmt_tree_r (tree* tp,
+ int* walk_subtrees ATTRIBUTE_UNUSED ,
+ void* data)
{
tree t = *tp;
htab_t *statements = (htab_t *) data;
@@ -1271,8 +1216,7 @@ verify_stmt_tree_r (tp, walk_subtrees, data)
circularities. */
void
-verify_stmt_tree (t)
- tree t;
+verify_stmt_tree (tree t)
{
htab_t statements;
statements = htab_create (37, htab_hash_pointer, htab_eq_pointer, NULL);
@@ -1283,10 +1227,9 @@ verify_stmt_tree (t)
/* Called from find_tree via walk_tree. */
static tree
-find_tree_r (tp, walk_subtrees, data)
- tree *tp;
- int *walk_subtrees ATTRIBUTE_UNUSED;
- void *data;
+find_tree_r (tree* tp,
+ int* walk_subtrees ATTRIBUTE_UNUSED ,
+ void* data)
{
if (*tp == (tree) data)
return (tree) data;
@@ -1297,9 +1240,7 @@ find_tree_r (tp, walk_subtrees, data)
/* Returns X if X appears in the tree structure rooted at T. */
tree
-find_tree (t, x)
- tree t;
- tree x;
+find_tree (tree t, tree x)
{
return walk_tree_without_duplicates (&t, find_tree_r, x);
}
@@ -1307,10 +1248,9 @@ find_tree (t, x)
/* Passed to walk_tree. Checks for the use of types with no linkage. */
static tree
-no_linkage_helper (tp, walk_subtrees, data)
- tree *tp;
- int *walk_subtrees ATTRIBUTE_UNUSED;
- void *data ATTRIBUTE_UNUSED;
+no_linkage_helper (tree* tp,
+ int* walk_subtrees ATTRIBUTE_UNUSED ,
+ void* data ATTRIBUTE_UNUSED )
{
tree t = *tp;
@@ -1326,8 +1266,7 @@ no_linkage_helper (tp, walk_subtrees, data)
it. */
tree
-no_linkage_check (t)
- tree t;
+no_linkage_check (tree t)
{
/* There's no point in checking linkage on template functions; we
can't know their complete types. */
@@ -1345,7 +1284,7 @@ extern int depth_reached;
#endif
void
-cxx_print_statistics ()
+cxx_print_statistics (void)
{
print_search_statistics ();
print_class_statistics ();
@@ -1360,8 +1299,7 @@ cxx_print_statistics ()
array. */
tree
-array_type_nelts_top (type)
- tree type;
+array_type_nelts_top (tree type)
{
return fold (build (PLUS_EXPR, sizetype,
array_type_nelts (type),
@@ -1373,8 +1311,7 @@ array_type_nelts_top (type)
ARRAY_TYPEs that are clumped together. */
tree
-array_type_nelts_total (type)
- tree type;
+array_type_nelts_total (tree type)
{
tree sz = array_type_nelts_top (type);
type = TREE_TYPE (type);
@@ -1390,10 +1327,7 @@ array_type_nelts_total (type)
/* Called from break_out_target_exprs via mapcar. */
static tree
-bot_manip (tp, walk_subtrees, data)
- tree *tp;
- int *walk_subtrees;
- void *data;
+bot_manip (tree* tp, int* walk_subtrees, void* data)
{
splay_tree target_remap = ((splay_tree) data);
tree t = *tp;
@@ -1447,10 +1381,9 @@ bot_manip (tp, walk_subtrees, data)
variables. */
static tree
-bot_replace (t, walk_subtrees, data)
- tree *t;
- int *walk_subtrees ATTRIBUTE_UNUSED;
- void *data;
+bot_replace (tree* t,
+ int* walk_subtrees ATTRIBUTE_UNUSED ,
+ void* data)
{
splay_tree target_remap = ((splay_tree) data);
@@ -1471,8 +1404,7 @@ bot_replace (t, walk_subtrees, data)
we must replace the temporaries with appropriate local versions. */
tree
-break_out_target_exprs (t)
- tree t;
+break_out_target_exprs (tree t)
{
static int target_remap_count;
static splay_tree target_remap;
@@ -1559,8 +1491,7 @@ build_min (enum tree_code code, tree tt, ...)
static GTY(()) tree shared_int_cache[256];
tree
-build_shared_int_cst (i)
- int i;
+build_shared_int_cst (int i)
{
if (i >= 256)
return build_int_2 (i, 0);
@@ -1572,8 +1503,7 @@ build_shared_int_cst (i)
}
tree
-get_type_decl (t)
- tree t;
+get_type_decl (tree t)
{
if (TREE_CODE (t) == TYPE_DECL)
return t;
@@ -1592,8 +1522,7 @@ get_type_decl (t)
Return 0 if ELEM is not in VEC. VEC may be NULL_TREE. */
tree
-vec_binfo_member (elem, vec)
- tree elem, vec;
+vec_binfo_member (tree elem, tree vec)
{
int i;
@@ -1609,8 +1538,7 @@ vec_binfo_member (elem, vec)
indirectly. */
tree
-decl_namespace_context (decl)
- tree decl;
+decl_namespace_context (tree decl)
{
while (1)
{
@@ -1624,39 +1552,35 @@ decl_namespace_context (decl)
}
/* Return truthvalue of whether T1 is the same tree structure as T2.
- Return 1 if they are the same.
- Return 0 if they are understandably different.
- Return -1 if either contains tree structure not understood by
- this function. */
+ Return 1 if they are the same. Return 0 if they are different. */
-int
-cp_tree_equal (t1, t2)
- tree t1, t2;
+bool
+cp_tree_equal (tree t1, tree t2)
{
register enum tree_code code1, code2;
- int cmp;
if (t1 == t2)
- return 1;
- if (t1 == 0 || t2 == 0)
- return 0;
-
- code1 = TREE_CODE (t1);
- code2 = TREE_CODE (t2);
-
- if (code1 == NOP_EXPR || code1 == CONVERT_EXPR || code1 == NON_LVALUE_EXPR)
- {
- if (code2 == NOP_EXPR || code2 == CONVERT_EXPR || code2 == NON_LVALUE_EXPR)
- return cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
- else
- return cp_tree_equal (TREE_OPERAND (t1, 0), t2);
- }
- else if (code2 == NOP_EXPR || code2 == CONVERT_EXPR
- || code2 == NON_LVALUE_EXPR)
- return cp_tree_equal (t1, TREE_OPERAND (t2, 0));
-
+ return true;
+ if (!t1 || !t2)
+ return false;
+
+ for (code1 = TREE_CODE (t1);
+ code1 == NOP_EXPR || code1 == CONVERT_EXPR
+ || code1 == NON_LVALUE_EXPR;
+ code1 = TREE_CODE (t1))
+ t1 = TREE_OPERAND (t1, 0);
+ for (code2 = TREE_CODE (t2);
+ code2 == NOP_EXPR || code2 == CONVERT_EXPR
+ || code1 == NON_LVALUE_EXPR;
+ code2 = TREE_CODE (t2))
+ t2 = TREE_OPERAND (t2, 0);
+
+ /* They might have become equal now. */
+ if (t1 == t2)
+ return true;
+
if (code1 != code2)
- return 0;
+ return false;
switch (code1)
{
@@ -1670,7 +1594,7 @@ cp_tree_equal (t1, t2)
case STRING_CST:
return TREE_STRING_LENGTH (t1) == TREE_STRING_LENGTH (t2)
&& !memcmp (TREE_STRING_POINTER (t1), TREE_STRING_POINTER (t2),
- TREE_STRING_LENGTH (t1));
+ TREE_STRING_LENGTH (t1));
case CONSTRUCTOR:
/* We need to do this when determining whether or not two
@@ -1679,61 +1603,62 @@ cp_tree_equal (t1, t2)
if (!(same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))
/* The first operand is RTL. */
&& TREE_OPERAND (t1, 0) == TREE_OPERAND (t2, 0)))
- return 0;
+ return false;
return cp_tree_equal (TREE_OPERAND (t1, 1), TREE_OPERAND (t2, 1));
case TREE_LIST:
- cmp = cp_tree_equal (TREE_PURPOSE (t1), TREE_PURPOSE (t2));
- if (cmp <= 0)
- return cmp;
- cmp = cp_tree_equal (TREE_VALUE (t1), TREE_VALUE (t2));
- if (cmp <= 0)
- return cmp;
+ if (!cp_tree_equal (TREE_PURPOSE (t1), TREE_PURPOSE (t2)))
+ return false;
+ if (!cp_tree_equal (TREE_VALUE (t1), TREE_VALUE (t2)))
+ return false;
return cp_tree_equal (TREE_CHAIN (t1), TREE_CHAIN (t2));
case SAVE_EXPR:
return cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
case CALL_EXPR:
- cmp = cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
- if (cmp <= 0)
- return cmp;
- return simple_cst_list_equal (TREE_OPERAND (t1, 1), TREE_OPERAND (t2, 1));
-
- case TARGET_EXPR:
- /* Special case: if either target is an unallocated VAR_DECL,
- it means that it's going to be unified with whatever the
- TARGET_EXPR is really supposed to initialize, so treat it
- as being equivalent to anything. */
- if ((TREE_CODE (TREE_OPERAND (t1, 0)) == VAR_DECL
- && DECL_NAME (TREE_OPERAND (t1, 0)) == NULL_TREE
- && !DECL_RTL_SET_P (TREE_OPERAND (t1, 0)))
- || (TREE_CODE (TREE_OPERAND (t2, 0)) == VAR_DECL
- && DECL_NAME (TREE_OPERAND (t2, 0)) == NULL_TREE
- && !DECL_RTL_SET_P (TREE_OPERAND (t2, 0))))
- cmp = 1;
- else
- cmp = cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
- if (cmp <= 0)
- return cmp;
+ if (!cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0)))
+ return false;
return cp_tree_equal (TREE_OPERAND (t1, 1), TREE_OPERAND (t2, 1));
+ case TARGET_EXPR:
+ {
+ tree o1 = TREE_OPERAND (t1, 0);
+ tree o2 = TREE_OPERAND (t2, 0);
+
+ /* Special case: if either target is an unallocated VAR_DECL,
+ it means that it's going to be unified with whatever the
+ TARGET_EXPR is really supposed to initialize, so treat it
+ as being equivalent to anything. */
+ if (TREE_CODE (o1) == VAR_DECL && DECL_NAME (o1) == NULL_TREE
+ && !DECL_RTL_SET_P (o1))
+ /*Nop*/;
+ else if (TREE_CODE (o2) == VAR_DECL && DECL_NAME (o2) == NULL_TREE
+ && !DECL_RTL_SET_P (o2))
+ /*Nop*/;
+ else if (!cp_tree_equal (o1, o2))
+ return false;
+
+ return cp_tree_equal (TREE_OPERAND (t1, 1), TREE_OPERAND (t2, 1));
+ }
+
case WITH_CLEANUP_EXPR:
- cmp = cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
- if (cmp <= 0)
- return cmp;
+ if (!cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0)))
+ return false;
return cp_tree_equal (TREE_OPERAND (t1, 1), TREE_OPERAND (t1, 1));
case COMPONENT_REF:
- if (TREE_OPERAND (t1, 1) == TREE_OPERAND (t2, 1))
- return cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
- return 0;
+ if (TREE_OPERAND (t1, 1) != TREE_OPERAND (t2, 1))
+ return false;
+ return cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
case VAR_DECL:
case PARM_DECL:
case CONST_DECL:
case FUNCTION_DECL:
- return 0;
+ case TEMPLATE_DECL:
+ case IDENTIFIER_NODE:
+ return false;
case TEMPLATE_PARM_INDEX:
return (TEMPLATE_PARM_IDX (t1) == TEMPLATE_PARM_IDX (t2)
@@ -1743,17 +1668,25 @@ cp_tree_equal (t1, t2)
case SIZEOF_EXPR:
case ALIGNOF_EXPR:
- if (TREE_CODE (TREE_OPERAND (t1, 0)) != TREE_CODE (TREE_OPERAND (t2, 0)))
- return 0;
- if (TYPE_P (TREE_OPERAND (t1, 0)))
- return same_type_p (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
- break;
-
+ {
+ tree o1 = TREE_OPERAND (t1, 0);
+ tree o2 = TREE_OPERAND (t2, 0);
+
+ if (TREE_CODE (o1) != TREE_CODE (o2))
+ return false;
+ if (TYPE_P (o1))
+ return same_type_p (o1, o2);
+ else
+ return cp_tree_equal (o1, o2);
+ }
+
case PTRMEM_CST:
/* Two pointer-to-members are the same if they point to the same
field or function in the same class. */
- return (PTRMEM_CST_MEMBER (t1) == PTRMEM_CST_MEMBER (t2)
- && same_type_p (PTRMEM_CST_CLASS (t1), PTRMEM_CST_CLASS (t2)));
+ if (PTRMEM_CST_MEMBER (t1) != PTRMEM_CST_MEMBER (t2))
+ return false;
+
+ return same_type_p (PTRMEM_CST_CLASS (t1), PTRMEM_CST_CLASS (t2));
default:
break;
@@ -1770,29 +1703,26 @@ cp_tree_equal (t1, t2)
{
int i;
- cmp = 1;
for (i = 0; i < TREE_CODE_LENGTH (code1); ++i)
- {
- cmp = cp_tree_equal (TREE_OPERAND (t1, i), TREE_OPERAND (t2, i));
- if (cmp <= 0)
- return cmp;
- }
- return cmp;
+ if (!cp_tree_equal (TREE_OPERAND (t1, i), TREE_OPERAND (t2, i)))
+ return false;
+
+ return true;
}
- case 't':
- return same_type_p (t1, t2) ? 1 : 0;
+ case 't':
+ return same_type_p (t1, t2);
}
- return -1;
+ my_friendly_assert (0, 20030617);
+ return false;
}
/* Build a wrapper around a 'struct z_candidate' so we can use it as a
tree. */
tree
-build_zc_wrapper (ptr)
- struct z_candidate *ptr;
+build_zc_wrapper (struct z_candidate* ptr)
{
tree t = make_node (WRAPPER);
WRAPPER_ZC (t) = ptr;
@@ -1802,8 +1732,7 @@ build_zc_wrapper (ptr)
/* The type of ARG when used as an lvalue. */
tree
-lvalue_type (arg)
- tree arg;
+lvalue_type (tree arg)
{
tree type = TREE_TYPE (arg);
if (TREE_CODE (arg) == OVERLOAD)
@@ -1815,8 +1744,7 @@ lvalue_type (arg)
reference types. */
tree
-error_type (arg)
- tree arg;
+error_type (tree arg)
{
tree type = TREE_TYPE (arg);
if (TREE_CODE (type) == ARRAY_TYPE)
@@ -1832,8 +1760,7 @@ error_type (arg)
/* Does FUNCTION use a variable-length argument list? */
int
-varargs_function_p (function)
- tree function;
+varargs_function_p (tree function)
{
tree parm = TYPE_ARG_TYPES (TREE_TYPE (function));
for (; parm; parm = TREE_CHAIN (parm))
@@ -1845,8 +1772,7 @@ varargs_function_p (function)
/* Returns 1 if decl is a member of a class. */
int
-member_p (decl)
- tree decl;
+member_p (tree decl)
{
const tree ctx = DECL_CONTEXT (decl);
return (ctx && TYPE_P (ctx));
@@ -1856,8 +1782,7 @@ member_p (decl)
object that the access is against. */
tree
-build_dummy_object (type)
- tree type;
+build_dummy_object (tree type)
{
tree decl = build1 (NOP_EXPR, build_pointer_type (type), void_zero_node);
return build_indirect_ref (decl, NULL);
@@ -1868,9 +1793,7 @@ build_dummy_object (type)
binfo path from current_class_type to TYPE, or 0. */
tree
-maybe_dummy_object (type, binfop)
- tree type;
- tree *binfop;
+maybe_dummy_object (tree type, tree* binfop)
{
tree decl, context;
tree binfo;
@@ -1905,8 +1828,7 @@ maybe_dummy_object (type, binfop)
/* Returns 1 if OB is a placeholder object, or a pointer to one. */
int
-is_dummy_object (ob)
- tree ob;
+is_dummy_object (tree ob)
{
if (TREE_CODE (ob) == INDIRECT_REF)
ob = TREE_OPERAND (ob, 0);
@@ -1917,8 +1839,7 @@ is_dummy_object (ob)
/* Returns 1 iff type T is a POD type, as defined in [basic.types]. */
int
-pod_type_p (t)
- tree t;
+pod_type_p (tree t)
{
t = strip_array_types (t);
@@ -1946,8 +1867,7 @@ pod_type_p (t)
zeros in it. */
int
-zero_init_p (t)
- tree t;
+zero_init_p (tree t)
{
t = strip_array_types (t);
@@ -1979,12 +1899,11 @@ const struct attribute_spec cxx_attribute_table[] =
/* Handle a "java_interface" attribute; arguments as in
struct attribute_spec.handler. */
static tree
-handle_java_interface_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags;
- bool *no_add_attrs;
+handle_java_interface_attribute (tree* node,
+ tree name,
+ tree args ATTRIBUTE_UNUSED ,
+ int flags,
+ bool* no_add_attrs)
{
if (DECL_P (*node)
|| !CLASS_TYPE_P (*node)
@@ -2005,12 +1924,11 @@ handle_java_interface_attribute (node, name, args, flags, no_add_attrs)
/* Handle a "com_interface" attribute; arguments as in
struct attribute_spec.handler. */
static tree
-handle_com_interface_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_com_interface_attribute (tree* node,
+ tree name,
+ tree args ATTRIBUTE_UNUSED ,
+ int flags ATTRIBUTE_UNUSED ,
+ bool* no_add_attrs)
{
static int warned;
@@ -2035,12 +1953,11 @@ handle_com_interface_attribute (node, name, args, flags, no_add_attrs)
/* Handle an "init_priority" attribute; arguments as in
struct attribute_spec.handler. */
static tree
-handle_init_priority_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+handle_init_priority_attribute (tree* node,
+ tree name,
+ tree args,
+ int flags ATTRIBUTE_UNUSED ,
+ bool* no_add_attrs)
{
tree initp_expr = TREE_VALUE (args);
tree decl = *node;
@@ -2111,9 +2028,7 @@ handle_init_priority_attribute (node, name, args, flags, no_add_attrs)
thing pointed to by the constant. */
tree
-make_ptrmem_cst (type, member)
- tree type;
- tree member;
+make_ptrmem_cst (tree type, tree member)
{
tree ptrmem_cst = make_node (PTRMEM_CST);
/* If would seem a great convenience if make_node would set
@@ -2128,12 +2043,11 @@ make_ptrmem_cst (type, member)
traversal. Called from walk_tree(). */
tree
-cp_walk_subtrees (tp, walk_subtrees_p, func, data, htab)
- tree *tp;
- int *walk_subtrees_p;
- walk_tree_fn func;
- void *data;
- void *htab;
+cp_walk_subtrees (tree* tp,
+ int* walk_subtrees_p,
+ walk_tree_fn func,
+ void* data,
+ void* htab)
{
enum tree_code code = TREE_CODE (*tp);
tree result;
@@ -2199,8 +2113,7 @@ cp_walk_subtrees (tp, walk_subtrees_p, func, data, htab)
function as a tree. */
int
-cp_cannot_inline_tree_fn (fnp)
- tree *fnp;
+cp_cannot_inline_tree_fn (tree* fnp)
{
tree fn = *fnp;
@@ -2251,9 +2164,7 @@ cp_cannot_inline_tree_fn (fnp)
return the latest function added to the array, PREV_FN. */
tree
-cp_add_pending_fn_decls (fns_p, prev_fn)
- void *fns_p;
- tree prev_fn;
+cp_add_pending_fn_decls (void* fns_p, tree prev_fn)
{
varray_type *fnsp = (varray_type *)fns_p;
struct saved_scope *s;
@@ -2273,8 +2184,7 @@ cp_add_pending_fn_decls (fns_p, prev_fn)
function. */
int
-cp_is_overload_p (t)
- tree t;
+cp_is_overload_p (tree t)
{
return TREE_CODE (t) == OVERLOAD;
}
@@ -2283,8 +2193,7 @@ cp_is_overload_p (t)
function FN. */
int
-cp_auto_var_in_fn_p (var, fn)
- tree var, fn;
+cp_auto_var_in_fn_p (tree var, tree fn)
{
return (DECL_P (var) && DECL_CONTEXT (var) == fn
&& nonstatic_local_decl_p (var));
@@ -2295,12 +2204,12 @@ cp_auto_var_in_fn_p (var, fn)
to be used. */
tree
-cp_copy_res_decl_for_inlining (result, fn, caller, decl_map_,
- need_decl, return_slot_addr)
- tree result, fn, caller;
- void *decl_map_;
- int *need_decl;
- tree return_slot_addr;
+cp_copy_res_decl_for_inlining (tree result,
+ tree fn,
+ tree caller,
+ void* decl_map_,
+ int* need_decl,
+ tree return_slot_addr)
{
splay_tree decl_map = (splay_tree)decl_map_;
tree var;
@@ -2362,8 +2271,7 @@ cp_copy_res_decl_for_inlining (result, fn, caller, decl_map_,
that's OK. Used for lang_hooks.tree_inlining.start_inlining. */
int
-cp_start_inlining (fn)
- tree fn;
+cp_start_inlining (tree fn)
{
if (DECL_TEMPLATE_INSTANTIATION (fn))
return push_tinst_level (fn);
@@ -2375,8 +2283,7 @@ cp_start_inlining (fn)
lang_hooks.tree_inlining.end_inlining. */
void
-cp_end_inlining (fn)
- tree fn ATTRIBUTE_UNUSED;
+cp_end_inlining (tree fn ATTRIBUTE_UNUSED )
{
if (DECL_TEMPLATE_INSTANTIATION (fn))
pop_tinst_level ();
@@ -2385,7 +2292,7 @@ cp_end_inlining (fn)
/* Initialize tree.c. */
void
-init_tree ()
+init_tree (void)
{
list_hash_table = htab_create_ggc (31, list_hash, list_hash_eq, NULL);
}
@@ -2395,10 +2302,9 @@ init_tree ()
pointed to by DATA (which is really a `splay_tree *'). */
static tree
-mark_local_for_remap_r (tp, walk_subtrees, data)
- tree *tp;
- int *walk_subtrees ATTRIBUTE_UNUSED;
- void *data;
+mark_local_for_remap_r (tree* tp,
+ int* walk_subtrees ATTRIBUTE_UNUSED ,
+ void* data)
{
tree t = *tp;
splay_tree st = (splay_tree) data;
@@ -2441,10 +2347,9 @@ mark_local_for_remap_r (tp, walk_subtrees, data)
remaps all local declarations to appropriate replacements. */
static tree
-cp_unsave_r (tp, walk_subtrees, data)
- tree *tp;
- int *walk_subtrees;
- void *data;
+cp_unsave_r (tree* tp,
+ int* walk_subtrees,
+ void* data)
{
splay_tree st = (splay_tree) data;
splay_tree_node n;
@@ -2476,8 +2381,7 @@ cp_unsave_r (tp, walk_subtrees, data)
/* Called whenever an expression needs to be unsaved. */
tree
-cxx_unsave_expr_now (tp)
- tree tp;
+cxx_unsave_expr_now (tree tp)
{
splay_tree st;
@@ -2502,8 +2406,7 @@ cxx_unsave_expr_now (tp)
predicate to test whether or not DECL is a special function. */
special_function_kind
-special_function_p (decl)
- tree decl;
+special_function_p (tree decl)
{
/* Rather than doing all this stuff with magic names, we should
probably have a field of type `special_function_kind' in
@@ -2547,8 +2450,7 @@ name_p (tree node)
/* Returns nonzero if TYPE is a character type, including wchar_t. */
int
-char_type_p (type)
- tree type;
+char_type_p (tree type)
{
return (same_type_p (type, char_type_node)
|| same_type_p (type, unsigned_char_type_node)
@@ -2564,8 +2466,7 @@ char_type_p (type)
as a global symbol when you run `nm' on the resulting object file. */
linkage_kind
-decl_linkage (decl)
- tree decl;
+decl_linkage (tree decl)
{
/* This function doesn't attempt to calculate the linkage from first
principles as given in [basic.link]. Instead, it makes use of
@@ -2604,9 +2505,7 @@ decl_linkage (decl)
expression to use the precalculated result. */
tree
-stabilize_expr (exp, initp)
- tree exp;
- tree *initp;
+stabilize_expr (tree exp, tree* initp)
{
tree init_expr;
@@ -2637,10 +2536,7 @@ stabilize_expr (exp, initp)
node has been accessed improperly. */
void
-lang_check_failed (file, line, function)
- const char *file;
- int line;
- const char *function;
+lang_check_failed (const char* file, int line, const char* function)
{
internal_error ("lang_* check: failed in %s, at %s:%d",
function, trim_filename (file), line);
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 051d9bc68e8..6c17089192d 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -45,35 +45,32 @@ Boston, MA 02111-1307, USA. */
#include "diagnostic.h"
#include "target.h"
-static tree convert_for_assignment PARAMS ((tree, tree, const char *, tree,
- int));
-static tree cp_pointer_int_sum PARAMS ((enum tree_code, tree, tree));
-static tree rationalize_conditional_expr PARAMS ((enum tree_code, tree));
-static int comp_target_parms PARAMS ((tree, tree));
-static int comp_ptr_ttypes_real PARAMS ((tree, tree, int));
-static int comp_ptr_ttypes_const PARAMS ((tree, tree));
-static int comp_ptr_ttypes_reinterpret PARAMS ((tree, tree));
-static int comp_except_types PARAMS ((tree, tree, int));
-static int comp_array_types PARAMS ((int (*) (tree, tree, int), tree,
- tree, int));
-static tree common_base_type PARAMS ((tree, tree));
-static tree lookup_anon_field PARAMS ((tree, tree));
-static tree pointer_diff PARAMS ((tree, tree, tree));
-static tree qualify_type_recursive PARAMS ((tree, tree));
-static tree get_delta_difference PARAMS ((tree, tree, int));
-static int comp_cv_target_types PARAMS ((tree, tree, int));
-static void casts_away_constness_r PARAMS ((tree *, tree *));
-static int casts_away_constness PARAMS ((tree, tree));
-static void maybe_warn_about_returning_address_of_local PARAMS ((tree));
-static tree strip_all_pointer_quals PARAMS ((tree));
+static tree convert_for_assignment (tree, tree, const char *, tree, int);
+static tree cp_pointer_int_sum (enum tree_code, tree, tree);
+static tree rationalize_conditional_expr (enum tree_code, tree);
+static int comp_target_parms (tree, tree);
+static int comp_ptr_ttypes_real (tree, tree, int);
+static int comp_ptr_ttypes_const (tree, tree);
+static int comp_ptr_ttypes_reinterpret (tree, tree);
+static bool comp_except_types (tree, tree, bool);
+static bool comp_array_types (tree, tree, bool);
+static tree common_base_type (tree, tree);
+static tree lookup_anon_field (tree, tree);
+static tree pointer_diff (tree, tree, tree);
+static tree qualify_type_recursive (tree, tree);
+static tree get_delta_difference (tree, tree, int);
+static int comp_cv_target_types (tree, tree, int);
+static void casts_away_constness_r (tree *, tree *);
+static bool casts_away_constness (tree, tree);
+static void maybe_warn_about_returning_address_of_local (tree);
+static tree strip_all_pointer_quals (tree);
static tree lookup_destructor (tree, tree, tree);
/* Return the target type of TYPE, which means return T for:
T*, T&, T[], T (...), and otherwise, just T. */
tree
-target_type (type)
- tree type;
+target_type (tree type)
{
if (TREE_CODE (type) == REFERENCE_TYPE)
type = TREE_TYPE (type);
@@ -92,8 +89,7 @@ target_type (type)
complete type when this function returns. */
tree
-require_complete_type (value)
- tree value;
+require_complete_type (tree value)
{
tree type;
@@ -132,8 +128,7 @@ require_complete_type (value)
horribly wrong, in which case the error_mark_node is returned. */
tree
-complete_type (type)
- tree type;
+complete_type (tree type)
{
if (type == NULL_TREE)
/* Rather than crash, we return something sure to cause an error
@@ -164,10 +159,7 @@ complete_type (type)
Returns NULL_TREE if the type cannot be made complete. */
tree
-complete_type_or_diagnostic (type, value, diag_type)
- tree type;
- tree value;
- int diag_type;
+complete_type_or_diagnostic (tree type, tree value, int diag_type)
{
type = complete_type (type);
if (type == error_mark_node)
@@ -740,7 +732,8 @@ common_type (t1, t2)
}
/* Compare two exception specifier types for exactness or subsetness, if
- allowed. Returns 0 for mismatch, 1 for same, 2 if B is allowed by A.
+ allowed. Returns false for mismatch, true for match (same, or
+ derived and !exact).
[except.spec] "If a class X ... objects of class X or any class publicly
and unambigously derrived from X. Similarly, if a pointer type Y * ...
@@ -754,17 +747,15 @@ common_type (t1, t2)
We implement the letter of the standard. */
-static int
-comp_except_types (a, b, exact)
- tree a, b;
- int exact;
+static bool
+comp_except_types (tree a, tree b, bool exact)
{
if (same_type_p (a, b))
- return 1;
+ return true;
else if (!exact)
{
if (cp_type_quals (a) || cp_type_quals (b))
- return 0;
+ return false;
if (TREE_CODE (a) == POINTER_TYPE
&& TREE_CODE (b) == POINTER_TYPE)
@@ -772,43 +763,41 @@ comp_except_types (a, b, exact)
a = TREE_TYPE (a);
b = TREE_TYPE (b);
if (cp_type_quals (a) || cp_type_quals (b))
- return 0;
+ return false;
}
if (TREE_CODE (a) != RECORD_TYPE
|| TREE_CODE (b) != RECORD_TYPE)
- return 0;
+ return false;
if (ACCESSIBLY_UNIQUELY_DERIVED_P (a, b))
- return 2;
+ return true;
}
- return 0;
+ return false;
}
-/* Return 1 if TYPE1 and TYPE2 are equivalent exception specifiers.
- If EXACT is 0, T2 can be stricter than T1 (according to 15.4/7),
+/* Return true if TYPE1 and TYPE2 are equivalent exception specifiers.
+ If EXACT is false, T2 can be stricter than T1 (according to 15.4/7),
otherwise it must be exact. Exception lists are unordered, but
we've already filtered out duplicates. Most lists will be in order,
we should try to make use of that. */
-int
-comp_except_specs (t1, t2, exact)
- tree t1, t2;
- int exact;
+bool
+comp_except_specs (tree t1, tree t2, bool exact)
{
tree probe;
tree base;
int length = 0;
if (t1 == t2)
- return 1;
+ return true;
if (t1 == NULL_TREE) /* T1 is ... */
return t2 == NULL_TREE || !exact;
if (!TREE_VALUE (t1)) /* t1 is EMPTY */
return t2 != NULL_TREE && !TREE_VALUE (t2);
if (t2 == NULL_TREE) /* T2 is ... */
- return 0;
+ return false;
if (TREE_VALUE (t1) && !TREE_VALUE (t2)) /* T2 is EMPTY, T1 is not */
return !exact;
@@ -832,37 +821,32 @@ comp_except_specs (t1, t2, exact)
}
}
if (probe == NULL_TREE)
- return 0;
+ return false;
}
return !exact || base == NULL_TREE || length == list_length (t1);
}
-/* Compare the array types T1 and T2, using CMP as the type comparison
- function for the element types. STRICT is as for comptypes. */
+/* Compare the array types T1 and T2. ALLOW_REDECLARATION is true if
+ [] can match [size]. */
-static int
-comp_array_types (cmp, t1, t2, strict)
- register int (*cmp) PARAMS ((tree, tree, int));
- tree t1, t2;
- int strict;
+static bool
+comp_array_types (tree t1, tree t2, bool allow_redeclaration)
{
tree d1;
tree d2;
if (t1 == t2)
- return 1;
+ return true;
/* The type of the array elements must be the same. */
- if (!(TREE_TYPE (t1) == TREE_TYPE (t2)
- || (*cmp) (TREE_TYPE (t1), TREE_TYPE (t2),
- strict & ~COMPARE_REDECLARATION)))
- return 0;
+ if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2)))
+ return false;
d1 = TYPE_DOMAIN (t1);
d2 = TYPE_DOMAIN (t2);
if (d1 == d2)
- return 1;
+ return true;
/* If one of the arrays is dimensionless, and the other has a
dimension, they are of different types. However, it is valid to
@@ -877,106 +861,83 @@ comp_array_types (cmp, t1, t2, strict)
array types that differ by the presence or absence of a major
array bound (_dcl.array_). */
if (!d1 || !d2)
- return strict & COMPARE_REDECLARATION;
+ return allow_redeclaration;
/* Check that the dimensions are the same. */
- return (cp_tree_equal (TYPE_MIN_VALUE (d1),
- TYPE_MIN_VALUE (d2))
- && cp_tree_equal (TYPE_MAX_VALUE (d1),
- TYPE_MAX_VALUE (d2)));
+ return (cp_tree_equal (TYPE_MIN_VALUE (d1), TYPE_MIN_VALUE (d2))
+ && cp_tree_equal (TYPE_MAX_VALUE (d1), TYPE_MAX_VALUE (d2)));
}
-/* Return 1 if T1 and T2 are compatible types for assignment or
- various other operations. STRICT is a bitwise-or of the COMPARE_*
- flags. */
+/* Return true if T1 and T2 are related as allowed by STRICT. STRICT
+ is a bitwise-or of the COMPARE_* flags. */
-int
-comptypes (t1, t2, strict)
- tree t1;
- tree t2;
- int strict;
+bool
+comptypes (tree t1, tree t2, int strict)
{
- int attrval, val;
- int orig_strict = strict;
-
- /* The special exemption for redeclaring array types without an
- array bound only applies at the top level:
-
- extern int (*i)[];
- int (*i)[8];
-
- is invalid, for example. */
- strict &= ~COMPARE_REDECLARATION;
-
- /* Suppress errors caused by previously reported errors */
if (t1 == t2)
- return 1;
+ return true;
/* This should never happen. */
my_friendly_assert (t1 != error_mark_node, 307);
+ /* Suppress errors caused by previously reported errors */
if (t2 == error_mark_node)
- return 0;
+ return false;
+
+ my_friendly_assert (TYPE_P (t1) && TYPE_P (t2), 20030623);
+
+ /* TYPENAME_TYPEs should be resolved if the qualifying scope is the
+ current instantiation. */
+ if (TREE_CODE (t1) == TYPENAME_TYPE)
+ {
+ tree resolved = resolve_typename_type (t1, /*only_current_p=*/true);
+
+ if (resolved != error_mark_node)
+ t1 = resolved;
+ }
+
+ if (TREE_CODE (t2) == TYPENAME_TYPE)
+ {
+ tree resolved = resolve_typename_type (t2, /*only_current_p=*/true);
+
+ if (resolved != error_mark_node)
+ t2 = resolved;
+ }
- /* If either type is the internal version of sizetype, return the
+ /* If either type is the internal version of sizetype, use the
language version. */
if (TREE_CODE (t1) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t1)
- && TYPE_DOMAIN (t1) != 0)
+ && TYPE_DOMAIN (t1))
t1 = TYPE_DOMAIN (t1);
if (TREE_CODE (t2) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t2)
- && TYPE_DOMAIN (t2) != 0)
+ && TYPE_DOMAIN (t2))
t2 = TYPE_DOMAIN (t2);
- if (strict & COMPARE_RELAXED)
- {
- /* Treat an enum type as the unsigned integer type of the same width. */
-
- if (TREE_CODE (t1) == ENUMERAL_TYPE)
- t1 = c_common_type_for_size (TYPE_PRECISION (t1), 1);
- if (TREE_CODE (t2) == ENUMERAL_TYPE)
- t2 = c_common_type_for_size (TYPE_PRECISION (t2), 1);
-
- if (t1 == t2)
- return 1;
- }
-
if (TYPE_PTRMEMFUNC_P (t1))
t1 = TYPE_PTRMEMFUNC_FN_TYPE (t1);
if (TYPE_PTRMEMFUNC_P (t2))
t2 = TYPE_PTRMEMFUNC_FN_TYPE (t2);
- /* TYPENAME_TYPEs should be resolved if the qualifying scope is the
- current instantiation. */
- if (TREE_CODE (t1) == TYPENAME_TYPE)
- t1 = resolve_typename_type_in_current_instantiation (t1);
- if (TREE_CODE (t2) == TYPENAME_TYPE)
- t2 = resolve_typename_type_in_current_instantiation (t2);
-
/* Different classes of types can't be compatible. */
if (TREE_CODE (t1) != TREE_CODE (t2))
- return 0;
+ return false;
/* Qualifiers must match. */
if (cp_type_quals (t1) != cp_type_quals (t2))
- return 0;
- if (strict == COMPARE_STRICT
- && TYPE_FOR_JAVA (t1) != TYPE_FOR_JAVA (t2))
- return 0;
+ return false;
+ if (TYPE_FOR_JAVA (t1) != TYPE_FOR_JAVA (t2))
+ return false;
/* Allow for two different type nodes which have essentially the same
definition. Note that we already checked for equality of the type
qualifiers (just above). */
if (TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2))
- return 1;
+ return true;
- /* 1 if no need for warning yet, 2 if warning cause has been seen. */
- if (! (attrval = (*targetm.comp_type_attributes) (t1, t2)))
- return 0;
-
- /* 1 if no need for warning yet, 2 if warning cause has been seen. */
- val = 0;
+ if (!(*targetm.comp_type_attributes) (t1, t2))
+ return false;
switch (TREE_CODE (t1))
{
@@ -984,13 +945,13 @@ comptypes (t1, t2, strict)
case BOUND_TEMPLATE_TEMPLATE_PARM:
if (TEMPLATE_TYPE_IDX (t1) != TEMPLATE_TYPE_IDX (t2)
|| TEMPLATE_TYPE_LEVEL (t1) != TEMPLATE_TYPE_LEVEL (t2))
- return 0;
- if (! comp_template_parms
- (DECL_TEMPLATE_PARMS (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL (t1)),
- DECL_TEMPLATE_PARMS (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL (t2))))
- return 0;
+ return false;
+ if (!comp_template_parms
+ (DECL_TEMPLATE_PARMS (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL (t1)),
+ DECL_TEMPLATE_PARMS (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL (t2))))
+ return false;
if (TREE_CODE (t1) == TEMPLATE_TEMPLATE_PARM)
- return 1;
+ return true;
/* Don't check inheritance. */
strict = COMPARE_STRICT;
/* fall through */
@@ -999,64 +960,50 @@ comptypes (t1, t2, strict)
case UNION_TYPE:
if (TYPE_TEMPLATE_INFO (t1) && TYPE_TEMPLATE_INFO (t2)
&& (TYPE_TI_TEMPLATE (t1) == TYPE_TI_TEMPLATE (t2)
- || TREE_CODE (t1) == BOUND_TEMPLATE_TEMPLATE_PARM))
- val = comp_template_args (TYPE_TI_ARGS (t1),
- TYPE_TI_ARGS (t2));
- look_hard:
+ || TREE_CODE (t1) == BOUND_TEMPLATE_TEMPLATE_PARM)
+ && comp_template_args (TYPE_TI_ARGS (t1), TYPE_TI_ARGS (t2)))
+ return true;
+
if ((strict & COMPARE_BASE) && DERIVED_FROM_P (t1, t2))
- val = 1;
- else if ((strict & COMPARE_RELAXED) && DERIVED_FROM_P (t2, t1))
- val = 1;
- break;
+ return true;
+ else if ((strict & COMPARE_DERIVED) && DERIVED_FROM_P (t2, t1))
+ return true;
+
+ return false;
case OFFSET_TYPE:
- val = (comptypes (build_pointer_type (TYPE_OFFSET_BASETYPE (t1)),
- build_pointer_type (TYPE_OFFSET_BASETYPE (t2)), strict)
- && comptypes (TREE_TYPE (t1), TREE_TYPE (t2), strict));
- break;
+ if (!comptypes (TYPE_OFFSET_BASETYPE (t1), TYPE_OFFSET_BASETYPE (t2),
+ strict & ~COMPARE_REDECLARATION))
+ return false;
+ /* FALLTHROUGH*/
case POINTER_TYPE:
case REFERENCE_TYPE:
- t1 = TREE_TYPE (t1);
- t2 = TREE_TYPE (t2);
- /* first, check whether the referred types match with the
- required level of strictness */
- val = comptypes (t1, t2, strict);
- if (val)
- break;
- if (TREE_CODE (t1) == RECORD_TYPE
- && TREE_CODE (t2) == RECORD_TYPE)
- goto look_hard;
- break;
+ return same_type_p (TREE_TYPE (t1), TREE_TYPE (t2));
case METHOD_TYPE:
case FUNCTION_TYPE:
- val = ((TREE_TYPE (t1) == TREE_TYPE (t2)
- || comptypes (TREE_TYPE (t1), TREE_TYPE (t2), strict))
- && compparms (TYPE_ARG_TYPES (t1), TYPE_ARG_TYPES (t2)));
- break;
+ if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2)))
+ return false;
+ return compparms (TYPE_ARG_TYPES (t1), TYPE_ARG_TYPES (t2));
case ARRAY_TYPE:
- /* Target types must match incl. qualifiers. We use ORIG_STRICT
- here since this is the one place where
- COMPARE_REDECLARATION should be used. */
- val = comp_array_types (comptypes, t1, t2, orig_strict);
- break;
+ /* Target types must match incl. qualifiers. */
+ return comp_array_types (t1, t2, !!(strict & COMPARE_REDECLARATION));
case TEMPLATE_TYPE_PARM:
- return TEMPLATE_TYPE_IDX (t1) == TEMPLATE_TYPE_IDX (t2)
- && TEMPLATE_TYPE_LEVEL (t1) == TEMPLATE_TYPE_LEVEL (t2);
+ return (TEMPLATE_TYPE_IDX (t1) == TEMPLATE_TYPE_IDX (t2)
+ && TEMPLATE_TYPE_LEVEL (t1) == TEMPLATE_TYPE_LEVEL (t2));
case TYPENAME_TYPE:
- if (cp_tree_equal (TYPENAME_TYPE_FULLNAME (t1),
- TYPENAME_TYPE_FULLNAME (t2)) < 1)
- return 0;
+ if (!cp_tree_equal (TYPENAME_TYPE_FULLNAME (t1),
+ TYPENAME_TYPE_FULLNAME (t2)))
+ return false;
return same_type_p (TYPE_CONTEXT (t1), TYPE_CONTEXT (t2));
case UNBOUND_CLASS_TEMPLATE:
- if (cp_tree_equal (TYPE_IDENTIFIER (t1),
- TYPE_IDENTIFIER (t2)) < 1)
- return 0;
+ if (!cp_tree_equal (TYPE_IDENTIFIER (t1), TYPE_IDENTIFIER (t2)))
+ return false;
return same_type_p (TYPE_CONTEXT (t1), TYPE_CONTEXT (t2));
case COMPLEX_TYPE:
@@ -1065,16 +1012,14 @@ comptypes (t1, t2, strict)
default:
break;
}
- return attrval == 2 && val == 1 ? 2 : val;
+ return false;
}
/* Subroutine of comp_target-types. Make sure that the cv-quals change
only in the same direction as the target type. */
static int
-comp_cv_target_types (ttl, ttr, nptrs)
- tree ttl, ttr;
- int nptrs;
+comp_cv_target_types (tree ttl, tree ttr, int nptrs)
{
int t;
@@ -1107,9 +1052,7 @@ comp_cv_target_types (ttl, ttr, nptrs)
similar instead. (jason 17 Apr 1997) */
int
-comp_target_types (ttl, ttr, nptrs)
- tree ttl, ttr;
- int nptrs;
+comp_target_types (tree ttl, tree ttr, int nptrs)
{
ttl = TYPE_MAIN_VARIANT (ttl);
ttr = TYPE_MAIN_VARIANT (ttr);
@@ -1166,9 +1109,8 @@ comp_target_types (ttl, ttr, nptrs)
return comp_cv_target_types (ttl, ttr, nptrs - 1);
}
- if (TREE_CODE (ttr) == ARRAY_TYPE)
- return comp_array_types (comp_target_types, ttl, ttr, COMPARE_STRICT);
- else if (TREE_CODE (ttr) == FUNCTION_TYPE || TREE_CODE (ttr) == METHOD_TYPE)
+ my_friendly_assert (TREE_CODE (ttr) != ARRAY_TYPE, 20030617);
+ if (TREE_CODE (ttr) == FUNCTION_TYPE || TREE_CODE (ttr) == METHOD_TYPE)
{
tree argsl, argsr;
int saw_contra = 0;
@@ -1263,11 +1205,9 @@ comp_target_types (ttl, ttr, nptrs)
{
if (nptrs < 0)
return 0;
- if (same_or_base_type_p (build_pointer_type (ttl),
- build_pointer_type (ttr)))
+ if (same_or_base_type_p (ttl, ttr))
return 1;
- if (same_or_base_type_p (build_pointer_type (ttr),
- build_pointer_type (ttl)))
+ if (same_or_base_type_p (ttr, ttl))
return -1;
return 0;
}
@@ -1277,42 +1217,42 @@ comp_target_types (ttl, ttr, nptrs)
/* Returns 1 if TYPE1 is at least as qualified as TYPE2. */
-int
-at_least_as_qualified_p (type1, type2)
- tree type1;
- tree type2;
+bool
+at_least_as_qualified_p (tree type1, tree type2)
{
+ int q1 = cp_type_quals (type1);
+ int q2 = cp_type_quals (type2);
+
/* All qualifiers for TYPE2 must also appear in TYPE1. */
- return ((cp_type_quals (type1) & cp_type_quals (type2))
- == cp_type_quals (type2));
+ return (q1 & q2) == q2;
}
/* Returns 1 if TYPE1 is more qualified than TYPE2. */
-int
-more_qualified_p (type1, type2)
- tree type1;
- tree type2;
+bool
+more_qualified_p (tree type1, tree type2)
{
- return (cp_type_quals (type1) != cp_type_quals (type2)
- && at_least_as_qualified_p (type1, type2));
+ int q1 = cp_type_quals (type1);
+ int q2 = cp_type_quals (type2);
+
+ return q1 != q2 && (q1 & q2) == q2;
}
/* Returns 1 if TYPE1 is more cv-qualified than TYPE2, -1 if TYPE2 is
more cv-qualified that TYPE1, and 0 otherwise. */
int
-comp_cv_qualification (type1, type2)
- tree type1;
- tree type2;
+comp_cv_qualification (tree type1, tree type2)
{
- if (cp_type_quals (type1) == cp_type_quals (type2))
+ int q1 = cp_type_quals (type1);
+ int q2 = cp_type_quals (type2);
+
+ if (q1 == q2)
return 0;
- if (at_least_as_qualified_p (type1, type2))
+ if ((q1 & q2) == q2)
return 1;
-
- else if (at_least_as_qualified_p (type2, type1))
+ else if ((q1 & q2) == q1)
return -1;
return 0;
@@ -1323,9 +1263,7 @@ comp_cv_qualification (type1, type2)
are similar. Returns -1 if the other way 'round, and 0 otherwise. */
int
-comp_cv_qual_signature (type1, type2)
- tree type1;
- tree type2;
+comp_cv_qual_signature (tree type1, tree type2)
{
if (comp_ptr_ttypes_real (type2, type1, -1))
return 1;
@@ -1340,8 +1278,7 @@ comp_cv_qual_signature (type1, type2)
returns ERROR_MARK_NODE. */
static tree
-common_base_type (tt1, tt2)
- tree tt1, tt2;
+common_base_type (tree tt1, tree tt2)
{
tree best = NULL_TREE;
int i;
@@ -1389,36 +1326,31 @@ common_base_type (tt1, tt2)
/* Subroutines of `comptypes'. */
-/* Return 1 if two parameter type lists PARMS1 and PARMS2 are
+/* Return true if two parameter type lists PARMS1 and PARMS2 are
equivalent in the sense that functions with those parameter types
can have equivalent types. The two lists must be equivalent,
- element by element.
+ element by element. */
- C++: See comment above about TYPE1, TYPE2. */
-
-int
-compparms (parms1, parms2)
- tree parms1, parms2;
+bool
+compparms (tree parms1, tree parms2)
{
- register tree t1 = parms1, t2 = parms2;
+ tree t1, t2;
/* An unspecified parmlist matches any specified parmlist
whose argument types don't need default promotions. */
- while (1)
+ for (t1 = parms1, t2 = parms2;
+ t1 || t2;
+ t1 = TREE_CHAIN (t1), t2 = TREE_CHAIN (t2))
{
- if (t1 == 0 && t2 == 0)
- return 1;
/* If one parmlist is shorter than the other,
they fail to match. */
- if (t1 == 0 || t2 == 0)
- return 0;
+ if (!t1 || !t2)
+ return false;
if (!same_type_p (TREE_VALUE (t2), TREE_VALUE (t1)))
- return 0;
-
- t1 = TREE_CHAIN (t1);
- t2 = TREE_CHAIN (t2);
+ return false;
}
+ return true;
}
/* This really wants return whether or not parameter type lists
@@ -1431,8 +1363,7 @@ compparms (parms1, parms2)
(jason 17 Apr 1997) */
static int
-comp_target_parms (parms1, parms2)
- tree parms1, parms2;
+comp_target_parms (tree parms1, tree parms2)
{
register tree t1 = parms1, t2 = parms2;
int warn_contravariance = 0;
@@ -1454,9 +1385,8 @@ comp_target_parms (parms1, parms2)
{
tree p1, p2;
- /* If one parmlist is shorter than the other,
- they fail to match, unless STRICT is <= 0. */
- if (t1 == 0 || t2 == 0)
+ /* If one parmlist is shorter than the other, they fail to match. */
+ if (!t1 || !t2)
return 0;
p1 = TREE_VALUE (t1);
p2 = TREE_VALUE (t2);
@@ -1499,10 +1429,7 @@ comp_target_parms (parms1, parms2)
}
tree
-cxx_sizeof_or_alignof_type (type, op, complain)
- tree type;
- enum tree_code op;
- int complain;
+cxx_sizeof_or_alignof_type (tree type, enum tree_code op, int complain)
{
enum tree_code type_code;
tree value;
@@ -1537,8 +1464,7 @@ cxx_sizeof_or_alignof_type (type, op, complain)
}
tree
-expr_sizeof (e)
- tree e;
+expr_sizeof (tree e)
{
if (processing_template_decl)
return build_min_nt (SIZEOF_EXPR, e);
@@ -1576,8 +1502,7 @@ expr_sizeof (e)
constants are replaced by their values. */
tree
-decay_conversion (exp)
- tree exp;
+decay_conversion (tree exp)
{
register tree type;
register enum tree_code code;
@@ -1694,8 +1619,7 @@ decay_conversion (exp)
}
tree
-default_conversion (exp)
- tree exp;
+default_conversion (tree exp)
{
tree type;
enum tree_code code;
@@ -1719,8 +1643,7 @@ default_conversion (exp)
or TREE_USED. */
tree
-inline_conversion (exp)
- tree exp;
+inline_conversion (tree exp)
{
if (TREE_CODE (exp) == FUNCTION_DECL)
exp = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (exp)), exp);
@@ -1732,9 +1655,7 @@ inline_conversion (exp)
decay_conversion to one. */
int
-string_conv_p (totype, exp, warn)
- tree totype, exp;
- int warn;
+string_conv_p (tree totype, tree exp, int warn)
{
tree t;
@@ -1780,9 +1701,7 @@ string_conv_p (totype, exp, warn)
get it there. */
static tree
-rationalize_conditional_expr (code, t)
- enum tree_code code;
- tree t;
+rationalize_conditional_expr (enum tree_code code, tree t)
{
/* For MIN_EXPR or MAX_EXPR, fold-const.c has arranged things so that
the first operand is always the one to be used if both operands
@@ -1810,8 +1729,7 @@ rationalize_conditional_expr (code, t)
that are directly reachable. */
static tree
-lookup_anon_field (t, type)
- tree t, type;
+lookup_anon_field (tree t, tree type)
{
tree field;
@@ -4106,10 +4024,7 @@ build_nop (tree type, tree expr)
(such as from short to int). */
tree
-build_unary_op (code, xarg, noconvert)
- enum tree_code code;
- tree xarg;
- int noconvert;
+build_unary_op (enum tree_code code, tree xarg, int noconvert)
{
/* No default_conversion here. It causes trouble for ADDR_EXPR. */
register tree arg = xarg;
@@ -4560,9 +4475,7 @@ build_unary_op (code, xarg, noconvert)
If ARG is not a kind of expression we can handle, return zero. */
tree
-unary_complex_lvalue (code, arg)
- enum tree_code code;
- tree arg;
+unary_complex_lvalue (enum tree_code code, tree arg)
{
/* Handle (a, b) used as an "lvalue". */
if (TREE_CODE (arg) == COMPOUND_EXPR)
@@ -4699,8 +4612,7 @@ unary_complex_lvalue (code, arg)
C++: we do not allow `current_class_ptr' to be addressable. */
bool
-cxx_mark_addressable (exp)
- tree exp;
+cxx_mark_addressable (tree exp)
{
register tree x = exp;
@@ -4765,8 +4677,7 @@ cxx_mark_addressable (exp)
/* Build and return a conditional expression IFEXP ? OP1 : OP2. */
tree
-build_x_conditional_expr (ifexp, op1, op2)
- tree ifexp, op1, op2;
+build_x_conditional_expr (tree ifexp, tree op1, tree op2)
{
if (processing_template_decl)
return build_min_nt (COND_EXPR, ifexp, op1, op2);
@@ -4778,8 +4689,7 @@ build_x_conditional_expr (ifexp, op1, op2)
this function just builds an expression list. */
tree
-build_x_compound_expr (list)
- tree list;
+build_x_compound_expr (tree list)
{
tree rest = TREE_CHAIN (list);
tree result;
@@ -4822,8 +4732,7 @@ build_x_compound_expr (list)
that performs them all and returns the value of the last of them. */
tree
-build_compound_expr (list)
- tree list;
+build_compound_expr (tree list)
{
register tree rest;
tree first;
@@ -4857,12 +4766,24 @@ build_compound_expr (list)
return build (COMPOUND_EXPR, TREE_TYPE (rest), first, rest);
}
+/* Issue an error message if casting from SRC_TYPE to DEST_TYPE casts
+ away constness. */
+
+static void
+check_for_casting_away_constness (tree src_type, tree dest_type)
+{
+ if (casts_away_constness (src_type, dest_type))
+ error ("static_cast from type `%T' to type `%T' casts away constness",
+ src_type, dest_type);
+}
+
+/* Return an expression representing static_cast<TYPE>(EXPR). */
+
tree
-build_static_cast (type, expr)
- tree type, expr;
+build_static_cast (tree type, tree expr)
{
tree intype;
- int ok;
+ tree result;
if (type == error_mark_node || expr == error_mark_node)
return error_mark_node;
@@ -4883,96 +4804,157 @@ build_static_cast (type, expr)
&& TREE_TYPE (expr) == TREE_TYPE (TREE_OPERAND (expr, 0)))
expr = TREE_OPERAND (expr, 0);
- if (TREE_CODE (type) == VOID_TYPE)
- {
- expr = convert_to_void (expr, /*implicit=*/NULL);
- return expr;
- }
+ intype = TREE_TYPE (expr);
- if (TREE_CODE (type) == REFERENCE_TYPE)
- return (convert_from_reference
- (convert_to_reference (type, expr, CONV_STATIC|CONV_IMPLICIT,
- LOOKUP_COMPLAIN, NULL_TREE)));
+ /* [expr.static.cast]
- if (IS_AGGR_TYPE (type))
- return build_cplus_new (type, (build_special_member_call
- (NULL_TREE, complete_ctor_identifier,
- build_tree_list (NULL_TREE, expr),
- TYPE_BINFO (type), LOOKUP_NORMAL)));
+ An expression e can be explicitly converted to a type T using a
+ static_cast of the form static_cast<T>(e) if the declaration T
+ t(e);" is well-formed, for some invented temporary variable
+ t. */
+ result = perform_direct_initialization_if_possible (type, expr);
+ if (result)
+ return convert_from_reference (result);
- intype = TREE_TYPE (expr);
+ /* [expr.static.cast]
- /* FIXME handle casting to array type. */
+ Any expression can be explicitly converted to type cv void. */
+ if (TREE_CODE (type) == VOID_TYPE)
+ return convert_to_void (expr, /*implicit=*/NULL);
- ok = 0;
- if (IS_AGGR_TYPE (intype)
- ? can_convert_arg (type, intype, expr)
- : can_convert_arg (strip_all_pointer_quals (type),
- strip_all_pointer_quals (intype), expr))
- /* This is a standard conversion. */
- ok = 1;
- else if (TYPE_PTROB_P (type) && TYPE_PTROB_P (intype))
- {
- /* They're pointers to objects. They must be aggregates that
- are related non-virtually. */
- base_kind kind;
-
- if (IS_AGGR_TYPE (TREE_TYPE (type)) && IS_AGGR_TYPE (TREE_TYPE (intype))
- && lookup_base (TREE_TYPE (type), TREE_TYPE (intype),
- ba_ignore | ba_quiet, &kind)
- && kind != bk_via_virtual)
- ok = 1;
- }
- else if (TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (intype))
- {
- /* They're pointers to members. The pointed to objects must be
- the same (ignoring CV qualifiers), and the containing classes
- must be related non-virtually. */
- base_kind kind;
-
- if (same_type_p
- (strip_all_pointer_quals (TREE_TYPE (TREE_TYPE (type))),
- strip_all_pointer_quals (TREE_TYPE (TREE_TYPE (intype))))
- && (lookup_base (TYPE_OFFSET_BASETYPE (TREE_TYPE (intype)),
- TYPE_OFFSET_BASETYPE (TREE_TYPE (type)),
- ba_ignore | ba_quiet, &kind))
- && kind != bk_via_virtual)
- ok = 1;
- }
- else if (TREE_CODE (intype) != BOOLEAN_TYPE
- && TREE_CODE (type) != ARRAY_TYPE
- && TREE_CODE (type) != FUNCTION_TYPE
- && can_convert (intype, strip_all_pointer_quals (type)))
- ok = 1;
- else if (TREE_CODE (intype) == ENUMERAL_TYPE
- && TREE_CODE (type) == ENUMERAL_TYPE)
- /* DR 128: "A value of integral _or enumeration_ type can be explicitly
- converted to an enumeration type."
- The integral to enumeration will be accepted by the previous clause.
- We need to explicitly check for enumeration to enumeration. */
- ok = 1;
+ /* [expr.static.cast]
+
+ An lvalue of type "cv1 B", where B is a class type, can be cast
+ to type "reference to cv2 D", where D is a class derived (clause
+ _class.derived_) from B, if a valid standard conversion from
+ "pointer to D" to "pointer to B" exists (_conv.ptr_), cv2 is the
+ same cv-qualification as, or greater cv-qualification than, cv1,
+ and B is not a virtual base class of D. */
+ if (TREE_CODE (type) == REFERENCE_TYPE
+ && CLASS_TYPE_P (TREE_TYPE (type))
+ && CLASS_TYPE_P (intype)
+ && real_non_cast_lvalue_p (expr)
+ && DERIVED_FROM_P (intype, TREE_TYPE (type))
+ && can_convert (build_pointer_type (TYPE_MAIN_VARIANT (intype)),
+ build_pointer_type (TYPE_MAIN_VARIANT
+ (TREE_TYPE (type))))
+ && at_least_as_qualified_p (TREE_TYPE (type), intype))
+ {
+ /* At this point we have checked all of the conditions except
+ that B is not a virtual base class of D. That will be
+ checked by build_base_path. */
+ tree base = lookup_base (TREE_TYPE (type), intype, ba_any, NULL);
+
+ /* Convert from B* to D*. */
+ expr = build_base_path (MINUS_EXPR, build_address (expr),
+ base, /*nonnull=*/false);
+ /* Convert the pointer to a reference -- but then remember that
+ there are no expressions with reference type in C++. */
+ return convert_from_reference (build_nop (type, expr));
+ }
/* [expr.static.cast]
- The static_cast operator shall not be used to cast away
- constness. */
- if (ok && casts_away_constness (intype, type))
- {
- error ("static_cast from type `%T' to type `%T' casts away constness",
- intype, type);
- return error_mark_node;
+ The inverse of any standard conversion sequence (clause _conv_),
+ other than the lvalue-to-rvalue (_conv.lval_), array-to-pointer
+ (_conv.array_), function-to-pointer (_conv.func_), and boolean
+ (_conv.bool_) conversions, can be performed explicitly using
+ static_cast subject to the restriction that the explicit
+ conversion does not cast away constness (_expr.const.cast_), and
+ the following additional rules for specific cases: */
+ /* For reference, the conversions not excluded are: integral
+ promotions, floating point promotion, integral conversions,
+ floating point conversions, floating-integral conversions,
+ pointer conversions, and pointer to member conversions. */
+ if ((ARITHMETIC_TYPE_P (type) && ARITHMETIC_TYPE_P (intype))
+ /* DR 128
+
+ A value of integral _or enumeration_ type can be explicitly
+ converted to an enumeration type. */
+ || (INTEGRAL_OR_ENUMERATION_TYPE_P (type)
+ && INTEGRAL_OR_ENUMERATION_TYPE_P (intype)))
+ /* Really, build_c_cast should defer to this function rather
+ than the other way around. */
+ return build_c_cast (type, expr);
+ if (TYPE_PTR_P (type) && TYPE_PTR_P (intype)
+ && CLASS_TYPE_P (TREE_TYPE (type))
+ && CLASS_TYPE_P (TREE_TYPE (intype))
+ && can_convert (build_pointer_type (TYPE_MAIN_VARIANT
+ (TREE_TYPE (intype))),
+ build_pointer_type (TYPE_MAIN_VARIANT
+ (TREE_TYPE (type)))))
+ {
+ tree base;
+
+ check_for_casting_away_constness (intype, type);
+ base = lookup_base (TREE_TYPE (type), TREE_TYPE (intype),
+ ba_check | ba_quiet, NULL);
+ return build_base_path (MINUS_EXPR, expr, base, /*nonnull=*/false);
+ }
+ if ((TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (intype))
+ || (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype)))
+ {
+ tree c1;
+ tree c2;
+ tree t1;
+ tree t2;
+
+ c1 = TYPE_PTRMEM_CLASS_TYPE (intype);
+ c2 = TYPE_PTRMEM_CLASS_TYPE (type);
+
+ if (TYPE_PTRMEM_P (type))
+ {
+ t1 = (build_ptrmem_type
+ (c1,
+ TYPE_MAIN_VARIANT (TYPE_PTRMEM_POINTED_TO_TYPE (intype))));
+ t2 = (build_ptrmem_type
+ (c2,
+ TYPE_MAIN_VARIANT (TYPE_PTRMEM_POINTED_TO_TYPE (type))));
+ }
+ else
+ {
+ t1 = intype;
+ t2 = type;
+ }
+ if (can_convert (t1, t2))
+ {
+ check_for_casting_away_constness (intype, type);
+ if (TYPE_PTRMEM_P (type))
+ {
+ if (TREE_CODE (expr) == PTRMEM_CST)
+ expr = cplus_expand_constant (expr);
+ expr = cp_build_binary_op (PLUS_EXPR,
+ cp_convert (ptrdiff_type_node, expr),
+ get_delta_difference (c1, c2,
+ /*force=*/1));
+ return build_nop (type, expr);
+ }
+ else
+ return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr,
+ /*force=*/1);
+ }
}
+
+ /* [expr.static.cast]
- if (ok)
- return build_c_cast (type, expr);
+ An rvalue of type "pointer to cv void" can be explicitly
+ converted to a pointer to object type. A value of type pointer
+ to object converted to "pointer to cv void" and back to the
+ original pointer type will have its original value. */
+ if (TREE_CODE (intype) == POINTER_TYPE
+ && VOID_TYPE_P (TREE_TYPE (intype))
+ && TYPE_PTROB_P (type))
+ {
+ check_for_casting_away_constness (intype, type);
+ return build_nop (type, expr);
+ }
error ("invalid static_cast from type `%T' to type `%T'", intype, type);
return error_mark_node;
}
tree
-build_reinterpret_cast (type, expr)
- tree type, expr;
+build_reinterpret_cast (tree type, tree expr)
{
tree intype;
@@ -5062,8 +5044,7 @@ build_reinterpret_cast (type, expr)
}
tree
-build_const_cast (type, expr)
- tree type, expr;
+build_const_cast (tree type, tree expr)
{
tree intype;
@@ -5132,8 +5113,7 @@ build_const_cast (type, expr)
when doing the cast. */
tree
-build_c_cast (type, expr)
- tree type, expr;
+build_c_cast (tree type, tree expr)
{
register tree value = expr;
tree otype;
@@ -5299,10 +5279,7 @@ build_c_cast (type, expr)
C++: If MODIFYCODE is INIT_EXPR, then leave references unbashed. */
tree
-build_modify_expr (lhs, modifycode, rhs)
- tree lhs;
- enum tree_code modifycode;
- tree rhs;
+build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
{
register tree result;
tree newrhs = rhs;
@@ -5665,10 +5642,7 @@ build_modify_expr (lhs, modifycode, rhs)
}
tree
-build_x_modify_expr (lhs, modifycode, rhs)
- tree lhs;
- enum tree_code modifycode;
- tree rhs;
+build_x_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
{
if (processing_template_decl)
return build_min_nt (MODOP_EXPR, lhs,
@@ -5695,9 +5669,7 @@ build_x_modify_expr (lhs, modifycode, rhs)
a pointer to member of FROM to a pointer to member of TO. */
static tree
-get_delta_difference (from, to, force)
- tree from, to;
- int force;
+get_delta_difference (tree from, tree to, int force)
{
tree delta = integer_zero_node;
tree binfo;
@@ -5760,8 +5732,7 @@ get_delta_difference (from, to, force)
the other components as specified. */
tree
-build_ptrmemfunc1 (type, delta, pfn)
- tree type, delta, pfn;
+build_ptrmemfunc1 (tree type, tree delta, tree pfn)
{
tree u = NULL_TREE;
tree delta_field;
@@ -5799,9 +5770,7 @@ build_ptrmemfunc1 (type, delta, pfn)
Return error_mark_node, if something goes wrong. */
tree
-build_ptrmemfunc (type, pfn, force)
- tree type, pfn;
- int force;
+build_ptrmemfunc (tree type, tree pfn, int force)
{
tree fn;
tree pfn_type;
@@ -5886,10 +5855,7 @@ build_ptrmemfunc (type, pfn, force)
integer_type_node. */
void
-expand_ptrmemfunc_cst (cst, delta, pfn)
- tree cst;
- tree *delta;
- tree *pfn;
+expand_ptrmemfunc_cst (tree cst, tree *delta, tree *pfn)
{
tree type = TREE_TYPE (cst);
tree fn = PTRMEM_CST_MEMBER (cst);
@@ -5952,8 +5918,7 @@ expand_ptrmemfunc_cst (cst, delta, pfn)
given by T. */
tree
-pfn_from_ptrmemfunc (t)
- tree t;
+pfn_from_ptrmemfunc (tree t)
{
if (TREE_CODE (t) == PTRMEM_CST)
{
@@ -5973,12 +5938,8 @@ pfn_from_ptrmemfunc (t)
marked EXPR. */
tree
-dubious_conversion_warnings (type, expr, errtype, fndecl, parmnum)
- tree type;
- tree expr;
- const char *errtype;
- tree fndecl;
- int parmnum;
+dubious_conversion_warnings (tree type, tree expr,
+ const char *errtype, tree fndecl, int parmnum)
{
if (TREE_CODE (type) == REFERENCE_TYPE)
type = TREE_TYPE (type);
@@ -6033,11 +5994,8 @@ dubious_conversion_warnings (type, expr, errtype, fndecl, parmnum)
FNDECL. */
static tree
-convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
- tree type, rhs;
- const char *errtype;
- tree fndecl;
- int parmnum;
+convert_for_assignment (tree type, tree rhs,
+ const char *errtype, tree fndecl, int parmnum)
{
register enum tree_code codel = TREE_CODE (type);
register tree rhstype;
@@ -6137,12 +6095,8 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
If flags doesn't include LOOKUP_COMPLAIN, don't complain about anything. */
tree
-convert_for_initialization (exp, type, rhs, flags, errtype, fndecl, parmnum)
- tree exp, type, rhs;
- int flags;
- const char *errtype;
- tree fndecl;
- int parmnum;
+convert_for_initialization (tree exp, tree type, tree rhs, int flags,
+ const char *errtype, tree fndecl, int parmnum)
{
register enum tree_code codel = TREE_CODE (type);
register tree rhstype;
@@ -6232,11 +6186,8 @@ convert_for_initialization (exp, type, rhs, flags, errtype, fndecl, parmnum)
up operands that are expected to be in memory. */
void
-c_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
- tree string, outputs, inputs, clobbers;
- int vol;
- const char *filename;
- int line;
+c_expand_asm_operands (tree string, tree outputs, tree inputs, tree clobbers,
+ int vol, const char *filename, int line)
{
int noutputs = list_length (outputs);
register int i;
@@ -6286,8 +6237,7 @@ c_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
temporary give an appropraite warning. */
static void
-maybe_warn_about_returning_address_of_local (retval)
- tree retval;
+maybe_warn_about_returning_address_of_local (tree retval)
{
tree valtype = TREE_TYPE (DECL_RESULT (current_function_decl));
tree whats_returned = retval;
@@ -6313,8 +6263,6 @@ maybe_warn_about_returning_address_of_local (retval)
if (TREE_CODE (whats_returned) == AGGR_INIT_EXPR
|| TREE_CODE (whats_returned) == TARGET_EXPR)
{
- /* Get the target. */
- whats_returned = TREE_OPERAND (whats_returned, 0);
warning ("returning reference to temporary");
return;
}
@@ -6349,8 +6297,7 @@ maybe_warn_about_returning_address_of_local (retval)
the DECL_RESULT for the function. */
tree
-check_return_expr (retval)
- tree retval;
+check_return_expr (tree retval)
{
tree result;
/* The type actually returned by the function, after any
@@ -6402,7 +6349,8 @@ check_return_expr (retval)
that's supposed to return a value. */
if (!retval && fn_returns_value_p)
{
- pedwarn ("return-statement with no value, in function declared with a non-void return type");
+ pedwarn ("return-statement with no value, in function returning `%D'",
+ valtype);
/* Clear this, so finish_function won't say that we reach the
end of a non-void function (which we don't, we gave a
return!). */
@@ -6418,7 +6366,8 @@ check_return_expr (retval)
its side-effects. */
finish_expr_stmt (retval);
else
- pedwarn ("return-statement with a value, in function declared with a void return type");
+ pedwarn ("return-statement with a value, in function returning `%D'",
+ retval);
current_function_returns_null = 1;
@@ -6538,9 +6487,7 @@ check_return_expr (retval)
const-qualified. */
static int
-comp_ptr_ttypes_real (to, from, constp)
- tree to, from;
- int constp;
+comp_ptr_ttypes_real (tree to, tree from, int constp)
{
int to_more_cv_qualified = 0;
@@ -6584,8 +6531,7 @@ comp_ptr_ttypes_real (to, from, constp)
types to this function. */
int
-comp_ptr_ttypes (to, from)
- tree to, from;
+comp_ptr_ttypes (tree to, tree from)
{
return comp_ptr_ttypes_real (to, from, 1);
}
@@ -6594,8 +6540,7 @@ comp_ptr_ttypes (to, from)
type or inheritance-related types, regardless of cv-quals. */
int
-ptr_reasonably_similar (to, from)
- tree to, from;
+ptr_reasonably_similar (tree to, tree from)
{
for (; ; to = TREE_TYPE (to), from = TREE_TYPE (from))
{
@@ -6610,7 +6555,7 @@ ptr_reasonably_similar (to, from)
if (TREE_CODE (from) == OFFSET_TYPE
&& comptypes (TYPE_OFFSET_BASETYPE (to),
TYPE_OFFSET_BASETYPE (from),
- COMPARE_BASE | COMPARE_RELAXED))
+ COMPARE_BASE | COMPARE_DERIVED))
continue;
if (TREE_CODE (to) == INTEGER_TYPE
@@ -6623,15 +6568,14 @@ ptr_reasonably_similar (to, from)
if (TREE_CODE (to) != POINTER_TYPE)
return comptypes
(TYPE_MAIN_VARIANT (to), TYPE_MAIN_VARIANT (from),
- COMPARE_BASE | COMPARE_RELAXED);
+ COMPARE_BASE | COMPARE_DERIVED);
}
}
/* Like comp_ptr_ttypes, for const_cast. */
static int
-comp_ptr_ttypes_const (to, from)
- tree to, from;
+comp_ptr_ttypes_const (tree to, tree from)
{
for (; ; to = TREE_TYPE (to), from = TREE_TYPE (from))
{
@@ -6651,8 +6595,7 @@ comp_ptr_ttypes_const (to, from)
/* Like comp_ptr_ttypes, for reinterpret_cast. */
static int
-comp_ptr_ttypes_reinterpret (to, from)
- tree to, from;
+comp_ptr_ttypes_reinterpret (tree to, tree from)
{
int constp = 1;
@@ -6687,8 +6630,7 @@ comp_ptr_ttypes_reinterpret (to, from)
elements for an array type. */
int
-cp_type_quals (type)
- tree type;
+cp_type_quals (tree type)
{
type = strip_array_types (type);
if (type == error_mark_node)
@@ -6698,9 +6640,8 @@ cp_type_quals (type)
/* Returns nonzero if the TYPE contains a mutable member */
-int
-cp_has_mutable_p (type)
- tree type;
+bool
+cp_has_mutable_p (tree type)
{
type = strip_array_types (type);
@@ -6712,9 +6653,7 @@ cp_has_mutable_p (type)
if and only if there is no implicit conversion from T1 to T2. */
static void
-casts_away_constness_r (t1, t2)
- tree *t1;
- tree *t2;
+casts_away_constness_r (tree *t1, tree *t2)
{
int quals1;
int quals2;
@@ -6772,10 +6711,8 @@ casts_away_constness_r (t1, t2)
/* Returns nonzero if casting from TYPE1 to TYPE2 casts away
constness. */
-static int
-casts_away_constness (t1, t2)
- tree t1;
- tree t2;
+static bool
+casts_away_constness (tree t1, tree t2)
{
if (TREE_CODE (t2) == REFERENCE_TYPE)
{
@@ -6785,8 +6722,7 @@ casts_away_constness (t1, t2)
using a reference cast casts away constness if a cast from an
rvalue of type "pointer to T1" to the type "pointer to T2"
casts away constness. */
- t1 = (TREE_CODE (t1) == REFERENCE_TYPE
- ? TREE_TYPE (t1) : t1);
+ t1 = (TREE_CODE (t1) == REFERENCE_TYPE ? TREE_TYPE (t1) : t1);
return casts_away_constness (build_pointer_type (t1),
build_pointer_type (TREE_TYPE (t2)));
}
@@ -6807,16 +6743,16 @@ casts_away_constness (t1, t2)
pointer or reference types. */
if (TREE_CODE (t1) != POINTER_TYPE
|| TREE_CODE (t2) != POINTER_TYPE)
- return 0;
+ return false;
/* Top-level qualifiers don't matter. */
t1 = TYPE_MAIN_VARIANT (t1);
t2 = TYPE_MAIN_VARIANT (t2);
casts_away_constness_r (&t1, &t2);
if (!can_convert (t2, t1))
- return 1;
+ return true;
- return 0;
+ return false;
}
/* Returns TYPE with its cv qualifiers removed
@@ -6825,8 +6761,7 @@ casts_away_constness (t1, t2)
above are those of the array members.) */
static tree
-strip_all_pointer_quals (type)
- tree type;
+strip_all_pointer_quals (tree type)
{
if (TREE_CODE (type) == POINTER_TYPE)
return build_pointer_type (strip_all_pointer_quals (TREE_TYPE (type)));
diff --git a/gcc/cppcharset.c b/gcc/cppcharset.c
index b11e6424ad8..f506ba2bc1b 100644
--- a/gcc/cppcharset.c
+++ b/gcc/cppcharset.c
@@ -25,7 +25,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "cpplib.h"
#include "cpphash.h"
-static int ucn_valid_in_identifier PARAMS ((cpp_reader *, cppchar_t));
+static int ucn_valid_in_identifier (cpp_reader *, cppchar_t);
/* [lex.charset]: The character designated by the universal character
name \UNNNNNNNN is that character whose character short name in
@@ -52,10 +52,7 @@ static int ucn_valid_in_identifier PARAMS ((cpp_reader *, cppchar_t));
*/
cppchar_t
-_cpp_valid_ucn (pfile, pstr, identifier_pos)
- cpp_reader *pfile;
- const uchar **pstr;
- int identifier_pos;
+_cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr, int identifier_pos)
{
cppchar_t result, c;
unsigned int length;
@@ -128,9 +125,7 @@ _cpp_valid_ucn (pfile, pstr, identifier_pos)
identifier. We assume C has already gone through the checks of
_cpp_valid_ucn. */
static int
-ucn_valid_in_identifier (pfile, c)
- cpp_reader *pfile;
- cppchar_t c;
+ucn_valid_in_identifier (cpp_reader *pfile, cppchar_t c)
{
/* None of the valid chars are outside the Basic Multilingual Plane (the
low 16 bits). */
diff --git a/gcc/cpperror.c b/gcc/cpperror.c
index 9f5a5397f44..cb681f00f24 100644
--- a/gcc/cpperror.c
+++ b/gcc/cpperror.c
@@ -31,16 +31,14 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "cpphash.h"
#include "intl.h"
-static void print_location PARAMS ((cpp_reader *, unsigned int, unsigned int));
+static void print_location (cpp_reader *, unsigned int, unsigned int);
/* Print the logical file location (LINE, COL) in preparation for a
diagnostic. Outputs the #include chain if it has changed. A line
of zero suppresses the include stack, and outputs the program name
instead. */
static void
-print_location (pfile, line, col)
- cpp_reader *pfile;
- unsigned int line, col;
+print_location (cpp_reader *pfile, unsigned int line, unsigned int col)
{
if (!pfile->buffer || line == 0)
fprintf (stderr, "%s: ", progname);
@@ -72,10 +70,8 @@ print_location (pfile, line, col)
the correct place by default. Returns 0 if the error has been
suppressed. */
int
-_cpp_begin_message (pfile, code, line, column)
- cpp_reader *pfile;
- int code;
- unsigned int line, column;
+_cpp_begin_message (cpp_reader *pfile, int code, unsigned int line,
+ unsigned int column)
{
int level = DL_EXTRACT (code);
@@ -177,10 +173,7 @@ cpp_error_with_line (cpp_reader *pfile, int level,
}
void
-cpp_errno (pfile, level, msgid)
- cpp_reader *pfile;
- int level;
- const char *msgid;
+cpp_errno (cpp_reader *pfile, int level, const char *msgid)
{
if (msgid[0] == '\0')
msgid = _("stdout");
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index bb74d1a6423..16082efd5e2 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -40,34 +40,31 @@ struct op
/* Some simple utility routines on double integers. */
#define num_zerop(num) ((num.low | num.high) == 0)
#define num_eq(num1, num2) (num1.low == num2.low && num1.high == num2.high)
-static bool num_positive PARAMS ((cpp_num, size_t));
-static bool num_greater_eq PARAMS ((cpp_num, cpp_num, size_t));
-static cpp_num num_trim PARAMS ((cpp_num, size_t));
-static cpp_num num_part_mul PARAMS ((cpp_num_part, cpp_num_part));
-
-static cpp_num num_unary_op PARAMS ((cpp_reader *, cpp_num, enum cpp_ttype));
-static cpp_num num_binary_op PARAMS ((cpp_reader *, cpp_num, cpp_num,
- enum cpp_ttype));
-static cpp_num num_negate PARAMS ((cpp_num, size_t));
-static cpp_num num_bitwise_op PARAMS ((cpp_reader *, cpp_num, cpp_num,
- enum cpp_ttype));
-static cpp_num num_inequality_op PARAMS ((cpp_reader *, cpp_num, cpp_num,
- enum cpp_ttype));
-static cpp_num num_equality_op PARAMS ((cpp_reader *, cpp_num, cpp_num,
- enum cpp_ttype));
-static cpp_num num_mul PARAMS ((cpp_reader *, cpp_num, cpp_num));
-static cpp_num num_div_op PARAMS ((cpp_reader *, cpp_num, cpp_num,
- enum cpp_ttype));
-static cpp_num num_lshift PARAMS ((cpp_num, size_t, size_t));
-static cpp_num num_rshift PARAMS ((cpp_num, size_t, size_t));
-
-static cpp_num append_digit PARAMS ((cpp_num, int, int, size_t));
-static cpp_num parse_defined PARAMS ((cpp_reader *));
-static cpp_num eval_token PARAMS ((cpp_reader *, const cpp_token *));
-static struct op *reduce PARAMS ((cpp_reader *, struct op *, enum cpp_ttype));
-static unsigned int interpret_float_suffix PARAMS ((const uchar *, size_t));
-static unsigned int interpret_int_suffix PARAMS ((const uchar *, size_t));
-static void check_promotion PARAMS ((cpp_reader *, const struct op *));
+static bool num_positive (cpp_num, size_t);
+static bool num_greater_eq (cpp_num, cpp_num, size_t);
+static cpp_num num_trim (cpp_num, size_t);
+static cpp_num num_part_mul (cpp_num_part, cpp_num_part);
+
+static cpp_num num_unary_op (cpp_reader *, cpp_num, enum cpp_ttype);
+static cpp_num num_binary_op (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype);
+static cpp_num num_negate (cpp_num, size_t);
+static cpp_num num_bitwise_op (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype);
+static cpp_num num_inequality_op (cpp_reader *, cpp_num, cpp_num,
+ enum cpp_ttype);
+static cpp_num num_equality_op (cpp_reader *, cpp_num, cpp_num,
+ enum cpp_ttype);
+static cpp_num num_mul (cpp_reader *, cpp_num, cpp_num);
+static cpp_num num_div_op (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype);
+static cpp_num num_lshift (cpp_num, size_t, size_t);
+static cpp_num num_rshift (cpp_num, size_t, size_t);
+
+static cpp_num append_digit (cpp_num, int, int, size_t);
+static cpp_num parse_defined (cpp_reader *);
+static cpp_num eval_token (cpp_reader *, const cpp_token *);
+static struct op *reduce (cpp_reader *, struct op *, enum cpp_ttype);
+static unsigned int interpret_float_suffix (const uchar *, size_t);
+static unsigned int interpret_int_suffix (const uchar *, size_t);
+static void check_promotion (cpp_reader *, const struct op *);
/* Token type abuse to create unary plus and minus operators. */
#define CPP_UPLUS (CPP_LAST_CPP_OP + 1)
@@ -84,9 +81,7 @@ static void check_promotion PARAMS ((cpp_reader *, const struct op *));
length LEN, possibly zero. Returns 0 for an invalid suffix, or a
flag vector describing the suffix. */
static unsigned int
-interpret_float_suffix (s, len)
- const uchar *s;
- size_t len;
+interpret_float_suffix (const uchar *s, size_t len)
{
size_t f = 0, l = 0, i = 0;
@@ -113,9 +108,7 @@ interpret_float_suffix (s, len)
of length LEN, possibly zero. Returns 0 for an invalid suffix, or a
flag vector describing the suffix. */
static unsigned int
-interpret_int_suffix (s, len)
- const uchar *s;
- size_t len;
+interpret_int_suffix (const uchar *s, size_t len)
{
size_t u, l, i;
@@ -149,9 +142,7 @@ interpret_int_suffix (s, len)
floating point, or invalid), radix (decimal, octal, hexadecimal),
and type suffixes. */
unsigned int
-cpp_classify_number (pfile, token)
- cpp_reader *pfile;
- const cpp_token *token;
+cpp_classify_number (cpp_reader *pfile, const cpp_token *token)
{
const uchar *str = token->val.str.text;
const uchar *limit;
@@ -314,13 +305,11 @@ cpp_classify_number (pfile, token)
of precision options->precision.
We do not provide any interface for decimal->float conversion,
- because the preprocessor doesn't need it and the floating point
- handling in GCC proper is too ugly to speak of. */
+ because the preprocessor doesn't need it and we don't want to
+ drag in GCC's floating point emulator. */
cpp_num
-cpp_interpret_integer (pfile, token, type)
- cpp_reader *pfile;
- const cpp_token *token;
- unsigned int type;
+cpp_interpret_integer (cpp_reader *pfile, const cpp_token *token,
+ unsigned int type)
{
const uchar *p, *end;
cpp_num result;
@@ -403,13 +392,9 @@ cpp_interpret_integer (pfile, token, type)
return result;
}
-/* Append DIGIT to NUM, a number of PRECISION bits being read in base
- BASE. */
+/* Append DIGIT to NUM, a number of PRECISION bits being read in base BASE. */
static cpp_num
-append_digit (num, digit, base, precision)
- cpp_num num;
- int digit, base;
- size_t precision;
+append_digit (cpp_num num, int digit, int base, size_t precision)
{
cpp_num result;
unsigned int shift = 3 + (base == 16);
@@ -458,8 +443,7 @@ append_digit (num, digit, base, precision)
/* Handle meeting "defined" in a preprocessor expression. */
static cpp_num
-parse_defined (pfile)
- cpp_reader *pfile;
+parse_defined (cpp_reader *pfile)
{
cpp_num result;
int paren = 0;
@@ -529,9 +513,7 @@ parse_defined (pfile)
number or character constant, or the result of the "defined" or "#"
operators). */
static cpp_num
-eval_token (pfile, token)
- cpp_reader *pfile;
- const cpp_token *token;
+eval_token (cpp_reader *pfile, const cpp_token *token)
{
cpp_num result;
unsigned int temp;
@@ -695,8 +677,7 @@ static const struct operator
stored in the 'value' field of the stack element of the operator
that precedes it. */
bool
-_cpp_parse_expr (pfile)
- cpp_reader *pfile;
+_cpp_parse_expr (cpp_reader *pfile)
{
struct op *top = pfile->op_stack;
unsigned int lex_count;
@@ -838,10 +819,7 @@ _cpp_parse_expr (pfile)
pushing operator OP. Returns NULL on error, otherwise the top of
the stack. */
static struct op *
-reduce (pfile, top, op)
- cpp_reader *pfile;
- struct op *top;
- enum cpp_ttype op;
+reduce (cpp_reader *pfile, struct op *top, enum cpp_ttype op)
{
unsigned int prio;
@@ -985,8 +963,7 @@ reduce (pfile, top, op)
/* Returns the position of the old top of stack after expansion. */
struct op *
-_cpp_expand_op_stack (pfile)
- cpp_reader *pfile;
+_cpp_expand_op_stack (cpp_reader *pfile)
{
size_t old_size = (size_t) (pfile->op_limit - pfile->op_stack);
size_t new_size = old_size * 2 + 20;
@@ -1001,9 +978,7 @@ _cpp_expand_op_stack (pfile)
/* Emits a warning if the effective sign of either operand of OP
changes because of integer promotions. */
static void
-check_promotion (pfile, op)
- cpp_reader *pfile;
- const struct op *op;
+check_promotion (cpp_reader *pfile, const struct op *op)
{
if (op->value.unsignedp == op[-1].value.unsignedp)
return;
@@ -1023,9 +998,7 @@ check_promotion (pfile, op)
/* Clears the unused high order bits of the number pointed to by PNUM. */
static cpp_num
-num_trim (num, precision)
- cpp_num num;
- size_t precision;
+num_trim (cpp_num num, size_t precision)
{
if (precision > PART_PRECISION)
{
@@ -1045,9 +1018,7 @@ num_trim (num, precision)
/* True iff A (presumed signed) >= 0. */
static bool
-num_positive (num, precision)
- cpp_num num;
- size_t precision;
+num_positive (cpp_num num, size_t precision)
{
if (precision > PART_PRECISION)
{
@@ -1061,9 +1032,7 @@ num_positive (num, precision)
/* Sign extend a number, with PRECISION significant bits and all
others assumed clear, to fill out a cpp_num structure. */
cpp_num
-cpp_num_sign_extend (num, precision)
- cpp_num num;
- size_t precision;
+cpp_num_sign_extend (cpp_num num, size_t precision)
{
if (!num.unsignedp)
{
@@ -1087,9 +1056,7 @@ cpp_num_sign_extend (num, precision)
/* Returns the negative of NUM. */
static cpp_num
-num_negate (num, precision)
- cpp_num num;
- size_t precision;
+num_negate (cpp_num num, size_t precision)
{
cpp_num copy;
@@ -1106,9 +1073,7 @@ num_negate (num, precision)
/* Returns true if A >= B. */
static bool
-num_greater_eq (pa, pb, precision)
- cpp_num pa, pb;
- size_t precision;
+num_greater_eq (cpp_num pa, cpp_num pb, size_t precision)
{
bool unsignedp;
@@ -1131,10 +1096,8 @@ num_greater_eq (pa, pb, precision)
/* Returns LHS OP RHS, where OP is a bit-wise operation. */
static cpp_num
-num_bitwise_op (pfile, lhs, rhs, op)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
- cpp_num lhs, rhs;
- enum cpp_ttype op;
+num_bitwise_op (cpp_reader *pfile ATTRIBUTE_UNUSED,
+ cpp_num lhs, cpp_num rhs, enum cpp_ttype op)
{
lhs.overflow = false;
lhs.unsignedp = lhs.unsignedp || rhs.unsignedp;
@@ -1162,10 +1125,8 @@ num_bitwise_op (pfile, lhs, rhs, op)
/* Returns LHS OP RHS, where OP is an inequality. */
static cpp_num
-num_inequality_op (pfile, lhs, rhs, op)
- cpp_reader *pfile;
- cpp_num lhs, rhs;
- enum cpp_ttype op;
+num_inequality_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs,
+ enum cpp_ttype op)
{
bool gte = num_greater_eq (lhs, rhs, CPP_OPTION (pfile, precision));
@@ -1186,10 +1147,8 @@ num_inequality_op (pfile, lhs, rhs, op)
/* Returns LHS OP RHS, where OP is == or !=. */
static cpp_num
-num_equality_op (pfile, lhs, rhs, op)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
- cpp_num lhs, rhs;
- enum cpp_ttype op;
+num_equality_op (cpp_reader *pfile ATTRIBUTE_UNUSED,
+ cpp_num lhs, cpp_num rhs, enum cpp_ttype op)
{
/* Work around a 3.0.4 bug; see PR 6950. */
bool eq = num_eq (lhs, rhs);
@@ -1204,9 +1163,7 @@ num_equality_op (pfile, lhs, rhs, op)
/* Shift NUM, of width PRECISION, right by N bits. */
static cpp_num
-num_rshift (num, precision, n)
- cpp_num num;
- size_t precision, n;
+num_rshift (cpp_num num, size_t precision, size_t n)
{
cpp_num_part sign_mask;
@@ -1246,9 +1203,7 @@ num_rshift (num, precision, n)
/* Shift NUM, of width PRECISION, left by N bits. */
static cpp_num
-num_lshift (num, precision, n)
- cpp_num num;
- size_t precision, n;
+num_lshift (cpp_num num, size_t precision, size_t n)
{
if (n >= precision)
{
@@ -1288,10 +1243,7 @@ num_lshift (num, precision, n)
/* The four unary operators: +, -, ! and ~. */
static cpp_num
-num_unary_op (pfile, num, op)
- cpp_reader *pfile;
- cpp_num num;
- enum cpp_ttype op;
+num_unary_op (cpp_reader *pfile, cpp_num num, enum cpp_ttype op)
{
switch (op)
{
@@ -1326,10 +1278,7 @@ num_unary_op (pfile, num, op)
/* The various binary operators. */
static cpp_num
-num_binary_op (pfile, lhs, rhs, op)
- cpp_reader *pfile;
- cpp_num lhs, rhs;
- enum cpp_ttype op;
+num_binary_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op)
{
cpp_num result;
size_t precision = CPP_OPTION (pfile, precision);
@@ -1411,8 +1360,7 @@ num_binary_op (pfile, lhs, rhs, op)
/* Multiplies two unsigned cpp_num_parts to give a cpp_num. This
cannot overflow. */
static cpp_num
-num_part_mul (lhs, rhs)
- cpp_num_part lhs, rhs;
+num_part_mul (cpp_num_part lhs, cpp_num_part rhs)
{
cpp_num result;
cpp_num_part middle[2], temp;
@@ -1442,9 +1390,7 @@ num_part_mul (lhs, rhs)
/* Multiply two preprocessing numbers. */
static cpp_num
-num_mul (pfile, lhs, rhs)
- cpp_reader *pfile;
- cpp_num lhs, rhs;
+num_mul (cpp_reader *pfile, cpp_num lhs, cpp_num rhs)
{
cpp_num result, temp;
bool unsignedp = lhs.unsignedp || rhs.unsignedp;
@@ -1494,10 +1440,7 @@ num_mul (pfile, lhs, rhs)
/* Divide two preprocessing numbers, returning the answer or the
remainder depending upon OP. */
static cpp_num
-num_div_op (pfile, lhs, rhs, op)
- cpp_reader *pfile;
- cpp_num lhs, rhs;
- enum cpp_ttype op;
+num_div_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op)
{
cpp_num result, sub;
cpp_num_part mask;
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index 292026a6cce..ceb64136969 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -86,31 +86,24 @@ struct include_file {
#define NO_INCLUDE_PATH ((struct include_file *) -1)
#define INCLUDE_PCH_P(F) (((F)->pch & 1) != 0)
-static struct file_name_map *read_name_map
- PARAMS ((cpp_reader *, const char *));
-static char *read_filename_string PARAMS ((int, FILE *));
-static char *remap_filename PARAMS ((cpp_reader *, char *,
- struct cpp_path *));
-static struct cpp_path *search_from PARAMS ((cpp_reader *,
- enum include_type));
-static struct include_file *
- find_include_file PARAMS ((cpp_reader *, const char *, int,
- enum include_type));
-static struct include_file *open_file PARAMS ((cpp_reader *, const char *));
-static struct include_file *validate_pch PARAMS ((cpp_reader *,
- const char *,
- const char *));
-static struct include_file *open_file_pch PARAMS ((cpp_reader *,
- const char *));
-static int read_include_file PARAMS ((cpp_reader *, struct include_file *));
-static bool stack_include_file PARAMS ((cpp_reader *, struct include_file *));
-static void purge_cache PARAMS ((struct include_file *));
-static void destroy_node PARAMS ((splay_tree_value));
-static int report_missing_guard PARAMS ((splay_tree_node, void *));
-static splay_tree_node find_or_create_entry PARAMS ((cpp_reader *,
- const char *));
-static void handle_missing_header PARAMS ((cpp_reader *, const char *, int));
-static int remove_component_p PARAMS ((const char *));
+static struct file_name_map *read_name_map (cpp_reader *, const char *);
+static char *read_filename_string (int, FILE *);
+static char *remap_filename (cpp_reader *, char *, struct cpp_path *);
+static struct cpp_path *search_from (cpp_reader *, enum include_type);
+static struct include_file *find_include_file (cpp_reader *, const char *,
+ int, enum include_type);
+static struct include_file *open_file (cpp_reader *, const char *);
+static struct include_file *validate_pch (cpp_reader *, const char *,
+ const char *);
+static struct include_file *open_file_pch (cpp_reader *, const char *);
+static int read_include_file (cpp_reader *, struct include_file *);
+static bool stack_include_file (cpp_reader *, struct include_file *);
+static void purge_cache (struct include_file *);
+static void destroy_node (splay_tree_value);
+static int report_missing_guard (splay_tree_node, void *);
+static splay_tree_node find_or_create_entry (cpp_reader *, const char *);
+static void handle_missing_header (cpp_reader *, const char *, int);
+static int remove_component_p (const char *);
/* Set up the splay tree we use to store information about all the
file names seen in this compilation. We also have entries for each
@@ -125,8 +118,7 @@ static int remove_component_p PARAMS ((const char *));
A node's value is a pointer to a struct include_file, and is never
NULL. */
void
-_cpp_init_includes (pfile)
- cpp_reader *pfile;
+_cpp_init_includes (cpp_reader *pfile)
{
pfile->all_include_files
= splay_tree_new ((splay_tree_compare_fn) strcmp,
@@ -136,16 +128,14 @@ _cpp_init_includes (pfile)
/* Tear down the splay tree. */
void
-_cpp_cleanup_includes (pfile)
- cpp_reader *pfile;
+_cpp_cleanup_includes (cpp_reader *pfile)
{
splay_tree_delete (pfile->all_include_files);
}
/* Free a node. The path string is automatically freed. */
static void
-destroy_node (v)
- splay_tree_value v;
+destroy_node (splay_tree_value v)
{
struct include_file *f = (struct include_file *) v;
@@ -158,8 +148,7 @@ destroy_node (v)
/* Mark a file to not be reread (e.g. #import, read failure). */
void
-_cpp_never_reread (file)
- struct include_file *file;
+_cpp_never_reread (struct include_file *file)
{
file->cmacro = NEVER_REREAD;
}
@@ -167,9 +156,7 @@ _cpp_never_reread (file)
/* Lookup a filename, which is simplified after making a copy, and
create an entry if none exists. */
static splay_tree_node
-find_or_create_entry (pfile, fname)
- cpp_reader *pfile;
- const char *fname;
+find_or_create_entry (cpp_reader *pfile, const char *fname)
{
splay_tree_node node;
struct include_file *file;
@@ -197,9 +184,7 @@ find_or_create_entry (pfile, fname)
/* Enter a file name in the splay tree, for the sake of cpp_included. */
void
-_cpp_fake_include (pfile, fname)
- cpp_reader *pfile;
- const char *fname;
+_cpp_fake_include (cpp_reader *pfile, const char *fname)
{
find_or_create_entry (pfile, fname);
}
@@ -214,9 +199,7 @@ _cpp_fake_include (pfile, fname)
Returns an include_file structure with an open file descriptor on
success, or NULL on failure. */
static struct include_file *
-open_file (pfile, filename)
- cpp_reader *pfile;
- const char *filename;
+open_file (cpp_reader *pfile, const char *filename)
{
splay_tree_node nd = find_or_create_entry (pfile, filename);
struct include_file *file = (struct include_file *) nd->value;
@@ -281,10 +264,7 @@ open_file (pfile, filename)
}
static struct include_file *
-validate_pch (pfile, filename, pchname)
- cpp_reader *pfile;
- const char *filename;
- const char *pchname;
+validate_pch (cpp_reader *pfile, const char *filename, const char *pchname)
{
struct include_file * file;
@@ -316,9 +296,7 @@ validate_pch (pfile, filename, pchname)
/* Like open_file, but also look for a precompiled header if (a) one exists
and (b) it is valid. */
static struct include_file *
-open_file_pch (pfile, filename)
- cpp_reader *pfile;
- const char *filename;
+open_file_pch (cpp_reader *pfile, const char *filename)
{
if (filename[0] != '\0'
&& pfile->cb.valid_pch != NULL)
@@ -377,9 +355,7 @@ open_file_pch (pfile, filename)
because of e.g. multiple-include guards. Returns true if a buffer
is stacked. */
static bool
-stack_include_file (pfile, inc)
- cpp_reader *pfile;
- struct include_file *inc;
+stack_include_file (cpp_reader *pfile, struct include_file *inc)
{
cpp_buffer *fp;
int sysp;
@@ -462,9 +438,7 @@ stack_include_file (pfile, inc)
FIXME: Flush file cache and try again if we run out of memory. */
static int
-read_include_file (pfile, inc)
- cpp_reader *pfile;
- struct include_file *inc;
+read_include_file (cpp_reader *pfile, struct include_file *inc)
{
ssize_t size, offset, count;
uchar *buf;
@@ -555,12 +529,11 @@ read_include_file (pfile, inc)
/* Drop INC's buffer from memory. */
static void
-purge_cache (inc)
- struct include_file *inc;
+purge_cache (struct include_file *inc)
{
if (inc->buffer)
{
- free ((PTR) inc->buffer);
+ free ((void *) inc->buffer);
inc->buffer = NULL;
}
}
@@ -568,9 +541,7 @@ purge_cache (inc)
/* Return 1 if the file named by FNAME has been included before in
any context, 0 otherwise. */
int
-cpp_included (pfile, fname)
- cpp_reader *pfile;
- const char *fname;
+cpp_included (cpp_reader *pfile, const char *fname)
{
struct cpp_path *path;
char *name, *n;
@@ -608,11 +579,8 @@ cpp_included (pfile, fname)
otherwise an include_file structure. If this request originates
from a directive of TYPE #include_next, set INCLUDE_NEXT to true. */
static struct include_file *
-find_include_file (pfile, fname, angle_brackets, type)
- cpp_reader *pfile;
- const char *fname;
- int angle_brackets;
- enum include_type type;
+find_include_file (cpp_reader *pfile, const char *fname, int angle_brackets,
+ enum include_type type)
{
struct cpp_path *path;
struct include_file *file;
@@ -676,9 +644,7 @@ find_include_file (pfile, fname, angle_brackets, type)
see the details of a buffer. This is an exported interface because
fix-header needs it. */
void
-cpp_make_system_header (pfile, syshdr, externc)
- cpp_reader *pfile;
- int syshdr, externc;
+cpp_make_system_header (cpp_reader *pfile, int syshdr, int externc)
{
int flags = 0;
@@ -693,10 +659,8 @@ cpp_make_system_header (pfile, syshdr, externc)
to achieve pseudo-file names like <built-in>.
If REASON is LC_LEAVE, then NEW_NAME must be NULL. */
void
-cpp_change_file (pfile, reason, new_name)
- cpp_reader *pfile;
- enum lc_reason reason;
- const char *new_name;
+cpp_change_file (cpp_reader *pfile, enum lc_reason reason,
+ const char *new_name)
{
_cpp_do_file_change (pfile, reason, new_name, 1, 0);
}
@@ -704,19 +668,15 @@ cpp_change_file (pfile, reason, new_name)
/* Report on all files that might benefit from a multiple include guard.
Triggered by -H. */
void
-_cpp_report_missing_guards (pfile)
- cpp_reader *pfile;
+_cpp_report_missing_guards (cpp_reader *pfile)
{
int banner = 0;
- splay_tree_foreach (pfile->all_include_files, report_missing_guard,
- (PTR) &banner);
+ splay_tree_foreach (pfile->all_include_files, report_missing_guard, &banner);
}
/* Callback function for splay_tree_foreach(). */
static int
-report_missing_guard (n, b)
- splay_tree_node n;
- void *b;
+report_missing_guard (splay_tree_node n, void *b)
{
struct include_file *f = (struct include_file *) n->value;
int *bannerp = (int *) b;
@@ -738,10 +698,8 @@ report_missing_guard (n, b)
appropriate. ANGLE_BRACKETS is nonzero if the file was bracketed
like <..>. */
static void
-handle_missing_header (pfile, fname, angle_brackets)
- cpp_reader *pfile;
- const char *fname;
- int angle_brackets;
+handle_missing_header (cpp_reader *pfile, const char *fname,
+ int angle_brackets)
{
bool print_dep
= CPP_OPTION (pfile, deps.style) > (angle_brackets || pfile->map->sysp);
@@ -762,11 +720,8 @@ handle_missing_header (pfile, fname, angle_brackets)
including HEADER, and the command line -imacros and -include.
Returns true if a buffer was stacked. */
bool
-_cpp_execute_include (pfile, fname, angle_brackets, type)
- cpp_reader *pfile;
- const char *fname;
- int angle_brackets;
- enum include_type type;
+_cpp_execute_include (cpp_reader *pfile, const char *fname, int angle_brackets,
+ enum include_type type)
{
bool stacked = false;
struct include_file *inc;
@@ -786,13 +741,11 @@ _cpp_execute_include (pfile, fname, angle_brackets, type)
}
/* Locate HEADER, and determine whether it is newer than the current
- file. If it cannot be located or dated, return -1, if it is newer
+ file. If it cannot be located or dated, return -1, if it is
newer, return 1, otherwise 0. */
int
-_cpp_compare_file_date (pfile, fname, angle_brackets)
- cpp_reader *pfile;
- const char *fname;
- int angle_brackets;
+_cpp_compare_file_date (cpp_reader *pfile, const char *fname,
+ int angle_brackets)
{
struct include_file *inc;
@@ -814,9 +767,7 @@ _cpp_compare_file_date (pfile, fname, angle_brackets)
FNAME is "", read standard input. Return true if a buffer was
stacked. */
bool
-_cpp_read_file (pfile, fname)
- cpp_reader *pfile;
- const char *fname;
+_cpp_read_file (cpp_reader *pfile, const char *fname)
{
/* This uses open_file, because we don't allow a PCH to be used as
the toplevel compilation (that would prevent re-compiling an
@@ -835,9 +786,7 @@ _cpp_read_file (pfile, fname)
/* Pushes the given file onto the buffer stack. Returns nonzero if
successful. */
bool
-cpp_push_include (pfile, filename)
- cpp_reader *pfile;
- const char *filename;
+cpp_push_include (cpp_reader *pfile, const char *filename)
{
/* Make the command line directive take up a line. */
pfile->line++;
@@ -847,9 +796,7 @@ cpp_push_include (pfile, filename)
/* Do appropriate cleanup when a file INC's buffer is popped off the
input stack. */
void
-_cpp_pop_file_buffer (pfile, inc)
- cpp_reader *pfile;
- struct include_file *inc;
+_cpp_pop_file_buffer (cpp_reader *pfile, struct include_file *inc)
{
/* Record the inclusion-preventing macro, which could be NULL
meaning no controlling macro. */
@@ -869,9 +816,7 @@ _cpp_pop_file_buffer (pfile, inc)
If we're handling -include or -imacros, use the "" chain, but with
the preprocessor's cwd prepended. */
static struct cpp_path *
-search_from (pfile, type)
- cpp_reader *pfile;
- enum include_type type;
+search_from (cpp_reader *pfile, enum include_type type)
{
cpp_buffer *buffer = pfile->buffer;
unsigned int dlen;
@@ -934,9 +879,7 @@ struct file_name_map {
/* Read a space delimited string of unlimited length from a stdio
file F. */
static char *
-read_filename_string (ch, f)
- int ch;
- FILE *f;
+read_filename_string (int ch, FILE *f)
{
char *alloc, *set;
int len;
@@ -971,9 +914,7 @@ struct file_name_map_list {
/* Read the file name map file for DIRNAME. */
static struct file_name_map *
-read_name_map (pfile, dirname)
- cpp_reader *pfile;
- const char *dirname;
+read_name_map (cpp_reader *pfile, const char *dirname)
{
struct file_name_map_list *map_list_ptr;
char *name;
@@ -1049,10 +990,7 @@ read_name_map (pfile, dirname)
/* Remap an unsimplified path NAME based on the file_name_map (if any)
for LOC. */
static char *
-remap_filename (pfile, name, loc)
- cpp_reader *pfile;
- char *name;
- struct cpp_path *loc;
+remap_filename (cpp_reader *pfile, char *name, struct cpp_path *loc)
{
struct file_name_map *map;
const char *from, *p;
@@ -1107,10 +1045,8 @@ remap_filename (pfile, name, loc)
If BRACKET does not lie in the QUOTE chain, it is set to QUOTE. */
void
-cpp_set_include_chains (pfile, quote, bracket, quote_ignores_source_dir)
- cpp_reader *pfile;
- cpp_path *quote, *bracket;
- int quote_ignores_source_dir;
+cpp_set_include_chains (cpp_reader *pfile, cpp_path *quote, cpp_path *bracket,
+ int quote_ignores_source_dir)
{
pfile->quote_include = quote;
pfile->bracket_include = quote;
@@ -1133,8 +1069,7 @@ cpp_set_include_chains (pfile, quote, bracket, quote_ignores_source_dir)
symlinks if we have it. If not, we can still catch errors with
stat (). */
static int
-remove_component_p (path)
- const char *path;
+remove_component_p (const char *path)
{
struct stat s;
int result;
@@ -1169,8 +1104,7 @@ remove_component_p (path)
of the string. Returns PATH. errno is 0 if no error occurred;
nonzero if an error occurred when using stat () or lstat (). */
void
-cpp_simplify_path (path)
- char *path ATTRIBUTE_UNUSED;
+cpp_simplify_path (char *path ATTRIBUTE_UNUSED)
{
#ifndef VMS
char *from, *to;
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 77bf9c07439..01cd0a41f26 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -30,28 +30,25 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "cpplib.h"
#include "cpphash.h"
-static cpp_hashnode *alloc_node PARAMS ((hash_table *));
+static cpp_hashnode *alloc_node (hash_table *);
/* Return an identifier node for hashtable.c. Used by cpplib except
when integrated with the C front ends. */
static cpp_hashnode *
-alloc_node (table)
- hash_table *table;
+alloc_node (hash_table *table)
{
cpp_hashnode *node;
node = (cpp_hashnode *) obstack_alloc (&table->pfile->hash_ob,
sizeof (cpp_hashnode));
- memset ((PTR) node, 0, sizeof (cpp_hashnode));
+ memset (node, 0, sizeof (cpp_hashnode));
return node;
}
/* Set up the identifier hash table. Use TABLE if non-null, otherwise
create our own. */
void
-_cpp_init_hashtable (pfile, table)
- cpp_reader *pfile;
- hash_table *table;
+_cpp_init_hashtable (cpp_reader *pfile, hash_table *table)
{
struct spec_nodes *s;
@@ -59,7 +56,7 @@ _cpp_init_hashtable (pfile, table)
{
pfile->our_hashtable = 1;
table = ht_create (13); /* 8K (=2^13) entries. */
- table->alloc_node = (hashnode (*) PARAMS ((hash_table *))) alloc_node;
+ table->alloc_node = (hashnode (*) (hash_table *)) alloc_node;
gcc_obstack_init (&pfile->hash_ob);
}
@@ -80,8 +77,7 @@ _cpp_init_hashtable (pfile, table)
/* Tear down the identifier hash table. */
void
-_cpp_destroy_hashtable (pfile)
- cpp_reader *pfile;
+_cpp_destroy_hashtable (cpp_reader *pfile)
{
if (pfile->our_hashtable)
{
@@ -93,10 +89,7 @@ _cpp_destroy_hashtable (pfile)
/* Returns the hash entry for the STR of length LEN, creating one
if necessary. */
cpp_hashnode *
-cpp_lookup (pfile, str, len)
- cpp_reader *pfile;
- const unsigned char *str;
- unsigned int len;
+cpp_lookup (cpp_reader *pfile, const unsigned char *str, unsigned int len)
{
/* ht_lookup cannot return NULL. */
return CPP_HASHNODE (ht_lookup (pfile->hash_table, str, len, HT_ALLOC));
@@ -104,10 +97,7 @@ cpp_lookup (pfile, str, len)
/* Determine whether the str STR, of length LEN, is a defined macro. */
int
-cpp_defined (pfile, str, len)
- cpp_reader *pfile;
- const unsigned char *str;
- int len;
+cpp_defined (cpp_reader *pfile, const unsigned char *str, int len)
{
cpp_hashnode *node;
@@ -120,10 +110,7 @@ cpp_defined (pfile, str, len)
/* For all nodes in the hashtable, callback CB with parameters PFILE,
the node, and V. */
void
-cpp_forall_identifiers (pfile, cb, v)
- cpp_reader *pfile;
- cpp_cb cb;
- PTR v;
+cpp_forall_identifiers (cpp_reader *pfile, cpp_cb cb, void *v)
{
/* We don't need a proxy since the hash table's identifier comes
first in cpp_hashnode. */
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index f6dbb10c18c..32fa1aaae1e 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -117,14 +117,13 @@ struct _cpp_buff
unsigned char *base, *cur, *limit;
};
-extern _cpp_buff *_cpp_get_buff PARAMS ((cpp_reader *, size_t));
-extern void _cpp_release_buff PARAMS ((cpp_reader *, _cpp_buff *));
-extern void _cpp_extend_buff PARAMS ((cpp_reader *, _cpp_buff **, size_t));
-extern _cpp_buff *_cpp_append_extend_buff PARAMS ((cpp_reader *, _cpp_buff *,
- size_t));
-extern void _cpp_free_buff PARAMS ((_cpp_buff *));
-extern unsigned char *_cpp_aligned_alloc PARAMS ((cpp_reader *, size_t));
-extern unsigned char *_cpp_unaligned_alloc PARAMS ((cpp_reader *, size_t));
+extern _cpp_buff *_cpp_get_buff (cpp_reader *, size_t);
+extern void _cpp_release_buff (cpp_reader *, _cpp_buff *);
+extern void _cpp_extend_buff (cpp_reader *, _cpp_buff **, size_t);
+extern _cpp_buff *_cpp_append_extend_buff (cpp_reader *, _cpp_buff *, size_t);
+extern void _cpp_free_buff (_cpp_buff *);
+extern unsigned char *_cpp_aligned_alloc (cpp_reader *, size_t);
+extern unsigned char *_cpp_unaligned_alloc (cpp_reader *, size_t);
#define BUFF_ROOM(BUFF) (size_t) ((BUFF)->limit - (BUFF)->cur)
#define BUFF_FRONT(BUFF) ((BUFF)->cur)
@@ -393,7 +392,7 @@ struct cpp_reader
list of recognized pragmas. */
struct pragma_entry *pragmas;
- /* Call backs. */
+ /* Call backs to cpplib client. */
struct cpp_callbacks cb;
/* Identifier hash table. */
@@ -468,90 +467,79 @@ extern unsigned char _cpp_trigraph_map[UCHAR_MAX + 1];
#define CPP_WTRADITIONAL(PF) CPP_OPTION (PF, warn_traditional)
/* In cpperror.c */
-extern int _cpp_begin_message PARAMS ((cpp_reader *, int,
- unsigned int, unsigned int));
+extern int _cpp_begin_message (cpp_reader *, int, unsigned int, unsigned int);
/* In cppmacro.c */
-extern void _cpp_free_definition PARAMS ((cpp_hashnode *));
-extern bool _cpp_create_definition PARAMS ((cpp_reader *, cpp_hashnode *));
-extern void _cpp_pop_context PARAMS ((cpp_reader *));
-extern void _cpp_push_text_context PARAMS ((cpp_reader *, cpp_hashnode *,
- const uchar *, size_t));
-extern bool _cpp_save_parameter PARAMS ((cpp_reader *, cpp_macro *,
- cpp_hashnode *));
-extern bool _cpp_arguments_ok PARAMS ((cpp_reader *, cpp_macro *,
- const cpp_hashnode *,
- unsigned int));
-extern const uchar *_cpp_builtin_macro_text PARAMS ((cpp_reader *,
- cpp_hashnode *));
-int _cpp_warn_if_unused_macro PARAMS ((cpp_reader *, cpp_hashnode *,
- void *));
+extern void _cpp_free_definition (cpp_hashnode *);
+extern bool _cpp_create_definition (cpp_reader *, cpp_hashnode *);
+extern void _cpp_pop_context (cpp_reader *);
+extern void _cpp_push_text_context (cpp_reader *, cpp_hashnode *,
+ const uchar *, size_t);
+extern bool _cpp_save_parameter (cpp_reader *, cpp_macro *, cpp_hashnode *);
+extern bool _cpp_arguments_ok (cpp_reader *, cpp_macro *, const cpp_hashnode *,
+ unsigned int);
+extern const uchar *_cpp_builtin_macro_text (cpp_reader *, cpp_hashnode *);
+int _cpp_warn_if_unused_macro (cpp_reader *, cpp_hashnode *, void *);
/* In cpphash.c */
-extern void _cpp_init_hashtable PARAMS ((cpp_reader *, hash_table *));
-extern void _cpp_destroy_hashtable PARAMS ((cpp_reader *));
+extern void _cpp_init_hashtable (cpp_reader *, hash_table *);
+extern void _cpp_destroy_hashtable (cpp_reader *);
/* In cppfiles.c */
-extern void _cpp_fake_include PARAMS ((cpp_reader *, const char *));
-extern void _cpp_never_reread PARAMS ((struct include_file *));
-extern bool _cpp_read_file PARAMS ((cpp_reader *, const char *));
-extern bool _cpp_execute_include PARAMS ((cpp_reader *, const char *,
- int, enum include_type));
-extern int _cpp_compare_file_date PARAMS ((cpp_reader *, const char *,
- int));
-extern void _cpp_report_missing_guards PARAMS ((cpp_reader *));
-extern void _cpp_init_includes PARAMS ((cpp_reader *));
-extern void _cpp_cleanup_includes PARAMS ((cpp_reader *));
-extern void _cpp_pop_file_buffer PARAMS ((cpp_reader *,
- struct include_file *));
+extern void _cpp_fake_include (cpp_reader *, const char *);
+extern void _cpp_never_reread (struct include_file *);
+extern bool _cpp_read_file (cpp_reader *, const char *);
+extern bool _cpp_execute_include (cpp_reader *, const char *, int,
+ enum include_type);
+extern int _cpp_compare_file_date (cpp_reader *, const char *, int);
+extern void _cpp_report_missing_guards (cpp_reader *);
+extern void _cpp_init_includes (cpp_reader *);
+extern void _cpp_cleanup_includes (cpp_reader *);
+extern void _cpp_pop_file_buffer (cpp_reader *, struct include_file *);
/* In cppexp.c */
-extern bool _cpp_parse_expr PARAMS ((cpp_reader *));
-extern struct op *_cpp_expand_op_stack PARAMS ((cpp_reader *));
+extern bool _cpp_parse_expr (cpp_reader *);
+extern struct op *_cpp_expand_op_stack (cpp_reader *);
/* In cpplex.c */
-extern void _cpp_process_line_notes PARAMS ((cpp_reader *, int));
-extern void _cpp_clean_line PARAMS ((cpp_reader *));
-extern bool _cpp_get_fresh_line PARAMS ((cpp_reader *));
-extern bool _cpp_skip_block_comment PARAMS ((cpp_reader *));
-extern cpp_token *_cpp_temp_token PARAMS ((cpp_reader *));
-extern const cpp_token *_cpp_lex_token PARAMS ((cpp_reader *));
-extern cpp_token *_cpp_lex_direct PARAMS ((cpp_reader *));
-extern int _cpp_equiv_tokens PARAMS ((const cpp_token *,
- const cpp_token *));
-extern void _cpp_init_tokenrun PARAMS ((tokenrun *, unsigned int));
+extern void _cpp_process_line_notes (cpp_reader *, int);
+extern void _cpp_clean_line (cpp_reader *);
+extern bool _cpp_get_fresh_line (cpp_reader *);
+extern bool _cpp_skip_block_comment (cpp_reader *);
+extern cpp_token *_cpp_temp_token (cpp_reader *);
+extern const cpp_token *_cpp_lex_token (cpp_reader *);
+extern cpp_token *_cpp_lex_direct (cpp_reader *);
+extern int _cpp_equiv_tokens (const cpp_token *, const cpp_token *);
+extern void _cpp_init_tokenrun (tokenrun *, unsigned int);
/* In cppinit.c. */
-extern void _cpp_maybe_push_include_file PARAMS ((cpp_reader *));
+extern void _cpp_maybe_push_include_file (cpp_reader *);
/* In cpplib.c */
-extern int _cpp_test_assertion PARAMS ((cpp_reader *, unsigned int *));
-extern int _cpp_handle_directive PARAMS ((cpp_reader *, int));
-extern void _cpp_define_builtin PARAMS ((cpp_reader *, const char *));
-extern char ** _cpp_save_pragma_names PARAMS ((cpp_reader *));
-extern void _cpp_restore_pragma_names PARAMS ((cpp_reader *, char **));
-extern void _cpp_do__Pragma PARAMS ((cpp_reader *));
-extern void _cpp_init_directives PARAMS ((cpp_reader *));
-extern void _cpp_init_internal_pragmas PARAMS ((cpp_reader *));
-extern void _cpp_do_file_change PARAMS ((cpp_reader *, enum lc_reason,
- const char *,
- unsigned int, unsigned int));
-extern void _cpp_pop_buffer PARAMS ((cpp_reader *));
+extern int _cpp_test_assertion (cpp_reader *, unsigned int *);
+extern int _cpp_handle_directive (cpp_reader *, int);
+extern void _cpp_define_builtin (cpp_reader *, const char *);
+extern char ** _cpp_save_pragma_names (cpp_reader *);
+extern void _cpp_restore_pragma_names (cpp_reader *, char **);
+extern void _cpp_do__Pragma (cpp_reader *);
+extern void _cpp_init_directives (cpp_reader *);
+extern void _cpp_init_internal_pragmas (cpp_reader *);
+extern void _cpp_do_file_change (cpp_reader *, enum lc_reason, const char *,
+ unsigned int, unsigned int);
+extern void _cpp_pop_buffer (cpp_reader *);
/* In cpptrad.c. */
-extern bool scan_out_logical_line PARAMS ((cpp_reader *, cpp_macro *));
-extern bool _cpp_read_logical_line_trad PARAMS ((cpp_reader *));
-extern void _cpp_overlay_buffer PARAMS ((cpp_reader *pfile, const uchar *,
- size_t));
-extern void _cpp_remove_overlay PARAMS ((cpp_reader *));
-extern bool _cpp_create_trad_definition PARAMS ((cpp_reader *, cpp_macro *));
-extern bool _cpp_expansions_different_trad PARAMS ((const cpp_macro *,
- const cpp_macro *));
-extern uchar *_cpp_copy_replacement_text PARAMS ((const cpp_macro *, uchar *));
-extern size_t _cpp_replacement_text_len PARAMS ((const cpp_macro *));
+extern bool scan_out_logical_line (cpp_reader *, cpp_macro *);
+extern bool _cpp_read_logical_line_trad (cpp_reader *);
+extern void _cpp_overlay_buffer (cpp_reader *pfile, const uchar *, size_t);
+extern void _cpp_remove_overlay (cpp_reader *);
+extern bool _cpp_create_trad_definition (cpp_reader *, cpp_macro *);
+extern bool _cpp_expansions_different_trad (const cpp_macro *,
+ const cpp_macro *);
+extern uchar *_cpp_copy_replacement_text (const cpp_macro *, uchar *);
+extern size_t _cpp_replacement_text_len (const cpp_macro *);
/* In cppcharset.c. */
-cppchar_t _cpp_valid_ucn PARAMS ((cpp_reader *, const uchar **,
- int identifer_p));
+cppchar_t _cpp_valid_ucn (cpp_reader *, const uchar **, int identifer_p);
/* Utility routines and macros. */
#define DSC(str) (const uchar *)str, sizeof str - 1
@@ -563,55 +551,45 @@ cppchar_t _cpp_valid_ucn PARAMS ((cpp_reader *, const uchar **,
/* These are inline functions instead of macros so we can get type
checking. */
-static inline int ustrcmp PARAMS ((const uchar *, const uchar *));
-static inline int ustrncmp PARAMS ((const uchar *, const uchar *,
- size_t));
-static inline size_t ustrlen PARAMS ((const uchar *));
-static inline uchar *uxstrdup PARAMS ((const uchar *));
-static inline uchar *ustrchr PARAMS ((const uchar *, int));
-static inline int ufputs PARAMS ((const uchar *, FILE *));
+static inline int ustrcmp (const uchar *, const uchar *);
+static inline int ustrncmp (const uchar *, const uchar *, size_t);
+static inline size_t ustrlen (const uchar *);
+static inline uchar *uxstrdup (const uchar *);
+static inline uchar *ustrchr (const uchar *, int);
+static inline int ufputs (const uchar *, FILE *);
static inline int
-ustrcmp (s1, s2)
- const uchar *s1, *s2;
+ustrcmp (const uchar *s1, const uchar *s2)
{
return strcmp ((const char *)s1, (const char *)s2);
}
static inline int
-ustrncmp (s1, s2, n)
- const uchar *s1, *s2;
- size_t n;
+ustrncmp (const uchar *s1, const uchar *s2, size_t n)
{
return strncmp ((const char *)s1, (const char *)s2, n);
}
static inline size_t
-ustrlen (s1)
- const uchar *s1;
+ustrlen (const uchar *s1)
{
return strlen ((const char *)s1);
}
static inline uchar *
-uxstrdup (s1)
- const uchar *s1;
+uxstrdup (const uchar *s1)
{
return (uchar *) xstrdup ((const char *)s1);
}
static inline uchar *
-ustrchr (s1, c)
- const uchar *s1;
- int c;
+ustrchr (const uchar *s1, int c)
{
return (uchar *) strchr ((const char *)s1, c);
}
static inline int
-ufputs (s, f)
- const uchar *s;
- FILE *f;
+ufputs (const uchar *s, FILE *f)
{
return fputs ((const char *)s, f);
}
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index cace8b9f5db..1792ddd8a07 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -27,10 +27,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "cpphash.h"
#include "mkdeps.h"
-static void init_library PARAMS ((void));
-static void mark_named_operators PARAMS ((cpp_reader *));
-static void read_original_filename PARAMS ((cpp_reader *));
-static void post_options PARAMS ((cpp_reader *));
+static void init_library (void);
+static void mark_named_operators (cpp_reader *);
+static void read_original_filename (cpp_reader *);
+static void post_options (cpp_reader *);
/* If we have designated initializers (GCC >2.7) these tables can be
initialized, constant data. Otherwise, they have to be filled in at
@@ -47,7 +47,7 @@ __extension__ const uchar _cpp_trigraph_map[UCHAR_MAX + 1] = {
#else
#define TRIGRAPH_MAP uchar _cpp_trigraph_map[UCHAR_MAX + 1] = { 0 }; \
- static void init_trigraph_map PARAMS ((void)) { \
+ static void init_trigraph_map (void) { \
unsigned char *x = _cpp_trigraph_map;
#define END }
@@ -91,9 +91,7 @@ static const struct lang_flags lang_defaults[] =
/* Sets internal flags correctly for a given language. */
void
-cpp_set_lang (pfile, lang)
- cpp_reader *pfile;
- enum c_lang lang;
+cpp_set_lang (cpp_reader *pfile, enum c_lang lang)
{
const struct lang_flags *l = &lang_defaults[(int) lang];
@@ -110,7 +108,7 @@ cpp_set_lang (pfile, lang)
/* Initialize library global state. */
static void
-init_library ()
+init_library (void)
{
static int initialized = 0;
@@ -127,9 +125,7 @@ init_library ()
/* Initialize a cpp_reader structure. */
cpp_reader *
-cpp_create_reader (lang, table)
- enum c_lang lang;
- hash_table *table;
+cpp_create_reader (enum c_lang lang, hash_table *table)
{
cpp_reader *pfile;
@@ -205,8 +201,7 @@ cpp_create_reader (lang, table)
/* Free resources used by PFILE. Accessing PFILE after this function
returns leads to undefined behavior. Returns the error count. */
void
-cpp_destroy (pfile)
- cpp_reader *pfile;
+cpp_destroy (cpp_reader *pfile)
{
cpp_context *context, *contextn;
tokenrun *run, *runn;
@@ -221,7 +216,7 @@ cpp_destroy (pfile)
if (pfile->macro_buffer)
{
- free ((PTR) pfile->macro_buffer);
+ free (pfile->macro_buffer);
pfile->macro_buffer = NULL;
pfile->macro_buffer_len = 0;
}
@@ -309,8 +304,7 @@ static const struct builtin operator_array[] =
/* Mark the C++ named operators in the hash table. */
static void
-mark_named_operators (pfile)
- cpp_reader *pfile;
+mark_named_operators (cpp_reader *pfile)
{
const struct builtin *b;
@@ -329,9 +323,7 @@ mark_named_operators (pfile)
macros, into the hash table. HOSTED is true if this is a hosted
environment. */
void
-cpp_init_builtins (pfile, hosted)
- cpp_reader *pfile;
- int hosted;
+cpp_init_builtins (cpp_reader *pfile, int hosted)
{
const struct builtin *b;
size_t n = ARRAY_SIZE (builtin_array);
@@ -368,9 +360,8 @@ cpp_init_builtins (pfile, hosted)
/* Sanity-checks are dependent on command-line options, so it is
called as a subroutine of cpp_read_main_file (). */
#if ENABLE_CHECKING
-static void sanity_checks PARAMS ((cpp_reader *));
-static void sanity_checks (pfile)
- cpp_reader *pfile;
+static void sanity_checks (cpp_reader *);
+static void sanity_checks (cpp_reader *pfile)
{
cppchar_t test = 0;
size_t max_precision = 2 * CHAR_BIT * sizeof (cpp_num_part);
@@ -383,7 +374,8 @@ static void sanity_checks (pfile)
if (CPP_OPTION (pfile, precision) > max_precision)
cpp_error (pfile, DL_ICE,
- "preprocessor arithmetic has maximum precision of %lu bits; target requires %lu bits",
+ "preprocessor arithmetic has maximum precision of %lu bits;"
+ " target requires %lu bits",
(unsigned long) max_precision,
(unsigned long) CPP_OPTION (pfile, precision));
@@ -408,7 +400,8 @@ static void sanity_checks (pfile)
if (CPP_OPTION (pfile, wchar_precision) > BITS_PER_CPPCHAR_T)
cpp_error (pfile, DL_ICE,
- "CPP on this host cannot handle wide character constants over %lu bits, but the target requires %lu bits",
+ "CPP on this host cannot handle wide character constants over"
+ " %lu bits, but the target requires %lu bits",
(unsigned long) BITS_PER_CPPCHAR_T,
(unsigned long) CPP_OPTION (pfile, wchar_precision));
}
@@ -420,10 +413,7 @@ static void sanity_checks (pfile)
cpp_read_main_file(). If no targets have been added before
cpp_read_main_file(), then the default target is used. */
void
-cpp_add_dependency_target (pfile, target, quote)
- cpp_reader *pfile;
- const char *target;
- int quote;
+cpp_add_dependency_target (cpp_reader *pfile, const char *target, int quote)
{
if (!pfile->deps)
pfile->deps = deps_init ();
@@ -436,9 +426,7 @@ cpp_add_dependency_target (pfile, target, quote)
or stdin if it is the empty string. Return the original filename
on success (e.g. foo.i->foo.c), or NULL on failure. */
const char *
-cpp_read_main_file (pfile, fname)
- cpp_reader *pfile;
- const char *fname;
+cpp_read_main_file (cpp_reader *pfile, const char *fname)
{
sanity_checks (pfile);
@@ -480,8 +468,7 @@ cpp_read_main_file (pfile, fname)
generate file_change callbacks, which the front ends must handle
appropriately given their state of initialization. */
static void
-read_original_filename (pfile)
- cpp_reader *pfile;
+read_original_filename (cpp_reader *pfile)
{
const cpp_token *token, *token1;
@@ -512,9 +499,7 @@ read_original_filename (pfile)
Maybe it should also reset state, such that you could call
cpp_start_read with a new filename to restart processing. */
int
-cpp_finish (pfile, deps_stream)
- cpp_reader *pfile;
- FILE *deps_stream;
+cpp_finish (cpp_reader *pfile, FILE *deps_stream)
{
/* Warn about unused macros before popping the final buffer. */
if (CPP_OPTION (pfile, warn_unused_macros))
@@ -546,8 +531,7 @@ cpp_finish (pfile, deps_stream)
}
static void
-post_options (pfile)
- cpp_reader *pfile;
+post_options (cpp_reader *pfile)
{
/* -Wtraditional is not useful in C++ mode. */
if (CPP_OPTION (pfile, cplusplus))
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 72a5e4d6125..6933e75035b 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -44,7 +44,7 @@ static const unsigned char *const digraph_spellings[] =
{ U"%:", U"%:%:", U"<:", U":>", U"<%", U"%>" };
#define OP(e, s) { SPELL_OPERATOR, U s },
-#define TK(e, s) { s, U STRINGX (e) },
+#define TK(e, s) { s, U #e },
static const struct token_spelling token_spellings[N_TTYPES] = { TTYPE_TABLE };
#undef OP
#undef TK
@@ -52,24 +52,23 @@ static const struct token_spelling token_spellings[N_TTYPES] = { TTYPE_TABLE };
#define TOKEN_SPELL(token) (token_spellings[(token)->type].category)
#define TOKEN_NAME(token) (token_spellings[(token)->type].name)
-static void add_line_note PARAMS ((cpp_buffer *, const uchar *, unsigned int));
-static int skip_line_comment PARAMS ((cpp_reader *));
-static void skip_whitespace PARAMS ((cpp_reader *, cppchar_t));
-static cpp_hashnode *lex_identifier PARAMS ((cpp_reader *, const uchar *));
-static void lex_number PARAMS ((cpp_reader *, cpp_string *));
-static bool forms_identifier_p PARAMS ((cpp_reader *, int));
-static void lex_string PARAMS ((cpp_reader *, cpp_token *, const uchar *));
-static void save_comment PARAMS ((cpp_reader *, cpp_token *, const uchar *,
- cppchar_t));
-static void create_literal PARAMS ((cpp_reader *, cpp_token *, const uchar *,
- unsigned int, enum cpp_ttype));
-static bool warn_in_comment PARAMS ((cpp_reader *, _cpp_line_note *));
-static int name_p PARAMS ((cpp_reader *, const cpp_string *));
-static cppchar_t maybe_read_ucn PARAMS ((cpp_reader *, const uchar **));
-static tokenrun *next_tokenrun PARAMS ((tokenrun *));
-
-static unsigned int hex_digit_value PARAMS ((unsigned int));
-static _cpp_buff *new_buff PARAMS ((size_t));
+static void add_line_note (cpp_buffer *, const uchar *, unsigned int);
+static int skip_line_comment (cpp_reader *);
+static void skip_whitespace (cpp_reader *, cppchar_t);
+static cpp_hashnode *lex_identifier (cpp_reader *, const uchar *);
+static void lex_number (cpp_reader *, cpp_string *);
+static bool forms_identifier_p (cpp_reader *, int);
+static void lex_string (cpp_reader *, cpp_token *, const uchar *);
+static void save_comment (cpp_reader *, cpp_token *, const uchar *, cppchar_t);
+static void create_literal (cpp_reader *, cpp_token *, const uchar *,
+ unsigned int, enum cpp_ttype);
+static bool warn_in_comment (cpp_reader *, _cpp_line_note *);
+static int name_p (cpp_reader *, const cpp_string *);
+static cppchar_t maybe_read_ucn (cpp_reader *, const uchar **);
+static tokenrun *next_tokenrun (tokenrun *);
+
+static unsigned int hex_digit_value (unsigned int);
+static _cpp_buff *new_buff (size_t);
/* Utility routine:
@@ -77,9 +76,7 @@ static _cpp_buff *new_buff PARAMS ((size_t));
Compares, the token TOKEN to the NUL-terminated string STRING.
TOKEN must be a CPP_NAME. Returns 1 for equal, 0 for unequal. */
int
-cpp_ideq (token, string)
- const cpp_token *token;
- const char *string;
+cpp_ideq (const cpp_token *token, const char *string)
{
if (token->type != CPP_NAME)
return 0;
@@ -90,10 +87,7 @@ cpp_ideq (token, string)
/* Record a note TYPE at byte POS into the current cleaned logical
line. */
static void
-add_line_note (buffer, pos, type)
- cpp_buffer *buffer;
- const uchar *pos;
- unsigned int type;
+add_line_note (cpp_buffer *buffer, const uchar *pos, unsigned int type)
{
if (buffer->notes_used == buffer->notes_cap)
{
@@ -110,8 +104,7 @@ add_line_note (buffer, pos, type)
/* Returns with a logical line that contains no escaped newlines or
trigraphs. This is a time-critical inner loop. */
void
-_cpp_clean_line (pfile)
- cpp_reader *pfile;
+_cpp_clean_line (cpp_reader *pfile)
{
cpp_buffer *buffer;
const uchar *s;
@@ -184,9 +177,7 @@ _cpp_clean_line (pfile)
/* Return true if the trigraph indicated by NOTE should be warned
about in a comment. */
static bool
-warn_in_comment (pfile, note)
- cpp_reader *pfile;
- _cpp_line_note *note;
+warn_in_comment (cpp_reader *pfile, _cpp_line_note *note)
{
const uchar *p;
@@ -214,9 +205,7 @@ warn_in_comment (pfile, note)
/* Process the notes created by add_line_note as far as the current
location. */
void
-_cpp_process_line_notes (pfile, in_comment)
- cpp_reader *pfile;
- int in_comment;
+_cpp_process_line_notes (cpp_reader *pfile, int in_comment)
{
cpp_buffer *buffer = pfile->buffer;
@@ -275,8 +264,7 @@ _cpp_process_line_notes (pfile, in_comment)
Buffer->cur points to the initial asterisk of the comment. */
bool
-_cpp_skip_block_comment (pfile)
- cpp_reader *pfile;
+_cpp_skip_block_comment (cpp_reader *pfile)
{
cpp_buffer *buffer = pfile->buffer;
cppchar_t c;
@@ -324,8 +312,7 @@ _cpp_skip_block_comment (pfile)
terminating newline. Handles escaped newlines. Returns nonzero
if a multiline comment. */
static int
-skip_line_comment (pfile)
- cpp_reader *pfile;
+skip_line_comment (cpp_reader *pfile)
{
cpp_buffer *buffer = pfile->buffer;
unsigned int orig_line = pfile->line;
@@ -339,9 +326,7 @@ skip_line_comment (pfile)
/* Skips whitespace, saving the next non-whitespace character. */
static void
-skip_whitespace (pfile, c)
- cpp_reader *pfile;
- cppchar_t c;
+skip_whitespace (cpp_reader *pfile, cppchar_t c)
{
cpp_buffer *buffer = pfile->buffer;
bool saw_NUL = false;
@@ -374,9 +359,7 @@ skip_whitespace (pfile, c)
/* See if the characters of a number token are valid in a name (no
'.', '+' or '-'). */
static int
-name_p (pfile, string)
- cpp_reader *pfile;
- const cpp_string *string;
+name_p (cpp_reader *pfile, const cpp_string *string)
{
unsigned int i;
@@ -390,9 +373,7 @@ name_p (pfile, string)
/* Returns TRUE if the sequence starting at buffer->cur is invalid in
an identifier. FIRST is TRUE if this starts an identifier. */
static bool
-forms_identifier_p (pfile, first)
- cpp_reader *pfile;
- int first;
+forms_identifier_p (cpp_reader *pfile, int first)
{
cpp_buffer *buffer = pfile->buffer;
@@ -426,9 +407,7 @@ forms_identifier_p (pfile, first)
/* Lex an identifier starting at BUFFER->CUR - 1. */
static cpp_hashnode *
-lex_identifier (pfile, base)
- cpp_reader *pfile;
- const uchar *base;
+lex_identifier (cpp_reader *pfile, const uchar *base)
{
cpp_hashnode *result;
const uchar *cur;
@@ -462,7 +441,8 @@ lex_identifier (pfile, base)
if (result == pfile->spec_nodes.n__VA_ARGS__
&& !pfile->state.va_args_ok)
cpp_error (pfile, DL_PEDWARN,
- "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro");
+ "__VA_ARGS__ can only appear in the expansion"
+ " of a C99 variadic macro");
}
return result;
@@ -470,9 +450,7 @@ lex_identifier (pfile, base)
/* Lex a number to NUMBER starting at BUFFER->CUR - 1. */
static void
-lex_number (pfile, number)
- cpp_reader *pfile;
- cpp_string *number;
+lex_number (cpp_reader *pfile, cpp_string *number)
{
const uchar *cur;
const uchar *base;
@@ -500,12 +478,8 @@ lex_number (pfile, number)
/* Create a token of type TYPE with a literal spelling. */
static void
-create_literal (pfile, token, base, len, type)
- cpp_reader *pfile;
- cpp_token *token;
- const uchar *base;
- unsigned int len;
- enum cpp_ttype type;
+create_literal (cpp_reader *pfile, cpp_token *token, const uchar *base,
+ unsigned int len, enum cpp_ttype type)
{
uchar *dest = _cpp_unaligned_alloc (pfile, len + 1);
@@ -524,10 +498,7 @@ create_literal (pfile, token, base, len, type)
The spelling is NUL-terminated, but it is not guaranteed that this
is the first NUL since embedded NULs are preserved. */
static void
-lex_string (pfile, token, base)
- cpp_reader *pfile;
- cpp_token *token;
- const uchar *base;
+lex_string (cpp_reader *pfile, cpp_token *token, const uchar *base)
{
bool saw_NUL = false;
const uchar *cur;
@@ -573,11 +544,8 @@ lex_string (pfile, token, base)
/* The stored comment includes the comment start and any terminator. */
static void
-save_comment (pfile, token, from, type)
- cpp_reader *pfile;
- cpp_token *token;
- const unsigned char *from;
- cppchar_t type;
+save_comment (cpp_reader *pfile, cpp_token *token, const unsigned char *from,
+ cppchar_t type)
{
unsigned char *buffer;
unsigned int len, clen;
@@ -617,9 +585,7 @@ save_comment (pfile, token, from, type)
/* Allocate COUNT tokens for RUN. */
void
-_cpp_init_tokenrun (run, count)
- tokenrun *run;
- unsigned int count;
+_cpp_init_tokenrun (tokenrun *run, unsigned int count)
{
run->base = xnewvec (cpp_token, count);
run->limit = run->base + count;
@@ -628,8 +594,7 @@ _cpp_init_tokenrun (run, count)
/* Returns the next tokenrun, or creates one if there is none. */
static tokenrun *
-next_tokenrun (run)
- tokenrun *run;
+next_tokenrun (tokenrun *run)
{
if (run->next == NULL)
{
@@ -646,8 +611,7 @@ next_tokenrun (run)
same as the last lexed token, so that diagnostics appear in the
right place. */
cpp_token *
-_cpp_temp_token (pfile)
- cpp_reader *pfile;
+_cpp_temp_token (cpp_reader *pfile)
{
cpp_token *old, *result;
@@ -668,8 +632,7 @@ _cpp_temp_token (pfile)
like directive handling, token lookahead, multiple include
optimization and skipping. */
const cpp_token *
-_cpp_lex_token (pfile)
- cpp_reader *pfile;
+_cpp_lex_token (cpp_reader *pfile)
{
cpp_token *result;
@@ -701,7 +664,7 @@ _cpp_lex_token (pfile)
&& _cpp_handle_directive (pfile, result->flags & PREV_WHITE))
continue;
if (pfile->cb.line_change && !pfile->state.skipping)
- (*pfile->cb.line_change)(pfile, result, pfile->state.parsing_args);
+ pfile->cb.line_change (pfile, result, pfile->state.parsing_args);
}
/* We don't skip tokens in directives. */
@@ -722,8 +685,7 @@ _cpp_lex_token (pfile)
/* Returns true if a fresh line has been loaded. */
bool
-_cpp_get_fresh_line (pfile)
- cpp_reader *pfile;
+_cpp_get_fresh_line (cpp_reader *pfile)
{
/* We can't get a new line until we leave the current directive. */
if (pfile->state.in_directive)
@@ -792,8 +754,7 @@ _cpp_get_fresh_line (pfile)
otherwise returns to the start of the token buffer if permissible.
Returns the location of the lexed token. */
cpp_token *
-_cpp_lex_direct (pfile)
- cpp_reader *pfile;
+_cpp_lex_direct (cpp_reader *pfile)
{
cppchar_t c;
cpp_buffer *buffer;
@@ -1128,8 +1089,7 @@ _cpp_lex_direct (pfile)
/* An upper bound on the number of bytes needed to spell TOKEN.
Does not include preceding whitespace. */
unsigned int
-cpp_token_len (token)
- const cpp_token *token;
+cpp_token_len (const cpp_token *token)
{
unsigned int len;
@@ -1145,13 +1105,11 @@ cpp_token_len (token)
/* Write the spelling of a token TOKEN to BUFFER. The buffer must
already contain the enough space to hold the token's spelling.
- Returns a pointer to the character after the last character
- written. */
+ Returns a pointer to the character after the last character written.
+ FIXME: Would be nice if we didn't need the PFILE argument. */
unsigned char *
-cpp_spell_token (pfile, token, buffer)
- cpp_reader *pfile; /* Would be nice to be rid of this... */
- const cpp_token *token;
- unsigned char *buffer;
+cpp_spell_token (cpp_reader *pfile, const cpp_token *token,
+ unsigned char *buffer)
{
switch (TOKEN_SPELL (token))
{
@@ -1195,9 +1153,7 @@ cpp_spell_token (pfile, token, buffer)
/* Returns TOKEN spelt as a null-terminated string. The string is
freed when the reader is destroyed. Useful for diagnostics. */
unsigned char *
-cpp_token_as_text (pfile, token)
- cpp_reader *pfile;
- const cpp_token *token;
+cpp_token_as_text (cpp_reader *pfile, const cpp_token *token)
{
unsigned int len = cpp_token_len (token) + 1;
unsigned char *start = _cpp_unaligned_alloc (pfile, len), *end;
@@ -1211,8 +1167,7 @@ cpp_token_as_text (pfile, token)
/* Used by C front ends, which really should move to using
cpp_token_as_text. */
const char *
-cpp_type2name (type)
- enum cpp_ttype type;
+cpp_type2name (enum cpp_ttype type)
{
return (const char *) token_spellings[type].name;
}
@@ -1221,9 +1176,7 @@ cpp_type2name (type)
Separated from cpp_spell_token for efficiency - to avoid stdio
double-buffering. */
void
-cpp_output_token (token, fp)
- const cpp_token *token;
- FILE *fp;
+cpp_output_token (const cpp_token *token, FILE *fp)
{
switch (TOKEN_SPELL (token))
{
@@ -1264,8 +1217,7 @@ cpp_output_token (token, fp)
/* Compare two tokens. */
int
-_cpp_equiv_tokens (a, b)
- const cpp_token *a, *b;
+_cpp_equiv_tokens (const cpp_token *a, const cpp_token *b)
{
if (a->type == b->type && a->flags == b->flags)
switch (TOKEN_SPELL (a))
@@ -1291,9 +1243,8 @@ _cpp_equiv_tokens (a, b)
conservative, and occasionally advises a space where one is not
needed, e.g. "." and ".2". */
int
-cpp_avoid_paste (pfile, token1, token2)
- cpp_reader *pfile;
- const cpp_token *token1, *token2;
+cpp_avoid_paste (cpp_reader *pfile, const cpp_token *token1,
+ const cpp_token *token2)
{
enum cpp_ttype a = token1->type, b = token2->type;
cppchar_t c;
@@ -1349,9 +1300,7 @@ cpp_avoid_paste (pfile, token1, token2)
character, to FP. Leading whitespace is removed. If there are
macros, special token padding is not performed. */
void
-cpp_output_line (pfile, fp)
- cpp_reader *pfile;
- FILE *fp;
+cpp_output_line (cpp_reader *pfile, FILE *fp)
{
const cpp_token *token;
@@ -1369,8 +1318,7 @@ cpp_output_line (pfile, fp)
/* Returns the value of a hexadecimal digit. */
static unsigned int
-hex_digit_value (c)
- unsigned int c;
+hex_digit_value (unsigned int c)
{
if (hex_p (c))
return hex_value (c);
@@ -1380,9 +1328,7 @@ hex_digit_value (c)
/* Read a possible universal character name starting at *PSTR. */
static cppchar_t
-maybe_read_ucn (pfile, pstr)
- cpp_reader *pfile;
- const uchar **pstr;
+maybe_read_ucn (cpp_reader *pfile, const uchar **pstr)
{
cppchar_t result, c = (*pstr)[-1];
@@ -1411,11 +1357,8 @@ maybe_read_ucn (pfile, pstr)
if the escape sequence is part of a wide character constant or
string literal. Handles all relevant diagnostics. */
cppchar_t
-cpp_parse_escape (pfile, pstr, limit, wide)
- cpp_reader *pfile;
- const unsigned char **pstr;
- const unsigned char *limit;
- int wide;
+cpp_parse_escape (cpp_reader *pfile, const unsigned char **pstr,
+ const unsigned char *limit, int wide)
{
/* Values of \a \b \e \f \n \r \t \v respectively. */
static const uchar ascii[] = { 7, 8, 27, 12, 10, 13, 9, 11 };
@@ -1555,7 +1498,8 @@ cpp_parse_escape (pfile, pstr, limit, wide)
if (c > mask)
{
- cpp_error (pfile, DL_PEDWARN, "escape sequence out of range for its type");
+ cpp_error (pfile, DL_PEDWARN,
+ "escape sequence out of range for its type");
c &= mask;
}
@@ -1569,11 +1513,8 @@ cpp_parse_escape (pfile, pstr, limit, wide)
characters seen, and UNSIGNEDP to a variable that indicates whether
the result has signed type. */
cppchar_t
-cpp_interpret_charconst (pfile, token, pchars_seen, unsignedp)
- cpp_reader *pfile;
- const cpp_token *token;
- unsigned int *pchars_seen;
- int *unsignedp;
+cpp_interpret_charconst (cpp_reader *pfile, const cpp_token *token,
+ unsigned int *pchars_seen, int *unsignedp)
{
const unsigned char *str, *limit;
unsigned int chars_seen = 0;
@@ -1678,8 +1619,7 @@ cpp_interpret_charconst (pfile, token, pchars_seen, unsignedp)
/* Create a new allocation buffer. Place the control block at the end
of the buffer, so that buffer overflows will cause immediate chaos. */
static _cpp_buff *
-new_buff (len)
- size_t len;
+new_buff (size_t len)
{
_cpp_buff *result;
unsigned char *base;
@@ -1699,9 +1639,7 @@ new_buff (len)
/* Place a chain of unwanted allocation buffers on the free list. */
void
-_cpp_release_buff (pfile, buff)
- cpp_reader *pfile;
- _cpp_buff *buff;
+_cpp_release_buff (cpp_reader *pfile, _cpp_buff *buff)
{
_cpp_buff *end = buff;
@@ -1713,9 +1651,7 @@ _cpp_release_buff (pfile, buff)
/* Return a free buffer of size at least MIN_SIZE. */
_cpp_buff *
-_cpp_get_buff (pfile, min_size)
- cpp_reader *pfile;
- size_t min_size;
+_cpp_get_buff (cpp_reader *pfile, size_t min_size)
{
_cpp_buff *result, **p;
@@ -1744,10 +1680,7 @@ _cpp_get_buff (pfile, min_size)
the excess bytes to the new buffer. Chains the new buffer after
BUFF, and returns the new buffer. */
_cpp_buff *
-_cpp_append_extend_buff (pfile, buff, min_extra)
- cpp_reader *pfile;
- _cpp_buff *buff;
- size_t min_extra;
+_cpp_append_extend_buff (cpp_reader *pfile, _cpp_buff *buff, size_t min_extra)
{
size_t size = EXTENDED_BUFF_SIZE (buff, min_extra);
_cpp_buff *new_buff = _cpp_get_buff (pfile, size);
@@ -1763,10 +1696,7 @@ _cpp_append_extend_buff (pfile, buff, min_extra)
Chains the new buffer before the buffer pointed to by BUFF, and
updates the pointer to point to the new buffer. */
void
-_cpp_extend_buff (pfile, pbuff, min_extra)
- cpp_reader *pfile;
- _cpp_buff **pbuff;
- size_t min_extra;
+_cpp_extend_buff (cpp_reader *pfile, _cpp_buff **pbuff, size_t min_extra)
{
_cpp_buff *new_buff, *old_buff = *pbuff;
size_t size = EXTENDED_BUFF_SIZE (old_buff, min_extra);
@@ -1793,9 +1723,7 @@ _cpp_free_buff (buff)
/* Allocate permanent, unaligned storage of length LEN. */
unsigned char *
-_cpp_unaligned_alloc (pfile, len)
- cpp_reader *pfile;
- size_t len;
+_cpp_unaligned_alloc (cpp_reader *pfile, size_t len)
{
_cpp_buff *buff = pfile->u_buff;
unsigned char *result = buff->cur;
@@ -1823,9 +1751,7 @@ _cpp_unaligned_alloc (pfile, len)
All existing other uses clearly fit this restriction: storing
registered pragmas during initialization. */
unsigned char *
-_cpp_aligned_alloc (pfile, len)
- cpp_reader *pfile;
- size_t len;
+_cpp_aligned_alloc (cpp_reader *pfile, size_t len)
{
_cpp_buff *buff = pfile->a_buff;
unsigned char *result = buff->cur;
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index bd69642a0b0..af32705856f 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -45,11 +45,11 @@ struct if_stack
const cpp_hashnode *mi_cmacro;/* macro name for #ifndef around entire file */
bool skip_elses; /* Can future #else / #elif be skipped? */
bool was_skipping; /* If were skipping on entry. */
- int type; /* Most recent conditional, for diagnostics. */
+ int type; /* Most recent conditional for diagnostics. */
};
/* Contains a registered pragma or pragma namespace. */
-typedef void (*pragma_cb) PARAMS ((cpp_reader *));
+typedef void (*pragma_cb) (cpp_reader *);
struct pragma_entry
{
struct pragma_entry *next;
@@ -82,7 +82,7 @@ struct pragma_entry
#define EXPAND (1 << 4)
/* Defines one #-directive, including how to handle it. */
-typedef void (*directive_handler) PARAMS ((cpp_reader *));
+typedef void (*directive_handler) (cpp_reader *);
typedef struct directive directive;
struct directive
{
@@ -95,51 +95,44 @@ struct directive
/* Forward declarations. */
-static void skip_rest_of_line PARAMS ((cpp_reader *));
-static void check_eol PARAMS ((cpp_reader *));
-static void start_directive PARAMS ((cpp_reader *));
-static void prepare_directive_trad PARAMS ((cpp_reader *));
-static void end_directive PARAMS ((cpp_reader *, int));
-static void directive_diagnostics
- PARAMS ((cpp_reader *, const directive *, int));
-static void run_directive PARAMS ((cpp_reader *, int,
- const char *, size_t));
-static char *glue_header_name PARAMS ((cpp_reader *));
-static const char *parse_include PARAMS ((cpp_reader *, int *));
-static void push_conditional PARAMS ((cpp_reader *, int, int,
- const cpp_hashnode *));
-static unsigned int read_flag PARAMS ((cpp_reader *, unsigned int));
-static uchar *dequote_string PARAMS ((cpp_reader *, const uchar *,
- unsigned int));
-static int strtoul_for_line PARAMS ((const uchar *, unsigned int,
- unsigned long *));
-static void do_diagnostic PARAMS ((cpp_reader *, int, int));
-static cpp_hashnode *lex_macro_node PARAMS ((cpp_reader *));
-static void do_include_common PARAMS ((cpp_reader *, enum include_type));
-static struct pragma_entry *lookup_pragma_entry
- PARAMS ((struct pragma_entry *, const cpp_hashnode *pragma));
-static struct pragma_entry *insert_pragma_entry
- PARAMS ((cpp_reader *, struct pragma_entry **, const cpp_hashnode *,
- pragma_cb));
-static int count_registered_pragmas PARAMS ((struct pragma_entry *));
-static char ** save_registered_pragmas
- PARAMS ((struct pragma_entry *, char **));
-static char ** restore_registered_pragmas
- PARAMS ((cpp_reader *, struct pragma_entry *, char **));
-static void do_pragma_once PARAMS ((cpp_reader *));
-static void do_pragma_poison PARAMS ((cpp_reader *));
-static void do_pragma_system_header PARAMS ((cpp_reader *));
-static void do_pragma_dependency PARAMS ((cpp_reader *));
-static void do_linemarker PARAMS ((cpp_reader *));
-static const cpp_token *get_token_no_padding PARAMS ((cpp_reader *));
-static const cpp_token *get__Pragma_string PARAMS ((cpp_reader *));
-static void destringize_and_run PARAMS ((cpp_reader *, const cpp_string *));
-static int parse_answer PARAMS ((cpp_reader *, struct answer **, int));
-static cpp_hashnode *parse_assertion PARAMS ((cpp_reader *, struct answer **,
- int));
-static struct answer ** find_answer PARAMS ((cpp_hashnode *,
- const struct answer *));
-static void handle_assertion PARAMS ((cpp_reader *, const char *, int));
+static void skip_rest_of_line (cpp_reader *);
+static void check_eol (cpp_reader *);
+static void start_directive (cpp_reader *);
+static void prepare_directive_trad (cpp_reader *);
+static void end_directive (cpp_reader *, int);
+static void directive_diagnostics (cpp_reader *, const directive *, int);
+static void run_directive (cpp_reader *, int, const char *, size_t);
+static char *glue_header_name (cpp_reader *);
+static const char *parse_include (cpp_reader *, int *);
+static void push_conditional (cpp_reader *, int, int, const cpp_hashnode *);
+static unsigned int read_flag (cpp_reader *, unsigned int);
+static uchar *dequote_string (cpp_reader *, const uchar *, unsigned int);
+static int strtoul_for_line (const uchar *, unsigned int, unsigned long *);
+static void do_diagnostic (cpp_reader *, int, int);
+static cpp_hashnode *lex_macro_node (cpp_reader *);
+static void do_include_common (cpp_reader *, enum include_type);
+static struct pragma_entry *lookup_pragma_entry (struct pragma_entry *,
+ const cpp_hashnode *);
+static struct pragma_entry *insert_pragma_entry (cpp_reader *,
+ struct pragma_entry **,
+ const cpp_hashnode *,
+ pragma_cb);
+static int count_registered_pragmas (struct pragma_entry *);
+static char ** save_registered_pragmas (struct pragma_entry *, char **);
+static char ** restore_registered_pragmas (cpp_reader *, struct pragma_entry *,
+ char **);
+static void do_pragma_once (cpp_reader *);
+static void do_pragma_poison (cpp_reader *);
+static void do_pragma_system_header (cpp_reader *);
+static void do_pragma_dependency (cpp_reader *);
+static void do_linemarker (cpp_reader *);
+static const cpp_token *get_token_no_padding (cpp_reader *);
+static const cpp_token *get__Pragma_string (cpp_reader *);
+static void destringize_and_run (cpp_reader *, const cpp_string *);
+static int parse_answer (cpp_reader *, struct answer **, int);
+static cpp_hashnode *parse_assertion (cpp_reader *, struct answer **, int);
+static struct answer ** find_answer (cpp_hashnode *, const struct answer *);
+static void handle_assertion (cpp_reader *, const char *, int);
/* This is the table of directive handlers. It is ordered by
frequency of occurrence; the numbers at the end are directive
@@ -174,8 +167,7 @@ D(sccs, T_SCCS, EXTENSION, 0) /* 0 SVR4? */
/* Use the table to generate a series of prototypes, an enum for the
directive names, and an array of directive handlers. */
-/* Don't invoke CONCAT2 with any whitespace or K&R cc will fail. */
-#define D(name, t, o, f) static void CONCAT2(do_,name) PARAMS ((cpp_reader *));
+#define D(name, t, o, f) static void do_##name (cpp_reader *);
DIRECTIVE_TABLE
#undef D
@@ -187,10 +179,9 @@ enum
};
#undef D
-/* Don't invoke CONCAT2 with any whitespace or K&R cc will fail. */
#define D(name, t, origin, flags) \
-{ CONCAT2(do_,name), (const uchar *) STRINGX(name), \
- sizeof STRINGX(name) - 1, origin, flags },
+{ do_##name, (const uchar *) #name, \
+ sizeof #name - 1, origin, flags },
static const directive dtable[] =
{
DIRECTIVE_TABLE
@@ -210,8 +201,7 @@ static const directive linemarker_dir =
/* Skip any remaining tokens in a directive. */
static void
-skip_rest_of_line (pfile)
- cpp_reader *pfile;
+skip_rest_of_line (cpp_reader *pfile)
{
/* Discard all stacked contexts. */
while (pfile->context->prev)
@@ -225,8 +215,7 @@ skip_rest_of_line (pfile)
/* Ensure there are no stray tokens at the end of a directive. */
static void
-check_eol (pfile)
- cpp_reader *pfile;
+check_eol (cpp_reader *pfile)
{
if (! SEEN_EOL () && _cpp_lex_token (pfile)->type != CPP_EOF)
cpp_error (pfile, DL_PEDWARN, "extra tokens at end of #%s directive",
@@ -235,8 +224,7 @@ check_eol (pfile)
/* Called when entering a directive, _Pragma or command-line directive. */
static void
-start_directive (pfile)
- cpp_reader *pfile;
+start_directive (cpp_reader *pfile)
{
/* Setup in-directive state. */
pfile->state.in_directive = 1;
@@ -248,9 +236,7 @@ start_directive (pfile)
/* Called when leaving a directive, _Pragma or command-line directive. */
static void
-end_directive (pfile, skip_line)
- cpp_reader *pfile;
- int skip_line;
+end_directive (cpp_reader *pfile, int skip_line)
{
if (CPP_OPTION (pfile, traditional))
{
@@ -281,8 +267,7 @@ end_directive (pfile, skip_line)
/* Prepare to handle the directive in pfile->directive. */
static void
-prepare_directive_trad (pfile)
- cpp_reader *pfile;
+prepare_directive_trad (cpp_reader *pfile)
{
if (pfile->directive != &dtable[T_DEFINE])
{
@@ -310,10 +295,7 @@ prepare_directive_trad (pfile)
/* Output diagnostics for a directive DIR. INDENTED is nonzero if
the '#' was indented. */
static void
-directive_diagnostics (pfile, dir, indented)
- cpp_reader *pfile;
- const directive *dir;
- int indented;
+directive_diagnostics (cpp_reader *pfile, const directive *dir, int indented)
{
/* Issue -pedantic warnings for extensions. */
if (CPP_PEDANTIC (pfile)
@@ -349,9 +331,7 @@ directive_diagnostics (pfile, dir, indented)
nonzero if the line of tokens has been handled, zero if we should
continue processing the line. */
int
-_cpp_handle_directive (pfile, indented)
- cpp_reader *pfile;
- int indented;
+_cpp_handle_directive (cpp_reader *pfile, int indented)
{
const directive *dir = 0;
const cpp_token *dname;
@@ -441,7 +421,7 @@ _cpp_handle_directive (pfile, indented)
prepare_directive_trad (pfile);
if (dir)
- (*pfile->directive->handler) (pfile);
+ pfile->directive->handler (pfile);
else if (skip == 0)
_cpp_backup_tokens (pfile, 1);
@@ -458,11 +438,7 @@ _cpp_handle_directive (pfile, indented)
/* Directive handler wrapper used by the command line option
processor. BUF is \n terminated. */
static void
-run_directive (pfile, dir_no, buf, count)
- cpp_reader *pfile;
- int dir_no;
- const char *buf;
- size_t count;
+run_directive (cpp_reader *pfile, int dir_no, const char *buf, size_t count)
{
cpp_push_buffer (pfile, (const uchar *) buf, count,
/* from_stage3 */ true, 1);
@@ -478,7 +454,7 @@ run_directive (pfile, dir_no, buf, count)
pfile->directive = &dtable[dir_no];
if (CPP_OPTION (pfile, traditional))
prepare_directive_trad (pfile);
- (void) (*pfile->directive->handler) (pfile);
+ pfile->directive->handler (pfile);
end_directive (pfile, 1);
if (dir_no == T_PRAGMA)
pfile->buffer->inc = NULL;
@@ -488,8 +464,7 @@ run_directive (pfile, dir_no, buf, count)
/* Checks for validity the macro name in #define, #undef, #ifdef and
#ifndef directives. */
static cpp_hashnode *
-lex_macro_node (pfile)
- cpp_reader *pfile;
+lex_macro_node (cpp_reader *pfile)
{
const cpp_token *token = _cpp_lex_token (pfile);
@@ -525,8 +500,7 @@ lex_macro_node (pfile)
/* Process a #define directive. Most work is done in cppmacro.c. */
static void
-do_define (pfile)
- cpp_reader *pfile;
+do_define (cpp_reader *pfile)
{
cpp_hashnode *node = lex_macro_node (pfile);
@@ -539,14 +513,13 @@ do_define (pfile)
if (_cpp_create_definition (pfile, node))
if (pfile->cb.define)
- (*pfile->cb.define) (pfile, pfile->directive_line, node);
+ pfile->cb.define (pfile, pfile->directive_line, node);
}
}
/* Handle #undef. Mark the identifier NT_VOID in the hash table. */
static void
-do_undef (pfile)
- cpp_reader *pfile;
+do_undef (cpp_reader *pfile)
{
cpp_hashnode *node = lex_macro_node (pfile);
@@ -555,7 +528,7 @@ do_undef (pfile)
if (node && node->type == NT_MACRO)
{
if (pfile->cb.undef)
- (*pfile->cb.undef) (pfile, pfile->directive_line, node);
+ pfile->cb.undef (pfile, pfile->directive_line, node);
if (node->flags & NODE_WARN)
cpp_error (pfile, DL_WARNING, "undefining \"%s\"", NODE_NAME (node));
@@ -572,8 +545,7 @@ do_undef (pfile)
as an h-char-sequence (< ... >); we are looking at the first token
after the <. Returns a malloced filename. */
static char *
-glue_header_name (pfile)
- cpp_reader *pfile;
+glue_header_name (cpp_reader *pfile)
{
const cpp_token *token;
char *buffer;
@@ -616,9 +588,7 @@ glue_header_name (pfile)
#pragma dependency. The string is malloced and the caller should
free it. Returns NULL on error. */
static const char *
-parse_include (pfile, pangle_brackets)
- cpp_reader *pfile;
- int *pangle_brackets;
+parse_include (cpp_reader *pfile, int *pangle_brackets)
{
char *fname;
const cpp_token *header;
@@ -657,9 +627,7 @@ parse_include (pfile, pangle_brackets)
/* Handle #include, #include_next and #import. */
static void
-do_include_common (pfile, type)
- cpp_reader *pfile;
- enum include_type type;
+do_include_common (cpp_reader *pfile, enum include_type type)
{
const char *fname;
int angle_brackets;
@@ -677,25 +645,23 @@ do_include_common (pfile, type)
skip_rest_of_line (pfile);
if (pfile->cb.include)
- (*pfile->cb.include) (pfile, pfile->directive_line,
- pfile->directive->name, fname, angle_brackets);
+ pfile->cb.include (pfile, pfile->directive_line,
+ pfile->directive->name, fname, angle_brackets);
_cpp_execute_include (pfile, fname, angle_brackets, type);
}
- free ((PTR) fname);
+ free ((void *) fname);
}
static void
-do_include (pfile)
- cpp_reader *pfile;
+do_include (cpp_reader *pfile)
{
do_include_common (pfile, IT_INCLUDE);
}
static void
-do_import (pfile)
- cpp_reader *pfile;
+do_import (cpp_reader *pfile)
{
if (CPP_OPTION (pfile, warn_import))
{
@@ -708,8 +674,7 @@ do_import (pfile)
}
static void
-do_include_next (pfile)
- cpp_reader *pfile;
+do_include_next (cpp_reader *pfile)
{
enum include_type type = IT_INCLUDE_NEXT;
@@ -729,9 +694,7 @@ do_include_next (pfile)
flag if it is valid, 0 at the end of the directive. Otherwise
complain. */
static unsigned int
-read_flag (pfile, last)
- cpp_reader *pfile;
- unsigned int last;
+read_flag (cpp_reader *pfile, unsigned int last)
{
const cpp_token *token = _cpp_lex_token (pfile);
@@ -755,10 +718,7 @@ read_flag (pfile, last)
which has a NUL terminator and all escape sequences converted to
their equivalents. Temporary, hopefully. */
static uchar *
-dequote_string (pfile, str, len)
- cpp_reader *pfile;
- const uchar *str;
- unsigned int len;
+dequote_string (cpp_reader *pfile, const uchar *str, unsigned int len)
{
uchar *result = _cpp_unaligned_alloc (pfile, len + 1);
uchar *dst = result;
@@ -781,10 +741,7 @@ dequote_string (pfile, str, len)
of length LEN, to binary; store it in NUMP, and return 0 if the
number was well-formed, 1 if not. Temporary, hopefully. */
static int
-strtoul_for_line (str, len, nump)
- const uchar *str;
- unsigned int len;
- unsigned long *nump;
+strtoul_for_line (const uchar *str, unsigned int len, long unsigned int *nump)
{
unsigned long reg = 0;
uchar c;
@@ -804,8 +761,7 @@ strtoul_for_line (str, len, nump)
Note that the filename string (if any) is a true string constant
(escapes are interpreted), unlike in #line. */
static void
-do_line (pfile)
- cpp_reader *pfile;
+do_line (cpp_reader *pfile)
{
const cpp_token *token;
const char *new_file = pfile->map->to_file;
@@ -852,8 +808,7 @@ do_line (pfile)
different syntax and semantics from #line: Flags are allowed,
and we never complain about the line number being too big. */
static void
-do_linemarker (pfile)
- cpp_reader *pfile;
+do_linemarker (cpp_reader *pfile)
{
const cpp_token *token;
const char *new_file = pfile->map->to_file;
@@ -923,27 +878,21 @@ do_linemarker (pfile)
header, 2 for a system header that needs to be extern "C" protected,
and zero otherwise. */
void
-_cpp_do_file_change (pfile, reason, to_file, file_line, sysp)
- cpp_reader *pfile;
- enum lc_reason reason;
- const char *to_file;
- unsigned int file_line;
- unsigned int sysp;
+_cpp_do_file_change (cpp_reader *pfile, enum lc_reason reason,
+ const char *to_file, unsigned int file_line,
+ unsigned int sysp)
{
pfile->map = add_line_map (&pfile->line_maps, reason, sysp,
pfile->line, to_file, file_line);
if (pfile->cb.file_change)
- (*pfile->cb.file_change) (pfile, pfile->map);
+ pfile->cb.file_change (pfile, pfile->map);
}
/* Report a warning or error detected by the program we are
processing. Use the directive's tokens in the error message. */
static void
-do_diagnostic (pfile, code, print_dir)
- cpp_reader *pfile;
- int code;
- int print_dir;
+do_diagnostic (cpp_reader *pfile, int code, int print_dir)
{
if (_cpp_begin_message (pfile, code,
pfile->cur_token[-1].line,
@@ -958,15 +907,13 @@ do_diagnostic (pfile, code, print_dir)
}
static void
-do_error (pfile)
- cpp_reader *pfile;
+do_error (cpp_reader *pfile)
{
do_diagnostic (pfile, DL_ERROR, 1);
}
static void
-do_warning (pfile)
- cpp_reader *pfile;
+do_warning (cpp_reader *pfile)
{
/* We want #warning diagnostics to be emitted in system headers too. */
do_diagnostic (pfile, DL_WARNING_SYSHDR, 1);
@@ -974,15 +921,14 @@ do_warning (pfile)
/* Report program identification. */
static void
-do_ident (pfile)
- cpp_reader *pfile;
+do_ident (cpp_reader *pfile)
{
const cpp_token *str = cpp_get_token (pfile);
if (str->type != CPP_STRING)
cpp_error (pfile, DL_ERROR, "invalid #ident directive");
else if (pfile->cb.ident)
- (*pfile->cb.ident) (pfile, pfile->directive_line, &str->val.str);
+ pfile->cb.ident (pfile, pfile->directive_line, &str->val.str);
check_eol (pfile);
}
@@ -991,9 +937,7 @@ do_ident (pfile)
matching entry, or NULL if none is found. The returned entry could
be the start of a namespace chain, or a pragma. */
static struct pragma_entry *
-lookup_pragma_entry (chain, pragma)
- struct pragma_entry *chain;
- const cpp_hashnode *pragma;
+lookup_pragma_entry (struct pragma_entry *chain, const cpp_hashnode *pragma)
{
while (chain && chain->pragma != pragma)
chain = chain->next;
@@ -1005,11 +949,8 @@ lookup_pragma_entry (chain, pragma)
singly-linked CHAIN. If handler is NULL, it is a namespace,
otherwise it is a pragma and its handler. */
static struct pragma_entry *
-insert_pragma_entry (pfile, chain, pragma, handler)
- cpp_reader *pfile;
- struct pragma_entry **chain;
- const cpp_hashnode *pragma;
- pragma_cb handler;
+insert_pragma_entry (cpp_reader *pfile, struct pragma_entry **chain,
+ const cpp_hashnode *pragma, pragma_cb handler)
{
struct pragma_entry *new;
@@ -1036,11 +977,8 @@ insert_pragma_entry (pfile, chain, pragma, handler)
goes in the global namespace. HANDLER is the handler it will call,
which must be non-NULL. */
void
-cpp_register_pragma (pfile, space, name, handler)
- cpp_reader *pfile;
- const char *space;
- const char *name;
- pragma_cb handler;
+cpp_register_pragma (cpp_reader *pfile, const char *space, const char *name,
+ pragma_cb handler)
{
struct pragma_entry **chain = &pfile->pragmas;
struct pragma_entry *entry;
@@ -1082,8 +1020,7 @@ cpp_register_pragma (pfile, space, name, handler)
/* Register the pragmas the preprocessor itself handles. */
void
-_cpp_init_internal_pragmas (pfile)
- cpp_reader *pfile;
+_cpp_init_internal_pragmas (cpp_reader *pfile)
{
/* Pragmas in the global namespace. */
cpp_register_pragma (pfile, 0, "once", do_pragma_once);
@@ -1097,8 +1034,7 @@ _cpp_init_internal_pragmas (pfile)
/* Return the number of registered pragmas in PE. */
static int
-count_registered_pragmas (pe)
- struct pragma_entry *pe;
+count_registered_pragmas (struct pragma_entry *pe)
{
int ct = 0;
for (; pe != NULL; pe = pe->next)
@@ -1114,9 +1050,7 @@ count_registered_pragmas (pe)
and return a pointer to the next free space in SD. */
static char **
-save_registered_pragmas (pe, sd)
- struct pragma_entry *pe;
- char **sd;
+save_registered_pragmas (struct pragma_entry *pe, char **sd)
{
for (; pe != NULL; pe = pe->next)
{
@@ -1133,8 +1067,7 @@ save_registered_pragmas (pe, sd)
registered pragmas. */
char **
-_cpp_save_pragma_names (pfile)
- cpp_reader *pfile;
+_cpp_save_pragma_names (cpp_reader *pfile)
{
int ct = count_registered_pragmas (pfile->pragmas);
char **result = xnewvec (char *, ct);
@@ -1146,10 +1079,8 @@ _cpp_save_pragma_names (pfile)
and return a pointer to the next unused name in SD. */
static char **
-restore_registered_pragmas (pfile, pe, sd)
- cpp_reader *pfile;
- struct pragma_entry *pe;
- char **sd;
+restore_registered_pragmas (cpp_reader *pfile, struct pragma_entry *pe,
+ char **sd)
{
for (; pe != NULL; pe = pe->next)
{
@@ -1165,9 +1096,7 @@ restore_registered_pragmas (pfile, pe, sd)
/* Restore the names of the registered pragmas from SAVED. */
void
-_cpp_restore_pragma_names (pfile, saved)
- cpp_reader *pfile;
- char **saved;
+_cpp_restore_pragma_names (cpp_reader *pfile, char **saved)
{
(void) restore_registered_pragmas (pfile, pfile->pragmas, saved);
free (saved);
@@ -1179,8 +1108,7 @@ _cpp_restore_pragma_names (pfile, saved)
expansion happens for other pragmas is implementation defined.
This implementation never macro-expands the text after #pragma. */
static void
-do_pragma (pfile)
- cpp_reader *pfile;
+do_pragma (cpp_reader *pfile)
{
const struct pragma_entry *p = NULL;
const cpp_token *token;
@@ -1209,14 +1137,14 @@ do_pragma (pfile)
themselves. Stand-alone CPP must ignore us, otherwise it will
prefix the directive with spaces, hence the 1. Ugh. */
if (pfile->cb.line_change)
- (*pfile->cb.line_change)(pfile, token, 1);
+ pfile->cb.line_change (pfile, token, 1);
if (p)
- (*p->u.handler) (pfile);
+ p->u.handler (pfile);
else if (pfile->cb.def_pragma)
{
_cpp_backup_tokens (pfile, count);
- (*pfile->cb.def_pragma) (pfile, pfile->directive_line);
+ pfile->cb.def_pragma (pfile, pfile->directive_line);
}
pfile->state.prevent_expansion--;
@@ -1224,8 +1152,7 @@ do_pragma (pfile)
/* Handle #pragma once. */
static void
-do_pragma_once (pfile)
- cpp_reader *pfile;
+do_pragma_once (cpp_reader *pfile)
{
if (CPP_OPTION (pfile, warn_deprecated))
cpp_error (pfile, DL_WARNING, "#pragma once is obsolete");
@@ -1241,8 +1168,7 @@ do_pragma_once (pfile)
/* Handle #pragma GCC poison, to poison one or more identifiers so
that the lexer produces a hard error for each subsequent usage. */
static void
-do_pragma_poison (pfile)
- cpp_reader *pfile;
+do_pragma_poison (cpp_reader *pfile)
{
const cpp_token *tok;
cpp_hashnode *hp;
@@ -1279,8 +1205,7 @@ do_pragma_poison (pfile)
system include directory. To prevent abuse, it is rejected in the
primary source file. */
static void
-do_pragma_system_header (pfile)
- cpp_reader *pfile;
+do_pragma_system_header (cpp_reader *pfile)
{
cpp_buffer *buffer = pfile->buffer;
@@ -1299,8 +1224,7 @@ do_pragma_system_header (pfile)
file. Issue a diagnostic, if the specified file is newer. We use this to
determine if a fixed header should be refixed. */
static void
-do_pragma_dependency (pfile)
- cpp_reader *pfile;
+do_pragma_dependency (cpp_reader *pfile)
{
const char *fname;
int angle_brackets, ordering;
@@ -1322,13 +1246,12 @@ do_pragma_dependency (pfile)
}
}
- free ((PTR) fname);
+ free ((void *) fname);
}
/* Get a token but skip padding. */
static const cpp_token *
-get_token_no_padding (pfile)
- cpp_reader *pfile;
+get_token_no_padding (cpp_reader *pfile)
{
for (;;)
{
@@ -1341,8 +1264,7 @@ get_token_no_padding (pfile)
/* Check syntax is "(string-literal)". Returns the string on success,
or NULL on failure. */
static const cpp_token *
-get__Pragma_string (pfile)
- cpp_reader *pfile;
+get__Pragma_string (cpp_reader *pfile)
{
const cpp_token *string;
@@ -1362,9 +1284,7 @@ get__Pragma_string (pfile)
/* Destringize IN into a temporary buffer, by removing the first \ of
\" and \\ sequences, and process the result as a #pragma directive. */
static void
-destringize_and_run (pfile, in)
- cpp_reader *pfile;
- const cpp_string *in;
+destringize_and_run (cpp_reader *pfile, const cpp_string *in)
{
const unsigned char *src, *limit;
char *dest, *result;
@@ -1419,13 +1339,12 @@ destringize_and_run (pfile, in)
Getting the line markers is a little tricky. */
if (pfile->cb.line_change)
- (*pfile->cb.line_change) (pfile, pfile->cur_token, false);
+ pfile->cb.line_change (pfile, pfile->cur_token, false);
}
/* Handle the _Pragma operator. */
void
-_cpp_do__Pragma (pfile)
- cpp_reader *pfile;
+_cpp_do__Pragma (cpp_reader *pfile)
{
const cpp_token *string = get__Pragma_string (pfile);
@@ -1436,17 +1355,15 @@ _cpp_do__Pragma (pfile)
"_Pragma takes a parenthesized string literal");
}
-/* Just ignore #sccs on all systems. */
+/* Ignore #sccs on all systems. */
static void
-do_sccs (pfile)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
+do_sccs (cpp_reader *pfile ATTRIBUTE_UNUSED)
{
}
/* Handle #ifdef. */
static void
-do_ifdef (pfile)
- cpp_reader *pfile;
+do_ifdef (cpp_reader *pfile)
{
int skip = 1;
@@ -1467,8 +1384,7 @@ do_ifdef (pfile)
/* Handle #ifndef. */
static void
-do_ifndef (pfile)
- cpp_reader *pfile;
+do_ifndef (cpp_reader *pfile)
{
int skip = 1;
const cpp_hashnode *node = 0;
@@ -1494,8 +1410,7 @@ do_ifndef (pfile)
cannot treat it as a controlling conditional, since the expansion
could change in the future. That is handled by cpp_get_token. */
static void
-do_if (pfile)
- cpp_reader *pfile;
+do_if (cpp_reader *pfile)
{
int skip = 1;
@@ -1509,8 +1424,7 @@ do_if (pfile)
if_stack; this is so that the error message for missing #endif's
etc. will point to the original #if. */
static void
-do_else (pfile)
- cpp_reader *pfile;
+do_else (cpp_reader *pfile)
{
cpp_buffer *buffer = pfile->buffer;
struct if_stack *ifs = buffer->if_stack;
@@ -1543,8 +1457,7 @@ do_else (pfile)
/* Handle a #elif directive by not changing if_stack either. See the
comment above do_else. */
static void
-do_elif (pfile)
- cpp_reader *pfile;
+do_elif (cpp_reader *pfile)
{
cpp_buffer *buffer = pfile->buffer;
struct if_stack *ifs = buffer->if_stack;
@@ -1579,8 +1492,7 @@ do_elif (pfile)
/* #endif pops the if stack and resets pfile->state.skipping. */
static void
-do_endif (pfile)
- cpp_reader *pfile;
+do_endif (cpp_reader *pfile)
{
cpp_buffer *buffer = pfile->buffer;
struct if_stack *ifs = buffer->if_stack;
@@ -1611,11 +1523,8 @@ do_endif (pfile)
is #if or #ifndef, CMACRO is a potentially controlling macro, and
we need to check here that we are at the top of the file. */
static void
-push_conditional (pfile, skip, type, cmacro)
- cpp_reader *pfile;
- int skip;
- int type;
- const cpp_hashnode *cmacro;
+push_conditional (cpp_reader *pfile, int skip, int type,
+ const cpp_hashnode *cmacro)
{
struct if_stack *ifs;
cpp_buffer *buffer = pfile->buffer;
@@ -1641,10 +1550,7 @@ push_conditional (pfile, skip, type, cmacro)
storage, i.e. the #assert case. Returns 0 on success, and sets
ANSWERP to point to the answer. */
static int
-parse_answer (pfile, answerp, type)
- cpp_reader *pfile;
- struct answer **answerp;
- int type;
+parse_answer (cpp_reader *pfile, struct answer **answerp, int type)
{
const cpp_token *paren;
struct answer *answer;
@@ -1720,10 +1626,7 @@ parse_answer (pfile, answerp, type)
the hash node of the predicate, or 0 on error. If an answer was
supplied, it is placed in ANSWERP, otherwise it is set to 0. */
static cpp_hashnode *
-parse_assertion (pfile, answerp, type)
- cpp_reader *pfile;
- struct answer **answerp;
- int type;
+parse_assertion (cpp_reader *pfile, struct answer **answerp, int type)
{
cpp_hashnode *result = 0;
const cpp_token *predicate;
@@ -1755,9 +1658,7 @@ parse_assertion (pfile, answerp, type)
/* Returns a pointer to the pointer to CANDIDATE in the answer chain,
or a pointer to NULL if the answer is not in the chain. */
static struct answer **
-find_answer (node, candidate)
- cpp_hashnode *node;
- const struct answer *candidate;
+find_answer (cpp_hashnode *node, const struct answer *candidate)
{
unsigned int i;
struct answer **result;
@@ -1784,9 +1685,7 @@ find_answer (node, candidate)
nonzero on failure, zero on success. On success, the result of
the test is written into VALUE, otherwise the value 0. */
int
-_cpp_test_assertion (pfile, value)
- cpp_reader *pfile;
- unsigned int *value;
+_cpp_test_assertion (cpp_reader *pfile, unsigned int *value)
{
struct answer *answer;
cpp_hashnode *node;
@@ -1809,8 +1708,7 @@ _cpp_test_assertion (pfile, value)
/* Handle #assert. */
static void
-do_assert (pfile)
- cpp_reader *pfile;
+do_assert (cpp_reader *pfile)
{
struct answer *new_answer;
cpp_hashnode *node;
@@ -1843,8 +1741,7 @@ do_assert (pfile)
/* Handle #unassert. */
static void
-do_unassert (pfile)
- cpp_reader *pfile;
+do_unassert (cpp_reader *pfile)
{
cpp_hashnode *node;
struct answer *answer;
@@ -1882,9 +1779,7 @@ do_unassert (pfile)
If STR has anything after the identifier, then it should
be identifier=definition. */
void
-cpp_define (pfile, str)
- cpp_reader *pfile;
- const char *str;
+cpp_define (cpp_reader *pfile, const char *str)
{
char *buf, *p;
size_t count;
@@ -1912,9 +1807,7 @@ cpp_define (pfile, str)
/* Slight variant of the above for use by initialize_builtins. */
void
-_cpp_define_builtin (pfile, str)
- cpp_reader *pfile;
- const char *str;
+_cpp_define_builtin (cpp_reader *pfile, const char *str)
{
size_t len = strlen (str);
char *buf = alloca (len + 1);
@@ -1925,9 +1818,7 @@ _cpp_define_builtin (pfile, str)
/* Process MACRO as if it appeared as the body of an #undef. */
void
-cpp_undef (pfile, macro)
- cpp_reader *pfile;
- const char *macro;
+cpp_undef (cpp_reader *pfile, const char *macro)
{
size_t len = strlen (macro);
char *buf = alloca (len + 1);
@@ -1938,28 +1829,21 @@ cpp_undef (pfile, macro)
/* Process the string STR as if it appeared as the body of a #assert. */
void
-cpp_assert (pfile, str)
- cpp_reader *pfile;
- const char *str;
+cpp_assert (cpp_reader *pfile, const char *str)
{
handle_assertion (pfile, str, T_ASSERT);
}
/* Process STR as if it appeared as the body of an #unassert. */
void
-cpp_unassert (pfile, str)
- cpp_reader *pfile;
- const char *str;
+cpp_unassert (cpp_reader *pfile, const char *str)
{
handle_assertion (pfile, str, T_UNASSERT);
}
/* Common code for cpp_assert (-A) and cpp_unassert (-A-). */
static void
-handle_assertion (pfile, str, type)
- cpp_reader *pfile;
- const char *str;
- int type;
+handle_assertion (cpp_reader *pfile, const char *str, int type)
{
size_t count = strlen (str);
const char *p = strchr (str, '=');
@@ -1982,41 +1866,35 @@ handle_assertion (pfile, str, type)
/* The number of errors for a given reader. */
unsigned int
-cpp_errors (pfile)
- cpp_reader *pfile;
+cpp_errors (cpp_reader *pfile)
{
return pfile->errors;
}
/* The options structure. */
cpp_options *
-cpp_get_options (pfile)
- cpp_reader *pfile;
+cpp_get_options (cpp_reader *pfile)
{
return &pfile->opts;
}
/* The callbacks structure. */
cpp_callbacks *
-cpp_get_callbacks (pfile)
- cpp_reader *pfile;
+cpp_get_callbacks (cpp_reader *pfile)
{
return &pfile->cb;
}
/* The line map set. */
const struct line_maps *
-cpp_get_line_maps (pfile)
- cpp_reader *pfile;
+cpp_get_line_maps (cpp_reader *pfile)
{
return &pfile->line_maps;
}
/* Copy the given callbacks structure to our own. */
void
-cpp_set_callbacks (pfile, cb)
- cpp_reader *pfile;
- cpp_callbacks *cb;
+cpp_set_callbacks (cpp_reader *pfile, cpp_callbacks *cb)
{
pfile->cb = *cb;
}
@@ -2025,12 +1903,8 @@ cpp_set_callbacks (pfile, cb)
doesn't fail. It does not generate a file change call back; that
is the responsibility of the caller. */
cpp_buffer *
-cpp_push_buffer (pfile, buffer, len, from_stage3, return_at_eof)
- cpp_reader *pfile;
- const uchar *buffer;
- size_t len;
- int from_stage3;
- int return_at_eof;
+cpp_push_buffer (cpp_reader *pfile, const uchar *buffer, size_t len,
+ int from_stage3, int return_at_eof)
{
cpp_buffer *new = xobnew (&pfile->buffer_ob, cpp_buffer);
@@ -2051,8 +1925,7 @@ cpp_push_buffer (pfile, buffer, len, from_stage3, return_at_eof)
/* Pops a single buffer, with a file change call-back if appropriate.
Then pushes the next -include file, if any remain. */
void
-_cpp_pop_buffer (pfile)
- cpp_reader *pfile;
+_cpp_pop_buffer (cpp_reader *pfile)
{
cpp_buffer *buffer = pfile->buffer;
struct include_file *inc = buffer->inc;
@@ -2088,8 +1961,7 @@ _cpp_pop_buffer (pfile)
/* Enter all recognized directives in the hash table. */
void
-_cpp_init_directives (pfile)
- cpp_reader *pfile;
+_cpp_init_directives (cpp_reader *pfile)
{
unsigned int i;
cpp_hashnode *node;
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 45142527ea2..aad2841ac62 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -371,20 +371,20 @@ struct cpp_options
unsigned char stdc_0_in_system_headers;
};
-/* Call backs. */
+/* Call backs to cpplib client. */
struct cpp_callbacks
{
/* Called when a new line of preprocessed output is started. */
- void (*line_change) PARAMS ((cpp_reader *, const cpp_token *, int));
- void (*file_change) PARAMS ((cpp_reader *, const struct line_map *));
- void (*include) PARAMS ((cpp_reader *, unsigned int,
- const unsigned char *, const char *, int));
- void (*define) PARAMS ((cpp_reader *, unsigned int, cpp_hashnode *));
- void (*undef) PARAMS ((cpp_reader *, unsigned int, cpp_hashnode *));
- void (*ident) PARAMS ((cpp_reader *, unsigned int, const cpp_string *));
- void (*def_pragma) PARAMS ((cpp_reader *, unsigned int));
- int (*valid_pch) PARAMS ((cpp_reader *, const char *, int));
- void (*read_pch) PARAMS ((cpp_reader *, const char *, int, const char *));
+ void (*line_change) (cpp_reader *, const cpp_token *, int);
+ void (*file_change) (cpp_reader *, const struct line_map *);
+ void (*include) (cpp_reader *, unsigned int, const unsigned char *,
+ const char *, int);
+ void (*define) (cpp_reader *, unsigned int, cpp_hashnode *);
+ void (*undef) (cpp_reader *, unsigned int, cpp_hashnode *);
+ void (*ident) (cpp_reader *, unsigned int, const cpp_string *);
+ void (*def_pragma) (cpp_reader *, unsigned int);
+ int (*valid_pch) (cpp_reader *, const char *, int);
+ void (*read_pch) (cpp_reader *, const char *, int, const char *);
};
/* Chain of directories to look for include files in. */
@@ -432,7 +432,7 @@ extern const char *progname;
#define NODE_DIAGNOSTIC (1 << 3) /* Possible diagnostic when lexed. */
#define NODE_WARN (1 << 4) /* Warn if redefined or undefined. */
#define NODE_DISABLED (1 << 5) /* A disabled macro. */
-#define NODE_MACRO_ARG (1 << 6) /* Used during #define processing. */
+#define NODE_MACRO_ARG (1 << 6) /* Used during #define processing. */
/* Different flavors of hash node. */
enum node_type
@@ -470,7 +470,7 @@ struct cpp_hashnode GTY(())
unsigned int is_directive : 1;
unsigned int directive_index : 7; /* If is_directive,
then index into directive table.
- Otherwise, a NODE_OPERATOR. */
+ Otherwise, a NODE_OPERATOR. */
unsigned char rid_code; /* Rid code - for front ends. */
ENUM_BITFIELD(node_type) type : 8; /* CPP node type. */
unsigned char flags; /* CPP flags. */
@@ -494,91 +494,83 @@ struct cpp_hashnode GTY(())
pointer. Otherwise you should pass in an initialized hash table
that cpplib will share; this technique is used by the C front
ends. */
-extern cpp_reader *cpp_create_reader PARAMS ((enum c_lang, struct ht *));
+extern cpp_reader *cpp_create_reader (enum c_lang, struct ht *);
/* Call this to change the selected language standard (e.g. because of
command line options). */
-extern void cpp_set_lang PARAMS ((cpp_reader *, enum c_lang));
+extern void cpp_set_lang (cpp_reader *, enum c_lang);
/* Add a dependency TARGET. Quote it for "make" if QUOTE. Can be
called any number of times before cpp_read_main_file(). If no
targets have been added before cpp_read_main_file(), then the
default target is used. */
-extern void cpp_add_dependency_target PARAMS ((cpp_reader *,
- const char * target,
- int quote));
+extern void cpp_add_dependency_target (cpp_reader *, const char *, int);
/* Set the include paths. */
-extern void cpp_set_include_chains PARAMS ((cpp_reader *, cpp_path *,
- cpp_path *, int));
+extern void cpp_set_include_chains (cpp_reader *, cpp_path *, cpp_path *, int);
/* Call these to get pointers to the options and callback structures
for a given reader. These pointers are good until you call
cpp_finish on that reader. You can either edit the callbacks
through the pointer returned from cpp_get_callbacks, or set them
with cpp_set_callbacks. */
-extern cpp_options *cpp_get_options PARAMS ((cpp_reader *));
-extern const struct line_maps *cpp_get_line_maps PARAMS ((cpp_reader *));
-extern cpp_callbacks *cpp_get_callbacks PARAMS ((cpp_reader *));
-extern void cpp_set_callbacks PARAMS ((cpp_reader *, cpp_callbacks *));
+extern cpp_options *cpp_get_options (cpp_reader *);
+extern const struct line_maps *cpp_get_line_maps (cpp_reader *);
+extern cpp_callbacks *cpp_get_callbacks (cpp_reader *);
+extern void cpp_set_callbacks (cpp_reader *, cpp_callbacks *);
/* This function reads the file, but does not start preprocessing. It
returns the name of the original file; this is the same as the
input file, except for preprocessed input. This will generate at
least one file change callback, and possibly a line change callback
too. If there was an error opening the file, it returns NULL. */
-extern const char *cpp_read_main_file PARAMS ((cpp_reader *, const char *));
+extern const char *cpp_read_main_file (cpp_reader *, const char *);
/* Set up built-ins like __FILE__. */
-extern void cpp_init_builtins PARAMS ((cpp_reader *, int));
+extern void cpp_init_builtins (cpp_reader *, int);
/* Call this to finish preprocessing. If you requested dependency
generation, pass an open stream to write the information to,
otherwise NULL. It is your responsibility to close the stream.
Returns cpp_errors (pfile). */
-extern int cpp_finish PARAMS ((cpp_reader *, FILE *deps_stream));
+extern int cpp_finish (cpp_reader *, FILE *deps_stream);
/* Call this to release the handle at the end of preprocessing. Any
use of the handle after this function returns is invalid. Returns
cpp_errors (pfile). */
-extern void cpp_destroy PARAMS ((cpp_reader *));
+extern void cpp_destroy (cpp_reader *);
/* Error count. */
-extern unsigned int cpp_errors PARAMS ((cpp_reader *));
-
-extern unsigned int cpp_token_len PARAMS ((const cpp_token *));
-extern unsigned char *cpp_token_as_text PARAMS ((cpp_reader *,
- const cpp_token *));
-extern unsigned char *cpp_spell_token PARAMS ((cpp_reader *, const cpp_token *,
- unsigned char *));
-extern void cpp_register_pragma PARAMS ((cpp_reader *,
- const char *, const char *,
- void (*) PARAMS ((cpp_reader *))));
-
-extern int cpp_avoid_paste PARAMS ((cpp_reader *, const cpp_token *,
- const cpp_token *));
-extern const cpp_token *cpp_get_token PARAMS ((cpp_reader *));
-extern const unsigned char *cpp_macro_definition PARAMS ((cpp_reader *,
- const cpp_hashnode *));
-extern void _cpp_backup_tokens PARAMS ((cpp_reader *, unsigned int));
+extern unsigned int cpp_errors (cpp_reader *);
+
+extern unsigned int cpp_token_len (const cpp_token *);
+extern unsigned char *cpp_token_as_text (cpp_reader *, const cpp_token *);
+extern unsigned char *cpp_spell_token (cpp_reader *, const cpp_token *,
+ unsigned char *);
+extern void cpp_register_pragma (cpp_reader *, const char *, const char *,
+ void (*) (cpp_reader *));
+extern int cpp_avoid_paste (cpp_reader *, const cpp_token *,
+ const cpp_token *);
+extern const cpp_token *cpp_get_token (cpp_reader *);
+extern const unsigned char *cpp_macro_definition (cpp_reader *,
+ const cpp_hashnode *);
+extern void _cpp_backup_tokens (cpp_reader *, unsigned int);
/* Evaluate a CPP_CHAR or CPP_WCHAR token. */
-extern cppchar_t
-cpp_interpret_charconst PARAMS ((cpp_reader *, const cpp_token *,
- unsigned int *, int *));
+extern cppchar_t cpp_interpret_charconst (cpp_reader *, const cpp_token *,
+ unsigned int *, int *);
/* Used to register macros and assertions, perhaps from the command line.
The text is the same as the command line argument. */
-extern void cpp_define PARAMS ((cpp_reader *, const char *));
-extern void cpp_assert PARAMS ((cpp_reader *, const char *));
-extern void cpp_undef PARAMS ((cpp_reader *, const char *));
-extern void cpp_unassert PARAMS ((cpp_reader *, const char *));
+extern void cpp_define (cpp_reader *, const char *);
+extern void cpp_assert (cpp_reader *, const char *);
+extern void cpp_undef (cpp_reader *, const char *);
+extern void cpp_unassert (cpp_reader *, const char *);
-extern cpp_buffer *cpp_push_buffer PARAMS ((cpp_reader *,
- const unsigned char *, size_t,
- int, int));
-extern int cpp_defined PARAMS ((cpp_reader *, const unsigned char *, int));
+extern cpp_buffer *cpp_push_buffer (cpp_reader *, const unsigned char *,
+ size_t, int, int);
+extern int cpp_defined (cpp_reader *, const unsigned char *, int);
/* A preprocessing number. Code assumes that any unused high bits of
the double integer are set to zero. */
@@ -619,15 +611,15 @@ struct cpp_num
/* Classify a CPP_NUMBER token. The return value is a combination of
the flags from the above sets. */
-extern unsigned cpp_classify_number PARAMS ((cpp_reader *, const cpp_token *));
+extern unsigned cpp_classify_number (cpp_reader *, const cpp_token *);
/* Evaluate a token classified as category CPP_N_INTEGER. */
-extern cpp_num cpp_interpret_integer PARAMS ((cpp_reader *, const cpp_token *,
- unsigned int type));
+extern cpp_num cpp_interpret_integer (cpp_reader *, const cpp_token *,
+ unsigned int type);
/* Sign extend a number, with PRECISION significant bits and all
others assumed clear, to fill out a cpp_num structure. */
-cpp_num cpp_num_sign_extend PARAMS ((cpp_num, size_t));
+cpp_num cpp_num_sign_extend (cpp_num, size_t);
/* Diagnostic levels. To get a diagnostic without associating a
position in the translation unit with it, use cpp_error_with_line
@@ -657,72 +649,64 @@ cpp_num cpp_num_sign_extend PARAMS ((cpp_num, size_t));
getting ridiculously oversized. */
/* Output a diagnostic of some kind. */
-extern void cpp_error PARAMS ((cpp_reader *, int, const char *msgid, ...))
+extern void cpp_error (cpp_reader *, int, const char *msgid, ...)
ATTRIBUTE_PRINTF_3;
-/* Output a diagnostic of severity LEVEL, with "MSG: " preceding the
+/* Output a diagnostic with "MSGID: " preceding the
error string of errno. No location is printed. */
-extern void cpp_errno PARAMS ((cpp_reader *, int level, const char *msg));
+extern void cpp_errno (cpp_reader *, int, const char *msgid);
/* Same as cpp_error, except additionally specifies a position as a
(translation unit) physical line and physical column. If the line is
zero, then no location is printed. */
-extern void cpp_error_with_line PARAMS ((cpp_reader *, int, unsigned, unsigned, const char *msgid, ...))
+extern void cpp_error_with_line (cpp_reader *, int, unsigned, unsigned, const char *msgid, ...)
ATTRIBUTE_PRINTF_5;
/* In cpplex.c */
-extern int cpp_ideq PARAMS ((const cpp_token *,
- const char *));
-extern void cpp_output_line PARAMS ((cpp_reader *, FILE *));
-extern void cpp_output_token PARAMS ((const cpp_token *, FILE *));
-extern const char *cpp_type2name PARAMS ((enum cpp_ttype));
+extern int cpp_ideq (const cpp_token *, const char *);
+extern void cpp_output_line (cpp_reader *, FILE *);
+extern void cpp_output_token (const cpp_token *, FILE *);
+extern const char *cpp_type2name (enum cpp_ttype);
/* Returns the value of an escape sequence, truncated to the correct
target precision. PSTR points to the input pointer, which is just
after the backslash. LIMIT is how much text we have. WIDE is true
if the escape sequence is part of a wide character constant or
string literal. Handles all relevant diagnostics. */
-extern cppchar_t cpp_parse_escape PARAMS ((cpp_reader *,
- const unsigned char ** pstr,
- const unsigned char *limit,
- int wide));
+extern cppchar_t cpp_parse_escape (cpp_reader *, const unsigned char ** pstr,
+ const unsigned char *limit, int wide);
/* In cpphash.c */
/* Lookup an identifier in the hashtable. Puts the identifier in the
table if it is not already there. */
-extern cpp_hashnode *cpp_lookup PARAMS ((cpp_reader *,
- const unsigned char *,
- unsigned int));
+extern cpp_hashnode *cpp_lookup (cpp_reader *, const unsigned char *,
+ unsigned int);
-typedef int (*cpp_cb) PARAMS ((cpp_reader *, cpp_hashnode *, void *));
-extern void cpp_forall_identifiers PARAMS ((cpp_reader *,
- cpp_cb, void *));
+typedef int (*cpp_cb) (cpp_reader *, cpp_hashnode *, void *);
+extern void cpp_forall_identifiers (cpp_reader *, cpp_cb, void *);
/* In cppmacro.c */
-extern void cpp_scan_nooutput PARAMS ((cpp_reader *));
-extern int cpp_sys_macro_p PARAMS ((cpp_reader *));
-extern unsigned char *cpp_quote_string PARAMS ((unsigned char *,
- const unsigned char *,
- unsigned int));
+extern void cpp_scan_nooutput (cpp_reader *);
+extern int cpp_sys_macro_p (cpp_reader *);
+extern unsigned char *cpp_quote_string (unsigned char *, const unsigned char *,
+ unsigned int);
/* In cppfiles.c */
-extern int cpp_included PARAMS ((cpp_reader *, const char *));
-extern void cpp_make_system_header PARAMS ((cpp_reader *, int, int));
-extern void cpp_simplify_path PARAMS ((char *));
-extern bool cpp_push_include PARAMS ((cpp_reader *, const char *));
-extern void cpp_change_file PARAMS ((cpp_reader *, enum lc_reason,
- const char *));
+extern int cpp_included (cpp_reader *, const char *);
+extern void cpp_make_system_header (cpp_reader *, int, int);
+extern void cpp_simplify_path (char *);
+extern bool cpp_push_include (cpp_reader *, const char *);
+extern void cpp_change_file (cpp_reader *, enum lc_reason, const char *);
/* In cpppch.c */
struct save_macro_data;
-extern int cpp_save_state PARAMS ((cpp_reader *, FILE *));
-extern int cpp_write_pch_deps PARAMS ((cpp_reader *, FILE *));
-extern int cpp_write_pch_state PARAMS ((cpp_reader *, FILE *));
-extern int cpp_valid_state PARAMS ((cpp_reader *, const char *, int));
-extern void cpp_prepare_state PARAMS ((cpp_reader *,
- struct save_macro_data **));
-extern int cpp_read_state PARAMS ((cpp_reader *, const char *, FILE *,
- struct save_macro_data *));
+extern int cpp_save_state (cpp_reader *, FILE *);
+extern int cpp_write_pch_deps (cpp_reader *, FILE *);
+extern int cpp_write_pch_state (cpp_reader *, FILE *);
+extern int cpp_valid_state (cpp_reader *, const char *, int);
+extern void cpp_prepare_state (cpp_reader *, struct save_macro_data **);
+extern int cpp_read_state (cpp_reader *, const char *, FILE *,
+ struct save_macro_data *);
#ifdef __cplusplus
}
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index eba8c0032a3..2b9c9b5f89b 100644
--- a/gcc/cppmacro.c
+++ b/gcc/cppmacro.c
@@ -42,47 +42,40 @@ struct macro_arg
/* Macro expansion. */
-static int enter_macro_context PARAMS ((cpp_reader *, cpp_hashnode *));
-static int builtin_macro PARAMS ((cpp_reader *, cpp_hashnode *));
-static void push_token_context
- PARAMS ((cpp_reader *, cpp_hashnode *, const cpp_token *, unsigned int));
-static void push_ptoken_context
- PARAMS ((cpp_reader *, cpp_hashnode *, _cpp_buff *,
- const cpp_token **, unsigned int));
-static _cpp_buff *collect_args PARAMS ((cpp_reader *, const cpp_hashnode *));
-static cpp_context *next_context PARAMS ((cpp_reader *));
-static const cpp_token *padding_token
- PARAMS ((cpp_reader *, const cpp_token *));
-static void expand_arg PARAMS ((cpp_reader *, macro_arg *));
-static const cpp_token *new_string_token PARAMS ((cpp_reader *, uchar *,
- unsigned int));
-static const cpp_token *stringify_arg PARAMS ((cpp_reader *, macro_arg *));
-static void paste_all_tokens PARAMS ((cpp_reader *, const cpp_token *));
-static bool paste_tokens PARAMS ((cpp_reader *, const cpp_token **,
- const cpp_token *));
-static void replace_args PARAMS ((cpp_reader *, cpp_hashnode *, cpp_macro *,
- macro_arg *));
-static _cpp_buff *funlike_invocation_p PARAMS ((cpp_reader *, cpp_hashnode *));
-static bool create_iso_definition PARAMS ((cpp_reader *, cpp_macro *));
+static int enter_macro_context (cpp_reader *, cpp_hashnode *);
+static int builtin_macro (cpp_reader *, cpp_hashnode *);
+static void push_token_context (cpp_reader *, cpp_hashnode *,
+ const cpp_token *, unsigned int);
+static void push_ptoken_context (cpp_reader *, cpp_hashnode *, _cpp_buff *,
+ const cpp_token **, unsigned int);
+static _cpp_buff *collect_args (cpp_reader *, const cpp_hashnode *);
+static cpp_context *next_context (cpp_reader *);
+static const cpp_token *padding_token (cpp_reader *, const cpp_token *);
+static void expand_arg (cpp_reader *, macro_arg *);
+static const cpp_token *new_string_token (cpp_reader *, uchar *, unsigned int);
+static const cpp_token *stringify_arg (cpp_reader *, macro_arg *);
+static void paste_all_tokens (cpp_reader *, const cpp_token *);
+static bool paste_tokens (cpp_reader *, const cpp_token **, const cpp_token *);
+static void replace_args (cpp_reader *, cpp_hashnode *, cpp_macro *,
+ macro_arg *);
+static _cpp_buff *funlike_invocation_p (cpp_reader *, cpp_hashnode *);
+static bool create_iso_definition (cpp_reader *, cpp_macro *);
/* #define directive parsing and handling. */
-static cpp_token *alloc_expansion_token PARAMS ((cpp_reader *, cpp_macro *));
-static cpp_token *lex_expansion_token PARAMS ((cpp_reader *, cpp_macro *));
-static bool warn_of_redefinition PARAMS ((cpp_reader *, const cpp_hashnode *,
- const cpp_macro *));
-static bool parse_params PARAMS ((cpp_reader *, cpp_macro *));
-static void check_trad_stringification PARAMS ((cpp_reader *,
- const cpp_macro *,
- const cpp_string *));
+static cpp_token *alloc_expansion_token (cpp_reader *, cpp_macro *);
+static cpp_token *lex_expansion_token (cpp_reader *, cpp_macro *);
+static bool warn_of_redefinition (cpp_reader *, const cpp_hashnode *,
+ const cpp_macro *);
+static bool parse_params (cpp_reader *, cpp_macro *);
+static void check_trad_stringification (cpp_reader *, const cpp_macro *,
+ const cpp_string *);
/* Emits a warning if NODE is a macro defined in the main file that
has not been used. */
int
-_cpp_warn_if_unused_macro (pfile, node, v)
- cpp_reader *pfile;
- cpp_hashnode *node;
- void *v ATTRIBUTE_UNUSED;
+_cpp_warn_if_unused_macro (cpp_reader *pfile, cpp_hashnode *node,
+ void *v ATTRIBUTE_UNUSED)
{
if (node->type == NT_MACRO && !(node->flags & NODE_BUILTIN))
{
@@ -100,10 +93,7 @@ _cpp_warn_if_unused_macro (pfile, node, v)
/* Allocates and returns a CPP_STRING token, containing TEXT of length
LEN, after null-terminating it. TEXT must be in permanent storage. */
static const cpp_token *
-new_string_token (pfile, text, len)
- cpp_reader *pfile;
- unsigned char *text;
- unsigned int len;
+new_string_token (cpp_reader *pfile, unsigned char *text, unsigned int len)
{
cpp_token *token = _cpp_temp_token (pfile);
@@ -126,9 +116,7 @@ static const char * const monthnames[] =
is created. Returns 1 if it generates a new token context, 0 to
return the token to the caller. */
const uchar *
-_cpp_builtin_macro_text (pfile, node)
- cpp_reader *pfile;
- cpp_hashnode *node;
+_cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node)
{
const uchar *result = NULL;
unsigned int number = 1;
@@ -221,7 +209,8 @@ _cpp_builtin_macro_text (pfile, node)
pfile->date = _cpp_unaligned_alloc (pfile,
sizeof ("\"Oct 11 1347\""));
sprintf ((char *) pfile->date, "\"%s %2d %4d\"",
- monthnames[tb->tm_mon], tb->tm_mday, tb->tm_year + 1900);
+ monthnames[tb->tm_mon], tb->tm_mday,
+ tb->tm_year + 1900);
pfile->time = _cpp_unaligned_alloc (pfile,
sizeof ("\"12:34:56\""));
@@ -260,9 +249,7 @@ _cpp_builtin_macro_text (pfile, node)
created. Returns 1 if it generates a new token context, 0 to
return the token to the caller. */
static int
-builtin_macro (pfile, node)
- cpp_reader *pfile;
- cpp_hashnode *node;
+builtin_macro (cpp_reader *pfile, cpp_hashnode *node)
{
const uchar *buf;
size_t len;
@@ -304,10 +291,7 @@ builtin_macro (pfile, node)
converted to octal. DEST must be of sufficient size. Returns
a pointer to the end of the string. */
uchar *
-cpp_quote_string (dest, src, len)
- uchar *dest;
- const uchar *src;
- unsigned int len;
+cpp_quote_string (uchar *dest, const uchar *src, unsigned int len)
{
while (len--)
{
@@ -336,9 +320,7 @@ cpp_quote_string (dest, src, len)
/* Convert a token sequence ARG to a single string token according to
the rules of the ISO C #-operator. */
static const cpp_token *
-stringify_arg (pfile, arg)
- cpp_reader *pfile;
- macro_arg *arg;
+stringify_arg (cpp_reader *pfile, macro_arg *arg)
{
unsigned char *dest;
unsigned int i, escape_it, backslash_count = 0;
@@ -425,9 +407,7 @@ stringify_arg (pfile, arg)
case, PLHS is updated to point to the pasted token, which is
guaranteed to not have the PASTE_LEFT flag set. */
static bool
-paste_tokens (pfile, plhs, rhs)
- cpp_reader *pfile;
- const cpp_token **plhs, *rhs;
+paste_tokens (cpp_reader *pfile, const cpp_token **plhs, const cpp_token *rhs)
{
unsigned char *buf, *end;
const cpp_token *lhs;
@@ -468,9 +448,7 @@ paste_tokens (pfile, plhs, rhs)
successful pastes, with the effect that the RHS appears in the
output stream after the pasted LHS normally. */
static void
-paste_all_tokens (pfile, lhs)
- cpp_reader *pfile;
- const cpp_token *lhs;
+paste_all_tokens (cpp_reader *pfile, const cpp_token *lhs)
{
const cpp_token *rhs;
cpp_context *context = pfile->context;
@@ -516,11 +494,7 @@ paste_all_tokens (pfile, lhs)
Note that MACRO cannot necessarily be deduced from NODE, in case
NODE was redefined whilst collecting arguments. */
bool
-_cpp_arguments_ok (pfile, macro, node, argc)
- cpp_reader *pfile;
- cpp_macro *macro;
- const cpp_hashnode *node;
- unsigned int argc;
+_cpp_arguments_ok (cpp_reader *pfile, cpp_macro *macro, const cpp_hashnode *node, unsigned int argc)
{
if (argc == macro->paramc)
return true;
@@ -561,9 +535,7 @@ _cpp_arguments_ok (pfile, macro, node, argc)
NULL. Each argument is terminated by a CPP_EOF token, for the
future benefit of expand_arg(). */
static _cpp_buff *
-collect_args (pfile, node)
- cpp_reader *pfile;
- const cpp_hashnode *node;
+collect_args (cpp_reader *pfile, const cpp_hashnode *node)
{
_cpp_buff *buff, *base_buff;
cpp_macro *macro;
@@ -697,9 +669,7 @@ collect_args (pfile, node)
intervening padding tokens. If we find the parenthesis, collect
the arguments and return the buffer containing them. */
static _cpp_buff *
-funlike_invocation_p (pfile, node)
- cpp_reader *pfile;
- cpp_hashnode *node;
+funlike_invocation_p (cpp_reader *pfile, cpp_hashnode *node)
{
const cpp_token *token, *padding = NULL;
@@ -739,9 +709,7 @@ funlike_invocation_p (pfile, node)
containing its yet-to-be-rescanned replacement list and return one.
Otherwise, we don't push a context and return zero. */
static int
-enter_macro_context (pfile, node)
- cpp_reader *pfile;
- cpp_hashnode *node;
+enter_macro_context (cpp_reader *pfile, cpp_hashnode *node)
{
/* The presence of a macro invalidates a file's controlling macro. */
pfile->mi_valid = false;
@@ -800,11 +768,7 @@ enter_macro_context (pfile, node)
Expand each argument before replacing, unless it is operated upon
by the # or ## operators. */
static void
-replace_args (pfile, node, macro, args)
- cpp_reader *pfile;
- cpp_hashnode *node;
- cpp_macro *macro;
- macro_arg *args;
+replace_args (cpp_reader *pfile, cpp_hashnode *node, cpp_macro *macro, macro_arg *args)
{
unsigned int i, total;
const cpp_token *src, *limit;
@@ -936,9 +900,7 @@ replace_args (pfile, node, macro, args)
/* Return a special padding token, with padding inherited from SOURCE. */
static const cpp_token *
-padding_token (pfile, source)
- cpp_reader *pfile;
- const cpp_token *source;
+padding_token (cpp_reader *pfile, const cpp_token *source)
{
cpp_token *result = _cpp_temp_token (pfile);
@@ -951,8 +913,7 @@ padding_token (pfile, source)
/* Get a new uninitialized context. Create a new one if we cannot
re-use an old one. */
static cpp_context *
-next_context (pfile)
- cpp_reader *pfile;
+next_context (cpp_reader *pfile)
{
cpp_context *result = pfile->context->next;
@@ -970,12 +931,8 @@ next_context (pfile)
/* Push a list of pointers to tokens. */
static void
-push_ptoken_context (pfile, macro, buff, first, count)
- cpp_reader *pfile;
- cpp_hashnode *macro;
- _cpp_buff *buff;
- const cpp_token **first;
- unsigned int count;
+push_ptoken_context (cpp_reader *pfile, cpp_hashnode *macro, _cpp_buff *buff,
+ const cpp_token **first, unsigned int count)
{
cpp_context *context = next_context (pfile);
@@ -988,11 +945,8 @@ push_ptoken_context (pfile, macro, buff, first, count)
/* Push a list of tokens. */
static void
-push_token_context (pfile, macro, first, count)
- cpp_reader *pfile;
- cpp_hashnode *macro;
- const cpp_token *first;
- unsigned int count;
+push_token_context (cpp_reader *pfile, cpp_hashnode *macro,
+ const cpp_token *first, unsigned int count)
{
cpp_context *context = next_context (pfile);
@@ -1005,11 +959,8 @@ push_token_context (pfile, macro, first, count)
/* Push a traditional macro's replacement text. */
void
-_cpp_push_text_context (pfile, macro, start, len)
- cpp_reader *pfile;
- cpp_hashnode *macro;
- const uchar *start;
- size_t len;
+_cpp_push_text_context (cpp_reader *pfile, cpp_hashnode *macro,
+ const uchar *start, size_t len)
{
cpp_context *context = next_context (pfile);
@@ -1028,9 +979,7 @@ _cpp_push_text_context (pfile, macro, start, len)
has terminated the argument's tokens with a CPP_EOF so that we know
when we have fully expanded the argument. */
static void
-expand_arg (pfile, arg)
- cpp_reader *pfile;
- macro_arg *arg;
+expand_arg (cpp_reader *pfile, macro_arg *arg)
{
unsigned int capacity;
bool saved_warn_trad;
@@ -1076,8 +1025,7 @@ expand_arg (pfile, arg)
context represented a macro's replacement list. The context
structure is not freed so that we can re-use it later. */
void
-_cpp_pop_context (pfile)
- cpp_reader *pfile;
+_cpp_pop_context (cpp_reader *pfile)
{
cpp_context *context = pfile->context;
@@ -1090,9 +1038,9 @@ _cpp_pop_context (pfile)
pfile->context = context->prev;
}
-/* Eternal routine to get a token. Also used nearly everywhere
+/* External routine to get a token. Also used nearly everywhere
internally, except for places where we know we can safely call
- the lexer directly, such as lexing a directive name.
+ _cpp_lex_token directly, such as lexing a directive name.
Macro expansions and directives are transparently handled,
including entering included files. Thus tokens are post-macro
@@ -1102,8 +1050,7 @@ _cpp_pop_context (pfile)
state.in_directive is still 1, and at the end of argument
pre-expansion. */
const cpp_token *
-cpp_get_token (pfile)
- cpp_reader *pfile;
+cpp_get_token (cpp_reader *pfile)
{
const cpp_token *result;
@@ -1180,8 +1127,7 @@ cpp_get_token (pfile)
defined in a system header. Just checks the macro at the top of
the stack. Used for diagnostic suppression. */
int
-cpp_sys_macro_p (pfile)
- cpp_reader *pfile;
+cpp_sys_macro_p (cpp_reader *pfile)
{
cpp_hashnode *node = pfile->context->macro;
@@ -1191,8 +1137,7 @@ cpp_sys_macro_p (pfile)
/* Read each token in, until end of the current file. Directives are
transparently processed. */
void
-cpp_scan_nooutput (pfile)
- cpp_reader *pfile;
+cpp_scan_nooutput (cpp_reader *pfile)
{
/* Request a CPP_EOF token at the end of this file, rather than
transparently continuing with the including file. */
@@ -1209,9 +1154,7 @@ cpp_scan_nooutput (pfile)
/* Step back one (or more) tokens. Can only step mack more than 1 if
they are from the lexer, and not from macro expansion. */
void
-_cpp_backup_tokens (pfile, count)
- cpp_reader *pfile;
- unsigned int count;
+_cpp_backup_tokens (cpp_reader *pfile, unsigned int count)
{
if (pfile->context->prev == NULL)
{
@@ -1243,10 +1186,8 @@ _cpp_backup_tokens (pfile, count)
/* Returns nonzero if a macro redefinition warning is required. */
static bool
-warn_of_redefinition (pfile, node, macro2)
- cpp_reader *pfile;
- const cpp_hashnode *node;
- const cpp_macro *macro2;
+warn_of_redefinition (cpp_reader *pfile, const cpp_hashnode *node,
+ const cpp_macro *macro2)
{
const cpp_macro *macro1;
unsigned int i;
@@ -1287,8 +1228,7 @@ warn_of_redefinition (pfile, node, macro2)
/* Free the definition of hashnode H. */
void
-_cpp_free_definition (h)
- cpp_hashnode *h;
+_cpp_free_definition (cpp_hashnode *h)
{
/* Macros and assertions no longer have anything to free. */
h->type = NT_VOID;
@@ -1299,10 +1239,7 @@ _cpp_free_definition (h)
/* Save parameter NODE to the parameter list of macro MACRO. Returns
zero on success, nonzero if the parameter is a duplicate. */
bool
-_cpp_save_parameter (pfile, macro, node)
- cpp_reader *pfile;
- cpp_macro *macro;
- cpp_hashnode *node;
+_cpp_save_parameter (cpp_reader *pfile, cpp_macro *macro, cpp_hashnode *node)
{
unsigned int len;
/* Constraint 6.10.3.6 - duplicate parameter names. */
@@ -1335,9 +1272,7 @@ _cpp_save_parameter (pfile, macro, node)
/* Check the syntax of the parameters in a MACRO definition. Returns
false if an error occurs. */
static bool
-parse_params (pfile, macro)
- cpp_reader *pfile;
- cpp_macro *macro;
+parse_params (cpp_reader *pfile, cpp_macro *macro)
{
unsigned int prev_ident = 0;
@@ -1416,9 +1351,7 @@ parse_params (pfile, macro)
/* Allocate room for a token from a macro's replacement list. */
static cpp_token *
-alloc_expansion_token (pfile, macro)
- cpp_reader *pfile;
- cpp_macro *macro;
+alloc_expansion_token (cpp_reader *pfile, cpp_macro *macro)
{
if (BUFF_ROOM (pfile->a_buff) < (macro->count + 1) * sizeof (cpp_token))
_cpp_extend_buff (pfile, &pfile->a_buff, sizeof (cpp_token));
@@ -1429,9 +1362,7 @@ alloc_expansion_token (pfile, macro)
/* Lex a token from the expansion of MACRO, but mark parameters as we
find them and warn of traditional stringification. */
static cpp_token *
-lex_expansion_token (pfile, macro)
- cpp_reader *pfile;
- cpp_macro *macro;
+lex_expansion_token (cpp_reader *pfile, cpp_macro *macro)
{
cpp_token *token;
@@ -1453,9 +1384,7 @@ lex_expansion_token (pfile, macro)
}
static bool
-create_iso_definition (pfile, macro)
- cpp_reader *pfile;
- cpp_macro *macro;
+create_iso_definition (cpp_reader *pfile, cpp_macro *macro)
{
cpp_token *token;
const cpp_token *ctoken;
@@ -1524,7 +1453,7 @@ create_iso_definition (pfile, macro)
if (macro->count == 0 || token->type == CPP_EOF)
{
cpp_error (pfile, DL_ERROR,
- "'##' cannot appear at either end of a macro expansion");
+ "'##' cannot appear at either end of a macro expansion");
return false;
}
@@ -1551,9 +1480,7 @@ create_iso_definition (pfile, macro)
/* Parse a macro and save its expansion. Returns nonzero on success. */
bool
-_cpp_create_definition (pfile, node)
- cpp_reader *pfile;
- cpp_hashnode *node;
+_cpp_create_definition (cpp_reader *pfile, cpp_hashnode *node)
{
cpp_macro *macro;
unsigned int i;
@@ -1634,10 +1561,8 @@ _cpp_create_definition (pfile, node)
/* Warn if a token in STRING matches one of a function-like MACRO's
parameters. */
static void
-check_trad_stringification (pfile, macro, string)
- cpp_reader *pfile;
- const cpp_macro *macro;
- const cpp_string *string;
+check_trad_stringification (cpp_reader *pfile, const cpp_macro *macro,
+ const cpp_string *string)
{
unsigned int i, len;
const uchar *p, *q, *limit;
@@ -1681,9 +1606,7 @@ check_trad_stringification (pfile, macro, string)
Caller is expected to generate the "#define" bit if needed. The
returned text is temporary, and automatically freed later. */
const unsigned char *
-cpp_macro_definition (pfile, node)
- cpp_reader *pfile;
- const cpp_hashnode *node;
+cpp_macro_definition (cpp_reader *pfile, const cpp_hashnode *node)
{
unsigned int i, len;
const cpp_macro *macro = node->value.macro;
diff --git a/gcc/cpppch.c b/gcc/cpppch.c
index 602711a427e..6b60c57eaac 100644
--- a/gcc/cpppch.c
+++ b/gcc/cpppch.c
@@ -24,16 +24,16 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "hashtab.h"
#include "mkdeps.h"
-static int write_macdef PARAMS ((cpp_reader *, cpp_hashnode *, void *));
-static int save_idents PARAMS ((cpp_reader *, cpp_hashnode *, void *));
-static hashval_t hashmem PARAMS ((const void *, size_t));
-static hashval_t cpp_string_hash PARAMS ((const void *));
-static int cpp_string_eq PARAMS ((const void *, const void *));
-static int count_defs PARAMS ((cpp_reader *, cpp_hashnode *, void *));
-static int comp_hashnodes PARAMS ((const void *, const void *));
-static int collect_ht_nodes PARAMS ((cpp_reader *, cpp_hashnode *, void *));
-static int write_defs PARAMS ((cpp_reader *, cpp_hashnode *, void *));
-static int save_macros PARAMS ((cpp_reader *, cpp_hashnode *, void *));
+static int write_macdef (cpp_reader *, cpp_hashnode *, void *);
+static int save_idents (cpp_reader *, cpp_hashnode *, void *);
+static hashval_t hashmem (const void *, size_t);
+static hashval_t cpp_string_hash (const void *);
+static int cpp_string_eq (const void *, const void *);
+static int count_defs (cpp_reader *, cpp_hashnode *, void *);
+static int comp_hashnodes (const void *, const void *);
+static int collect_ht_nodes (cpp_reader *, cpp_hashnode *, void *);
+static int write_defs (cpp_reader *, cpp_hashnode *, void *);
+static int save_macros (cpp_reader *, cpp_hashnode *, void *);
/* This structure represents a macro definition on disk. */
struct macrodef_struct
@@ -47,10 +47,7 @@ struct macrodef_struct
Suitable for being called by cpp_forall_identifiers. */
static int
-write_macdef (pfile, hn, file_p)
- cpp_reader *pfile;
- cpp_hashnode *hn;
- void *file_p;
+write_macdef (cpp_reader *pfile, cpp_hashnode *hn, void *file_p)
{
FILE *f = (FILE *) file_p;
switch (hn->type)
@@ -112,7 +109,7 @@ struct cpp_savedstate
size_t hashsize;
/* Number of definitions */
size_t n_defs;
- /* Array of definitions. In cpp_write_pch_deps it is used for sorting. */
+ /* Array of definitions. In cpp_write_pch_deps it is used for sorting. */
cpp_hashnode **defs;
/* Space for the next definition. Definitions are null-terminated
strings. */
@@ -123,10 +120,7 @@ struct cpp_savedstate
put the definition in 'definedstrs'. */
static int
-save_idents (pfile, hn, ss_p)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
- cpp_hashnode *hn;
- void *ss_p;
+save_idents (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_hashnode *hn, void *ss_p)
{
struct cpp_savedstate *const ss = (struct cpp_savedstate *)ss_p;
@@ -158,9 +152,7 @@ save_idents (pfile, hn, ss_p)
/* Hash some memory in a generic way. */
static hashval_t
-hashmem (p_p, sz)
- const void *p_p;
- size_t sz;
+hashmem (const void *p_p, size_t sz)
{
const unsigned char *p = (const unsigned char *)p_p;
size_t i;
@@ -175,8 +167,7 @@ hashmem (p_p, sz)
/* Hash a cpp string for the hashtable machinery. */
static hashval_t
-cpp_string_hash (a_p)
- const void *a_p;
+cpp_string_hash (const void *a_p)
{
const struct cpp_string *a = (const struct cpp_string *) a_p;
return hashmem (a->text, a->len);
@@ -185,9 +176,7 @@ cpp_string_hash (a_p)
/* Compare two cpp strings for the hashtable machinery. */
static int
-cpp_string_eq (a_p, b_p)
- const void *a_p;
- const void *b_p;
+cpp_string_eq (const void *a_p, const void *b_p)
{
const struct cpp_string *a = (const struct cpp_string *) a_p;
const struct cpp_string *b = (const struct cpp_string *) b_p;
@@ -201,9 +190,7 @@ cpp_string_eq (a_p, b_p)
would be called when reading the precompiled header back in. */
int
-cpp_save_state (r, f)
- cpp_reader *r;
- FILE *f;
+cpp_save_state (cpp_reader *r, FILE *f)
{
/* Save the list of non-void identifiers for the dependency checking. */
r->savedstate = xmalloc (sizeof (struct cpp_savedstate));
@@ -220,10 +207,7 @@ cpp_save_state (r, f)
/* Calculate the 'hashsize' field of the saved state. */
static int
-count_defs (pfile, hn, ss_p)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
- cpp_hashnode *hn;
- void *ss_p;
+count_defs (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_hashnode *hn, void *ss_p)
{
struct cpp_savedstate *const ss = (struct cpp_savedstate *)ss_p;
@@ -260,12 +244,9 @@ count_defs (pfile, hn, ss_p)
}
}
-/* Collect the identifiers into the state's string table. */
+/* Collect the identifiers into the state's string table. */
static int
-write_defs (pfile, hn, ss_p)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
- cpp_hashnode *hn;
- void *ss_p;
+write_defs (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_hashnode *hn, void *ss_p)
{
struct cpp_savedstate *const ss = (struct cpp_savedstate *)ss_p;
@@ -305,9 +286,7 @@ write_defs (pfile, hn, ss_p)
/* Comparison function for qsort. The arguments point to pointers of
type ht_hashnode *. */
static int
-comp_hashnodes (px, py)
- const void *px;
- const void *py;
+comp_hashnodes (const void *px, const void *py)
{
cpp_hashnode *x = *(cpp_hashnode **) px;
cpp_hashnode *y = *(cpp_hashnode **) py;
@@ -318,9 +297,7 @@ comp_hashnodes (px, py)
called after the PCH is ready to be saved. */
int
-cpp_write_pch_deps (r, f)
- cpp_reader *r;
- FILE *f;
+cpp_write_pch_deps (cpp_reader *r, FILE *f)
{
struct macrodef_struct z;
struct cpp_savedstate *const ss = r->savedstate;
@@ -337,7 +314,7 @@ cpp_write_pch_deps (r, f)
ss->n_defs = 0;
cpp_forall_identifiers (r, write_defs, ss);
- /* Sort the list, copy it into a buffer, and write it out. */
+ /* Sort the list, copy it into a buffer, and write it out. */
qsort (ss->defs, ss->n_defs, sizeof (cpp_hashnode *), &comp_hashnodes);
definedstrs = ss->definedstrs = xmalloc (ss->hashsize);
for (i = 0; i < ss->n_defs; ++i)
@@ -367,9 +344,7 @@ cpp_write_pch_deps (r, f)
cpp_read_state. */
int
-cpp_write_pch_state (r, f)
- cpp_reader *r;
- FILE *f;
+cpp_write_pch_state (cpp_reader *r, FILE *f)
{
struct macrodef_struct z;
@@ -410,10 +385,8 @@ struct ht_node_list
/* Callback for collecting identifiers from hash table */
static int
-collect_ht_nodes (pfile, hn, nl_p)
- cpp_reader *pfile ATTRIBUTE_UNUSED;
- cpp_hashnode *hn;
- void *nl_p;
+collect_ht_nodes (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_hashnode *hn,
+ void *nl_p)
{
struct ht_node_list *const nl = (struct ht_node_list *)nl_p;
@@ -446,10 +419,7 @@ collect_ht_nodes (pfile, hn, nl_p)
*/
int
-cpp_valid_state (r, name, fd)
- cpp_reader *r;
- const char *name;
- int fd;
+cpp_valid_state (cpp_reader *r, const char *name, int fd)
{
struct macrodef_struct m;
size_t namebufsz = 256;
@@ -526,7 +496,7 @@ cpp_valid_state (r, name, fd)
qsort (nl.defs, nl.n_defs, sizeof (cpp_hashnode *), &comp_hashnodes);
/* Loop through nl.defs and undeftab, both of which are sorted lists.
- There should be no matches. */
+ There should be no matches. */
first = undeftab;
last = undeftab + m.definition_length;
i = 0;
@@ -583,10 +553,7 @@ struct save_macro_data
a PCH restore. */
static int
-save_macros (r, h, data_p)
- cpp_reader *r ATTRIBUTE_UNUSED;
- cpp_hashnode *h;
- void *data_p;
+save_macros (cpp_reader *r ATTRIBUTE_UNUSED, cpp_hashnode *h, void *data_p)
{
struct save_macro_data *data = (struct save_macro_data *)data_p;
if (h->type != NT_VOID
@@ -614,9 +581,7 @@ save_macros (r, h, data_p)
macros in 'data'. */
void
-cpp_prepare_state (r, data)
- cpp_reader *r;
- struct save_macro_data **data;
+cpp_prepare_state (cpp_reader *r, struct save_macro_data **data)
{
struct save_macro_data *d = xmalloc (sizeof (struct save_macro_data));
@@ -632,11 +597,8 @@ cpp_prepare_state (r, data)
DEPNAME is passed to deps_restore. */
int
-cpp_read_state (r, name, f, data)
- cpp_reader *r;
- const char *name;
- FILE *f;
- struct save_macro_data *data;
+cpp_read_state (cpp_reader *r, const char *name, FILE *f,
+ struct save_macro_data *data)
{
struct macrodef_struct m;
size_t defnlen = 256;
diff --git a/gcc/cppspec.c b/gcc/cppspec.c
index db15d7dfd37..eb5205fa323 100644
--- a/gcc/cppspec.c
+++ b/gcc/cppspec.c
@@ -51,10 +51,8 @@ static const char *const known_suffixes[] =
/* Filter argc and argv before processing by the gcc driver proper. */
void
-lang_specific_driver (in_argc, in_argv, in_added_libraries)
- int *in_argc;
- const char *const **in_argv;
- int *in_added_libraries ATTRIBUTE_UNUSED;
+lang_specific_driver (int *in_argc, const char *const **in_argv,
+ int *in_added_libraries ATTRIBUTE_UNUSED)
{
int argc = *in_argc;
const char *const *argv = *in_argv;
@@ -203,7 +201,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
}
/* Called before linking. Returns 0 on success and -1 on failure. */
-int lang_specific_pre_link ()
+int lang_specific_pre_link (void)
{
return 0; /* Not used for cpp. */
}
diff --git a/gcc/cpptrad.c b/gcc/cpptrad.c
index f8923ae8412..0e4b2314bb4 100644
--- a/gcc/cpptrad.c
+++ b/gcc/cpptrad.c
@@ -81,29 +81,24 @@ enum ls {ls_none = 0, /* Normal state. */
/* Lexing TODO: Maybe handle space in escaped newlines. Stop cpplex.c
from recognizing comments and directives during its lexing pass. */
-static const uchar *skip_whitespace PARAMS ((cpp_reader *, const uchar *,
- int));
-static cpp_hashnode *lex_identifier PARAMS ((cpp_reader *, const uchar *));
-static const uchar *copy_comment PARAMS ((cpp_reader *, const uchar *, int));
-static void check_output_buffer PARAMS ((cpp_reader *, size_t));
-static void push_replacement_text PARAMS ((cpp_reader *, cpp_hashnode *));
-static bool scan_parameters PARAMS ((cpp_reader *, cpp_macro *));
-static bool recursive_macro PARAMS ((cpp_reader *, cpp_hashnode *));
-static void save_replacement_text PARAMS ((cpp_reader *, cpp_macro *,
- unsigned int));
-static void maybe_start_funlike PARAMS ((cpp_reader *, cpp_hashnode *,
- const uchar *, struct fun_macro *));
-static void save_argument PARAMS ((struct fun_macro *, size_t));
-static void replace_args_and_push PARAMS ((cpp_reader *, struct fun_macro *));
-static size_t canonicalize_text PARAMS ((uchar *, const uchar *, size_t,
- uchar *));
+static const uchar *skip_whitespace (cpp_reader *, const uchar *, int);
+static cpp_hashnode *lex_identifier (cpp_reader *, const uchar *);
+static const uchar *copy_comment (cpp_reader *, const uchar *, int);
+static void check_output_buffer (cpp_reader *, size_t);
+static void push_replacement_text (cpp_reader *, cpp_hashnode *);
+static bool scan_parameters (cpp_reader *, cpp_macro *);
+static bool recursive_macro (cpp_reader *, cpp_hashnode *);
+static void save_replacement_text (cpp_reader *, cpp_macro *, unsigned int);
+static void maybe_start_funlike (cpp_reader *, cpp_hashnode *, const uchar *,
+ struct fun_macro *);
+static void save_argument (struct fun_macro *, size_t);
+static void replace_args_and_push (cpp_reader *, struct fun_macro *);
+static size_t canonicalize_text (uchar *, const uchar *, size_t, uchar *);
/* Ensures we have N bytes' space in the output buffer, and
reallocates it if not. */
static void
-check_output_buffer (pfile, n)
- cpp_reader *pfile;
- size_t n;
+check_output_buffer (cpp_reader *pfile, size_t n)
{
/* We might need two bytes to terminate an unterminated comment, and
one more to terminate the line with a NUL. */
@@ -134,10 +129,7 @@ check_output_buffer (pfile, n)
Returns a pointer to the first character after the comment in the
input buffer. */
static const uchar *
-copy_comment (pfile, cur, in_define)
- cpp_reader *pfile;
- const uchar *cur;
- int in_define;
+copy_comment (cpp_reader *pfile, const uchar *cur, int in_define)
{
bool unterminated, copy = false;
unsigned int from_line = pfile->line;
@@ -197,10 +189,7 @@ copy_comment (pfile, cur, in_define)
Returns a pointer to the first character after the whitespace in
the input buffer. */
static const uchar *
-skip_whitespace (pfile, cur, skip_comments)
- cpp_reader *pfile;
- const uchar *cur;
- int skip_comments;
+skip_whitespace (cpp_reader *pfile, const uchar *cur, int skip_comments)
{
uchar *out = pfile->out.cur;
@@ -232,9 +221,7 @@ skip_whitespace (pfile, cur, skip_comments)
to point to a valid first character of an identifier. Returns
the hashnode, and updates out.cur. */
static cpp_hashnode *
-lex_identifier (pfile, cur)
- cpp_reader *pfile;
- const uchar *cur;
+lex_identifier (cpp_reader *pfile, const uchar *cur)
{
size_t len;
uchar *out = pfile->out.cur;
@@ -256,10 +243,7 @@ lex_identifier (pfile, cur)
starting at START. The true buffer is restored upon calling
restore_buff(). */
void
-_cpp_overlay_buffer (pfile, start, len)
- cpp_reader *pfile;
- const uchar *start;
- size_t len;
+_cpp_overlay_buffer (cpp_reader *pfile, const uchar *start, size_t len)
{
cpp_buffer *buffer = pfile->buffer;
@@ -276,8 +260,7 @@ _cpp_overlay_buffer (pfile, start, len)
/* Restores a buffer overlaid by _cpp_overlay_buffer(). */
void
-_cpp_remove_overlay (pfile)
- cpp_reader *pfile;
+_cpp_remove_overlay (cpp_reader *pfile)
{
cpp_buffer *buffer = pfile->overlaid_buffer;
@@ -292,8 +275,7 @@ _cpp_remove_overlay (pfile)
/* Reads a logical line into the output buffer. Returns TRUE if there
is more text left in the buffer. */
bool
-_cpp_read_logical_line_trad (pfile)
- cpp_reader *pfile;
+_cpp_read_logical_line_trad (cpp_reader *pfile)
{
do
{
@@ -308,11 +290,7 @@ _cpp_read_logical_line_trad (pfile)
/* Set up state for finding the opening '(' of a function-like
macro. */
static void
-maybe_start_funlike (pfile, node, start, macro)
- cpp_reader *pfile;
- cpp_hashnode *node;
- const uchar *start;
- struct fun_macro *macro;
+maybe_start_funlike (cpp_reader *pfile, cpp_hashnode *node, const uchar *start, struct fun_macro *macro)
{
unsigned int n = node->value.macro->paramc + 1;
@@ -327,9 +305,7 @@ maybe_start_funlike (pfile, node, start, macro)
/* Save the OFFSET of the start of the next argument to MACRO. */
static void
-save_argument (macro, offset)
- struct fun_macro *macro;
- size_t offset;
+save_argument (struct fun_macro *macro, size_t offset)
{
macro->argc++;
if (macro->argc <= macro->node->value.macro->paramc)
@@ -344,9 +320,7 @@ save_argument (macro, offset)
MACRO, and we call save_replacement_text() every time we meet an
argument. */
bool
-scan_out_logical_line (pfile, macro)
- cpp_reader *pfile;
- cpp_macro *macro;
+scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro)
{
bool result = true;
cpp_context *context;
@@ -683,9 +657,7 @@ scan_out_logical_line (pfile, macro)
the context stack. NODE is either object-like, or a function-like
macro with no arguments. */
static void
-push_replacement_text (pfile, node)
- cpp_reader *pfile;
- cpp_hashnode *node;
+push_replacement_text (cpp_reader *pfile, cpp_hashnode *node)
{
size_t len;
const uchar *text;
@@ -713,9 +685,7 @@ push_replacement_text (pfile, node)
/* Returns TRUE if traditional macro recursion is detected. */
static bool
-recursive_macro (pfile, node)
- cpp_reader *pfile;
- cpp_hashnode *node;
+recursive_macro (cpp_reader *pfile, cpp_hashnode *node)
{
bool recursing = !!(node->flags & NODE_DISABLED);
@@ -756,8 +726,7 @@ recursive_macro (pfile, node)
/* Return the length of the replacement text of a function-like or
object-like non-builtin macro. */
size_t
-_cpp_replacement_text_len (macro)
- const cpp_macro *macro;
+_cpp_replacement_text_len (const cpp_macro *macro)
{
size_t len;
@@ -787,9 +756,7 @@ _cpp_replacement_text_len (macro)
sufficient size. It is not NUL-terminated. The next character is
returned. */
uchar *
-_cpp_copy_replacement_text (macro, dest)
- const cpp_macro *macro;
- uchar *dest;
+_cpp_copy_replacement_text (const cpp_macro *macro, uchar *dest)
{
if (macro->fun_like && (macro->paramc != 0))
{
@@ -823,9 +790,7 @@ _cpp_copy_replacement_text (macro, dest)
the context stack. NODE is either object-like, or a function-like
macro with no arguments. */
static void
-replace_args_and_push (pfile, fmacro)
- cpp_reader *pfile;
- struct fun_macro *fmacro;
+replace_args_and_push (cpp_reader *pfile, struct fun_macro *fmacro)
{
cpp_macro *macro = fmacro->node->value.macro;
@@ -889,9 +854,7 @@ replace_args_and_push (pfile, fmacro)
duplicate parameter). On success, CUR (pfile->context) is just
past the closing parenthesis. */
static bool
-scan_parameters (pfile, macro)
- cpp_reader *pfile;
- cpp_macro *macro;
+scan_parameters (cpp_reader *pfile, cpp_macro *macro)
{
const uchar *cur = CUR (pfile->context) + 1;
bool ok;
@@ -930,10 +893,8 @@ scan_parameters (pfile, macro)
ARG_INDEX, with zero indicating the end of the replacement
text. */
static void
-save_replacement_text (pfile, macro, arg_index)
- cpp_reader *pfile;
- cpp_macro *macro;
- unsigned int arg_index;
+save_replacement_text (cpp_reader *pfile, cpp_macro *macro,
+ unsigned int arg_index)
{
size_t len = pfile->out.cur - pfile->out.base;
uchar *exp;
@@ -981,9 +942,7 @@ save_replacement_text (pfile, macro, arg_index)
/* Analyze and save the replacement text of a macro. Returns true on
success. */
bool
-_cpp_create_trad_definition (pfile, macro)
- cpp_reader *pfile;
- cpp_macro *macro;
+_cpp_create_trad_definition (cpp_reader *pfile, cpp_macro *macro)
{
const uchar *cur;
uchar *limit;
@@ -1040,11 +999,7 @@ _cpp_create_trad_definition (pfile, macro)
quote currently in effect is pointed to by PQUOTE, and is updated
by the function. Returns the number of bytes copied. */
static size_t
-canonicalize_text (dest, src, len, pquote)
- uchar *dest;
- const uchar *src;
- size_t len;
- uchar *pquote;
+canonicalize_text (uchar *dest, const uchar *src, size_t len, uchar *pquote)
{
uchar *orig_dest = dest;
uchar quote = *pquote;
@@ -1078,8 +1033,8 @@ canonicalize_text (dest, src, len, pquote)
/* Returns true if MACRO1 and MACRO2 have expansions different other
than in the form of their whitespace. */
bool
-_cpp_expansions_different_trad (macro1, macro2)
- const cpp_macro *macro1, *macro2;
+_cpp_expansions_different_trad (const cpp_macro *macro1,
+ const cpp_macro *macro2)
{
uchar *p1 = xmalloc (macro1->count + macro2->count);
uchar *p2 = p1 + macro1->count;
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index baf473b9006..71557486a4d 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -93,6 +93,17 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "xcoffout.h"
#endif
+extern int flag_debug_only_used_symbols;
+
+#undef DBXOUT_DECR_NESTING
+#define DBXOUT_DECR_NESTING \
+ if (--debug_nesting == 0 && symbol_queue_index > 0) \
+ debug_flush_symbol_queue ()
+
+#undef DBXOUT_DECR_NESTING_AND_RETURN
+#define DBXOUT_DECR_NESTING_AND_RETURN(x) \
+ do {--debug_nesting; return (x);} while (0)
+
#ifndef ASM_STABS_OP
#define ASM_STABS_OP "\t.stabs\t"
#endif
@@ -193,6 +204,10 @@ static GTY(()) int next_file_number;
static GTY(()) int scope_labelno;
+/* A counter for dbxout_source_line. */
+
+static GTY(()) int dbxout_source_line_counter;
+
/* Nonzero if we have actually used any of the GDB extensions
to the debugging format. The idea is that we use them for the
first time only if there's a strong reason, but once we have done that,
@@ -501,9 +516,6 @@ dbxout_init (input_file_name)
#ifdef DBX_OUTPUT_STANDARD_TYPES
DBX_OUTPUT_STANDARD_TYPES (syms);
-#else
- dbxout_symbol (TYPE_NAME (integer_type_node), 0);
- dbxout_symbol (TYPE_NAME (char_type_node), 0);
#endif
/* Get all permanent types that have typedef names,
@@ -583,7 +595,7 @@ dbxout_handle_pch (unsigned at_end)
}
else
{
- /* ... and an EINCL. */
+ /* ... and an EINCL. */
dbxout_end_source_file (0);
/* Deal with cases where 'lastfile' was never actually changed. */
@@ -638,7 +650,8 @@ dbxout_source_line (lineno, filename)
dbxout_source_file (asmfile, filename);
#ifdef ASM_OUTPUT_SOURCE_LINE
- ASM_OUTPUT_SOURCE_LINE (asmfile, lineno);
+ dbxout_source_line_counter += 1;
+ ASM_OUTPUT_SOURCE_LINE (asmfile, lineno, dbxout_source_line_counter);
#else
fprintf (asmfile, "%s%d,0,%d\n", ASM_STABD_OP, N_SLINE, lineno);
#endif
@@ -700,7 +713,12 @@ dbxout_global_decl (decl)
if (TREE_CODE (decl) == VAR_DECL
&& ! DECL_EXTERNAL (decl)
&& DECL_RTL_SET_P (decl)) /* Not necessary? */
- dbxout_symbol (decl, 0);
+ {
+ int saved_tree_used = TREE_USED (decl);
+ TREE_USED (decl) = 1;
+ dbxout_symbol (decl, 0);
+ TREE_USED (decl) = saved_tree_used;
+ }
}
/* At the end of compilation, finish writing the symbol table.
@@ -714,6 +732,8 @@ dbxout_finish (filename)
#ifdef DBX_OUTPUT_MAIN_SOURCE_FILE_END
DBX_OUTPUT_MAIN_SOURCE_FILE_END (asmfile, filename);
#endif /* DBX_OUTPUT_MAIN_SOURCE_FILE_END */
+
+ debug_free_queue ();
}
/* Output floating point type values used by the 'R' stab letter.
@@ -1120,6 +1140,7 @@ dbxout_range_type (type)
}
}
+
/* Output a reference to a type. If the type has not yet been
described in the dbx output, output its definition now.
For a type already defined, just refer to its definition
@@ -1195,6 +1216,21 @@ dbxout_type (type, full)
#endif
}
+ if (flag_debug_only_used_symbols)
+ {
+ if ((TREE_CODE (type) == RECORD_TYPE
+ || TREE_CODE (type) == UNION_TYPE
+ || TREE_CODE (type) == QUAL_UNION_TYPE
+ || TREE_CODE (type) == ENUMERAL_TYPE)
+ && TYPE_STUB_DECL (type)
+ && TREE_CODE_CLASS (TREE_CODE (TYPE_STUB_DECL (type))) == 'd'
+ && ! DECL_IGNORED_P (TYPE_STUB_DECL (type)))
+ debug_queue_symbol (TYPE_STUB_DECL (type));
+ else if (TYPE_NAME (type)
+ && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
+ debug_queue_symbol (TYPE_NAME (type));
+ }
+
/* Output the number of this type, to refer to it. */
dbxout_type_index (type);
@@ -1278,6 +1314,18 @@ dbxout_type (type, full)
}
else if (main_variant != TYPE_MAIN_VARIANT (type))
{
+ if (flag_debug_only_used_symbols)
+ {
+ tree orig_type = DECL_ORIGINAL_TYPE (TYPE_NAME (type));
+
+ if ((TREE_CODE (orig_type) == RECORD_TYPE
+ || TREE_CODE (orig_type) == UNION_TYPE
+ || TREE_CODE (orig_type) == QUAL_UNION_TYPE
+ || TREE_CODE (orig_type) == ENUMERAL_TYPE)
+ && TYPE_STUB_DECL (orig_type)
+ && ! DECL_IGNORED_P (TYPE_STUB_DECL (orig_type)))
+ debug_queue_symbol (TYPE_STUB_DECL (orig_type));
+ }
/* 'type' is a typedef; output the type it refers to. */
dbxout_type (DECL_ORIGINAL_TYPE (TYPE_NAME (type)), 0);
return;
@@ -1987,6 +2035,9 @@ dbxout_symbol (decl, local)
tree context = NULL_TREE;
int result = 0;
+ /* "Intercept" dbxout_symbol() calls like we do all debug_hooks. */
+ ++debug_nesting;
+
/* Cast avoids warning in old compilers. */
current_sym_code = (STAB_CODE_TYPE) 0;
current_sym_value = 0;
@@ -1996,7 +2047,62 @@ dbxout_symbol (decl, local)
if ((DECL_NAME (decl) == 0 && TREE_CODE (decl) != TYPE_DECL)
|| DECL_IGNORED_P (decl))
- return 0;
+ DBXOUT_DECR_NESTING_AND_RETURN (0);
+
+ /* If we are to generate only the symbols actualy used then such
+ symbol nodees are flagged with TREE_USED. Ignore any that
+ aren't flaged as TREE_USED. */
+
+ if (flag_debug_only_used_symbols)
+ {
+ tree t;
+
+ if (!TREE_USED (decl)
+ && (TREE_CODE (decl) != VAR_DECL || !DECL_INITIAL (decl)))
+ DBXOUT_DECR_NESTING_AND_RETURN (0);
+
+ /* We now have a used symbol. We need to generate the info for
+ the symbol's type in addition to the symbol itself. These
+ type symbols are queued to be generated after were done with
+ the symbol itself (done because the symbol's info is generated
+ with fprintf's, etc. as it determines what's needed).
+
+ Note, because the TREE_TYPE(type) might be something like a
+ pointer to a named type we need to look for the first name
+ we see following the TREE_TYPE chain. */
+
+ t = type;
+ while (POINTER_TYPE_P (t))
+ t = TREE_TYPE (t);
+
+ /* RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE, and ENUMERAL_TYPE
+ need special treatment. The TYPE_STUB_DECL field in these
+ types generally represents the tag name type we want to
+ output. In addition there could be a typedef type with
+ a different name. In that case we also want to output
+ that. */
+
+ if ((TREE_CODE (t) == RECORD_TYPE
+ || TREE_CODE (t) == UNION_TYPE
+ || TREE_CODE (t) == QUAL_UNION_TYPE
+ || TREE_CODE (t) == ENUMERAL_TYPE)
+ && TYPE_STUB_DECL (t)
+ && TYPE_STUB_DECL (t) != decl
+ && TREE_CODE_CLASS (TREE_CODE (TYPE_STUB_DECL (t))) == 'd'
+ && ! DECL_IGNORED_P (TYPE_STUB_DECL (t)))
+ {
+ debug_queue_symbol (TYPE_STUB_DECL (t));
+ if (TYPE_NAME (t)
+ && TYPE_NAME (t) != TYPE_STUB_DECL (t)
+ && TYPE_NAME (t) != decl
+ && TREE_CODE_CLASS (TREE_CODE (TYPE_NAME (t))) == 'd')
+ debug_queue_symbol (TYPE_NAME (t));
+ }
+ else if (TYPE_NAME (t)
+ && TYPE_NAME (t) != decl
+ && TREE_CODE_CLASS (TREE_CODE (TYPE_NAME (t))) == 'd')
+ debug_queue_symbol (TYPE_NAME (t));
+ }
dbxout_prepare_symbol (decl);
@@ -2014,7 +2120,7 @@ dbxout_symbol (decl, local)
case FUNCTION_DECL:
if (DECL_RTL (decl) == 0)
- return 0;
+ DBXOUT_DECR_NESTING_AND_RETURN (0);
if (DECL_EXTERNAL (decl))
break;
/* Don't mention a nested function under its parent. */
@@ -2051,22 +2157,10 @@ dbxout_symbol (decl, local)
break;
case TYPE_DECL:
-#if 0
- /* This seems all wrong. Outputting most kinds of types gives no name
- at all. A true definition gives no name; a cross-ref for a
- structure can give the tag name, but not a type name.
- It seems that no typedef name is defined by outputting a type. */
-
- /* If this typedef name was defined by outputting the type,
- don't duplicate it. */
- if (typevec[TYPE_SYMTAB_ADDRESS (type)].status == TYPE_DEFINED
- && TYPE_NAME (TREE_TYPE (decl)) == decl)
- return 0;
-#endif
/* Don't output the same typedef twice.
And don't output what language-specific stuff doesn't want output. */
if (TREE_ASM_WRITTEN (decl) || TYPE_DECL_SUPPRESS_DEBUG (decl))
- return 0;
+ DBXOUT_DECR_NESTING_AND_RETURN (0);
FORCE_TEXT;
result = 1;
@@ -2092,6 +2186,8 @@ dbxout_symbol (decl, local)
/* Distinguish the implicit typedefs of C++
from explicit ones that might be found in C. */
&& DECL_ARTIFICIAL (decl)
+ /* Do not generate a tag for incomplete records. */
+ && COMPLETE_TYPE_P (type)
/* Do not generate a tag for records of variable size,
since this type can not be properly described in the
DBX format, and it confuses some tools such as objdump. */
@@ -2213,7 +2309,7 @@ dbxout_symbol (decl, local)
/* Named return value, treat like a VAR_DECL. */
case VAR_DECL:
if (! DECL_RTL_SET_P (decl))
- return 0;
+ DBXOUT_DECR_NESTING_AND_RETURN (0);
/* Don't mention a variable that is external.
Let the file that defines it describe it. */
if (DECL_EXTERNAL (decl))
@@ -2240,6 +2336,7 @@ dbxout_symbol (decl, local)
fprintf (asmfile, "%s\"%s:c=i" HOST_WIDE_INT_PRINT_DEC
"\",0x%x,0,0,0\n",
ASM_STABS_OP, name, ival, N_LSYM);
+ DBXOUT_DECR_NESTING;
return 1;
}
else if (TREE_CODE (TREE_TYPE (decl)) == REAL_TYPE)
@@ -2263,6 +2360,7 @@ dbxout_symbol (decl, local)
default:
break;
}
+ DBXOUT_DECR_NESTING;
return result;
}
@@ -2599,6 +2697,8 @@ void
dbxout_parms (parms)
tree parms;
{
+ ++debug_nesting;
+
for (; parms; parms = TREE_CHAIN (parms))
if (DECL_NAME (parms) && TREE_TYPE (parms) != error_mark_node)
{
@@ -2856,6 +2956,7 @@ dbxout_parms (parms)
dbxout_finish_symbol (parms);
}
}
+ DBXOUT_DECR_NESTING;
}
/* Output definitions for the places where parms live during the function,
@@ -2873,6 +2974,8 @@ void
dbxout_reg_parms (parms)
tree parms;
{
+ ++debug_nesting;
+
for (; parms; parms = TREE_CHAIN (parms))
if (DECL_NAME (parms) && PARM_PASSED_IN_MEMORY (parms))
{
@@ -2893,6 +2996,7 @@ dbxout_reg_parms (parms)
dbxout_symbol_location (parms, TREE_TYPE (parms),
0, DECL_RTL (parms));
}
+ DBXOUT_DECR_NESTING;
}
/* Given a chain of ..._TYPE nodes (as come in a parameter list),
@@ -3030,7 +3134,19 @@ static void
dbxout_begin_function (decl)
tree decl;
{
- dbxout_symbol (decl, 0);
+ int saved_tree_used1 = TREE_USED (decl);
+ TREE_USED (decl) = 1;
+ if (DECL_NAME (DECL_RESULT (decl)) != 0)
+ {
+ int saved_tree_used2 = TREE_USED (DECL_RESULT (decl));
+ TREE_USED (DECL_RESULT (decl)) = 1;
+ dbxout_symbol (decl, 0);
+ TREE_USED (DECL_RESULT (decl)) = saved_tree_used2;
+ }
+ else
+ dbxout_symbol (decl, 0);
+ TREE_USED (decl) = saved_tree_used1;
+
dbxout_parms (DECL_ARGUMENTS (decl));
if (DECL_NAME (DECL_RESULT (decl)) != 0)
dbxout_symbol (DECL_RESULT (decl), 1);
diff --git a/gcc/debug.h b/gcc/debug.h
index 2793e302115..c1c0842069d 100644
--- a/gcc/debug.h
+++ b/gcc/debug.h
@@ -146,4 +146,10 @@ extern void dwarf2out_frame_finish PARAMS ((void));
translation unit. */
extern int dwarf2out_do_frame PARAMS ((void));
+extern void debug_flush_symbol_queue PARAMS ((void));
+extern void debug_queue_symbol PARAMS ((tree));
+extern void debug_free_queue PARAMS ((void));
+extern int debug_nesting;
+extern int symbol_queue_index;
+
#endif /* !GCC_DEBUG_H */
diff --git a/gcc/defaults.h b/gcc/defaults.h
index b34fab8f8b8..eb3e78cae13 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -613,12 +613,18 @@ You Lose! You must define PREFERRED_DEBUGGING_TYPE!
CONST_DOUBLE_OK_FOR_LETTER_P (OP, C)
#endif
+#ifndef REG_CLASS_FROM_CONSTRAINT
#define REG_CLASS_FROM_CONSTRAINT(C,STR) REG_CLASS_FROM_LETTER (C)
+#endif
#if defined (EXTRA_CONSTRAINT) && ! defined (EXTRA_CONSTRAINT_STR)
#define EXTRA_CONSTRAINT_STR(OP, C,STR) EXTRA_CONSTRAINT (OP, C)
#endif
+#ifndef REGISTER_MOVE_COST
+#define REGISTER_MOVE_COST(m, x, y) 2
+#endif
+
/* Determine whether the the entire c99 runtime
is present in the runtime library. */
#ifndef TARGET_C99_FUNCTIONS
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 674f5e3c2cd..8736a606478 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -85,7 +85,6 @@ static void diagnostic_action_after_output (diagnostic_context *,
static void real_abort (void) ATTRIBUTE_NORETURN;
extern int rtl_dump_and_exit;
-extern int warnings_are_errors;
/* A diagnostic_context surrogate for stderr. */
static diagnostic_context global_diagnostic_context;
@@ -336,6 +335,18 @@ output_long_hexadecimal (output_buffer *buffer, long unsigned int i)
}
static inline void
+output_long_long_decimal (output_buffer *buffer, long long int i)
+{
+ output_formatted_scalar (buffer, "%lld", i);
+}
+
+void
+output_host_wide_integer (output_buffer *buffer, HOST_WIDE_INT i)
+{
+ output_formatted_scalar (buffer, HOST_WIDE_INT_PRINT_DEC, i);
+}
+
+static inline void
output_pointer (output_buffer *buffer, void *p)
{
output_formatted_scalar (buffer, HOST_PTR_PRINTF, p);
@@ -458,6 +469,8 @@ output_buffer_to_stream (output_buffer *buffer)
%o: unsigned integer in base eight.
%x: unsigned integer in base sixteen.
%ld, %li, %lo, %lu, %lx: long versions of the above.
+ %ll: long long int.
+ %w: and integer of type HOST_WIDE_INT.
%c: character.
%s: string.
%p: pointer.
@@ -543,6 +556,15 @@ output_format (output_buffer *buffer, text_info *text)
(buffer, va_arg (*text->args_ptr, unsigned int));
break;
+ case 'l':
+ if (long_integer)
+ output_long_long_decimal
+ (buffer, va_arg (*text->args_ptr, long long));
+ else
+ /* Sould not happen. */
+ abort();
+ break;
+
case 'm':
output_add_string (buffer, xstrerror (text->err_no));
break;
@@ -576,6 +598,11 @@ output_format (output_buffer *buffer, text_info *text)
}
break;
+ case 'w':
+ output_host_wide_integer
+ (buffer, va_arg (*text->args_ptr, HOST_WIDE_INT));
+ break;
+
default:
if (!buffer->format_decoder
|| !(*buffer->format_decoder) (buffer, text))
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h
index 1b6c1721035..80d6a44d68d 100644
--- a/gcc/diagnostic.h
+++ b/gcc/diagnostic.h
@@ -315,6 +315,7 @@ extern int output_space_left (const output_buffer *);
extern void output_append (output_buffer *, const char *, const char *);
extern void output_add_character (output_buffer *, int);
extern void output_decimal (output_buffer *, int);
+extern void output_host_wide_integer (output_buffer *, HOST_WIDE_INT);
extern void output_add_string (output_buffer *, const char *);
extern void output_add_identifier (output_buffer *, tree);
extern const char *output_finalize_message (output_buffer *);
diff --git a/gcc/doc/contrib.texi b/gcc/doc/contrib.texi
index 567cf258ea8..1b18d8ed3ef 100644
--- a/gcc/doc/contrib.texi
+++ b/gcc/doc/contrib.texi
@@ -48,7 +48,7 @@ Scott Bambrough for help porting the Java compiler.
Wolfgang Bangerth for processing tons of bug reports.
@item
-Jon Beniston for his Win32 port of Java.
+Jon Beniston for his Windows port of Java.
@item
Daniel Berlin for better DWARF2 support, faster/better optimizations,
@@ -125,7 +125,7 @@ previous contributions to the steering committee, loop optimizations, etc.
Stephane Carrez for 68HC11 and 68HC12 ports.
@item
-Steve Chamberlain for support for the Hitachi SH and H8 processors
+Steve Chamberlain for support for the Renesas SH and H8 processors
and the PicoJava processor, and for GCJ config fixes.
@item
@@ -203,8 +203,9 @@ Richard Earnshaw for his ongoing work with the ARM@.
@item
David Edelsohn for his direction via the steering committee, ongoing work
-with the RS6000/PowerPC port, help cleaning up Haifa loop changes, and
-for doing the entire AIX port of libstdc++ with his bare hands.
+with the RS6000/PowerPC port, help cleaning up Haifa loop changes,
+doing the entire AIX port of libstdc++ with his bare hands, and for
+ensuring GCC properly keeps working on AIX.
@item
Kevin Ediger for the floating point formatting of num_put::do_put in
@@ -253,8 +254,9 @@ Ivan Fontes Garcia for the Portugese translation of the GCJ FAQ.
Peter Gerwinski for various bug fixes and the Pascal front end.
@item
-Kaveh Ghazi for his direction via the steering committee and
-amazing work to make @samp{-W -Wall} useful.
+Kaveh Ghazi for his direction via the steering committee,
+amazing work to make @samp{-W -Wall} useful, and continously testing
+GCC on a plethora of platforms.
@item
John Gilmore for a donation to the FSF earmarked improving GNU Java.
@@ -316,7 +318,7 @@ Nobuyuki Hikichi of Software Research Associates, Tokyo, contributed
the support for the Sony NEWS machine.
@item
-Kazu Hirata for caring and feeding the Hitachi H8/300 port and various fixes.
+Kazu Hirata for caring and feeding the Renesas H8/300 port and various fixes.
@item
Manfred Hollstein for his ongoing work to keep the m88k alive, lots
@@ -338,7 +340,7 @@ Kamil Iskra for general m68k hacking.
Lee Iverson for random fixes and MIPS testing.
@item
-Andreas Jaeger for various fixes to the MIPS port
+Andreas Jaeger for testing and benchmarking of GCC and various bug fixes.
@item
Jakub Jelinek for his SPARC work and sibling call optimizations as well
@@ -492,7 +494,7 @@ for Java test code.
Bryce McKinlay for numerous GCJ and libgcj fixes and improvements.
@item
-Adam Megacz for his work on the Win32 port of GCJ.
+Adam Megacz for his work on the Windows port of GCJ.
@item
Michael Meissner for LRS framework, ia32, m32r, v850, m88k, MIPS,
@@ -646,7 +648,8 @@ hacking.
@item
Loren J. Rittle for improvements to libstdc++-v3 including the FreeBSD
port, threading fixes, thread-related configury changes, critical
-threading documentation, and solutions to really tricky I/O problems.
+threading documentation, and solutions to really tricky I/O problems,
+as well as keeping GCC properly working on FreeBSD and continuous testing.
@item
Craig Rodrigues for processing tons of bug reports.
@@ -886,9 +889,9 @@ Gilles Zunino for help porting Java to Irix.
@end itemize
-
-We'd also like to thank the folks who have contributed time and energy in
-testing GCC:
+In addition to the above, all of which also contributed time and energy in
+testing GCC, we would like to thank the following for their contributions
+to testing:
@itemize @bullet
@item
@@ -925,12 +928,6 @@ Frank Braun
Rodney Brown
@item
-Joe Buck
-
-@item
-Craig Burley
-
-@item
Sidney Cadot
@item
@@ -940,12 +937,6 @@ Bradford Castalia
Ralph Doncaster
@item
-Ulrich Drepper
-
-@item
-David Edelsohn
-
-@item
Richard Emberson
@item
@@ -970,9 +961,6 @@ Charles-Antoine Gauthier
Yung Shing Gene
@item
-Kaveh Ghazi
-
-@item
David Gilbert
@item
@@ -997,21 +985,9 @@ Amancio Hasty
Bryan W. Headley
@item
-Kate Hedstrom
-
-@item
-Richard Henderson
-
-@item
Kevin B. Hendricks
@item
-Manfred Hollstein
-
-@item
-Kamil Iskra
-
-@item
Joep Jansen
@item
@@ -1027,30 +1003,15 @@ Tobias Kuipers
Anand Krishnaswamy
@item
-Jeff Law
-
-@item
-Robert Lipe
-
-@item
llewelly
@item
Damon Love
@item
-Dave Love
-
-@item
-H.J. Lu
-
-@item
Brad Lucier
@item
-Mumit Khan
-
-@item
Matthias Klose
@item
@@ -1060,12 +1021,6 @@ Martin Knoblauch
Jesse Macnish
@item
-David Miller
-
-@item
-Toon Moene
-
-@item
Stefan Morrell
@item
@@ -1078,9 +1033,6 @@ Matthias Mueller
Pekka Nikander
@item
-Alexandre Oliva
-
-@item
Jon Olson
@item
@@ -1102,9 +1054,6 @@ Paul Reilly
Tom Reilly
@item
-Loren J. Rittle
-
-@item
Torsten Rueger
@item
@@ -1114,24 +1063,15 @@ Danny Sadinoff
Marc Schifer
@item
-Peter Schmid
-
-@item
David Schuler
@item
Vin Shelton
@item
-Franz Sirl
-
-@item
Tim Souder
@item
-Mike Stump
-
-@item
Adam Sulmicki
@item
@@ -1141,9 +1081,6 @@ George Talbot
Gregory Warnes
@item
-Carlo Wood
-
-@item
David E. Young
@item
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 0da4407b2dc..e7e87126525 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -5164,6 +5164,7 @@ instructions, but allow the compiler to schedule those calls.
@menu
* Alpha Built-in Functions::
+* ARM Built-in Functions::
* X86 Built-in Functions::
* PowerPC AltiVec Built-in Functions::
@end menu
@@ -5250,6 +5251,164 @@ void *__builtin_thread_pointer (void)
void __builtin_set_thread_pointer (void *)
@end example
+@node ARM Built-in Functions
+@subsection ARM Built-in Functions
+
+These built-in functions are available for the ARM family of
+processors, when the @option{-mcpu=iwmmxt} switch is used:
+
+@example
+typedef int __v2si __attribute__ ((__mode__ (__V2SI__)))
+
+v2si __builtin_arm_waddw (v2si, v2si)
+v2si __builtin_arm_waddw (v2si, v2si)
+v2si __builtin_arm_wsubw (v2si, v2si)
+v2si __builtin_arm_wsubw (v2si, v2si)
+v2si __builtin_arm_waddwss (v2si, v2si)
+v2si __builtin_arm_wsubwss (v2si, v2si)
+v2si __builtin_arm_wsubwss (v2si, v2si)
+v2si __builtin_arm_wsubwss (v2si, v2si)
+v2si __builtin_arm_wsubwss (v2si, v2si)
+v2si __builtin_arm_waddwus (v2si, v2si)
+v2si __builtin_arm_wsubwus (v2si, v2si)
+v2si __builtin_arm_wsubwus (v2si, v2si)
+v2si __builtin_arm_wmaxuw (v2si, v2si)
+v2si __builtin_arm_wmaxsw (v2si, v2si)
+v2si __builtin_arm_wavg2br (v2si, v2si)
+v2si __builtin_arm_wavg2hr (v2si, v2si)
+v2si __builtin_arm_wavg2b (v2si, v2si)
+v2si __builtin_arm_wavg2h (v2si, v2si)
+v2si __builtin_arm_waccb (v2si)
+v2si __builtin_arm_wacch (v2si)
+v2si __builtin_arm_waccw (v2si)
+v2si __builtin_arm_wmacs (v2si, v2si, v2si)
+v2si __builtin_arm_wmacsz (v2si, v2si, v2si)
+v2si __builtin_arm_wmacu (v2si, v2si, v2si)
+v2si __builtin_arm_wmacuz (v2si, v2si)
+v2si __builtin_arm_wsadb (v2si, v2si)
+v2si __builtin_arm_wsadbz (v2si, v2si)
+v2si __builtin_arm_wsadh (v2si, v2si)
+v2si __builtin_arm_wsadhz (v2si, v2si)
+v2si __builtin_arm_walign (v2si, v2si)
+v2si __builtin_arm_tmia (v2si, int, int)
+v2si __builtin_arm_tmiaph (v2si, int, int)
+v2si __builtin_arm_tmiabb (v2si, int, int)
+v2si __builtin_arm_tmiabt (v2si, int, int)
+v2si __builtin_arm_tmiatb (v2si, int, int)
+v2si __builtin_arm_tmiatt (v2si, int, int)
+int __builtin_arm_tmovmskb (v2si)
+int __builtin_arm_tmovmskh (v2si)
+int __builtin_arm_tmovmskw (v2si)
+v2si __builtin_arm_wmadds (v2si, v2si)
+v2si __builtin_arm_wmaddu (v2si, v2si)
+v2si __builtin_arm_wpackhss (v2si, v2si)
+v2si __builtin_arm_wpackwss (v2si, v2si)
+v2si __builtin_arm_wpackdss (v2si, v2si)
+v2si __builtin_arm_wpackhus (v2si, v2si)
+v2si __builtin_arm_wpackwus (v2si, v2si)
+v2si __builtin_arm_wpackdus (v2si, v2si)
+v2si __builtin_arm_waddb (v2si, v2si)
+v2si __builtin_arm_waddh (v2si, v2si)
+v2si __builtin_arm_waddw (v2si, v2si)
+v2si __builtin_arm_waddbss (v2si, v2si)
+v2si __builtin_arm_waddhss (v2si, v2si)
+v2si __builtin_arm_waddwss (v2si, v2si)
+v2si __builtin_arm_waddbus (v2si, v2si)
+v2si __builtin_arm_waddhus (v2si, v2si)
+v2si __builtin_arm_waddwus (v2si, v2si)
+v2si __builtin_arm_wsubb (v2si, v2si)
+v2si __builtin_arm_wsubh (v2si, v2si)
+v2si __builtin_arm_wsubw (v2si, v2si)
+v2si __builtin_arm_wsubbss (v2si, v2si)
+v2si __builtin_arm_wsubhss (v2si, v2si)
+v2si __builtin_arm_wsubwss (v2si, v2si)
+v2si __builtin_arm_wsubbus (v2si, v2si)
+v2si __builtin_arm_wsubhus (v2si, v2si)
+v2si __builtin_arm_wsubwus (v2si, v2si)
+v2si __builtin_arm_wand (v2si, v2si)
+v2si __builtin_arm_wandn (v2si, v2si)
+v2si __builtin_arm_wor (v2si, v2si)
+v2si __builtin_arm_wxor (v2si, v2si)
+v2si __builtin_arm_wcmpeqb (v2si, v2si)
+v2si __builtin_arm_wcmpeqh (v2si, v2si)
+v2si __builtin_arm_wcmpeqw (v2si, v2si)
+v2si __builtin_arm_wcmpgtub (v2si, v2si)
+v2si __builtin_arm_wcmpgtuh (v2si, v2si)
+v2si __builtin_arm_wcmpgtuw (v2si, v2si)
+v2si __builtin_arm_wcmpgtsb (v2si, v2si)
+v2si __builtin_arm_wcmpgtsh (v2si, v2si)
+v2si __builtin_arm_wcmpgtsw (v2si, v2si)
+int __builtin_arm_textrmsb (v2si, int)
+int __builtin_arm_textrmsh (v2si, int)
+int __builtin_arm_textrmsw (v2si, int)
+int __builtin_arm_textrmub (v2si, int)
+int __builtin_arm_textrmuh (v2si, int)
+int __builtin_arm_textrmuw (v2si, int)
+v2si __builtin_arm_tinsrb (v2si, int, int)
+v2si __builtin_arm_tinsrh (v2si, int, int)
+v2si __builtin_arm_tinsrw (v2si, int, int)
+v2si __builtin_arm_wmaxsw (v2si, v2si)
+v2si __builtin_arm_wmaxsh (v2si, v2si)
+v2si __builtin_arm_wmaxsb (v2si, v2si)
+v2si __builtin_arm_wmaxuw (v2si, v2si)
+v2si __builtin_arm_wmaxuh (v2si, v2si)
+v2si __builtin_arm_wmaxub (v2si, v2si)
+v2si __builtin_arm_wminsw (v2si, v2si)
+v2si __builtin_arm_wminsh (v2si, v2si)
+v2si __builtin_arm_wminsb (v2si, v2si)
+v2si __builtin_arm_wminuw (v2si, v2si)
+v2si __builtin_arm_wminuh (v2si, v2si)
+v2si __builtin_arm_wminub (v2si, v2si)
+v2si __builtin_arm_wmuluh (v2si, v2si)
+v2si __builtin_arm_wmulsh (v2si, v2si)
+v2si __builtin_arm_wmulul (v2si, v2si)
+v2si __builtin_arm_wshufh (v2si, int)
+v2si __builtin_arm_wsllh (v2si, v2si)
+v2si __builtin_arm_wsllw (v2si, v2si)
+v2si __builtin_arm_wslld (v2si, v2si)
+v2si __builtin_arm_wsrah (v2si, v2si)
+v2si __builtin_arm_wsraw (v2si, v2si)
+v2si __builtin_arm_wsrad (v2si, v2si)
+v2si __builtin_arm_wsrlh (v2si, v2si)
+v2si __builtin_arm_wsrlw (v2si, v2si)
+v2si __builtin_arm_wsrld (v2si, v2si)
+v2si __builtin_arm_wrorh (v2si, v2si)
+v2si __builtin_arm_wrorw (v2si, v2si)
+v2si __builtin_arm_wrord (v2si, v2si)
+v2si __builtin_arm_wsllhi (v2si, int)
+v2si __builtin_arm_wsllwi (v2si, int)
+v2si __builtin_arm_wslldi (v2si, v2si)
+v2si __builtin_arm_wsrahi (v2si, int)
+v2si __builtin_arm_wsrawi (v2si, int)
+v2si __builtin_arm_wsradi (v2si, v2si)
+v2si __builtin_arm_wsrlwi (v2si, int)
+v2si __builtin_arm_wsrldi (v2si, int)
+v2si __builtin_arm_wrorhi (v2si, int)
+v2si __builtin_arm_wrorwi (v2si, int)
+v2si __builtin_arm_wrordi (v2si, int)
+v2si __builtin_arm_wunpckihb (v2si, v2si)
+v2si __builtin_arm_wunpckihh (v2si, v2si)
+v2si __builtin_arm_wunpckihw (v2si, v2si)
+v2si __builtin_arm_wunpckilb (v2si, v2si)
+v2si __builtin_arm_wunpckilh (v2si, v2si)
+v2si __builtin_arm_wunpckilw (v2si, v2si)
+v2si __builtin_arm_wunpckehsb (v2si)
+v2si __builtin_arm_wunpckehsh (v2si)
+v2si __builtin_arm_wunpckehsw (v2si)
+v2si __builtin_arm_wunpckehub (v2si)
+v2si __builtin_arm_wunpckehuh (v2si)
+v2si __builtin_arm_wunpckehuw (v2si)
+v2si __builtin_arm_wunpckelsb (v2si)
+v2si __builtin_arm_wunpckelsh (v2si)
+v2si __builtin_arm_wunpckelsw (v2si)
+v2si __builtin_arm_wunpckelub (v2si)
+v2si __builtin_arm_wunpckeluh (v2si)
+v2si __builtin_arm_wunpckeluw (v2si)
+v2si __builtin_arm_wsubwss (v2si, v2si)
+v2si __builtin_arm_wsraw (v2si, v2si)
+v2si __builtin_arm_wsrad (v2si, v2si)
+@end example
+
@node X86 Built-in Functions
@subsection X86 Built-in Functions
@@ -5433,6 +5592,31 @@ Generates the @code{movhps} machine instruction as a store to memory.
Generates the @code{movlps} machine instruction as a store to memory.
@end table
+The following built-in functions are available when @option{-mpni} is used.
+All of them generate the machine instruction that is part of the name.
+
+@example
+v2df __builtin_ia32_addsubpd (v2df, v2df)
+v2df __builtin_ia32_addsubps (v2df, v2df)
+v2df __builtin_ia32_haddpd (v2df, v2df)
+v2df __builtin_ia32_haddps (v2df, v2df)
+v2df __builtin_ia32_hsubpd (v2df, v2df)
+v2df __builtin_ia32_hsubps (v2df, v2df)
+v16qi __builtin_ia32_lddqu (char const *)
+void __builtin_ia32_monitor (void *, unsigned int, unsigned int)
+v2df __builtin_ia32_movddup (v2df)
+v4sf __builtin_ia32_movshdup (v4sf)
+v4sf __builtin_ia32_movsldup (v4sf)
+void __builtin_ia32_mwait (unsigned int, unsigned int)
+@end example
+
+The following built-in functions are available when @option{-mpni} is used.
+
+@table @code
+@item v2df __builtin_ia32_loadddup (double const *)
+Generates the @code{movddup} machine instruction as a load from memory.
+@end table
+
The following built-in functions are available when @option{-m3dnow} is used.
All of them generate the machine instruction that is part of the name.
@@ -6953,7 +7137,7 @@ Add @code{__thread} to the list of specifiers in paragraph 3.
New section before @b{[basic.stc.static]}
@quotation
-The keyword @code{__thread} applied to an non-local object gives the
+The keyword @code{__thread} applied to a non-local object gives the
object thread storage duration.
A local variable or class data member declared both @code{static}
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 546a968fd7b..83ebbb1c468 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -745,13 +745,15 @@ whether you use the GNU assembler. On any other system,
@item @samp{m68000-att-sysv}
@item @samp{@var{any}-lynx-lynxos}
@item @samp{mips-@var{any}}
+@item @samp{sparc-sun-solaris2.@var{any}}
+@item @samp{sparc64-@var{any}-solaris2.@var{any}}
@end itemize
-On the systems listed above (except for the HP-PA, for ISC on the
-386, and for @samp{mips-sgi-irix5.*}), if you use the GNU assembler,
+On the systems listed above (except for the HP-PA, the SPARC, for ISC on
+the 386, and for @samp{mips-sgi-irix5.*}), if you use the GNU assembler,
you should also use the GNU linker (and specify @option{--with-gnu-ld}).
-@item --with-as=@var{pathname}
+@item @anchor{with-as}--with-as=@var{pathname}
Specify that the
compiler should use the assembler pointed to by @var{pathname}, rather
than the one found by the standard rules to find an assembler, which
@@ -776,12 +778,11 @@ and want to choose one that is not found by the above rules.
@item @anchor{with-gnu-ld}--with-gnu-ld
Same as @uref{#with-gnu-as,,@option{--with-gnu-as}}
-but for linker.
-
+but for the linker.
@item --with-ld=@var{pathname}
-Same as
-@option{--with-as}, but for the linker.
+Same as @uref{#with-as,,@option{--with-as}}
+but for the linker.
@item --with-stabs
Specify that stabs debugging
@@ -1317,12 +1318,13 @@ Note that if an error occurs in any step the make process will exit.
@section Building in parallel
-If you have a multiprocessor system you can use @samp{make bootstrap
-MAKE="make -j 2" -j 2} or just @samp{make -j 2 bootstrap}
-for GNU Make 3.79 and above instead of just @samp{make bootstrap}
-when building GCC@. You can use a bigger number instead of two if
-you like. In most cases, it won't help to use a number bigger than
-the number of processors in your machine.
+You can use @samp{make bootstrap MAKE="make -j 2" -j 2}, or just
+@samp{make -j 2 bootstrap} for GNU Make 3.79 and above, instead of
+@samp{make bootstrap} to build GCC in parallel.
+You can also specify a bigger number, and in most cases using a value
+greater than the number of processors in your machine will result in
+fewer and shorter I/O latency hits, thus improving overall throughput;
+this is especially true for slow drives and network filesystems.
@section Building the Ada compiler
@@ -1494,6 +1496,9 @@ To get a list of the possible @file{*.exp} files, pipe the
output of @samp{make check} into a file and look at the
@samp{Running @dots{} .exp} lines.
+The Java runtime tests can be executed via @samp{make check}
+in the @file{@var{target}/libjava/testsuite} directory in
+the build tree.
@section Additional testing for Java Class Libraries
@@ -1742,8 +1747,8 @@ AIX:
DOS---@uref{http://www.delorie.com/djgpp/,,DJGPP}.
@item
-Hitachi H8/300[HS]---@uref{http://h8300-hms.sourceforge.net/,,GNU
-Development Tools for the Hitachi H8/300[HS] Series}.
+Renesas H8/300[HS]---@uref{http://h8300-hms.sourceforge.net/,,GNU
+Development Tools for the Renesas H8/300[HS] Series}.
@item
HP-UX:
@@ -2306,7 +2311,7 @@ Shared @file{libgcc_s.so} is now built and installed by default.
<hr />
@end html
@heading @anchor{h8300-hms}h8300-hms
-Hitachi H8/300 series of processors.
+Renesas H8/300 series of processors.
Please have a look at our @uref{binaries.html,,binaries page}.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 990096b16f3..a751d8e419f 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -244,7 +244,7 @@ in the following sections.
-fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
-fdump-tree-inlined@r{[}-@var{n}@r{]} @gol
-feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
--fmem-report -fprofile-arcs @gol
+-feliminate-unused-debug-symbols -fmem-report -fprofile-arcs @gol
-frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
-ftest-coverage -ftime-report @gol
-g -g@var{level} -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2 @gol
@@ -258,7 +258,8 @@ in the following sections.
@xref{Optimize Options,,Options that Control Optimization}.
@gccoptlist{-falign-functions=@var{n} -falign-jumps=@var{n} @gol
-falign-labels=@var{n} -falign-loops=@var{n} @gol
--fbranch-probabilities -fcaller-saves -fcprop-registers @gol
+-fbranch-probabilities -fprofile-values -fbranch-target-load-optimize @gol
+-fbranch-target-load-optimize2 -fcaller-saves -fcprop-registers @gol
-fcse-follow-jumps -fcse-skip-blocks -fdata-sections @gol
-fdelayed-branch -fdelete-null-pointer-checks @gol
-fexpensive-optimizations -ffast-math -ffloat-store @gol
@@ -486,7 +487,7 @@ in the following sections.
-mno-fp-ret-in-387 -msoft-float -msvr3-shlib @gol
-mno-wide-multiply -mrtd -malign-double @gol
-mpreferred-stack-boundary=@var{num} @gol
--mmmx -msse -msse2 -m3dnow @gol
+-mmmx -msse -msse2 -mpni -m3dnow @gol
-mthreads -mno-align-stringops -minline-all-stringops @gol
-mpush-args -maccumulate-outgoing-args -m128bit-long-double @gol
-m96bit-long-double -mregparm=@var{num} -momit-leaf-frame-pointer @gol
@@ -2810,6 +2811,15 @@ code is to provide behavior which is selectable at compile-time.
@item -Winline
@opindex Winline
Warn if a function can not be inlined and it was declared as inline.
+Even with this option, the compiler will not warn about failures to
+inline functions declared in system headers.
+
+The compiler uses a variety of heuristics to determine whether or not
+to inline a function. For example, the compiler takes into account
+the size of the function being inlined and the the amount of inlining
+that has already been done in the current function. Therefore,
+seemingly insignificant changes in the source program can cause the
+warnings produced by @option{-Winline} to appear or disappear.
@item -Wno-invalid-offsetof @r{(C++ only)}
@opindex Wno-invalid-offsetof
@@ -2906,6 +2916,11 @@ systems. On MIPS, Alpha and System V Release 4 systems this option
produces stabs debugging output which is not understood by DBX or SDB@.
On System V Release 4 systems this option requires the GNU assembler.
+@item -feliminate-unused-debug-symbols
+@opindex feliminate-unused-debug-symbols
+Produce debugging information in stabs format (if that is supported),
+for only symbols that are actualy used.
+
@item -gstabs+
@opindex gstabs+
Produce debugging information in stabs format (if that is supported),
@@ -3114,9 +3129,11 @@ Dump after instruction combination, to the file @file{@var{file}.21.combine}.
@item C
@opindex dC
Dump after the first if conversion, to the file @file{@var{file}.16.ce1}.
+Also dump after the second if conversion, to the file @file{@var{file}.22.ce2}.
@item d
@opindex dd
-Dump after delayed branch scheduling, to @file{@var{file}.36.dbr}.
+Dump after branch target load optimization, to to @file{@var{file}.33.btl}.
+Also dump after delayed branch scheduling, to @file{@var{file}.36.dbr}.
@item D
@opindex dD
Dump all macro definitions, at the end of preprocessing, in addition to
@@ -3130,25 +3147,22 @@ Dump after SSA optimizations, to @file{@var{file}.04.ssa} and
Dump after the second if conversion, to @file{@var{file}.32.ce3}.
@item f
@opindex df
-Dump after life analysis, to @file{@var{file}.20.life}.
+Dump after control and data flow analysis, to @file{@var{file}.14.cfg}.
+Also dump after life analysis, to @file{@var{file}.20.life}.
@item F
@opindex dF
Dump after purging @code{ADDRESSOF} codes, to @file{@var{file}.10.addressof}.
@item g
@opindex dg
Dump after global register allocation, to @file{@var{file}.26.greg}.
-@item h
-@opindex dh
-Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
-@item k
-@opindex dk
-Dump after reg-to-stack conversion, to @file{@var{file}.34.stack}.
-@item o
-@opindex do
-Dump after post-reload optimizations, to @file{@var{file}.27.postreload}.
@item G
@opindex dG
Dump after GCSE, to @file{@var{file}.11.gcse}.
+Also dump after jump bypassing and control flow optimizations, to
+@file{@var{file}.13.bypass}.
+@item h
+@opindex dh
+Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
@item i
@opindex di
Dump after sibling call optimizations, to @file{@var{file}.01.sibling}.
@@ -3157,7 +3171,7 @@ Dump after sibling call optimizations, to @file{@var{file}.01.sibling}.
Dump after the first jump optimization, to @file{@var{file}.03.jump}.
@item k
@opindex dk
-Dump after conversion from registers to stack, to @file{@var{file}.34.stack}.
+Dump after conversion from registers to stack, to @file{@var{file}.35.stack}.
@item l
@opindex dl
Dump after local register allocation, to @file{@var{file}.25.lreg}.
@@ -3168,19 +3182,22 @@ Dump after loop optimization passes, to @file{@var{file}.12.loop} and
@item M
@opindex dM
Dump after performing the machine dependent reorganization pass, to
-@file{@var{file}.35.mach}.
+@file{@var{file}.36.mach}.
@item n
@opindex dn
Dump after register renumbering, to @file{@var{file}.30.rnreg}.
@item N
@opindex dN
Dump after the register move pass, to @file{@var{file}.23.regmove}.
+@item o
+@opindex do
+Dump after post-reload optimizations, to @file{@var{file}.27.postreload}.
@item r
@opindex dr
Dump after RTL generation, to @file{@var{file}.00.rtl}.
@item R
@opindex dR
-Dump after the second scheduling pass, to @file{@var{file}.33.sched2}.
+Dump after the second scheduling pass, to @file{@var{file}.34.sched2}.
@item s
@opindex ds
Dump after CSE (including the jump optimization that sometimes follows
@@ -3192,12 +3209,19 @@ Dump after the first scheduling pass, to @file{@var{file}.24.sched}.
@opindex dt
Dump after the second CSE pass (including the jump optimization that
sometimes follows CSE), to @file{@var{file}.19.cse2}.
+@item T
+@opindex dT
+Dump after running tracer, to @file{@var{file}.17.tracer}.
@item u
@opindex du
Dump after null pointer elimination pass to @file{@var{file}.08.null}.
@item w
@opindex dw
Dump after the second flow pass, to @file{@var{file}.28.flow2}.
+@item W
+@opindex dW
+Dump after SSA conditional constant propagation, to
+@file{@var{file}.05.ssaccp}.
@item X
@opindex dX
Dump after SSA dead code elimination, to @file{@var{file}.06.ssadce}.
@@ -4027,7 +4051,7 @@ The default is @option{-fguess-branch-probability} at levels
Reorder basic blocks in the compiled function in order to reduce number of
taken branches and improve code locality.
-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
+Enabled at levels @option{-O2}, @option{-O3}.
@item -freorder-functions
@opindex freorder-functions
@@ -4305,6 +4329,11 @@ used in one place: in @file{reorg.c}, instead of guessing which path a
branch is mostly to take, the @samp{REG_BR_PROB} values are used to
exactly determine which path is taken more often.
+@item -fprofile-values
+@opindex fprofile-values
+If combined with @option{-fprofile-arcs}, it adds code so that some
+data about values of expressions in the program is gathered.
+
@item -fnew-ra
@opindex fnew-ra
Use a graph coloring register allocator. Currently this option is meant
@@ -4420,6 +4449,19 @@ Perform Sparse Conditional Constant Propagation in SSA form. Requires
Perform aggressive dead-code elimination in SSA form. Requires @option{-fssa}.
Like @option{-fssa}, this is an experimental feature.
+@item -fbranch-target-load-optimize
+@opindex fbranch-target-load-optimize
+Perform branch target register load optimization before prologue / epilogue
+threading.
+The use of target registers can typically be exposed only during reload,
+thus hoisting loads out of loops and doing inter-block scheduling needs
+a separate optimization pass.
+
+@item -fbranch-target-load-optimize2
+@opindex fbranch-target-load-optimize2
+Perform branch target register load optimization after prologue / epilogue
+threading.
+
@@ -6338,7 +6380,7 @@ assembly code. Permissible names are: @samp{arm2}, @samp{arm250},
@samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
@samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
@samp{arm920t}, @samp{arm940t}, @samp{arm9tdmi}, @samp{arm10tdmi},
-@samp{arm1020t}, @samp{xscale}, @samp{ep9312}.
+@samp{arm1020t}, @samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
@itemx -mtune=@var{name}
@opindex mtune
@@ -6358,7 +6400,7 @@ name to determine what kind of instructions it can emit when generating
assembly code. This option can be used in conjunction with or instead
of the @option{-mcpu=} option. Permissible names are: @samp{armv2},
@samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
-@samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{ep9312}.
+@samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{iwmmxt}, @samp{ep9312}.
@item -mfpe=@var{number}
@itemx -mfp=@var{number}
@@ -6431,8 +6473,8 @@ Specify the register to be used for PIC addressing. The default is R10
unless stack-checking is enabled, when R9 is used.
@item -mcirrus-fix-invalid-insns
-@opindex -mcirrus-fix-invalid-insns
-@opindex -mno-cirrus-fix-invalid-insns
+@opindex mcirrus-fix-invalid-insns
+@opindex mno-cirrus-fix-invalid-insns
Insert NOPs into the instruction stream to in order to work around
problems with invalid Maverick instruction combinations. This option
is only valid if the @option{-mcpu=ep9312} option has been used to
@@ -8185,6 +8227,13 @@ code that expects temporaries to be 80bit.
This is the default choice for x86-64 compiler.
+@item pni
+Use all SSE extensions enabled by @option{-msse2} as well as the new
+SSE extensions in Prescott New Intrunctions. @option{-mpni} also
+enables 2 builtin functions, @code{__builtin_ia32_monitor} and
+@code{__builtin_ia32_mwait}, for new intrunctions @code{monitor} and
+@code{mwait}.
+
@item sse,387
Attempt to utilize both instruction sets at once. This effectively double the
amount of available registers and on chips with separate execution units for
@@ -8366,6 +8415,8 @@ preferred alignment to @option{-mpreferred-stack-boundary=2}.
@itemx -mno-sse
@item -msse2
@itemx -mno-sse2
+@item -mpni
+@itemx -mno-pni
@item -m3dnow
@itemx -mno-3dnow
@opindex mmmx
@@ -9239,7 +9290,7 @@ Enable the use of the instruction @code{fmovd}.
@item -mhitachi
@opindex mhitachi
-Comply with the calling conventions defined by Hitachi.
+Comply with the calling conventions defined by Renesas.
@item -mnomacsave
@opindex mnomacsave
@@ -9530,16 +9581,16 @@ the assembler/linker complain about out of range branches within a switch
table.
@item -mapp-regs
-@opindex -mapp-regs
+@opindex mapp-regs
This option will cause r2 and r5 to be used in the code generated by
the compiler. This setting is the default.
@item -mno-app-regs
-@opindex -mno-app-regs
+@opindex mno-app-regs
This option will cause r2 and r5 to be treated as fixed registers.
@item -mv850e
-@opindex -mv850e
+@opindex mv850e
Specify that the target processor is the V850E. The preprocessor
constant @samp{__v850e__} will be defined if this option is used.
@@ -9551,7 +9602,7 @@ The preprocessor constants @samp{__v850} and @samp{__v851__} are always
defined, regardless of which processor variant is the target.
@item -mdisable-callt
-@opindex -mdisable-callt
+@opindex mdisable-callt
This option will suppress generation of the CALLT instruction for the
v850e flavors of the v850 architecture. The default is
@option{-mno-disable-callt} which allows the CALLT instruction to be used.
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index 7a6ddd4e5e5..ae371cc85a2 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -2263,7 +2263,7 @@ A memory reference that is a stack push.
A memory reference that is a stack pop.
@item S
-A memory reference that refers to an constant address of known value.
+A memory reference that refers to a constant address of known value.
@item T
The register indicated by Rx (not implemented yet).
@@ -4302,7 +4302,7 @@ instruction is always valid, as compiler expect identical behavior of new
jump. When new sequence contains multiple jump instructions or new labels,
more assistance is needed. Splitter is required to create only unconditional
jumps, or simple conditional jump instructions. Additionally it must attach a
-@code{REG_BR_PROB} note to each conditional jump. An global variable
+@code{REG_BR_PROB} note to each conditional jump. A global variable
@code{split_branch_probability} hold the probability of original branch in case
it was an simple conditional jump, @minus{}1 otherwise. To simplify
recomputing of edge frequencies, new sequence is required to have only
diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
index 0ad91508b34..a0c65557622 100644
--- a/gcc/doc/rtl.texi
+++ b/gcc/doc/rtl.texi
@@ -2769,7 +2769,7 @@ Here is an example of its use:
This says to modify pseudo register 42 by adding the contents of pseudo
register 48 to it, after the use of what ever 42 points to.
-@findex post_modify
+@findex pre_modify
@item (pre_modify:@var{m} @var{x} @var{expr})
Similar except side effects happen before the use.
@end table
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index a079bce266f..3537f1c2158 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -944,9 +944,9 @@ test cases and magic comments more.
@node libgcj Tests
@subsection The Java library test suites.
-Runtime tests are executed via @samp{make check} from the @samp{testsuite}
-directory of the libjava hierarchy in the build tree. Additional runtime
-tests can be checked into this testsuite.
+Runtime tests are executed via @samp{make check} in the
+@file{@var{target}/libjava/testsuite} directory in the build
+tree. Additional runtime tests can be checked into this testsuite.
Regression testing of the core packages in libgcj is also covered by the
Mauve test suite. The @uref{http://sources.redhat.com/mauve/,,Mauve Project}
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index b83781642cb..d5d112ccb28 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -93,9 +93,7 @@ from being defined in the @file{.h} file to being part of the
@c prevent bad page break with this line
You can control the compilation driver.
-@table @code
-@findex SWITCH_TAKES_ARG
-@item SWITCH_TAKES_ARG (@var{char})
+@defmac SWITCH_TAKES_ARG (@var{char})
A C expression which determines whether the option @option{-@var{char}}
takes arguments. The value should be the number of arguments that
option takes--zero, for many options.
@@ -106,9 +104,9 @@ properly. You need not define @code{SWITCH_TAKES_ARG} unless you
wish to add additional options which take arguments. Any redefinition
should call @code{DEFAULT_SWITCH_TAKES_ARG} and then check for
additional options.
+@end defmac
-@findex WORD_SWITCH_TAKES_ARG
-@item WORD_SWITCH_TAKES_ARG (@var{name})
+@defmac WORD_SWITCH_TAKES_ARG (@var{name})
A C expression which determines whether the option @option{-@var{name}}
takes arguments. The value should be the number of arguments that
option takes--zero, for many options. This macro rather than
@@ -120,9 +118,9 @@ properly. You need not define @code{WORD_SWITCH_TAKES_ARG} unless you
wish to add additional options which take arguments. Any redefinition
should call @code{DEFAULT_WORD_SWITCH_TAKES_ARG} and then check for
additional options.
+@end defmac
-@findex SWITCH_CURTAILS_COMPILATION
-@item SWITCH_CURTAILS_COMPILATION (@var{char})
+@defmac SWITCH_CURTAILS_COMPILATION (@var{char})
A C expression which determines whether the option @option{-@var{char}}
stops compilation before the generation of an executable. The value is
boolean, nonzero if the option does stop an executable from being
@@ -135,16 +133,16 @@ options properly. You need not define
options which affect the generation of an executable. Any redefinition
should call @code{DEFAULT_SWITCH_CURTAILS_COMPILATION} and then check
for additional options.
+@end defmac
-@findex SWITCHES_NEED_SPACES
-@item SWITCHES_NEED_SPACES
+@defmac SWITCHES_NEED_SPACES
A string-valued C expression which enumerates the options for which
the linker needs a space between the option and its argument.
If this macro is not defined, the default value is @code{""}.
+@end defmac
-@findex TARGET_OPTION_TRANSLATE_TABLE
-@item TARGET_OPTION_TRANSLATE_TABLE
+@defmac TARGET_OPTION_TRANSLATE_TABLE
If defined, a list of pairs of strings, the first of which is a
potential command line target to the @file{gcc} driver program, and the
second of which is a space-separated (tabs and other whitespace are not
@@ -162,9 +160,9 @@ multilibs. Example nonsensical definition, where @code{-malt-abi},
@{ "-fast", "-march=fast-foo -malt-abi -I/usr/fast-foo" @}, \
@{ "-compat", "-EB -malign=4 -mspoo" @}
@end smallexample
+@end defmac
-@findex DRIVER_SELF_SPECS
-@item DRIVER_SELF_SPECS
+@defmac DRIVER_SELF_SPECS
A list of specs for the driver itself. It should be a suitable
initializer for an array of strings, with no surrounding braces.
@@ -180,9 +178,9 @@ options. It provides a way of standardizing the command line so
that the other specs are easier to write.
Do not define this macro if it does not need to do anything.
+@end defmac
-@findex OPTION_DEFAULT_SPECS
-@item OPTION_DEFAULT_SPECS
+@defmac OPTION_DEFAULT_SPECS
A list of specs used to support configure-time default options (i.e.@:
@option{--with} options) in the driver. It should be a suitable initializer
for an array of structures, each containing two strings, without the
@@ -199,23 +197,23 @@ default @file{specs} files and processing @code{DRIVER_SELF_SPECS}, using
the same mechanism as @code{DRIVER_SELF_SPECS}.
Do not define this macro if it does not need to do anything.
+@end defmac
-@findex CPP_SPEC
-@item CPP_SPEC
+@defmac CPP_SPEC
A C string constant that tells the GCC driver program options to
pass to CPP@. It can also specify how to translate options you
give to GCC into options for GCC to pass to the CPP@.
Do not define this macro if it does not need to do anything.
+@end defmac
-@findex CPLUSPLUS_CPP_SPEC
-@item CPLUSPLUS_CPP_SPEC
+@defmac CPLUSPLUS_CPP_SPEC
This macro is just like @code{CPP_SPEC}, but is used for C++, rather
than C@. If you do not define this macro, then the value of
@code{CPP_SPEC} (if any) will be used instead.
+@end defmac
-@findex CC1_SPEC
-@item CC1_SPEC
+@defmac CC1_SPEC
A C string constant that tells the GCC driver program options to
pass to @code{cc1}, @code{cc1plus}, @code{f771}, and the other language
front ends.
@@ -223,9 +221,9 @@ It can also specify how to translate options you give to GCC into options
for GCC to pass to front ends.
Do not define this macro if it does not need to do anything.
+@end defmac
-@findex CC1PLUS_SPEC
-@item CC1PLUS_SPEC
+@defmac CC1PLUS_SPEC
A C string constant that tells the GCC driver program options to
pass to @code{cc1plus}. It can also specify how to translate options you
give to GCC into options for GCC to pass to the @code{cc1plus}.
@@ -234,27 +232,27 @@ Do not define this macro if it does not need to do anything.
Note that everything defined in CC1_SPEC is already passed to
@code{cc1plus} so there is no need to duplicate the contents of
CC1_SPEC in CC1PLUS_SPEC@.
+@end defmac
-@findex ASM_SPEC
-@item ASM_SPEC
+@defmac ASM_SPEC
A C string constant that tells the GCC driver program options to
pass to the assembler. It can also specify how to translate options
you give to GCC into options for GCC to pass to the assembler.
See the file @file{sun3.h} for an example of this.
Do not define this macro if it does not need to do anything.
+@end defmac
-@findex ASM_FINAL_SPEC
-@item ASM_FINAL_SPEC
+@defmac ASM_FINAL_SPEC
A C string constant that tells the GCC driver program how to
run any programs which cleanup after the normal assembler.
Normally, this is not needed. See the file @file{mips.h} for
an example of this.
Do not define this macro if it does not need to do anything.
+@end defmac
-@findex AS_NEEDS_DASH_FOR_PIPED_INPUT
-@item AS_NEEDS_DASH_FOR_PIPED_INPUT
+@defmac AS_NEEDS_DASH_FOR_PIPED_INPUT
Define this macro, with no value, if the driver should give the assembler
an argument consisting of a single dash, @option{-}, to instruct it to
read from its standard input (which will be a pipe connected to the
@@ -265,26 +263,26 @@ If you do not define this macro, the assembler is assumed to read its
standard input if given no non-option arguments. If your assembler
cannot read standard input at all, use a @samp{%@{pipe:%e@}} construct;
see @file{mips.h} for instance.
+@end defmac
-@findex LINK_SPEC
-@item LINK_SPEC
+@defmac LINK_SPEC
A C string constant that tells the GCC driver program options to
pass to the linker. It can also specify how to translate options you
give to GCC into options for GCC to pass to the linker.
Do not define this macro if it does not need to do anything.
+@end defmac
-@findex LIB_SPEC
-@item LIB_SPEC
+@defmac LIB_SPEC
Another C string constant used much like @code{LINK_SPEC}. The difference
between the two is that @code{LIB_SPEC} is used at the end of the
command given to the linker.
If this macro is not defined, a default is provided that
loads the standard C library from the usual place. See @file{gcc.c}.
+@end defmac
-@findex LIBGCC_SPEC
-@item LIBGCC_SPEC
+@defmac LIBGCC_SPEC
Another C string constant that tells the GCC driver program
how and when to place a reference to @file{libgcc.a} into the
linker command line. This constant is placed both before and after
@@ -292,26 +290,26 @@ the value of @code{LIB_SPEC}.
If this macro is not defined, the GCC driver provides a default that
passes the string @option{-lgcc} to the linker.
+@end defmac
-@findex STARTFILE_SPEC
-@item STARTFILE_SPEC
+@defmac STARTFILE_SPEC
Another C string constant used much like @code{LINK_SPEC}. The
difference between the two is that @code{STARTFILE_SPEC} is used at
the very beginning of the command given to the linker.
If this macro is not defined, a default is provided that loads the
standard C startup file from the usual place. See @file{gcc.c}.
+@end defmac
-@findex ENDFILE_SPEC
-@item ENDFILE_SPEC
+@defmac ENDFILE_SPEC
Another C string constant used much like @code{LINK_SPEC}. The
difference between the two is that @code{ENDFILE_SPEC} is used at
the very end of the command given to the linker.
Do not define this macro if it does not need to do anything.
+@end defmac
-@findex THREAD_MODEL_SPEC
-@item THREAD_MODEL_SPEC
+@defmac THREAD_MODEL_SPEC
GCC @code{-v} will print the thread model GCC was configured to use.
However, this doesn't work on platforms that are multilibbed on thread
models, such as AIX 4.3. On such platforms, define
@@ -319,9 +317,22 @@ models, such as AIX 4.3. On such platforms, define
blanks that names one of the recognized thread models. @code{%*}, the
default value of this macro, will expand to the value of
@code{thread_file} set in @file{config.gcc}.
+@end defmac
-@findex EXTRA_SPECS
-@item EXTRA_SPECS
+@defmac SYSROOT_SUFFIX_SPEC
+Define this macro to add a suffix to the target sysroot when GCC is
+configured with a sysroot. This will cause GCC to search for usr/lib,
+et al, within sysroot+suffix.
+@end defmac
+
+@defmac SYSROOT_HEADERS_SUFFIX_SPEC
+Define this macro to add a headers_suffix to the target sysroot when
+GCC is configured with a sysroot. This will cause GCC to pass the
+updated sysroot+headers_suffix to CPP@, causing it to search for
+usr/include, et al, within sysroot+headers_suffix.
+@end defmac
+
+@defmac EXTRA_SPECS
Define this macro to provide additional specifications to put in the
@file{specs} file that can be used in various specifications like
@code{CC1_SPEC}.
@@ -371,30 +382,30 @@ while the @file{config/rs6000/eabiaix.h} target file defines
#undef CPP_SYSV_DEFAULT
#define CPP_SYSV_DEFAULT "-D_CALL_AIX"
@end smallexample
+@end defmac
-@findex LINK_LIBGCC_SPECIAL
-@item LINK_LIBGCC_SPECIAL
+@defmac LINK_LIBGCC_SPECIAL
Define this macro if the driver program should find the library
@file{libgcc.a} itself and should not pass @option{-L} options to the
linker. If you do not define this macro, the driver program will pass
the argument @option{-lgcc} to tell the linker to do the search and will
pass @option{-L} options to it.
+@end defmac
-@findex LINK_LIBGCC_SPECIAL_1
-@item LINK_LIBGCC_SPECIAL_1
+@defmac LINK_LIBGCC_SPECIAL_1
Define this macro if the driver program should find the library
@file{libgcc.a}. If you do not define this macro, the driver program will pass
the argument @option{-lgcc} to tell the linker to do the search.
This macro is similar to @code{LINK_LIBGCC_SPECIAL}, except that it does
not affect @option{-L} options.
+@end defmac
-@findex LINK_GCC_C_SEQUENCE_SPEC
-@item LINK_GCC_C_SEQUENCE_SPEC
+@defmac LINK_GCC_C_SEQUENCE_SPEC
The sequence in which libgcc and libc are specified to the linker.
By default this is @code{%G %L %G}.
+@end defmac
-@findex LINK_COMMAND_SPEC
-@item LINK_COMMAND_SPEC
+@defmac LINK_COMMAND_SPEC
A C string constant giving the complete command line need to execute the
linker. When you do this, you will need to update your port each time a
change is made to the link command line within @file{gcc.c}. Therefore,
@@ -402,15 +413,15 @@ define this macro only if you need to completely redefine the command
line for invoking the linker and there is no other way to accomplish
the effect you need. Overriding this macro may be avoidable by overriding
@code{LINK_GCC_C_SEQUENCE_SPEC} instead.
+@end defmac
-@findex LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
-@item LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
+@defmac LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
A nonzero value causes @command{collect2} to remove duplicate @option{-L@var{directory}} search
directories from linking commands. Do not give it a nonzero value if
removing duplicate search directories changes the linker's semantics.
+@end defmac
-@findex MULTILIB_DEFAULTS
-@item MULTILIB_DEFAULTS
+@defmac MULTILIB_DEFAULTS
Define this macro as a C expression for the initializer of an array of
string to tell the driver program which options are defaults for this
target and thus do not need to be handled specially when using
@@ -420,55 +431,55 @@ Do not define this macro if @code{MULTILIB_OPTIONS} is not defined in
the target makefile fragment or if none of the options listed in
@code{MULTILIB_OPTIONS} are set by default.
@xref{Target Fragment}.
+@end defmac
-@findex RELATIVE_PREFIX_NOT_LINKDIR
-@item RELATIVE_PREFIX_NOT_LINKDIR
+@defmac RELATIVE_PREFIX_NOT_LINKDIR
Define this macro to tell @command{gcc} that it should only translate
a @option{-B} prefix into a @option{-L} linker option if the prefix
indicates an absolute file name.
+@end defmac
-@findex STANDARD_EXEC_PREFIX
-@item STANDARD_EXEC_PREFIX
+@defmac STANDARD_EXEC_PREFIX
Define this macro as a C string constant if you wish to override the
standard choice of @file{/usr/local/lib/gcc-lib/} as the default prefix to
try when searching for the executable files of the compiler.
+@end defmac
-@findex MD_EXEC_PREFIX
-@item MD_EXEC_PREFIX
+@defmac MD_EXEC_PREFIX
If defined, this macro is an additional prefix to try after
@code{STANDARD_EXEC_PREFIX}. @code{MD_EXEC_PREFIX} is not searched
when the @option{-b} option is used, or the compiler is built as a cross
compiler. If you define @code{MD_EXEC_PREFIX}, then be sure to add it
to the list of directories used to find the assembler in @file{configure.in}.
+@end defmac
-@findex STANDARD_STARTFILE_PREFIX
-@item STANDARD_STARTFILE_PREFIX
+@defmac STANDARD_STARTFILE_PREFIX
Define this macro as a C string constant if you wish to override the
standard choice of @file{/usr/local/lib/} as the default prefix to
try when searching for startup files such as @file{crt0.o}.
+@end defmac
-@findex MD_STARTFILE_PREFIX
-@item MD_STARTFILE_PREFIX
+@defmac MD_STARTFILE_PREFIX
If defined, this macro supplies an additional prefix to try after the
standard prefixes. @code{MD_EXEC_PREFIX} is not searched when the
@option{-b} option is used, or when the compiler is built as a cross
compiler.
+@end defmac
-@findex MD_STARTFILE_PREFIX_1
-@item MD_STARTFILE_PREFIX_1
+@defmac MD_STARTFILE_PREFIX_1
If defined, this macro supplies yet another prefix to try after the
standard prefixes. It is not searched when the @option{-b} option is
used, or when the compiler is built as a cross compiler.
+@end defmac
-@findex INIT_ENVIRONMENT
-@item INIT_ENVIRONMENT
+@defmac INIT_ENVIRONMENT
Define this macro as a C string constant if you wish to set environment
variables for programs called by the driver, such as the assembler and
loader. The driver passes the value of this macro to @code{putenv} to
initialize the necessary environment variables.
+@end defmac
-@findex LOCAL_INCLUDE_DIR
-@item LOCAL_INCLUDE_DIR
+@defmac LOCAL_INCLUDE_DIR
Define this macro as a C string constant if you wish to override the
standard choice of @file{/usr/local/include} as the default prefix to
try when searching for local header files. @code{LOCAL_INCLUDE_DIR}
@@ -476,11 +487,11 @@ comes before @code{SYSTEM_INCLUDE_DIR} in the search order.
Cross compilers do not search either @file{/usr/local/include} or its
replacement.
+@end defmac
-@findex MODIFY_TARGET_NAME
-@item MODIFY_TARGET_NAME
-Define this macro if you with to define command-line switches that modify the
-default target name
+@defmac MODIFY_TARGET_NAME
+Define this macro if you wish to define command-line switches that
+modify the default target name.
For each switch, you can include a string to be appended to the first
part of the configuration name or a string to be deleted from the
@@ -501,10 +512,9 @@ code
@{ @{ "-32", DELETE, "64"@}, \
@{"-64", ADD, "64"@}@}
@end smallexample
+@end defmac
-
-@findex SYSTEM_INCLUDE_DIR
-@item SYSTEM_INCLUDE_DIR
+@defmac SYSTEM_INCLUDE_DIR
Define this macro as a C string constant if you wish to specify a
system-specific directory to search for header files before the standard
directory. @code{SYSTEM_INCLUDE_DIR} comes before
@@ -512,24 +522,24 @@ directory. @code{SYSTEM_INCLUDE_DIR} comes before
Cross compilers do not use this macro and do not search the directory
specified.
+@end defmac
-@findex STANDARD_INCLUDE_DIR
-@item STANDARD_INCLUDE_DIR
+@defmac STANDARD_INCLUDE_DIR
Define this macro as a C string constant if you wish to override the
standard choice of @file{/usr/include} as the default prefix to
try when searching for header files.
-Cross compilers do not use this macro and do not search either
+Cross compilers ignore this macro and do not search either
@file{/usr/include} or its replacement.
+@end defmac
-@findex STANDARD_INCLUDE_COMPONENT
-@item STANDARD_INCLUDE_COMPONENT
+@defmac STANDARD_INCLUDE_COMPONENT
The ``component'' corresponding to @code{STANDARD_INCLUDE_DIR}.
See @code{INCLUDE_DEFAULTS}, below, for the description of components.
If you do not define this macro, no component is used.
+@end defmac
-@findex INCLUDE_DEFAULTS
-@item INCLUDE_DEFAULTS
+@defmac INCLUDE_DEFAULTS
Define this macro if you wish to override the entire default search path
for include files. For a native compiler, the default search path
usually consists of @code{GCC_INCLUDE_DIR}, @code{LOCAL_INCLUDE_DIR},
@@ -564,7 +574,7 @@ For example, here is the definition used for VAX/VMS:
@{ 0, 0, 0, 0@} \
@}
@end example
-@end table
+@end defmac
Here is the order of prefixes tried for exec files:
@@ -632,9 +642,7 @@ The macro @code{STANDARD_STARTFILE_PREFIX}.
@c prevent bad page break with this line
Here are run-time target specifications.
-@table @code
-@findex TARGET_CPU_CPP_BUILTINS
-@item TARGET_CPU_CPP_BUILTINS()
+@defmac TARGET_CPU_CPP_BUILTINS ()
This function-like macro expands to a block of code that defines
built-in preprocessor macros and assertions for the target cpu, using
the functions @code{builtin_define}, @code{builtin_define_std} and
@@ -668,26 +676,28 @@ to check for that first. If you need to check for strict ANSI, the
variable @code{flag_iso} can be used. The function-like macro
@code{preprocessing_trad_p()} can be used to check for traditional
preprocessing.
+@end defmac
-@findex TARGET_OS_CPP_BUILTINS
-@item TARGET_OS_CPP_BUILTINS()
+@defmac TARGET_OS_CPP_BUILTINS ()
Similarly to @code{TARGET_CPU_CPP_BUILTINS} but this macro is optional
and is used for the target operating system instead.
+@end defmac
-@findex TARGET_OBJFMT_CPP_BUILTINS
-@item TARGET_OBJFMT_CPP_BUILTINS()
+@defmac TARGET_OBJFMT_CPP_BUILTINS ()
Similarly to @code{TARGET_CPU_CPP_BUILTINS} but this macro is optional
and is used for the target object format. @file{elfos.h} uses this
macro to define @code{__ELF__}, so you probably do not need to define
it yourself.
+@end defmac
-@findex extern int target_flags
-@item extern int target_flags;
+@deftypevar {extern int} target_flags
This declaration should be present.
+@end deftypevar
@cindex optional hardware or system features
@cindex features, optional, in system conventions
-@item TARGET_@dots{}
+
+@defmac TARGET_@var{featurename}
This series of macros is to allow compiler command arguments to
enable or disable the use of optional features of the target machine.
For example, one machine description serves both the 68000 and
@@ -698,14 +708,14 @@ by means of a macro @code{TARGET_68020} that tests a bit in
Define a macro @code{TARGET_@var{featurename}} for each such option.
Its definition should test a bit in @code{target_flags}. It is
-recommended that a helper macro @code{TARGET_MASK_@var{featurename}}
+recommended that a helper macro @code{MASK_@var{featurename}}
is defined for each bit-value to test, and used in
@code{TARGET_@var{featurename}} and @code{TARGET_SWITCHES}. For
example:
@smallexample
#define TARGET_MASK_68020 1
-#define TARGET_68020 (target_flags & TARGET_MASK_68020)
+#define TARGET_68020 (target_flags & MASK_68020)
@end smallexample
One place where these macros are used is in the condition-expressions
@@ -713,9 +723,9 @@ of instruction patterns. Note how @code{TARGET_68020} appears
frequently in the 68000 machine description file, @file{m68k.md}.
Another place they are used is in the definitions of the other
macros in the @file{@var{machine}.h} file.
+@end defmac
-@findex TARGET_SWITCHES
-@item TARGET_SWITCHES
+@defmac TARGET_SWITCHES
This macro defines names of command options to set and clear
bits in @code{target_flags}. Its definition is an initializer
with a subgrouping for each command option.
@@ -746,14 +756,15 @@ with opposite meanings, and picks the latter as the default:
@smallexample
#define TARGET_SWITCHES \
- @{ @{ "68020", TARGET_MASK_68020, "" @}, \
- @{ "68000", -TARGET_MASK_68020, \
+ @{ @{ "68020", MASK_68020, "" @}, \
+ @{ "68000", -MASK_68020, \
N_("Compile for the 68000") @}, \
- @{ "", TARGET_MASK_68020, "" @}@}
+ @{ "", MASK_68020, "" @}, \
+ @}
@end smallexample
+@end defmac
-@findex TARGET_OPTIONS
-@item TARGET_OPTIONS
+@defmac TARGET_OPTIONS
This macro is similar to @code{TARGET_SWITCHES} but defines names of command
options that have values. Its definition is an initializer with a
subgrouping for each command option.
@@ -790,7 +801,7 @@ extern char *m88k_short_data;
N_("Specify the size of the short data section"), 0 @} @}
@end smallexample
-Here is an variant of the above that allows the user to also specify
+Here is a variant of the above that allows the user to also specify
just @option{-mshort-data} where a default of @code{"64"} is used.
@smallexample
@@ -820,9 +831,9 @@ extern char *chip_alu;
#define TARGET_ALU1 (chip_alu[0] == '1')
#define TARGET_ALU2 (chip_alu[0] == '2')
@end smallexample
+@end defmac
-@findex TARGET_VERSION
-@item TARGET_VERSION
+@defmac TARGET_VERSION
This macro is a C statement to print on @code{stderr} a string
describing the particular machine description choice. Every machine
description should define @code{TARGET_VERSION}. For example:
@@ -836,9 +847,9 @@ description should define @code{TARGET_VERSION}. For example:
fprintf (stderr, " (68k, MIT syntax)");
#endif
@end smallexample
+@end defmac
-@findex OVERRIDE_OPTIONS
-@item OVERRIDE_OPTIONS
+@defmac OVERRIDE_OPTIONS
Sometimes certain combinations of command options do not make sense on
a particular target machine. You can define a macro
@code{OVERRIDE_OPTIONS} to take account of this. This macro, if
@@ -847,9 +858,9 @@ parsed.
Don't use this macro to turn on various extra optimizations for
@option{-O}. That is what @code{OPTIMIZATION_OPTIONS} is for.
+@end defmac
-@findex OPTIMIZATION_OPTIONS
-@item OPTIMIZATION_OPTIONS (@var{level}, @var{size})
+@defmac OPTIMIZATION_OPTIONS (@var{level}, @var{size})
Some machines may desire to change what optimizations are performed for
various optimization levels. This macro, if defined, is executed once
just after the optimization level is determined and before the remainder
@@ -869,13 +880,13 @@ machine-specific optimizations.
@strong{Do not examine @code{write_symbols} in
this macro!} The debugging options are not supposed to alter the
generated code.
+@end defmac
-@findex CAN_DEBUG_WITHOUT_FP
-@item CAN_DEBUG_WITHOUT_FP
+@defmac CAN_DEBUG_WITHOUT_FP
Define this macro if debugging can be performed even without a frame
pointer. If this macro is defined, GCC will turn on the
@option{-fomit-frame-pointer} option whenever @option{-O} is specified.
-@end table
+@end defmac
@node Per-Function Data
@section Defining data structures for per-function information.
@@ -914,30 +925,24 @@ the saving and restoring of the target specific information. Since the
single data area approach is no longer used, these pointers are no
longer supported.
-The macro and function pointers are described below.
-
-@table @code
-@findex INIT_EXPANDERS
-@item INIT_EXPANDERS
+@defmac INIT_EXPANDERS
Macro called to initialize any target specific information. This macro
is called once per function, before generation of any RTL has begun.
The intention of this macro is to allow the initialization of the
-function pointers below.
+function pointer @code{init_machine_status}.
+@end defmac
-@findex init_machine_status
-@item init_machine_status
-This is a @code{void (*)(struct function *)} function pointer. If this
-pointer is non-@code{NULL} it will be called once per function, before function
-compilation starts, in order to allow the target to perform any target
-specific initialization of the @code{struct function} structure. It is
-intended that this would be used to initialize the @code{machine} of
-that structure.
+@deftypevar {void (*)(struct function *)} init_machine_status
+If this function pointer is non-@code{NULL} it will be called once per
+function, before function compilation starts, in order to allow the
+target to perform any target specific initialization of the
+@code{struct function} structure. It is intended that this would be
+used to initialize the @code{machine} of that structure.
@code{struct machine_function} structures are expected to be freed by GC.
Generally, any memory that they reference must be allocated by using
@code{ggc_alloc}, including the structure itself.
-
-@end table
+@end deftypevar
@node Storage Layout
@section Storage Layout
@@ -948,9 +953,7 @@ alignments measured in bits do not need to be constant. They can be C
expressions that refer to static variables, such as the @code{target_flags}.
@xref{Run-time Target}.
-@table @code
-@findex BITS_BIG_ENDIAN
-@item BITS_BIG_ENDIAN
+@defmac BITS_BIG_ENDIAN
Define this macro to have the value 1 if the most significant bit in a
byte has the lowest number; otherwise define it to have the value zero.
This means that bit-field instructions count from the most significant
@@ -960,29 +963,29 @@ macro need not be a constant.
This macro does not affect the way structure fields are packed into
bytes or words; that is controlled by @code{BYTES_BIG_ENDIAN}.
+@end defmac
-@findex BYTES_BIG_ENDIAN
-@item BYTES_BIG_ENDIAN
+@defmac BYTES_BIG_ENDIAN
Define this macro to have the value 1 if the most significant byte in a
word has the lowest number. This macro need not be a constant.
+@end defmac
-@findex WORDS_BIG_ENDIAN
-@item WORDS_BIG_ENDIAN
+@defmac WORDS_BIG_ENDIAN
Define this macro to have the value 1 if, in a multiword object, the
most significant word has the lowest number. This applies to both
memory locations and registers; GCC fundamentally assumes that the
order of words in memory is the same as the order in registers. This
macro need not be a constant.
+@end defmac
-@findex LIBGCC2_WORDS_BIG_ENDIAN
-@item LIBGCC2_WORDS_BIG_ENDIAN
+@defmac LIBGCC2_WORDS_BIG_ENDIAN
Define this macro if @code{WORDS_BIG_ENDIAN} is not constant. This must be a
constant value with the same meaning as @code{WORDS_BIG_ENDIAN}, which will be
used only when compiling @file{libgcc2.c}. Typically the value will be set
based on preprocessor defines.
+@end defmac
-@findex FLOAT_WORDS_BIG_ENDIAN
-@item FLOAT_WORDS_BIG_ENDIAN
+@defmac FLOAT_WORDS_BIG_ENDIAN
Define this macro to have the value 1 if @code{DFmode}, @code{XFmode} or
@code{TFmode} floating point numbers are stored in memory with the word
containing the sign bit at the lowest address; otherwise define it to
@@ -990,42 +993,42 @@ have the value 0. This macro need not be a constant.
You need not define this macro if the ordering is the same as for
multi-word integers.
+@end defmac
-@findex BITS_PER_UNIT
-@item BITS_PER_UNIT
+@defmac BITS_PER_UNIT
Define this macro to be the number of bits in an addressable storage
unit (byte). If you do not define this macro the default is 8.
+@end defmac
-@findex BITS_PER_WORD
-@item BITS_PER_WORD
+@defmac BITS_PER_WORD
Number of bits in a word. If you do not define this macro, the default
is @code{BITS_PER_UNIT * UNITS_PER_WORD}.
+@end defmac
-@findex MAX_BITS_PER_WORD
-@item MAX_BITS_PER_WORD
+@defmac MAX_BITS_PER_WORD
Maximum number of bits in a word. If this is undefined, the default is
@code{BITS_PER_WORD}. Otherwise, it is the constant value that is the
largest value that @code{BITS_PER_WORD} can have at run-time.
+@end defmac
-@findex UNITS_PER_WORD
-@item UNITS_PER_WORD
+@defmac UNITS_PER_WORD
Number of storage units in a word; normally 4.
+@end defmac
-@findex MIN_UNITS_PER_WORD
-@item MIN_UNITS_PER_WORD
+@defmac MIN_UNITS_PER_WORD
Minimum number of units in a word. If this is undefined, the default is
@code{UNITS_PER_WORD}. Otherwise, it is the constant value that is the
smallest value that @code{UNITS_PER_WORD} can have at run-time.
+@end defmac
-@findex POINTER_SIZE
-@item POINTER_SIZE
+@defmac POINTER_SIZE
Width of a pointer, in bits. You must specify a value no wider than the
width of @code{Pmode}. If it is not equal to the width of @code{Pmode},
you must define @code{POINTERS_EXTEND_UNSIGNED}. If you do not specify
a value the default is @code{BITS_PER_WORD}.
+@end defmac
-@findex POINTERS_EXTEND_UNSIGNED
-@item POINTERS_EXTEND_UNSIGNED
+@defmac POINTERS_EXTEND_UNSIGNED
A C expression whose value is greater than zero if pointers that need to be
extended from being @code{POINTER_SIZE} bits wide to @code{Pmode} are to
be zero-extended and zero if they are to be sign-extended. If the value
@@ -1034,9 +1037,9 @@ extends a pointer from @code{POINTER_SIZE} to @code{Pmode}.
You need not define this macro if the @code{POINTER_SIZE} is equal
to the width of @code{Pmode}.
+@end defmac
-@findex PROMOTE_MODE
-@item PROMOTE_MODE (@var{m}, @var{unsignedp}, @var{type})
+@defmac PROMOTE_MODE (@var{m}, @var{unsignedp}, @var{type})
A macro to update @var{m} and @var{unsignedp} when an object whose type
is @var{type} and which has the specified mode and signedness is to be
stored in a register. This macro is only called when @var{type} is a
@@ -1057,52 +1060,52 @@ sign-extend the result to 64 bits. On such machines, set
@var{unsignedp} according to which kind of extension is more efficient.
Do not define this macro if it would never modify @var{m}.
+@end defmac
-@findex PROMOTE_FUNCTION_ARGS
-@item PROMOTE_FUNCTION_ARGS
+@defmac PROMOTE_FUNCTION_ARGS
Define this macro if the promotion described by @code{PROMOTE_MODE}
should also be done for outgoing function arguments.
+@end defmac
-@findex PROMOTE_FUNCTION_RETURN
-@item PROMOTE_FUNCTION_RETURN
+@defmac PROMOTE_FUNCTION_RETURN
Define this macro if the promotion described by @code{PROMOTE_MODE}
should also be done for the return value of functions.
If this macro is defined, @code{FUNCTION_VALUE} must perform the same
promotions done by @code{PROMOTE_MODE}.
+@end defmac
-@findex PROMOTE_FOR_CALL_ONLY
-@item PROMOTE_FOR_CALL_ONLY
+@defmac PROMOTE_FOR_CALL_ONLY
Define this macro if the promotion described by @code{PROMOTE_MODE}
should @emph{only} be performed for outgoing function arguments or
function return values, as specified by @code{PROMOTE_FUNCTION_ARGS}
and @code{PROMOTE_FUNCTION_RETURN}, respectively.
+@end defmac
-@findex PARM_BOUNDARY
-@item PARM_BOUNDARY
+@defmac PARM_BOUNDARY
Normal alignment required for function parameters on the stack, in
bits. All stack parameters receive at least this much alignment
regardless of data type. On most machines, this is the same as the
size of an integer.
+@end defmac
-@findex STACK_BOUNDARY
-@item STACK_BOUNDARY
+@defmac STACK_BOUNDARY
Define this macro to the minimum alignment enforced by hardware for the
stack pointer on this machine. The definition is a C expression for the
desired alignment (measured in bits). This value is used as a default
if @code{PREFERRED_STACK_BOUNDARY} is not defined. On most machines,
this should be the same as @code{PARM_BOUNDARY}.
+@end defmac
-@findex PREFERRED_STACK_BOUNDARY
-@item PREFERRED_STACK_BOUNDARY
+@defmac PREFERRED_STACK_BOUNDARY
Define this macro if you wish to preserve a certain alignment for the
stack pointer, greater than what the hardware enforces. The definition
is a C expression for the desired alignment (measured in bits). This
macro must evaluate to a value equal to or larger than
@code{STACK_BOUNDARY}.
+@end defmac
-@findex FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN
-@item FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN
+@defmac FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN
A C expression that evaluates true if @code{PREFERRED_STACK_BOUNDARY} is
not guaranteed by the runtime and we should emit code to align the stack
at the beginning of @code{main}.
@@ -1112,47 +1115,47 @@ If @code{PUSH_ROUNDING} is not defined, the stack will always be aligned
to the specified boundary. If @code{PUSH_ROUNDING} is defined and specifies
a less strict alignment than @code{PREFERRED_STACK_BOUNDARY}, the stack may
be momentarily unaligned while pushing arguments.
+@end defmac
-@findex FUNCTION_BOUNDARY
-@item FUNCTION_BOUNDARY
+@defmac FUNCTION_BOUNDARY
Alignment required for a function entry point, in bits.
+@end defmac
-@findex BIGGEST_ALIGNMENT
-@item BIGGEST_ALIGNMENT
+@defmac BIGGEST_ALIGNMENT
Biggest alignment that any data type can require on this machine, in bits.
+@end defmac
-@findex MINIMUM_ATOMIC_ALIGNMENT
-@item MINIMUM_ATOMIC_ALIGNMENT
+@defmac MINIMUM_ATOMIC_ALIGNMENT
If defined, the smallest alignment, in bits, that can be given to an
object that can be referenced in one operation, without disturbing any
nearby object. Normally, this is @code{BITS_PER_UNIT}, but may be larger
on machines that don't have byte or half-word store operations.
+@end defmac
-@findex BIGGEST_FIELD_ALIGNMENT
-@item BIGGEST_FIELD_ALIGNMENT
+@defmac BIGGEST_FIELD_ALIGNMENT
Biggest alignment that any structure or union field can require on this
machine, in bits. If defined, this overrides @code{BIGGEST_ALIGNMENT} for
structure and union fields only, unless the field alignment has been set
by the @code{__attribute__ ((aligned (@var{n})))} construct.
+@end defmac
-@findex ADJUST_FIELD_ALIGN
-@item ADJUST_FIELD_ALIGN (@var{field}, @var{computed})
+@defmac ADJUST_FIELD_ALIGN (@var{field}, @var{computed})
An expression for the alignment of a structure field @var{field} if the
alignment computed in the usual way (including applying of
@code{BIGGEST_ALIGNMENT} and @code{BIGGEST_FIELD_ALIGNMENT} to the
alignment) is @var{computed}. It overrides alignment only if the
field alignment has not been set by the
@code{__attribute__ ((aligned (@var{n})))} construct.
+@end defmac
-@findex MAX_OFILE_ALIGNMENT
-@item MAX_OFILE_ALIGNMENT
+@defmac MAX_OFILE_ALIGNMENT
Biggest alignment supported by the object file format of this machine.
Use this macro to limit the alignment which can be specified using the
@code{__attribute__ ((aligned (@var{n})))} construct. If not defined,
the default value is @code{BIGGEST_ALIGNMENT}.
+@end defmac
-@findex DATA_ALIGNMENT
-@item DATA_ALIGNMENT (@var{type}, @var{basic-align})
+@defmac DATA_ALIGNMENT (@var{type}, @var{basic-align})
If defined, a C expression to compute the alignment for a variable in
the static store. @var{type} is the data type, and @var{basic-align} is
the alignment that the object would ordinarily have. The value of this
@@ -1165,9 +1168,9 @@ One use of this macro is to increase alignment of medium-size data to
make it all fit in fewer cache lines. Another is to cause character
arrays to be word-aligned so that @code{strcpy} calls that copy
constants to character arrays can be done inline.
+@end defmac
-@findex CONSTANT_ALIGNMENT
-@item CONSTANT_ALIGNMENT (@var{constant}, @var{basic-align})
+@defmac CONSTANT_ALIGNMENT (@var{constant}, @var{basic-align})
If defined, a C expression to compute the alignment given to a constant
that is being placed in memory. @var{constant} is the constant and
@var{basic-align} is the alignment that the object would ordinarily
@@ -1179,9 +1182,9 @@ If this macro is not defined, then @var{basic-align} is used.
The typical use of this macro is to increase alignment for string
constants to be word aligned so that @code{strcpy} calls that copy
constants can be done inline.
+@end defmac
-@findex LOCAL_ALIGNMENT
-@item LOCAL_ALIGNMENT (@var{type}, @var{basic-align})
+@defmac LOCAL_ALIGNMENT (@var{type}, @var{basic-align})
If defined, a C expression to compute the alignment for a variable in
the local store. @var{type} is the data type, and @var{basic-align} is
the alignment that the object would ordinarily have. The value of this
@@ -1191,30 +1194,30 @@ If this macro is not defined, then @var{basic-align} is used.
One use of this macro is to increase alignment of medium-size data to
make it all fit in fewer cache lines.
+@end defmac
-@findex EMPTY_FIELD_BOUNDARY
-@item EMPTY_FIELD_BOUNDARY
+@defmac EMPTY_FIELD_BOUNDARY
Alignment in bits to be given to a structure bit-field that follows an
empty field such as @code{int : 0;}.
If @code{PCC_BITFIELD_TYPE_MATTERS} is true, it overrides this macro.
+@end defmac
-@findex STRUCTURE_SIZE_BOUNDARY
-@item STRUCTURE_SIZE_BOUNDARY
+@defmac STRUCTURE_SIZE_BOUNDARY
Number of bits which any structure or union's size must be a multiple of.
Each structure or union's size is rounded up to a multiple of this.
If you do not define this macro, the default is the same as
@code{BITS_PER_UNIT}.
+@end defmac
-@findex STRICT_ALIGNMENT
-@item STRICT_ALIGNMENT
+@defmac STRICT_ALIGNMENT
Define this macro to be the value 1 if instructions will fail to work
if given data not on the nominal alignment. If instructions will merely
go slower in that case, define this macro as 0.
+@end defmac
-@findex PCC_BITFIELD_TYPE_MATTERS
-@item PCC_BITFIELD_TYPE_MATTERS
+@defmac PCC_BITFIELD_TYPE_MATTERS
Define this if you wish to imitate the way many other C compilers handle
alignment of bit-fields and the structures that contain them.
@@ -1279,14 +1282,14 @@ main ()
If this prints 2 and 5, then the compiler's behavior is what you would
get from @code{PCC_BITFIELD_TYPE_MATTERS}.
+@end defmac
-@findex BITFIELD_NBYTES_LIMITED
-@item BITFIELD_NBYTES_LIMITED
+@defmac BITFIELD_NBYTES_LIMITED
Like @code{PCC_BITFIELD_TYPE_MATTERS} except that its effect is limited
to aligning a bit-field within the structure.
+@end defmac
-@findex MEMBER_TYPE_FORCES_BLK
-@item MEMBER_TYPE_FORCES_BLK (@var{field}, @var{mode})
+@defmac MEMBER_TYPE_FORCES_BLK (@var{field}, @var{mode})
Return 1 if a structure or array containing @var{field} should be accessed using
@code{BLKMODE}.
@@ -1298,9 +1301,9 @@ retain the field's mode.
Normally, this is not needed. See the file @file{c4x.h} for an example
of how to use this macro to prevent a structure having a floating point
field from being accessed in an integer mode.
+@end defmac
-@findex ROUND_TYPE_ALIGN
-@item ROUND_TYPE_ALIGN (@var{type}, @var{computed}, @var{specified})
+@defmac ROUND_TYPE_ALIGN (@var{type}, @var{computed}, @var{specified})
Define this macro as an expression for the alignment of a type (given
by @var{type} as a tree node) if the alignment computed in the usual
way is @var{computed} and the alignment explicitly specified was
@@ -1308,23 +1311,23 @@ way is @var{computed} and the alignment explicitly specified was
The default is to use @var{specified} if it is larger; otherwise, use
the smaller of @var{computed} and @code{BIGGEST_ALIGNMENT}
+@end defmac
-@findex MAX_FIXED_MODE_SIZE
-@item MAX_FIXED_MODE_SIZE
+@defmac MAX_FIXED_MODE_SIZE
An integer expression for the size in bits of the largest integer
machine mode that should actually be used. All integer machine modes of
this size or smaller can be used for structures and unions with the
appropriate sizes. If this macro is undefined, @code{GET_MODE_BITSIZE
(DImode)} is assumed.
+@end defmac
-@findex VECTOR_MODE_SUPPORTED_P
-@item VECTOR_MODE_SUPPORTED_P(@var{mode})
+@defmac VECTOR_MODE_SUPPORTED_P (@var{mode})
Define this macro to be nonzero if the port is prepared to handle insns
involving vector mode @var{mode}. At the very least, it must have move
patterns for this mode.
+@end defmac
-@findex STACK_SAVEAREA_MODE
-@item STACK_SAVEAREA_MODE (@var{save_level})
+@defmac STACK_SAVEAREA_MODE (@var{save_level})
If defined, an expression of type @code{enum machine_mode} that
specifies the mode of the save area operand of a
@code{save_stack_@var{level}} named pattern (@pxref{Standard Names}).
@@ -1336,9 +1339,9 @@ You need not define this macro if it always returns @code{Pmode}. You
would most commonly define this macro if the
@code{save_stack_@var{level}} patterns need to support both a 32- and a
64-bit mode.
+@end defmac
-@findex STACK_SIZE_MODE
-@item STACK_SIZE_MODE
+@defmac STACK_SIZE_MODE
If defined, an expression of type @code{enum machine_mode} that
specifies the mode of the size increment operand of an
@code{allocate_stack} named pattern (@pxref{Standard Names}).
@@ -1346,45 +1349,37 @@ specifies the mode of the size increment operand of an
You need not define this macro if it always returns @code{word_mode}.
You would most commonly define this macro if the @code{allocate_stack}
pattern needs to support both a 32- and a 64-bit mode.
+@end defmac
-@findex TARGET_FLOAT_FORMAT
-@item TARGET_FLOAT_FORMAT
+@defmac TARGET_FLOAT_FORMAT
A code distinguishing the floating point format of the target machine.
-There are five defined values:
+There are four defined values:
-@table @code
-@findex IEEE_FLOAT_FORMAT
+@ftable @code
@item IEEE_FLOAT_FORMAT
This code indicates IEEE floating point. It is the default; there is no
-need to define this macro when the format is IEEE@.
+need to define @code{TARGET_FLOAT_FORMAT} when the format is IEEE@.
-@findex VAX_FLOAT_FORMAT
@item VAX_FLOAT_FORMAT
This code indicates the ``F float'' (for @code{float}) and ``D float''
or ``G float'' formats (for @code{double}) used on the VAX and PDP-11@.
-@findex IBM_FLOAT_FORMAT
@item IBM_FLOAT_FORMAT
This code indicates the format used on the IBM System/370.
-@findex C4X_FLOAT_FORMAT
@item C4X_FLOAT_FORMAT
This code indicates the format used on the TMS320C3x/C4x.
+@end ftable
-@findex UNKNOWN_FLOAT_FORMAT
-@item UNKNOWN_FLOAT_FORMAT
-This code indicates any other format.
-@end table
-
-If any other
-formats are actually in use on supported machines, new codes should be
-defined for them.
+If your target uses a floating point format other than these, you must
+define a new @var{name}_FLOAT_FORMAT code for it, and add support for
+it to @file{real.c}.
The ordering of the component words of floating point values stored in
memory is controlled by @code{FLOAT_WORDS_BIG_ENDIAN}.
+@end defmac
-@findex MODE_HAS_NANS
-@item MODE_HAS_NANS (@var{mode})
+@defmac MODE_HAS_NANS (@var{mode})
When defined, this macro should be true if @var{mode} has a NaN
representation. The compiler assumes that NaNs are not equal to
anything (including themselves) and that addition, subtraction,
@@ -1393,16 +1388,16 @@ NaN@.
By default, this macro is true if @var{mode} is a floating-point
mode and the target floating-point format is IEEE@.
+@end defmac
-@findex MODE_HAS_INFINITIES
-@item MODE_HAS_INFINITIES (@var{mode})
+@defmac MODE_HAS_INFINITIES (@var{mode})
This macro should be true if @var{mode} can represent infinity. At
present, the compiler uses this macro to decide whether @samp{x - x}
is always defined. By default, the macro is true when @var{mode}
is a floating-point mode and the target format is IEEE@.
+@end defmac
-@findex MODE_HAS_SIGNED_ZEROS
-@item MODE_HAS_SIGNED_ZEROS (@var{mode})
+@defmac MODE_HAS_SIGNED_ZEROS (@var{mode})
True if @var{mode} distinguishes between positive and negative zero.
The rules are expected to follow the IEEE standard:
@@ -1422,9 +1417,9 @@ of the operands is negative.
The default definition is true if @var{mode} is a floating-point
mode and the target format is IEEE@.
+@end defmac
-@findex MODE_HAS_SIGN_DEPENDENT_ROUNDING
-@item MODE_HAS_SIGN_DEPENDENT_ROUNDING (@var{mode})
+@defmac MODE_HAS_SIGN_DEPENDENT_ROUNDING (@var{mode})
If defined, this macro should be true for @var{mode} if it has at
least one rounding mode in which @samp{x} and @samp{-x} can be
rounded to numbers of different magnitude. Two such modes are
@@ -1432,9 +1427,9 @@ towards @minus{}infinity and towards +infinity.
The default definition of this macro is true if @var{mode} is
a floating-point mode and the target format is IEEE@.
+@end defmac
-@findex ROUND_TOWARDS_ZERO
-@item ROUND_TOWARDS_ZERO
+@defmac ROUND_TOWARDS_ZERO
If defined, this macro should be true if the prevailing rounding
mode is towards zero. A true value has the following effects:
@@ -1458,9 +1453,9 @@ primary rounding mode is towards zero, library functions like
parser should behave like the target's @code{strtod} where possible.
Not defining this macro is equivalent to returning zero.
+@end defmac
-@findex LARGEST_EXPONENT_IS_NORMAL
-@item LARGEST_EXPONENT_IS_NORMAL (@var{size})
+@defmac LARGEST_EXPONENT_IS_NORMAL (@var{size})
This macro should return true if floats with @var{size}
bits do not have a NaN or infinity representation, but use the largest
exponent for normal numbers instead.
@@ -1471,7 +1466,7 @@ It also affects the way @file{libgcc.a} and @file{real.c} emulate
floating-point arithmetic.
The default definition of this macro returns false for all sizes.
-@end table
+@end defmac
@deftypefn {Target Hook} bool TARGET_VECTOR_OPAQUE_P (tree @var{type})
This target hook should return @code{true} a vector is opaque. That
@@ -1517,116 +1512,115 @@ basic data types used in programs being compiled. Unlike the macros in
the previous section, these apply to specific features of C and related
languages, rather than to fundamental aspects of storage layout.
-@table @code
-@findex INT_TYPE_SIZE
-@item INT_TYPE_SIZE
+@defmac INT_TYPE_SIZE
A C expression for the size in bits of the type @code{int} on the
target machine. If you don't define this, the default is one word.
+@end defmac
-@findex SHORT_TYPE_SIZE
-@item SHORT_TYPE_SIZE
+@defmac SHORT_TYPE_SIZE
A C expression for the size in bits of the type @code{short} on the
target machine. If you don't define this, the default is half a word.
(If this would be less than one storage unit, it is rounded up to one
unit.)
+@end defmac
-@findex LONG_TYPE_SIZE
-@item LONG_TYPE_SIZE
+@defmac LONG_TYPE_SIZE
A C expression for the size in bits of the type @code{long} on the
target machine. If you don't define this, the default is one word.
+@end defmac
-@findex ADA_LONG_TYPE_SIZE
-@item ADA_LONG_TYPE_SIZE
+@defmac ADA_LONG_TYPE_SIZE
On some machines, the size used for the Ada equivalent of the type
@code{long} by a native Ada compiler differs from that used by C. In
that situation, define this macro to be a C expression to be used for
the size of that type. If you don't define this, the default is the
value of @code{LONG_TYPE_SIZE}.
+@end defmac
-@findex MAX_LONG_TYPE_SIZE
-@item MAX_LONG_TYPE_SIZE
+@defmac MAX_LONG_TYPE_SIZE
Maximum number for the size in bits of the type @code{long} on the
target machine. If this is undefined, the default is
@code{LONG_TYPE_SIZE}. Otherwise, it is the constant value that is the
largest value that @code{LONG_TYPE_SIZE} can have at run-time. This is
used in @code{cpp}.
+@end defmac
-@findex LONG_LONG_TYPE_SIZE
-@item LONG_LONG_TYPE_SIZE
+@defmac LONG_LONG_TYPE_SIZE
A C expression for the size in bits of the type @code{long long} on the
target machine. If you don't define this, the default is two
words. If you want to support GNU Ada on your machine, the value of this
macro must be at least 64.
+@end defmac
-@findex CHAR_TYPE_SIZE
-@item CHAR_TYPE_SIZE
+@defmac CHAR_TYPE_SIZE
A C expression for the size in bits of the type @code{char} on the
target machine. If you don't define this, the default is
@code{BITS_PER_UNIT}.
+@end defmac
-@findex BOOL_TYPE_SIZE
-@item BOOL_TYPE_SIZE
+@defmac BOOL_TYPE_SIZE
A C expression for the size in bits of the C++ type @code{bool} and
C99 type @code{_Bool} on the target machine. If you don't define
this, and you probably shouldn't, the default is @code{CHAR_TYPE_SIZE}.
+@end defmac
-@findex FLOAT_TYPE_SIZE
-@item FLOAT_TYPE_SIZE
+@defmac FLOAT_TYPE_SIZE
A C expression for the size in bits of the type @code{float} on the
target machine. If you don't define this, the default is one word.
+@end defmac
-@findex DOUBLE_TYPE_SIZE
-@item DOUBLE_TYPE_SIZE
+@defmac DOUBLE_TYPE_SIZE
A C expression for the size in bits of the type @code{double} on the
target machine. If you don't define this, the default is two
words.
+@end defmac
-@findex LONG_DOUBLE_TYPE_SIZE
-@item LONG_DOUBLE_TYPE_SIZE
+@defmac LONG_DOUBLE_TYPE_SIZE
A C expression for the size in bits of the type @code{long double} on
the target machine. If you don't define this, the default is two
words.
+@end defmac
-@findex MAX_LONG_DOUBLE_TYPE_SIZE
+@defmac MAX_LONG_DOUBLE_TYPE_SIZE
Maximum number for the size in bits of the type @code{long double} on the
target machine. If this is undefined, the default is
@code{LONG_DOUBLE_TYPE_SIZE}. Otherwise, it is the constant value that is
the largest value that @code{LONG_DOUBLE_TYPE_SIZE} can have at run-time.
This is used in @code{cpp}.
+@end defmac
-@findex TARGET_FLT_EVAL_METHOD
-@item TARGET_FLT_EVAL_METHOD
+@defmac TARGET_FLT_EVAL_METHOD
A C expression for the value for @code{FLT_EVAL_METHOD} in @file{float.h},
assuming, if applicable, that the floating-point control word is in its
default state. If you do not define this macro the value of
@code{FLT_EVAL_METHOD} will be zero.
+@end defmac
-@findex WIDEST_HARDWARE_FP_SIZE
-@item WIDEST_HARDWARE_FP_SIZE
+@defmac WIDEST_HARDWARE_FP_SIZE
A C expression for the size in bits of the widest floating-point format
supported by the hardware. If you define this macro, you must specify a
value less than or equal to the value of @code{LONG_DOUBLE_TYPE_SIZE}.
If you do not define this macro, the value of @code{LONG_DOUBLE_TYPE_SIZE}
is the default.
+@end defmac
-@findex DEFAULT_SIGNED_CHAR
-@item DEFAULT_SIGNED_CHAR
+@defmac DEFAULT_SIGNED_CHAR
An expression whose value is 1 or 0, according to whether the type
@code{char} should be signed or unsigned by default. The user can
always override this default with the options @option{-fsigned-char}
and @option{-funsigned-char}.
+@end defmac
-@findex DEFAULT_SHORT_ENUMS
-@item DEFAULT_SHORT_ENUMS
+@defmac DEFAULT_SHORT_ENUMS
A C expression to determine whether to give an @code{enum} type
only as many bytes as it takes to represent the range of possible values
of that type. A nonzero value means to do that; a zero value means all
@code{enum} types should be allocated like @code{int}.
If you don't define the macro, the default is 0.
+@end defmac
-@findex SIZE_TYPE
-@item SIZE_TYPE
+@defmac SIZE_TYPE
A C expression for a string describing the name of the data type to use
for size values. The typedef name @code{size_t} is defined using the
contents of the string.
@@ -1641,49 +1635,49 @@ crash on startup.
If you don't define this macro, the default is @code{"long unsigned
int"}.
+@end defmac
-@findex PTRDIFF_TYPE
-@item PTRDIFF_TYPE
+@defmac PTRDIFF_TYPE
A C expression for a string describing the name of the data type to use
for the result of subtracting two pointers. The typedef name
@code{ptrdiff_t} is defined using the contents of the string. See
@code{SIZE_TYPE} above for more information.
If you don't define this macro, the default is @code{"long int"}.
+@end defmac
-@findex WCHAR_TYPE
-@item WCHAR_TYPE
+@defmac WCHAR_TYPE
A C expression for a string describing the name of the data type to use
for wide characters. The typedef name @code{wchar_t} is defined using
the contents of the string. See @code{SIZE_TYPE} above for more
information.
If you don't define this macro, the default is @code{"int"}.
+@end defmac
-@findex WCHAR_TYPE_SIZE
-@item WCHAR_TYPE_SIZE
+@defmac WCHAR_TYPE_SIZE
A C expression for the size in bits of the data type for wide
characters. This is used in @code{cpp}, which cannot make use of
@code{WCHAR_TYPE}.
+@end defmac
-@findex MAX_WCHAR_TYPE_SIZE
-@item MAX_WCHAR_TYPE_SIZE
+@defmac MAX_WCHAR_TYPE_SIZE
Maximum number for the size in bits of the data type for wide
characters. If this is undefined, the default is
@code{WCHAR_TYPE_SIZE}. Otherwise, it is the constant value that is the
largest value that @code{WCHAR_TYPE_SIZE} can have at run-time. This is
used in @code{cpp}.
+@end defmac
-@findex GCOV_TYPE_SIZE
-@item GCOV_TYPE_SIZE
+@defmac GCOV_TYPE_SIZE
A C expression for the size in bits of the type used for gcov counters on the
target machine. If you don't define this, the default is one
@code{LONG_TYPE_SIZE} in case it is greater or equal to 64-bit and
@code{LONG_LONG_TYPE_SIZE} otherwise. You may want to re-define the type to
ensure atomicity for counters in multithreaded programs.
+@end defmac
-@findex WINT_TYPE
-@item WINT_TYPE
+@defmac WINT_TYPE
A C expression for a string describing the name of the data type to
use for wide characters passed to @code{printf} and returned from
@code{getwc}. The typedef name @code{wint_t} is defined using the
@@ -1691,9 +1685,9 @@ contents of the string. See @code{SIZE_TYPE} above for more
information.
If you don't define this macro, the default is @code{"unsigned int"}.
+@end defmac
-@findex INTMAX_TYPE
-@item INTMAX_TYPE
+@defmac INTMAX_TYPE
A C expression for a string describing the name of the data type that
can represent any value of any standard or extended signed integer type.
The typedef name @code{intmax_t} is defined using the contents of the
@@ -1702,9 +1696,9 @@ string. See @code{SIZE_TYPE} above for more information.
If you don't define this macro, the default is the first of
@code{"int"}, @code{"long int"}, or @code{"long long int"} that has as
much precision as @code{long long int}.
+@end defmac
-@findex UINTMAX_TYPE
-@item UINTMAX_TYPE
+@defmac UINTMAX_TYPE
A C expression for a string describing the name of the data type that
can represent any value of any standard or extended unsigned integer
type. The typedef name @code{uintmax_t} is defined using the contents
@@ -1714,9 +1708,9 @@ If you don't define this macro, the default is the first of
@code{"unsigned int"}, @code{"long unsigned int"}, or @code{"long long
unsigned int"} that has as much precision as @code{long long unsigned
int}.
+@end defmac
-@findex TARGET_PTRMEMFUNC_VBIT_LOCATION
-@item TARGET_PTRMEMFUNC_VBIT_LOCATION
+@defmac TARGET_PTRMEMFUNC_VBIT_LOCATION
The C++ compiler represents a pointer-to-member-function with a struct
that looks like:
@@ -1753,9 +1747,9 @@ In general, you should not have to define this macro. On architectures
in which function addresses are always even, according to
@code{FUNCTION_BOUNDARY}, GCC will automatically define this macro to
@code{ptrmemfunc_vbit_in_pfn}.
+@end defmac
-@findex TARGET_VTABLE_USES_DESCRIPTORS
-@item TARGET_VTABLE_USES_DESCRIPTORS
+@defmac TARGET_VTABLE_USES_DESCRIPTORS
Normally, the C++ compiler uses function pointers in vtables. This
macro allows the target to change to use ``function descriptors''
instead. Function descriptors are found on targets for whom a
@@ -1765,21 +1759,21 @@ pointer to which the function's data is relative.
If vtables are used, the value of this macro should be the number
of words that the function descriptor occupies.
+@end defmac
-@findex TARGET_VTABLE_ENTRY_ALIGN
-@item TARGET_VTABLE_ENTRY_ALIGN
+@defmac TARGET_VTABLE_ENTRY_ALIGN
By default, the vtable entries are void pointers, the so the alignment
is the same as pointer alignment. The value of this macro specifies
the alignment of the vtable entry in bits. It should be defined only
when special alignment is necessary. */
+@end defmac
-@findex TARGET_VTABLE_DATA_ENTRY_DISTANCE
-@item TARGET_VTABLE_DATA_ENTRY_DISTANCE
+@defmac TARGET_VTABLE_DATA_ENTRY_DISTANCE
There are a few non-descriptor entries in the vtable at offsets below
zero. If these entries must be padded (say, to preserve the alignment
specified by @code{TARGET_VTABLE_ENTRY_ALIGN}), set this to the number
of words in each data entry.
-@end table
+@end defmac
@node Escape Sequences
@section Target Character Escape Sequences
@@ -1787,38 +1781,30 @@ of words in each data entry.
By default, GCC assumes that the C character escape sequences take on
their ASCII values for the target. If this is not correct, you must
-explicitly define all of the macros below.
+explicitly define all of the macros below. All of them must evaluate
+to constants; they are used in @code{case} statements.
-@table @code
@findex TARGET_BELL
-@item TARGET_BELL
-A C constant expression for the integer value for escape sequence
-@samp{\a}.
-
+@findex TARGET_CR
@findex TARGET_ESC
-@item TARGET_ESC
-A C constant expression for the integer value of the target escape
-character. As an extension, GCC evaluates the escape sequences
-@samp{\e} and @samp{\E} to this.
-
-@findex TARGET_TAB
-@findex TARGET_BS
+@findex TARGET_FF
@findex TARGET_NEWLINE
-@item TARGET_BS
-@itemx TARGET_TAB
-@itemx TARGET_NEWLINE
-C constant expressions for the integer values for escape sequences
-@samp{\b}, @samp{\t} and @samp{\n}.
-
+@findex TARGET_TAB
@findex TARGET_VT
-@findex TARGET_FF
-@findex TARGET_CR
-@item TARGET_VT
-@itemx TARGET_FF
-@itemx TARGET_CR
-C constant expressions for the integer values for escape sequences
-@samp{\v}, @samp{\f} and @samp{\r}.
-@end table
+@multitable {@code{TARGET_NEWLINE}} {Escape} {ASCII character}
+@item Macro @tab Escape @tab ASCII character
+@item @code{TARGET_BELL} @tab @kbd{\a} @tab @code{07}, @code{BEL}
+@item @code{TARGET_CR} @tab @kbd{\r} @tab @code{0D}, @code{CR}
+@item @code{TARGET_ESC} @tab @kbd{\e}, @kbd{\E} @tab @code{1B}, @code{ESC}
+@item @code{TARGET_FF} @tab @kbd{\f} @tab @code{0C}, @code{FF}
+@item @code{TARGET_NEWLINE} @tab @kbd{\n} @tab @code{0A}, @code{LF}
+@item @code{TARGET_TAB} @tab @kbd{\t} @tab @code{09}, @code{HT}
+@item @code{TARGET_VT} @tab @kbd{\v} @tab @code{0B}, @code{VT}
+@end multitable
+
+@noindent
+Note that the @kbd{\e} and @kbd{\E} escapes are GNU extensions, not
+part of the C standard.
@node Registers
@section Register Usage
@@ -1847,16 +1833,14 @@ For returning values in registers, see @ref{Scalar Return}.
@c prevent bad page break with this line
Registers have various characteristics.
-@table @code
-@findex FIRST_PSEUDO_REGISTER
-@item FIRST_PSEUDO_REGISTER
+@defmac FIRST_PSEUDO_REGISTER
Number of hardware registers known to the compiler. They receive
numbers 0 through @code{FIRST_PSEUDO_REGISTER-1}; thus, the first
pseudo register's number really is assigned the number
@code{FIRST_PSEUDO_REGISTER}.
+@end defmac
-@item FIXED_REGISTERS
-@findex FIXED_REGISTERS
+@defmac FIXED_REGISTERS
@cindex fixed register
An initializer that says which registers are used for fixed purposes
all throughout the compiled code and are therefore not available for
@@ -1875,9 +1859,9 @@ the following one, may be overridden at run time either automatically,
by the actions of the macro @code{CONDITIONAL_REGISTER_USAGE}, or by
the user with the command options @option{-ffixed-@var{reg}},
@option{-fcall-used-@var{reg}} and @option{-fcall-saved-@var{reg}}.
+@end defmac
-@findex CALL_USED_REGISTERS
-@item CALL_USED_REGISTERS
+@defmac CALL_USED_REGISTERS
@cindex call-used register
@cindex call-clobbered register
@cindex call-saved register
@@ -1890,9 +1874,9 @@ function calls.
If a register has 0 in @code{CALL_USED_REGISTERS}, the compiler
automatically saves it on function entry and restores it on function
exit, if the register is used within the function.
+@end defmac
-@findex CALL_REALLY_USED_REGISTERS
-@item CALL_REALLY_USED_REGISTERS
+@defmac CALL_REALLY_USED_REGISTERS
@cindex call-used register
@cindex call-clobbered register
@cindex call-saved register
@@ -1901,9 +1885,9 @@ that the entire set of @code{FIXED_REGISTERS} be included.
(@code{CALL_USED_REGISTERS} must be a superset of @code{FIXED_REGISTERS}).
This macro is optional. If not specified, it defaults to the value
of @code{CALL_USED_REGISTERS}.
+@end defmac
-@findex HARD_REGNO_CALL_PART_CLOBBERED
-@item HARD_REGNO_CALL_PART_CLOBBERED (@var{regno}, @var{mode})
+@defmac HARD_REGNO_CALL_PART_CLOBBERED (@var{regno}, @var{mode})
@cindex call-used register
@cindex call-clobbered register
@cindex call-saved register
@@ -1912,11 +1896,14 @@ value of mode @var{mode} in hard register number @var{regno} across a
call without some part of it being clobbered. For most machines this
macro need not be defined. It is only required for machines that do not
preserve the entire contents of a register across a call.
+@end defmac
-@findex CONDITIONAL_REGISTER_USAGE
@findex fixed_regs
@findex call_used_regs
-@item CONDITIONAL_REGISTER_USAGE
+@findex global_regs
+@findex reg_names
+@findex reg_class_contents
+@defmac CONDITIONAL_REGISTER_USAGE
Zero or more C statements that may conditionally modify five variables
@code{fixed_regs}, @code{call_used_regs}, @code{global_regs},
@code{reg_names}, and @code{reg_class_contents}, to take into account
@@ -1948,46 +1935,44 @@ is called with a letter for a class that shouldn't be used.
of the insn patterns whose constraints permit this class are
controlled by target switches, then GCC will automatically avoid using
these registers when the target switches are opposed to them.)
+@end defmac
-@findex NON_SAVING_SETJMP
-@item NON_SAVING_SETJMP
+@defmac NON_SAVING_SETJMP
If this macro is defined and has a nonzero value, it means that
@code{setjmp} and related functions fail to save the registers, or that
@code{longjmp} fails to restore them. To compensate, the compiler
avoids putting variables in registers in functions that use
@code{setjmp}.
+@end defmac
-@findex INCOMING_REGNO
-@item INCOMING_REGNO (@var{out})
+@defmac INCOMING_REGNO (@var{out})
Define this macro if the target machine has register windows. This C
expression returns the register number as seen by the called function
corresponding to the register number @var{out} as seen by the calling
function. Return @var{out} if register number @var{out} is not an
outbound register.
+@end defmac
-@findex OUTGOING_REGNO
-@item OUTGOING_REGNO (@var{in})
+@defmac OUTGOING_REGNO (@var{in})
Define this macro if the target machine has register windows. This C
expression returns the register number as seen by the calling function
corresponding to the register number @var{in} as seen by the called
function. Return @var{in} if register number @var{in} is not an inbound
register.
+@end defmac
-@findex LOCAL_REGNO
-@item LOCAL_REGNO (@var{regno})
+@defmac LOCAL_REGNO (@var{regno})
Define this macro if the target machine has register windows. This C
expression returns true if the register is call-saved but is in the
register window. Unlike most call-saved registers, such registers
need not be explicitly restored on function exit or during non-local
gotos.
+@end defmac
-@ignore
-@findex PC_REGNUM
-@item PC_REGNUM
+@defmac PC_REGNUM
If the program counter has a register number, define this as that
register number. Otherwise, do not define it.
-@end ignore
-@end table
+@end defmac
@node Allocation Order
@subsection Order of Allocation of Registers
@@ -1997,9 +1982,7 @@ register number. Otherwise, do not define it.
@c prevent bad page break with this line
Registers are allocated in order.
-@table @code
-@findex REG_ALLOC_ORDER
-@item REG_ALLOC_ORDER
+@defmac REG_ALLOC_ORDER
If defined, an initializer for a vector of integers, containing the
numbers of hard registers in the order in which GCC should prefer
to use them (from most preferred to least).
@@ -2012,9 +1995,9 @@ registers must always be saved and the save-multiple-registers
instruction supports only sequences of consecutive registers. On such
machines, define @code{REG_ALLOC_ORDER} to be an initializer that lists
the highest numbered allocable register first.
+@end defmac
-@findex ORDER_REGS_FOR_LOCAL_ALLOC
-@item ORDER_REGS_FOR_LOCAL_ALLOC
+@defmac ORDER_REGS_FOR_LOCAL_ALLOC
A C statement (sans semicolon) to choose the order in which to allocate
hard registers for pseudo-registers local to a basic block.
@@ -2026,7 +2009,7 @@ The macro body should not assume anything about the contents of
@code{reg_alloc_order} before execution of the macro.
On most machines, it is not necessary to define this macro.
-@end table
+@end defmac
@node Values in Registers
@subsection How Values Fit in Registers
@@ -2035,9 +2018,7 @@ This section discusses the macros that describe which kinds of values
(specifically, which machine modes) each register can hold, and how many
consecutive registers are needed for a given mode.
-@table @code
-@findex HARD_REGNO_NREGS
-@item HARD_REGNO_NREGS (@var{regno}, @var{mode})
+@defmac HARD_REGNO_NREGS (@var{regno}, @var{mode})
A C expression for the number of consecutive hard registers, starting
at register number @var{regno}, required to hold a value of mode
@var{mode}.
@@ -2050,9 +2031,9 @@ definition of this macro is
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
/ UNITS_PER_WORD)
@end smallexample
+@end defmac
-@findex HARD_REGNO_MODE_OK
-@item HARD_REGNO_MODE_OK (@var{regno}, @var{mode})
+@defmac HARD_REGNO_MODE_OK (@var{regno}, @var{mode})
A C expression that is nonzero if it is permissible to store a value
of mode @var{mode} in hard register number @var{regno} (or in several
registers starting with that one). For a machine where all registers
@@ -2111,9 +2092,9 @@ so that it is better to store a value in a stack frame than in such a
register if floating point arithmetic is not being done. As long as the
floating registers are not in class @code{GENERAL_REGS}, they will not
be used unless some pattern's constraint asks for one.
+@end defmac
-@findex MODES_TIEABLE_P
-@item MODES_TIEABLE_P (@var{mode1}, @var{mode2})
+@defmac MODES_TIEABLE_P (@var{mode1}, @var{mode2})
A C expression that is nonzero if a value of mode
@var{mode1} is accessible in mode @var{mode2} without copying.
@@ -2127,13 +2108,13 @@ accessibility of the value in a narrower mode.
You should define this macro to return nonzero in as many cases as
possible since doing so will allow GCC to perform better register
allocation.
+@end defmac
-@findex AVOID_CCMODE_COPIES
-@item AVOID_CCMODE_COPIES
+@defmac AVOID_CCMODE_COPIES
Define this macro if the compiler should avoid copies to/from @code{CCmode}
registers. You should only define this macro if support for copying to/from
@code{CCmode} is incomplete.
-@end table
+@end defmac
@node Leaf Functions
@subsection Handling Leaf Functions
@@ -2158,9 +2139,7 @@ suitable for leaf function treatment. So it needs to renumber the
registers in order to output a leaf function. The following macros
accomplish this.
-@table @code
-@findex LEAF_REGISTERS
-@item LEAF_REGISTERS
+@defmac LEAF_REGISTERS
Name of a char vector, indexed by hard register number, which
contains 1 for a register that is allowable in a candidate for leaf
function treatment.
@@ -2173,9 +2152,9 @@ in this vector.
Define this macro only if the target machine offers a way to optimize
the treatment of leaf functions.
+@end defmac
-@findex LEAF_REG_REMAP
-@item LEAF_REG_REMAP (@var{regno})
+@defmac LEAF_REG_REMAP (@var{regno})
A C expression whose value is the register number to which @var{regno}
should be renumbered, when a function is treated as a leaf function.
@@ -2186,7 +2165,7 @@ will cause the compiler to abort.
Define this macro only if the target machine offers a way to optimize the
treatment of leaf functions, and registers need to be renumbered to do
this.
-@end table
+@end defmac
@findex current_function_is_leaf
@findex current_function_uses_only_leaf_regs
@@ -2207,28 +2186,31 @@ only useful if @code{LEAF_REGISTERS} is defined.
@subsection Registers That Form a Stack
There are special features to handle computers where some of the
-``registers'' form a stack, as in the 80387 coprocessor for the 80386.
-Stack registers are normally written by pushing onto the stack, and are
-numbered relative to the top of the stack.
+``registers'' form a stack. Stack registers are normally written by
+pushing onto the stack, and are numbered relative to the top of the
+stack.
Currently, GCC can only handle one group of stack-like registers, and
-they must be consecutively numbered.
-
-@table @code
-@findex STACK_REGS
-@item STACK_REGS
+they must be consecutively numbered. Furthermore, the existing
+support for stack-like registers is specific to the 80387 floating
+point coprocessor. If you have a new architecture that uses
+stack-like registers, you will need to do substantial work on
+@file{reg-stack.c} and write your machine description to cooperate
+with it, as well as defining these macros.
+
+@defmac STACK_REGS
Define this if the machine has any stack-like registers.
+@end defmac
-@findex FIRST_STACK_REG
-@item FIRST_STACK_REG
+@defmac FIRST_STACK_REG
The number of the first stack-like register. This one is the top
of the stack.
+@end defmac
-@findex LAST_STACK_REG
-@item LAST_STACK_REG
+@defmac LAST_STACK_REG
The number of the last stack-like register. This one is the bottom of
the stack.
-@end table
+@end defmac
@node Register Classes
@section Register Classes
@@ -2293,9 +2275,7 @@ instruction must have a subclass consisting of registers from which
single-byte values can be loaded or stored. This is so that
@code{PREFERRED_RELOAD_CLASS} can always have a possible value to return.
-@table @code
-@findex enum reg_class
-@item enum reg_class
+@deftp {Data type} {enum reg_class}
An enumeral type that must be defined with all the register class names
as enumeral values. @code{NO_REGS} must be first. @code{ALL_REGS}
must be the last register class, followed by one more enumeral value,
@@ -2305,22 +2285,22 @@ tells how many classes there are.
Each register class has a number, which is the value of casting
the class name to type @code{int}. The number serves as an index
in many of the tables described below.
+@end deftp
-@findex N_REG_CLASSES
-@item N_REG_CLASSES
+@defmac N_REG_CLASSES
The number of distinct register classes, defined as follows:
@example
#define N_REG_CLASSES (int) LIM_REG_CLASSES
@end example
+@end defmac
-@findex REG_CLASS_NAMES
-@item REG_CLASS_NAMES
+@defmac REG_CLASS_NAMES
An initializer containing the names of the register classes as C string
constants. These names are used in writing some of the debugging dumps.
+@end defmac
-@findex REG_CLASS_CONTENTS
-@item REG_CLASS_CONTENTS
+@defmac REG_CLASS_CONTENTS
An initializer containing the contents of the register classes, as integers
which are bit masks. The @var{n}th integer specifies the contents of class
@var{n}. The way the integer @var{mask} is interpreted is that
@@ -2333,36 +2313,36 @@ for the type @code{HARD_REG_SET} which is defined in @file{hard-reg-set.h}.
In this situation, the first integer in each sub-initializer corresponds to
registers 0 through 31, the second integer to registers 32 through 63, and
so on.
+@end defmac
-@findex REGNO_REG_CLASS
-@item REGNO_REG_CLASS (@var{regno})
+@defmac REGNO_REG_CLASS (@var{regno})
A C expression whose value is a register class containing hard register
@var{regno}. In general there is more than one such class; choose a class
which is @dfn{minimal}, meaning that no smaller class also contains the
register.
+@end defmac
-@findex BASE_REG_CLASS
-@item BASE_REG_CLASS
+@defmac BASE_REG_CLASS
A macro whose definition is the name of the class to which a valid
base register must belong. A base register is one used in an address
which is the register value plus a displacement.
+@end defmac
-@findex MODE_BASE_REG_CLASS
-@item MODE_BASE_REG_CLASS (@var{mode})
+@defmac MODE_BASE_REG_CLASS (@var{mode})
This is a variation of the @code{BASE_REG_CLASS} macro which allows
the selection of a base register in a mode dependent manner. If
@var{mode} is VOIDmode then it should return the same value as
@code{BASE_REG_CLASS}.
+@end defmac
-@findex INDEX_REG_CLASS
-@item INDEX_REG_CLASS
+@defmac INDEX_REG_CLASS
A macro whose definition is the name of the class to which a valid
index register must belong. An index register is one used in an
address where its value is either multiplied by a scale factor or
added to another register (as well as added to a displacement).
+@end defmac
-@findex CONSTRAINT_LEN
-@item CONSTRAINT_LEN (@var{char}, @var{str})
+@defmac CONSTRAINT_LEN (@var{char}, @var{str})
For the constraint at the start of @var{str}, which starts with the letter
@var{c}, return the length. This allows you to have register class /
constant / extra constraints that are longer than a single letter;
@@ -2375,40 +2355,40 @@ for the md file, so you can also use this macro to help you while you are
transitioning from a byzantine single-letter-constraint scheme: when you
return a negative length for a constraint you want to re-use, genoutput
will complain about every instance where it is used in the md file.
+@end defmac
-@findex REG_CLASS_FROM_LETTER
-@item REG_CLASS_FROM_LETTER (@var{char})
+@defmac REG_CLASS_FROM_LETTER (@var{char})
A C expression which defines the machine-dependent operand constraint
letters for register classes. If @var{char} is such a letter, the
value should be the register class corresponding to it. Otherwise,
the value should be @code{NO_REGS}. The register letter @samp{r},
corresponding to class @code{GENERAL_REGS}, will not be passed
to this macro; you do not need to handle it.
+@end defmac
-@findex REG_CLASS_FROM_CONSTRAINT
-@item REG_CLASS_FROM_CONSTRAINT (@var{char}, @var{str})
+@defmac REG_CLASS_FROM_CONSTRAINT (@var{char}, @var{str})
Like @code{REG_CLASS_FROM_LETTER}, but you also get the constraint string
passed in @var{str}, so that you can use suffixes to distinguish between
different variants.
+@end defmac
-@findex REGNO_OK_FOR_BASE_P
-@item REGNO_OK_FOR_BASE_P (@var{num})
+@defmac REGNO_OK_FOR_BASE_P (@var{num})
A C expression which is nonzero if register number @var{num} is
suitable for use as a base register in operand addresses. It may be
either a suitable hard register or a pseudo register that has been
allocated such a hard register.
+@end defmac
-@findex REGNO_MODE_OK_FOR_BASE_P
-@item REGNO_MODE_OK_FOR_BASE_P (@var{num}, @var{mode})
+@defmac REGNO_MODE_OK_FOR_BASE_P (@var{num}, @var{mode})
A C expression that is just like @code{REGNO_OK_FOR_BASE_P}, except that
that expression may examine the mode of the memory reference in
@var{mode}. You should define this macro if the mode of the memory
reference affects whether a register may be used as a base register. If
you define this macro, the compiler will use it instead of
@code{REGNO_OK_FOR_BASE_P}.
+@end defmac
-@findex REGNO_OK_FOR_INDEX_P
-@item REGNO_OK_FOR_INDEX_P (@var{num})
+@defmac REGNO_OK_FOR_INDEX_P (@var{num})
A C expression which is nonzero if register number @var{num} is
suitable for use as an index register in operand addresses. It may be
either a suitable hard register or a pseudo register that has been
@@ -2422,9 +2402,9 @@ labeling is used must fit the machine's constraints of which registers
may serve in each capacity. The compiler will try both labelings,
looking for one that is valid, and will reload one or both registers
only if neither labeling works.
+@end defmac
-@findex PREFERRED_RELOAD_CLASS
-@item PREFERRED_RELOAD_CLASS (@var{x}, @var{class})
+@defmac PREFERRED_RELOAD_CLASS (@var{x}, @var{class})
A C expression that places additional restrictions on the register class
to use when it is necessary to copy value @var{x} into a register in class
@var{class}. The value is a register class; perhaps @var{class}, or perhaps
@@ -2445,15 +2425,15 @@ If @var{x} is a @code{const_double}, by returning @code{NO_REGS}
you can force @var{x} into a memory constant. This is useful on
certain machines where immediate floating values cannot be loaded into
certain kinds of registers.
+@end defmac
-@findex PREFERRED_OUTPUT_RELOAD_CLASS
-@item PREFERRED_OUTPUT_RELOAD_CLASS (@var{x}, @var{class})
+@defmac PREFERRED_OUTPUT_RELOAD_CLASS (@var{x}, @var{class})
Like @code{PREFERRED_RELOAD_CLASS}, but for output reloads instead of
input reloads. If you don't define this macro, the default is to use
@var{class}, unchanged.
+@end defmac
-@findex LIMIT_RELOAD_CLASS
-@item LIMIT_RELOAD_CLASS (@var{mode}, @var{class})
+@defmac LIMIT_RELOAD_CLASS (@var{mode}, @var{class})
A C expression that places additional restrictions on the register class
to use when it is necessary to be able to hold a value of mode
@var{mode} in a reload register for which class @var{class} would
@@ -2467,13 +2447,11 @@ smaller class.
Don't define this macro unless the target machine has limitations which
require the macro to do something nontrivial.
+@end defmac
-@findex SECONDARY_RELOAD_CLASS
-@findex SECONDARY_INPUT_RELOAD_CLASS
-@findex SECONDARY_OUTPUT_RELOAD_CLASS
-@item SECONDARY_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
-@itemx SECONDARY_INPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
-@itemx SECONDARY_OUTPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
+@defmac SECONDARY_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
+@defmacx SECONDARY_INPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
+@defmacx SECONDARY_OUTPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
Many machines have some registers that cannot be copied directly to or
from memory or even from other types of registers. An example is the
@samp{MQ} register, which on most machines, can only be copied to or
@@ -2532,9 +2510,9 @@ would not be helpful. Instead, a stack location must be used to perform
the copy and the @code{mov@var{m}} pattern should use memory as an
intermediate storage. This case often occurs between floating-point and
general registers.
+@end defmac
-@findex SECONDARY_MEMORY_NEEDED
-@item SECONDARY_MEMORY_NEEDED (@var{class1}, @var{class2}, @var{m})
+@defmac SECONDARY_MEMORY_NEEDED (@var{class1}, @var{class2}, @var{m})
Certain machines have the property that some registers cannot be copied
to some other registers without using memory. Define this macro on
those machines to be a C expression that is nonzero if objects of mode
@@ -2543,9 +2521,9 @@ class @var{class2} by storing a register of @var{class1} into memory
and loading that memory location into a register of @var{class2}.
Do not define this macro if its value would always be zero.
+@end defmac
-@findex SECONDARY_MEMORY_NEEDED_RTX
-@item SECONDARY_MEMORY_NEEDED_RTX (@var{mode})
+@defmac SECONDARY_MEMORY_NEEDED_RTX (@var{mode})
Normally when @code{SECONDARY_MEMORY_NEEDED} is defined, the compiler
allocates a stack slot for a memory location needed for register copies.
If this macro is defined, the compiler instead uses the memory location
@@ -2553,9 +2531,9 @@ defined by this macro.
Do not define this macro if you do not define
@code{SECONDARY_MEMORY_NEEDED}.
+@end defmac
-@findex SECONDARY_MEMORY_NEEDED_MODE
-@item SECONDARY_MEMORY_NEEDED_MODE (@var{mode})
+@defmac SECONDARY_MEMORY_NEEDED_MODE (@var{mode})
When the compiler needs a secondary memory location to copy between two
registers of mode @var{mode}, it normally allocates sufficient memory to
hold a quantity of @code{BITS_PER_WORD} bits and performs the store and
@@ -2577,9 +2555,9 @@ details.
Do not define this macro if you do not define
@code{SECONDARY_MEMORY_NEEDED} or if widening @var{mode} to a mode that
is @code{BITS_PER_WORD} bits wide is correct for your machine.
+@end defmac
-@findex SMALL_REGISTER_CLASSES
-@item SMALL_REGISTER_CLASSES
+@defmac SMALL_REGISTER_CLASSES
On some machines, it is risky to let hard registers live across arbitrary
insns. Typically, these machines have instructions that require values
to be in specific registers (like an accumulator), and reload will fail
@@ -2596,9 +2574,9 @@ that can be performed in some cases. If you do not define this macro
with a nonzero value when it is required, the compiler will run out of
spill registers and print a fatal error message. For most machines, you
should not define this macro at all.
+@end defmac
-@findex CLASS_LIKELY_SPILLED_P
-@item CLASS_LIKELY_SPILLED_P (@var{class})
+@defmac CLASS_LIKELY_SPILLED_P (@var{class})
A C expression whose value is nonzero if pseudos that have been assigned
to registers of class @var{class} would likely be spilled because
registers of @var{class} are needed for spill registers.
@@ -2614,9 +2592,9 @@ register. If there would not be another register available for
reallocation, you should not change the definition of this macro since
the only effect of such a definition would be to slow down register
allocation.
+@end defmac
-@findex CLASS_MAX_NREGS
-@item CLASS_MAX_NREGS (@var{class}, @var{mode})
+@defmac CLASS_MAX_NREGS (@var{class}, @var{mode})
A C expression for the maximum number of consecutive registers
of class @var{class} needed to hold a value of mode @var{mode}.
@@ -2627,8 +2605,9 @@ should be the maximum value of @code{HARD_REGNO_NREGS (@var{regno},
This macro helps control the handling of multiple-word values
in the reload pass.
+@end defmac
-@item CANNOT_CHANGE_MODE_CLASS(@var{from}, @var{to}, @var{class})
+@defmac CANNOT_CHANGE_MODE_CLASS (@var{from}, @var{to}, @var{class})
If defined, a C expression that returns nonzero for a @var{class} for which
a change from mode @var{from} to mode @var{to} is invalid.
@@ -2644,14 +2623,12 @@ as below:
(GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \
? reg_classes_intersect_p (FLOAT_REGS, (CLASS)) : 0)
@end example
-@end table
+@end defmac
Three other special macros describe which operands fit which constraint
letters.
-@table @code
-@findex CONST_OK_FOR_LETTER_P
-@item CONST_OK_FOR_LETTER_P (@var{value}, @var{c})
+@defmac CONST_OK_FOR_LETTER_P (@var{value}, @var{c})
A C expression that defines the machine-dependent operand constraint
letters (@samp{I}, @samp{J}, @samp{K}, @dots{} @samp{P}) that specify
particular ranges of integer values. If @var{c} is one of those
@@ -2659,15 +2636,15 @@ letters, the expression should check that @var{value}, an integer, is in
the appropriate range and return 1 if so, 0 otherwise. If @var{c} is
not one of those letters, the value should be 0 regardless of
@var{value}.
+@end defmac
-@findex CONST_OK_FOR_CONSTRAINT_P
-@item CONST_OK_FOR_CONSTRAINT_P (@var{value}, @var{c}, @var{str})
+@defmac CONST_OK_FOR_CONSTRAINT_P (@var{value}, @var{c}, @var{str})
Like @code{CONST_OK_FOR_LETTER_P}, but you also get the constraint
string passed in @var{str}, so that you can use suffixes to distinguish
between different variants.
+@end defmac
-@findex CONST_DOUBLE_OK_FOR_LETTER_P
-@item CONST_DOUBLE_OK_FOR_LETTER_P (@var{value}, @var{c})
+@defmac CONST_DOUBLE_OK_FOR_LETTER_P (@var{value}, @var{c})
A C expression that defines the machine-dependent operand constraint
letters that specify particular ranges of @code{const_double} values
(@samp{G} or @samp{H}).
@@ -2681,15 +2658,15 @@ letters, the value should be 0 regardless of @var{value}.
@code{DImode} fixed-point constants. A given letter can accept either
or both kinds of values. It can use @code{GET_MODE} to distinguish
between these kinds.
+@end defmac
-@findex CONST_DOUBLE_OK_FOR_CONSTRAINT_P
-@item CONST_DOUBLE_OK_FOR_CONSTRAINT_P (@var{value}, @var{c}, @var{str})
+@defmac CONST_DOUBLE_OK_FOR_CONSTRAINT_P (@var{value}, @var{c}, @var{str})
Like @code{CONST_DOUBLE_OK_FOR_LETTER_P}, but you also get the constraint
string passed in @var{str}, so that you can use suffixes to distinguish
between different variants.
+@end defmac
-@findex EXTRA_CONSTRAINT
-@item EXTRA_CONSTRAINT (@var{value}, @var{c})
+@defmac EXTRA_CONSTRAINT (@var{value}, @var{c})
A C expression that defines the optional machine-dependent constraint
letters that can be used to segregate specific types of operands, usually
memory references, for the target machine. Any letter that is not
@@ -2709,15 +2686,15 @@ letter @samp{Q} is defined as representing a memory address that does
a @samp{Q} constraint on the input and @samp{r} on the output. The next
alternative specifies @samp{m} on the input and a register class that
does not include r0 on the output.
+@end defmac
-@findex EXTRA_CONSTRAINT_STR
-@item EXTRA_CONSTRAINT_STR (@var{value}, @var{c}, @var{str})
+@defmac EXTRA_CONSTRAINT_STR (@var{value}, @var{c}, @var{str})
Like @code{EXTRA_CONSTRAINT}, but you also get the constraint string passed
in @var{str}, so that you can use suffixes to distinguish between different
variants.
+@end defmac
-@findex EXTRA_MEMORY_CONSTRAINT
-@item EXTRA_MEMORY_CONSTRAINT (@var{c}, @var{str})
+@defmac EXTRA_MEMORY_CONSTRAINT (@var{c}, @var{str})
A C expression that defines the optional machine-dependent constraint
letters, amongst those accepted by @code{EXTRA_CONSTRAINT}, that should
be treated like memory constraints by the reload pass.
@@ -2738,9 +2715,9 @@ a @samp{Q} constraint can handle any memory operand, because the
reload pass knows it can be reloaded by copying the memory address
into a base register if required. This is analogous to the way
a @samp{o} constraint can handle any memory operand.
+@end defmac
-@findex EXTRA_ADDRESS_CONSTRAINT
-@item EXTRA_ADDRESS_CONSTRAINT (@var{c}, @var{str})
+@defmac EXTRA_ADDRESS_CONSTRAINT (@var{c}, @var{str})
A C expression that defines the optional machine-dependent constraint
letters, amongst those accepted by @code{EXTRA_CONSTRAINT} /
@code{EXTRA_CONSTRAINT_STR}, that should
@@ -2756,7 +2733,7 @@ type of @var{str}, by copying it into a base register.
Any constraint marked as @code{EXTRA_ADDRESS_CONSTRAINT} can only
be used with the @code{address_operand} predicate. It is treated
analogously to the @samp{p} constraint.
-@end table
+@end defmac
@node Stack and Calling
@section Stack Layout and Calling Conventions
@@ -2789,19 +2766,16 @@ This describes the stack layout and calling conventions.
@c prevent bad page break with this line
Here is the basic stack layout.
-@table @code
-@findex STACK_GROWS_DOWNWARD
-@item STACK_GROWS_DOWNWARD
+@defmac STACK_GROWS_DOWNWARD
Define this macro if pushing a word onto the stack moves the stack
pointer to a smaller address.
When we say, ``define this macro if @dots{},'' it means that the
compiler checks this macro only with @code{#ifdef} so the precise
definition used does not matter.
+@end defmac
-@findex STACK_PUSH_CODE
-@item STACK_PUSH_CODE
-
+@defmac STACK_PUSH_CODE
This macro defines the operation used when something is pushed
on the stack. In RTL, a push operation will be
@code{(set (mem (STACK_PUSH_CODE (reg sp))) @dots{})}
@@ -2815,19 +2789,19 @@ space for the next item on the stack.
The default is @code{PRE_DEC} when @code{STACK_GROWS_DOWNWARD} is
defined, which is almost always right, and @code{PRE_INC} otherwise,
which is often wrong.
+@end defmac
-@findex FRAME_GROWS_DOWNWARD
-@item FRAME_GROWS_DOWNWARD
+@defmac FRAME_GROWS_DOWNWARD
Define this macro if the addresses of local variable slots are at negative
offsets from the frame pointer.
+@end defmac
-@findex ARGS_GROW_DOWNWARD
-@item ARGS_GROW_DOWNWARD
+@defmac ARGS_GROW_DOWNWARD
Define this macro if successive arguments to a function occupy decreasing
addresses on the stack.
+@end defmac
-@findex STARTING_FRAME_OFFSET
-@item STARTING_FRAME_OFFSET
+@defmac STARTING_FRAME_OFFSET
Offset from the frame pointer to the first local variable slot to be allocated.
If @code{FRAME_GROWS_DOWNWARD}, find the next slot's offset by
@@ -2836,9 +2810,9 @@ Otherwise, it is found by adding the length of the first slot to the
value @code{STARTING_FRAME_OFFSET}.
@c i'm not sure if the above is still correct.. had to change it to get
@c rid of an overfull. --mew 2feb93
+@end defmac
-@findex STACK_ALIGNMENT_NEEDED
-@item STACK_ALIGNMENT_NEEDED
+@defmac STACK_ALIGNMENT_NEEDED
Define to zero to disable final alignment of the stack during reload.
The nonzero default for this macro is suitable for most ports.
@@ -2846,36 +2820,36 @@ On ports where @code{STARTING_FRAME_OFFSET} is nonzero or where there
is a register save block following the local block that doesn't require
alignment to @code{STACK_BOUNDARY}, it may be beneficial to disable
stack alignment and do it in the backend.
+@end defmac
-@findex STACK_POINTER_OFFSET
-@item STACK_POINTER_OFFSET
+@defmac STACK_POINTER_OFFSET
Offset from the stack pointer register to the first location at which
outgoing arguments are placed. If not specified, the default value of
zero is used. This is the proper value for most machines.
If @code{ARGS_GROW_DOWNWARD}, this is the offset to the location above
the first location at which outgoing arguments are placed.
+@end defmac
-@findex FIRST_PARM_OFFSET
-@item FIRST_PARM_OFFSET (@var{fundecl})
+@defmac FIRST_PARM_OFFSET (@var{fundecl})
Offset from the argument pointer register to the first argument's
address. On some machines it may depend on the data type of the
function.
If @code{ARGS_GROW_DOWNWARD}, this is the offset to the location above
the first argument's address.
+@end defmac
-@findex STACK_DYNAMIC_OFFSET
-@item STACK_DYNAMIC_OFFSET (@var{fundecl})
+@defmac STACK_DYNAMIC_OFFSET (@var{fundecl})
Offset from the stack pointer register to an item dynamically allocated
on the stack, e.g., by @code{alloca}.
The default value for this macro is @code{STACK_POINTER_OFFSET} plus the
length of the outgoing arguments. The default is correct for most
machines. See @file{function.c} for details.
+@end defmac
-@findex DYNAMIC_CHAIN_ADDRESS
-@item DYNAMIC_CHAIN_ADDRESS (@var{frameaddr})
+@defmac DYNAMIC_CHAIN_ADDRESS (@var{frameaddr})
A C expression whose value is RTL representing the address in a stack
frame where the pointer to the caller's frame is stored. Assume that
@var{frameaddr} is an RTL expression for the address of the stack frame
@@ -2884,25 +2858,25 @@ itself.
If you don't define this macro, the default is to return the value
of @var{frameaddr}---that is, the stack frame address is also the
address of the stack word that points to the previous frame.
+@end defmac
-@findex SETUP_FRAME_ADDRESSES
-@item SETUP_FRAME_ADDRESSES
+@defmac SETUP_FRAME_ADDRESSES
If defined, a C expression that produces the machine-specific code to
setup the stack so that arbitrary frames can be accessed. For example,
on the SPARC, we must flush all of the register windows to the stack
before we can access arbitrary stack frames. You will seldom need to
define this macro.
+@end defmac
-@findex BUILTIN_SETJMP_FRAME_VALUE
-@item BUILTIN_SETJMP_FRAME_VALUE
+@defmac BUILTIN_SETJMP_FRAME_VALUE
If defined, a C expression that contains an rtx that is used to store
the address of the current frame into the built in @code{setjmp} buffer.
The default value, @code{virtual_stack_vars_rtx}, is correct for most
machines. One reason you may need to define this macro is if
@code{hard_frame_pointer_rtx} is the appropriate value on your machine.
+@end defmac
-@findex RETURN_ADDR_RTX
-@item RETURN_ADDR_RTX (@var{count}, @var{frameaddr})
+@defmac RETURN_ADDR_RTX (@var{count}, @var{frameaddr})
A C expression whose value is RTL representing the value of the return
address for the frame @var{count} steps up from the current frame, after
the prologue. @var{frameaddr} is the frame pointer of the @var{count}
@@ -2912,14 +2886,14 @@ frame, or the frame pointer of the @var{count} @minus{} 1 frame if
The value of the expression must always be the correct address when
@var{count} is zero, but may be @code{NULL_RTX} if there is not way to
determine the return address of other frames.
+@end defmac
-@findex RETURN_ADDR_IN_PREVIOUS_FRAME
-@item RETURN_ADDR_IN_PREVIOUS_FRAME
+@defmac RETURN_ADDR_IN_PREVIOUS_FRAME
Define this if the return address of a particular stack frame is accessed
from the frame pointer of the previous stack frame.
+@end defmac
-@findex INCOMING_RETURN_ADDR_RTX
-@item INCOMING_RETURN_ADDR_RTX
+@defmac INCOMING_RETURN_ADDR_RTX
A C expression whose value is RTL representing the location of the
incoming return address at the beginning of any function, before the
prologue. This RTL is either a @code{REG}, indicating that the return
@@ -2931,9 +2905,9 @@ debugging information like that provided by DWARF 2.
If this RTL is a @code{REG}, you should also define
@code{DWARF_FRAME_RETURN_COLUMN} to @code{DWARF_FRAME_REGNUM (REGNO)}.
+@end defmac
-@findex INCOMING_FRAME_SP_OFFSET
-@item INCOMING_FRAME_SP_OFFSET
+@defmac INCOMING_FRAME_SP_OFFSET
A C expression whose value is an integer giving the offset, in bytes,
from the value of the stack pointer register to the top of the stack
frame at the beginning of any function, before the prologue. The top of
@@ -2942,9 +2916,9 @@ previous frame, just before the call instruction.
You only need to define this macro if you want to support call frame
debugging information like that provided by DWARF 2.
+@end defmac
-@findex ARG_POINTER_CFA_OFFSET
-@item ARG_POINTER_CFA_OFFSET (@var{fundecl})
+@defmac ARG_POINTER_CFA_OFFSET (@var{fundecl})
A C expression whose value is an integer giving the offset, in bytes,
from the argument pointer to the canonical frame address (cfa). The
final value should coincide with that calculated by
@@ -2960,21 +2934,19 @@ and rs6000, and so such targets need to define this macro.
You only need to define this macro if the default is incorrect, and you
want to support call frame debugging information like that provided by
DWARF 2.
+@end defmac
-@findex SMALL_STACK
-@item SMALL_STACK
+@defmac SMALL_STACK
Define this macro if the stack size for the target is very small. This
has the effect of disabling gcc's built-in @samp{alloca}, though
@samp{__builtin_alloca} is not affected.
-@end table
+@end defmac
@node Exception Handling
@subsection Exception Handling Support
@cindex exception handling
-@table @code
-@findex EH_RETURN_DATA_REGNO
-@item EH_RETURN_DATA_REGNO (@var{N})
+@defmac EH_RETURN_DATA_REGNO (@var{N})
A C expression whose value is the @var{N}th register number used for
data by exception handlers, or @code{INVALID_REGNUM} if fewer than
@var{N} registers are usable.
@@ -2987,9 +2959,9 @@ but may negatively impact code size. The target must support at least
You must define this macro if you want to support call frame exception
handling like that provided by DWARF 2.
+@end defmac
-@findex EH_RETURN_STACKADJ_RTX
-@item EH_RETURN_STACKADJ_RTX
+@defmac EH_RETURN_STACKADJ_RTX
A C expression whose value is RTL representing a location in which
to store a stack adjustment to be applied before function return.
This is used to unwind the stack to an exception handler's call frame.
@@ -3004,9 +2976,9 @@ this case, the exception handling library routines will update the
stack location to be restored in place. Otherwise, you must define
this macro if you want to support call frame exception handling like
that provided by DWARF 2.
+@end defmac
-@findex EH_RETURN_HANDLER_RTX
-@item EH_RETURN_HANDLER_RTX
+@defmac EH_RETURN_HANDLER_RTX
A C expression whose value is RTL representing a location in which
to store the address of an exception handler to which we should
return. It will not be assigned on code paths that return normally.
@@ -3025,9 +2997,9 @@ the @code{eh_return} instruction pattern should be used instead.
If you want to support call frame exception handling, you must
define either this macro or the @code{eh_return} instruction pattern.
+@end defmac
-@findex ASM_PREFERRED_EH_DATA_FORMAT
-@item ASM_PREFERRED_EH_DATA_FORMAT(@var{code}, @var{global})
+@defmac ASM_PREFERRED_EH_DATA_FORMAT (@var{code}, @var{global})
This macro chooses the encoding of pointers embedded in the exception
handling sections. If at all possible, this should be defined such
that the exception handling section will not require dynamic relocations,
@@ -3040,9 +3012,9 @@ as found in @file{dwarf2.h}.
If this macro is not defined, pointers will not be encoded but
represented directly.
+@end defmac
-@findex ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX
-@item ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(@var{file}, @var{encoding}, @var{size}, @var{addr}, @var{done})
+@defmac ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX (@var{file}, @var{encoding}, @var{size}, @var{addr}, @var{done})
This macro allows the target to emit whatever special magic is required
to represent the encoding chosen by @code{ASM_PREFERRED_EH_DATA_FORMAT}.
Generic code takes care of pc-relative and indirect encodings; this must
@@ -3052,9 +3024,9 @@ This is a C statement that branches to @var{done} if the format was
handled. @var{encoding} is the format chosen, @var{size} is the number
of bytes that the format occupies, @var{addr} is the @code{SYMBOL_REF}
to be emitted.
+@end defmac
-@findex MD_FALLBACK_FRAME_STATE_FOR
-@item MD_FALLBACK_FRAME_STATE_FOR(@var{context}, @var{fs}, @var{success})
+@defmac MD_FALLBACK_FRAME_STATE_FOR (@var{context}, @var{fs}, @var{success})
This macro allows the target to add cpu and operating system specific
code to the call-frame unwinder for use when there is no unwind data
available. The most common reason to implement this macro is to unwind
@@ -3068,7 +3040,10 @@ the stack pointer value. If the frame can be decoded, the register save
addresses should be updated in @var{fs} and the macro should branch to
@var{success}. If the frame cannot be decoded, the macro should do
nothing.
-@end table
+
+For proper signal handling in Java this macro is accompanied by
+@code{MAKE_THROW_FRAME}, defined in @file{libjava/include/*-signal.h} headers.
+@end defmac
@node Stack Checking
@subsection Specifying How Stack Checking is Done
@@ -3099,59 +3074,57 @@ If neither of the above are true, GCC will generate code to periodically
Normally, you will use the default values of these macros, so GCC
will use the third approach.
-@table @code
-@findex STACK_CHECK_BUILTIN
-@item STACK_CHECK_BUILTIN
+@defmac STACK_CHECK_BUILTIN
A nonzero value if stack checking is done by the configuration files in a
machine-dependent manner. You should define this macro if stack checking
is require by the ABI of your machine or if you would like to have to stack
checking in some more efficient way than GCC's portable approach.
The default value of this macro is zero.
+@end defmac
-@findex STACK_CHECK_PROBE_INTERVAL
-@item STACK_CHECK_PROBE_INTERVAL
+@defmac STACK_CHECK_PROBE_INTERVAL
An integer representing the interval at which GCC must generate stack
probe instructions. You will normally define this macro to be no larger
than the size of the ``guard pages'' at the end of a stack area. The
default value of 4096 is suitable for most systems.
+@end defmac
-@findex STACK_CHECK_PROBE_LOAD
-@item STACK_CHECK_PROBE_LOAD
+@defmac STACK_CHECK_PROBE_LOAD
A integer which is nonzero if GCC should perform the stack probe
as a load instruction and zero if GCC should use a store instruction.
The default is zero, which is the most efficient choice on most systems.
+@end defmac
-@findex STACK_CHECK_PROTECT
-@item STACK_CHECK_PROTECT
+@defmac STACK_CHECK_PROTECT
The number of bytes of stack needed to recover from a stack overflow,
for languages where such a recovery is supported. The default value of
75 words should be adequate for most machines.
+@end defmac
-@findex STACK_CHECK_MAX_FRAME_SIZE
-@item STACK_CHECK_MAX_FRAME_SIZE
+@defmac STACK_CHECK_MAX_FRAME_SIZE
The maximum size of a stack frame, in bytes. GCC will generate probe
instructions in non-leaf functions to ensure at least this many bytes of
stack are available. If a stack frame is larger than this size, stack
checking will not be reliable and GCC will issue a warning. The
default is chosen so that GCC only generates one instruction on most
systems. You should normally not change the default value of this macro.
+@end defmac
-@findex STACK_CHECK_FIXED_FRAME_SIZE
-@item STACK_CHECK_FIXED_FRAME_SIZE
+@defmac STACK_CHECK_FIXED_FRAME_SIZE
GCC uses this value to generate the above warning message. It
represents the amount of fixed frame used by a function, not including
space for any callee-saved registers, temporaries and user variables.
You need only specify an upper bound for this amount and will normally
use the default of four words.
+@end defmac
-@findex STACK_CHECK_MAX_VAR_SIZE
-@item STACK_CHECK_MAX_VAR_SIZE
+@defmac STACK_CHECK_MAX_VAR_SIZE
The maximum size, in bytes, of an object that GCC will place in the
fixed area of the stack frame when the user specifies
@option{-fstack-check}.
GCC computed the default from the values of the above macros and you will
normally not need to override that default.
-@end table
+@end defmac
@need 2000
@node Frame Registers
@@ -3160,22 +3133,20 @@ normally not need to override that default.
@c prevent bad page break with this line
This discusses registers that address the stack frame.
-@table @code
-@findex STACK_POINTER_REGNUM
-@item STACK_POINTER_REGNUM
+@defmac STACK_POINTER_REGNUM
The register number of the stack pointer register, which must also be a
fixed register according to @code{FIXED_REGISTERS}. On most machines,
the hardware determines which register this is.
+@end defmac
-@findex FRAME_POINTER_REGNUM
-@item FRAME_POINTER_REGNUM
+@defmac FRAME_POINTER_REGNUM
The register number of the frame pointer register, which is used to
access automatic variables in the stack frame. On some machines, the
hardware determines which register this is. On other machines, you can
choose any register you wish for this purpose.
+@end defmac
-@findex HARD_FRAME_POINTER_REGNUM
-@item HARD_FRAME_POINTER_REGNUM
+@defmac HARD_FRAME_POINTER_REGNUM
On some machines the offset between the frame pointer and starting
offset of the automatic variables is not known until after register
allocation has been done (for example, because the saved registers are
@@ -3195,9 +3166,9 @@ or @code{STACK_POINTER_REGNUM}.
Do not define this macro if it would be the same as
@code{FRAME_POINTER_REGNUM}.
+@end defmac
-@findex ARG_POINTER_REGNUM
-@item ARG_POINTER_REGNUM
+@defmac ARG_POINTER_REGNUM
The register number of the arg pointer register, which is used to access
the function's argument list. On some machines, this is the same as the
frame pointer register. On some machines, the hardware determines which
@@ -3206,9 +3177,9 @@ wish for this purpose. If this is not the same register as the frame
pointer register, then you must mark it as a fixed register according to
@code{FIXED_REGISTERS}, or arrange to be able to eliminate it
(@pxref{Elimination}).
+@end defmac
-@findex RETURN_ADDRESS_POINTER_REGNUM
-@item RETURN_ADDRESS_POINTER_REGNUM
+@defmac RETURN_ADDRESS_POINTER_REGNUM
The register number of the return address pointer register, which is used to
access the current function's return address from the stack. On some
machines, the return address is not at a fixed offset from the frame
@@ -3218,11 +3189,10 @@ to point to the return address on the stack, and then be converted by
Do not define this macro unless there is no other way to get the return
address from the stack.
+@end defmac
-@findex STATIC_CHAIN_REGNUM
-@findex STATIC_CHAIN_INCOMING_REGNUM
-@item STATIC_CHAIN_REGNUM
-@itemx STATIC_CHAIN_INCOMING_REGNUM
+@defmac STATIC_CHAIN_REGNUM
+@defmacx STATIC_CHAIN_INCOMING_REGNUM
Register numbers used for passing a function's static chain pointer. If
register windows are used, the register number as seen by the called
function is @code{STATIC_CHAIN_INCOMING_REGNUM}, while the register
@@ -3234,11 +3204,10 @@ The static chain register need not be a fixed register.
If the static chain is passed in memory, these macros should not be
defined; instead, the next two macros should be defined.
+@end defmac
-@findex STATIC_CHAIN
-@findex STATIC_CHAIN_INCOMING
-@item STATIC_CHAIN
-@itemx STATIC_CHAIN_INCOMING
+@defmac STATIC_CHAIN
+@defmacx STATIC_CHAIN_INCOMING
If the static chain is passed in memory, these macros provide rtx giving
@code{mem} expressions that denote where they are stored.
@code{STATIC_CHAIN} and @code{STATIC_CHAIN_INCOMING} give the locations
@@ -3255,9 +3224,9 @@ macros and should be used to refer to those items.
If the static chain is passed in a register, the two previous macros should
be defined instead.
+@end defmac
-@findex DWARF_FRAME_REGISTERS
-@item DWARF_FRAME_REGISTERS
+@defmac DWARF_FRAME_REGISTERS
This macro specifies the maximum number of hard registers that can be
saved in a call frame. This is used to size data structures used in
DWARF2 exception handling.
@@ -3272,18 +3241,18 @@ registers that are not call-saved.
If this macro is not defined, it defaults to
@code{FIRST_PSEUDO_REGISTER}.
+@end defmac
-@findex PRE_GCC3_DWARF_FRAME_REGISTERS
-@item PRE_GCC3_DWARF_FRAME_REGISTERS
+@defmac PRE_GCC3_DWARF_FRAME_REGISTERS
This macro is similar to @code{DWARF_FRAME_REGISTERS}, but is provided
for backward compatibility in pre GCC 3.0 compiled code.
If this macro is not defined, it defaults to
@code{DWARF_FRAME_REGISTERS}.
+@end defmac
-@findex DWARF_REG_TO_UNWIND_COLUMN
-@item DWARF_REG_TO_UNWIND_COLUMN (@var{regno})
+@defmac DWARF_REG_TO_UNWIND_COLUMN (@var{regno})
Define this macro if the target's representation for dwarf registers
is different than the internal representation for unwind column.
@@ -3291,8 +3260,7 @@ Given a dwarf register, this macro should return the interal unwind
column number to use instead.
See the PowerPC's SPE target for an example.
-
-@end table
+@end defmac
@node Elimination
@subsection Eliminating Frame Pointer and Arg Pointer
@@ -3300,9 +3268,7 @@ See the PowerPC's SPE target for an example.
@c prevent bad page break with this line
This is about eliminating the frame pointer and arg pointer.
-@table @code
-@findex FRAME_POINTER_REQUIRED
-@item FRAME_POINTER_REQUIRED
+@defmac FRAME_POINTER_REQUIRED
A C expression which is nonzero if a function must have and use a frame
pointer. This expression is evaluated in the reload pass. If its value is
nonzero the function will have a frame pointer.
@@ -3322,10 +3288,10 @@ them.
In a function that does not require a frame pointer, the frame pointer
register can be allocated for ordinary usage, unless you mark it as a
fixed register. See @code{FIXED_REGISTERS} for more information.
+@end defmac
-@findex INITIAL_FRAME_POINTER_OFFSET
@findex get_frame_size
-@item INITIAL_FRAME_POINTER_OFFSET (@var{depth-var})
+@defmac INITIAL_FRAME_POINTER_OFFSET (@var{depth-var})
A C statement to store in the variable @var{depth-var} the difference
between the frame pointer and the stack pointer values immediately after
the function prologue. The value would be computed from information
@@ -3336,9 +3302,9 @@ If @code{ELIMINABLE_REGS} is defined, this macro will be not be used and
need not be defined. Otherwise, it must be defined even if
@code{FRAME_POINTER_REQUIRED} is defined to always be true; in that
case, you may set @var{depth-var} to anything.
+@end defmac
-@findex ELIMINABLE_REGS
-@item ELIMINABLE_REGS
+@defmac ELIMINABLE_REGS
If defined, this macro specifies a table of register pairs used to
eliminate unneeded registers that point into the stack frame. If it is not
defined, the only elimination attempted by the compiler is to replace
@@ -3363,23 +3329,23 @@ In this case, you might specify:
Note that the elimination of the argument pointer with the stack pointer is
specified first since that is the preferred elimination.
+@end defmac
-@findex CAN_ELIMINATE
-@item CAN_ELIMINATE (@var{from-reg}, @var{to-reg})
+@defmac CAN_ELIMINATE (@var{from-reg}, @var{to-reg})
A C expression that returns nonzero if the compiler is allowed to try
to replace register number @var{from-reg} with register number
@var{to-reg}. This macro need only be defined if @code{ELIMINABLE_REGS}
is defined, and will usually be the constant 1, since most of the cases
preventing register elimination are things that the compiler already
knows about.
+@end defmac
-@findex INITIAL_ELIMINATION_OFFSET
-@item INITIAL_ELIMINATION_OFFSET (@var{from-reg}, @var{to-reg}, @var{offset-var})
+@defmac INITIAL_ELIMINATION_OFFSET (@var{from-reg}, @var{to-reg}, @var{offset-var})
This macro is similar to @code{INITIAL_FRAME_POINTER_OFFSET}. It
specifies the initial difference between the specified pair of
registers. This macro must be defined if @code{ELIMINABLE_REGS} is
defined.
-@end table
+@end defmac
@node Stack Arguments
@subsection Passing Function Arguments on the Stack
@@ -3390,27 +3356,25 @@ The macros in this section control how arguments are passed
on the stack. See the following section for other macros that
control passing certain arguments in registers.
-@table @code
-@findex PROMOTE_PROTOTYPES
-@item PROMOTE_PROTOTYPES
+@defmac PROMOTE_PROTOTYPES
A C expression whose value is nonzero if an argument declared in
a prototype as an integral type smaller than @code{int} should
actually be passed as an @code{int}. In addition to avoiding
errors in certain cases of mismatch, it also makes for better
code on certain machines. If the macro is not defined in target
header files, it defaults to 0.
+@end defmac
-@findex PUSH_ARGS
-@item PUSH_ARGS
+@defmac PUSH_ARGS
A C expression. If nonzero, push insns will be used to pass
outgoing arguments.
If the target machine does not have a push instruction, set it to zero.
That directs GCC to use an alternate strategy: to
allocate the entire argument block and then store the arguments into
it. When @code{PUSH_ARGS} is nonzero, @code{PUSH_ROUNDING} must be defined too.
+@end defmac
-@findex PUSH_ROUNDING
-@item PUSH_ROUNDING (@var{npushed})
+@defmac PUSH_ROUNDING (@var{npushed})
A C expression that is the number of bytes actually pushed onto the
stack when an instruction attempts to push @var{npushed} bytes.
@@ -3428,10 +3392,10 @@ alignment. Then the definition should be
@example
#define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
@end example
+@end defmac
-@findex ACCUMULATE_OUTGOING_ARGS
@findex current_function_outgoing_args_size
-@item ACCUMULATE_OUTGOING_ARGS
+@defmac ACCUMULATE_OUTGOING_ARGS
A C expression. If nonzero, the maximum amount of space required for outgoing arguments
will be computed and placed into the variable
@code{current_function_outgoing_args_size}. No space will be pushed
@@ -3440,9 +3404,9 @@ increase the stack frame size by this amount.
Setting both @code{PUSH_ARGS} and @code{ACCUMULATE_OUTGOING_ARGS}
is not proper.
+@end defmac
-@findex REG_PARM_STACK_SPACE
-@item REG_PARM_STACK_SPACE (@var{fndecl})
+@defmac REG_PARM_STACK_SPACE (@var{fndecl})
Define this macro if functions should assume that stack space has been
allocated for arguments even when their values are passed in
registers.
@@ -3454,13 +3418,12 @@ which can be zero if GCC is calling a library function.
This space can be allocated by the caller, or be a part of the
machine-dependent stack frame: @code{OUTGOING_REG_PARM_STACK_SPACE} says
which.
+@end defmac
@c above is overfull. not sure what to do. --mew 5feb93 did
@c something, not sure if it looks good. --mew 10feb93
-@findex MAYBE_REG_PARM_STACK_SPACE
-@findex FINAL_REG_PARM_STACK_SPACE
-@item MAYBE_REG_PARM_STACK_SPACE
-@itemx FINAL_REG_PARM_STACK_SPACE (@var{const_size}, @var{var_size})
+@defmac MAYBE_REG_PARM_STACK_SPACE
+@defmacx FINAL_REG_PARM_STACK_SPACE (@var{const_size}, @var{var_size})
Define these macros in addition to the one above if functions might
allocate stack space for arguments even when their values are passed
in registers. These should be used when the stack space allocated
@@ -3484,18 +3447,18 @@ In each case this value can be easily computed.
When deciding whether a called function needs such stack space, and how
much space to reserve, GCC uses these two macros instead of
@code{REG_PARM_STACK_SPACE}.
+@end defmac
-@findex OUTGOING_REG_PARM_STACK_SPACE
-@item OUTGOING_REG_PARM_STACK_SPACE
+@defmac OUTGOING_REG_PARM_STACK_SPACE
Define this if it is the responsibility of the caller to allocate the area
reserved for arguments passed in registers.
If @code{ACCUMULATE_OUTGOING_ARGS} is defined, this macro controls
whether the space for these arguments counts in the value of
@code{current_function_outgoing_args_size}.
+@end defmac
-@findex STACK_PARMS_IN_REG_PARM_AREA
-@item STACK_PARMS_IN_REG_PARM_AREA
+@defmac STACK_PARMS_IN_REG_PARM_AREA
Define this macro if @code{REG_PARM_STACK_SPACE} is defined, but the
stack parameters don't skip the area specified by it.
@c i changed this, makes more sens and it should have taken care of the
@@ -3505,9 +3468,9 @@ Normally, when a parameter is not passed in registers, it is placed on the
stack beyond the @code{REG_PARM_STACK_SPACE} area. Defining this macro
suppresses this behavior and causes the parameter to be passed on the
stack in its natural location.
+@end defmac
-@findex RETURN_POPS_ARGS
-@item RETURN_POPS_ARGS (@var{fundecl}, @var{funtype}, @var{stack-size})
+@defmac RETURN_POPS_ARGS (@var{fundecl}, @var{funtype}, @var{stack-size})
A C expression that should indicate the number of bytes of its own
arguments that a function pops on returning, or 0 if the
function pops no arguments and the caller must therefore pop them all
@@ -3544,9 +3507,9 @@ arguments pop them but other functions (such as @code{printf}) pop
nothing (the caller pops all). When this convention is in use,
@var{funtype} is examined to determine whether a function takes a fixed
number of arguments.
+@end defmac
-@findex CALL_POPS_ARGS
-@item CALL_POPS_ARGS (@var{cum})
+@defmac CALL_POPS_ARGS (@var{cum})
A C expression that should indicate the number of bytes a call sequence
pops off the stack. It is added to the value of @code{RETURN_POPS_ARGS}
when compiling a function call.
@@ -3559,8 +3522,7 @@ that pops certain registers off the stack, depending on the arguments
that have been passed to the function. Since this is a property of the
call site, not of the called function, @code{RETURN_POPS_ARGS} is not
appropriate.
-
-@end table
+@end defmac
@node Register Arguments
@subsection Passing Arguments in Registers
@@ -3571,9 +3533,7 @@ This section describes the macros which let you control how various
types of arguments are passed in registers or how they are arranged in
the stack.
-@table @code
-@findex FUNCTION_ARG
-@item FUNCTION_ARG (@var{cum}, @var{mode}, @var{type}, @var{named})
+@defmac FUNCTION_ARG (@var{cum}, @var{mode}, @var{type}, @var{named})
A C expression that controls whether a function argument is passed
in a register, and which register.
@@ -3626,16 +3586,16 @@ is not defined and @code{FUNCTION_ARG} returns nonzero for such an
argument, the compiler will abort. If @code{REG_PARM_STACK_SPACE} is
defined, the argument will be computed in the stack and then loaded into
a register.
+@end defmac
-@findex MUST_PASS_IN_STACK
-@item MUST_PASS_IN_STACK (@var{mode}, @var{type})
+@defmac MUST_PASS_IN_STACK (@var{mode}, @var{type})
Define as a C expression that evaluates to nonzero if we do not know how
to pass TYPE solely in registers. The file @file{expr.h} defines a
definition that is usually appropriate, refer to @file{expr.h} for additional
documentation.
+@end defmac
-@findex FUNCTION_INCOMING_ARG
-@item FUNCTION_INCOMING_ARG (@var{cum}, @var{mode}, @var{type}, @var{named})
+@defmac FUNCTION_INCOMING_ARG (@var{cum}, @var{mode}, @var{type}, @var{named})
Define this macro if the target machine has ``register windows'', so
that the register in which a function sees an arguments is not
necessarily the same as the one in which the caller passed the
@@ -3648,9 +3608,9 @@ where the arguments will arrive.
If @code{FUNCTION_INCOMING_ARG} is not defined, @code{FUNCTION_ARG}
serves both purposes.
+@end defmac
-@findex FUNCTION_ARG_PARTIAL_NREGS
-@item FUNCTION_ARG_PARTIAL_NREGS (@var{cum}, @var{mode}, @var{type}, @var{named})
+@defmac FUNCTION_ARG_PARTIAL_NREGS (@var{cum}, @var{mode}, @var{type}, @var{named})
A C expression for the number of words, at the beginning of an
argument, that must be put in registers. The value must be zero for
arguments that are passed entirely in registers or that are entirely
@@ -3668,9 +3628,9 @@ registers.
@code{FUNCTION_ARG} for these arguments should return the first
register to be used by the caller for this argument; likewise
@code{FUNCTION_INCOMING_ARG}, for the called function.
+@end defmac
-@findex FUNCTION_ARG_PASS_BY_REFERENCE
-@item FUNCTION_ARG_PASS_BY_REFERENCE (@var{cum}, @var{mode}, @var{type}, @var{named})
+@defmac FUNCTION_ARG_PASS_BY_REFERENCE (@var{cum}, @var{mode}, @var{type}, @var{named})
A C expression that indicates when an argument must be passed by reference.
If nonzero for an argument, a copy of that argument is made in memory and a
pointer to the argument is passed instead of the argument itself.
@@ -3685,9 +3645,9 @@ definition of this macro might be
MUST_PASS_IN_STACK (MODE, TYPE)
@end smallexample
@c this is *still* too long. --mew 5feb93
+@end defmac
-@findex FUNCTION_ARG_CALLEE_COPIES
-@item FUNCTION_ARG_CALLEE_COPIES (@var{cum}, @var{mode}, @var{type}, @var{named})
+@defmac FUNCTION_ARG_CALLEE_COPIES (@var{cum}, @var{mode}, @var{type}, @var{named})
If defined, a C expression that indicates when it is the called function's
responsibility to make a copy of arguments passed by invisible reference.
Normally, the caller makes a copy and passes the address of the copy to the
@@ -3696,9 +3656,9 @@ nonzero, the caller does not make a copy. Instead, it passes a pointer to the
``live'' value. The called function must not modify this value. If it can be
determined that the value won't be modified, it need not make a copy;
otherwise a copy must be made.
+@end defmac
-@findex CUMULATIVE_ARGS
-@item CUMULATIVE_ARGS
+@defmac CUMULATIVE_ARGS
A C type for declaring a variable that is used as the first argument of
@code{FUNCTION_ARG} and other related values. For some target machines,
the type @code{int} suffices and can hold the number of bytes of
@@ -3710,17 +3670,18 @@ variables to keep track of that. For target machines on which all
arguments are passed on the stack, there is no need to store anything in
@code{CUMULATIVE_ARGS}; however, the data structure must exist and
should not be empty, so use @code{int}.
+@end defmac
-@findex INIT_CUMULATIVE_ARGS
-@item INIT_CUMULATIVE_ARGS (@var{cum}, @var{fntype}, @var{libname},
-@var{fndecl}) A C statement (sans semicolon) for initializing the variable
-@var{cum} for the state at the beginning of the argument list. The variable
-has type @code{CUMULATIVE_ARGS}. The value of @var{fntype} is the tree node
-for the data type of the function which will receive the args, or 0 if the args
-are to a compiler support library function. For direct calls that are not
-libcalls, @var{fndecl} contain the declaration node of the function.
-@var{fndecl} is also set when @code{INIT_CUMULATIVE_ARGS} is used to find
-arguments for the function being compiled.
+@defmac INIT_CUMULATIVE_ARGS (@var{cum}, @var{fntype}, @var{libname}, @var{fndecl})
+A C statement (sans semicolon) for initializing the variable
+@var{cum} for the state at the beginning of the argument list. The
+variable has type @code{CUMULATIVE_ARGS}. The value of @var{fntype}
+is the tree node for the data type of the function which will receive
+the args, or 0 if the args are to a compiler support library function.
+For direct calls that are not libcalls, @var{fndecl} contain the
+declaration node of the function. @var{fndecl} is also set when
+@code{INIT_CUMULATIVE_ARGS} is used to find arguments for the function
+being compiled.
When processing a call to a compiler support library function,
@var{libname} identifies which one. It is a @code{symbol_ref} rtx which
@@ -3728,17 +3689,17 @@ contains the name of the function, as a string. @var{libname} is 0 when
an ordinary C function call is being processed. Thus, each time this
macro is called, either @var{libname} or @var{fntype} is nonzero, but
never both of them at once.
+@end defmac
-@findex INIT_CUMULATIVE_LIBCALL_ARGS
-@item INIT_CUMULATIVE_LIBCALL_ARGS (@var{cum}, @var{mode}, @var{libname})
+@defmac INIT_CUMULATIVE_LIBCALL_ARGS (@var{cum}, @var{mode}, @var{libname})
Like @code{INIT_CUMULATIVE_ARGS} but only used for outgoing libcalls,
it gets a @code{MODE} argument instead of @var{fntype}, that would be
@code{NULL}. @var{indirect} would always be zero, too. If this macro
is not defined, @code{INIT_CUMULATIVE_ARGS (cum, NULL_RTX, libname,
0)} is used instead.
+@end defmac
-@findex INIT_CUMULATIVE_INCOMING_ARGS
-@item INIT_CUMULATIVE_INCOMING_ARGS (@var{cum}, @var{fntype}, @var{libname})
+@defmac INIT_CUMULATIVE_INCOMING_ARGS (@var{cum}, @var{fntype}, @var{libname})
Like @code{INIT_CUMULATIVE_ARGS} but overrides it for the purposes of
finding the arguments for the function being compiled. If this macro is
undefined, @code{INIT_CUMULATIVE_ARGS} is used instead.
@@ -3749,9 +3710,9 @@ argument @var{libname} exists for symmetry with
@code{INIT_CUMULATIVE_ARGS}.
@c could use "this macro" in place of @code{INIT_CUMULATIVE_ARGS}, maybe.
@c --mew 5feb93 i switched the order of the sentences. --mew 10feb93
+@end defmac
-@findex FUNCTION_ARG_ADVANCE
-@item FUNCTION_ARG_ADVANCE (@var{cum}, @var{mode}, @var{type}, @var{named})
+@defmac FUNCTION_ARG_ADVANCE (@var{cum}, @var{mode}, @var{type}, @var{named})
A C statement (sans semicolon) to update the summarizer variable
@var{cum} to advance past an argument in the argument list. The
values @var{mode}, @var{type} and @var{named} describe that argument.
@@ -3761,9 +3722,9 @@ the @emph{following} argument with @code{FUNCTION_ARG}, etc.
This macro need not do anything if the argument in question was passed
on the stack. The compiler knows how to track the amount of stack space
used for arguments without any special help.
+@end defmac
-@findex FUNCTION_ARG_PADDING
-@item FUNCTION_ARG_PADDING (@var{mode}, @var{type})
+@defmac FUNCTION_ARG_PADDING (@var{mode}, @var{type})
If defined, a C expression which determines whether, and in which direction,
to pad out an argument with extra space. The value should be of type
@code{enum direction}: either @code{upward} to pad above the argument,
@@ -3777,32 +3738,32 @@ This macro has a default definition which is right for most systems.
For little-endian machines, the default is to pad upward. For
big-endian machines, the default is to pad downward for an argument of
constant size shorter than an @code{int}, and upward otherwise.
+@end defmac
-@findex PAD_VARARGS_DOWN
-@item PAD_VARARGS_DOWN
+@defmac PAD_VARARGS_DOWN
If defined, a C expression which determines whether the default
implementation of va_arg will attempt to pad down before reading the
next argument, if that argument is smaller than its aligned space as
controlled by @code{PARM_BOUNDARY}. If this macro is not defined, all such
arguments are padded down if @code{BYTES_BIG_ENDIAN} is true.
+@end defmac
-@findex FUNCTION_ARG_BOUNDARY
-@item FUNCTION_ARG_BOUNDARY (@var{mode}, @var{type})
+@defmac FUNCTION_ARG_BOUNDARY (@var{mode}, @var{type})
If defined, a C expression that gives the alignment boundary, in bits,
of an argument with the specified mode and type. If it is not defined,
@code{PARM_BOUNDARY} is used for all arguments.
+@end defmac
-@findex FUNCTION_ARG_REGNO_P
-@item FUNCTION_ARG_REGNO_P (@var{regno})
+@defmac FUNCTION_ARG_REGNO_P (@var{regno})
A C expression that is nonzero if @var{regno} is the number of a hard
register in which function arguments are sometimes passed. This does
@emph{not} include implicit arguments such as the static chain and
the structure-value address. On many machines, no registers can be
used for this purpose since all function arguments are pushed on the
stack.
+@end defmac
-@findex SPLIT_COMPLEX_ARGS
-@item SPLIT_COMPLEX_ARGS
+@defmac SPLIT_COMPLEX_ARGS
Define this macro to a nonzero value if complex function arguments
should be split into their corresponding components. By default, GCC
@@ -3811,15 +3772,14 @@ Some ABIs require complex arguments to be split and treated as their
individual components. For example, on AIX64, complex floats should
be passed in a pair of floating point registers, even though a complex
float would fit in one 64-bit floating point register.
+@end defmac
-@findex LOAD_ARGS_REVERSED
-@item LOAD_ARGS_REVERSED
+@defmac LOAD_ARGS_REVERSED
If defined, the order in which arguments are loaded into their
respective argument registers is reversed so that the last
argument is loaded first. This macro only affects arguments
passed in registers.
-
-@end table
+@end defmac
@node Scalar Return
@subsection How Scalar Function Values Are Returned
@@ -3830,9 +3790,7 @@ passed in registers.
This section discusses the macros that control returning scalars as
values---values that can fit in registers.
-@table @code
-@findex FUNCTION_VALUE
-@item FUNCTION_VALUE (@var{valtype}, @var{func})
+@defmac FUNCTION_VALUE (@var{valtype}, @var{func})
A C expression to create an RTX representing the place where a
function returns a value of data type @var{valtype}. @var{valtype} is
a tree node representing a data type. Write @code{TYPE_MODE
@@ -3859,9 +3817,9 @@ known.
@code{FUNCTION_VALUE} is not used for return vales with aggregate data
types, because these are returned in another way. See
@code{STRUCT_VALUE_REGNUM} and related macros, below.
+@end defmac
-@findex FUNCTION_OUTGOING_VALUE
-@item FUNCTION_OUTGOING_VALUE (@var{valtype}, @var{func})
+@defmac FUNCTION_OUTGOING_VALUE (@var{valtype}, @var{func})
Define this macro if the target machine has ``register windows''
so that the register in which a function returns its value is not
the same as the one in which the caller sees the value.
@@ -3877,9 +3835,9 @@ If @code{FUNCTION_OUTGOING_VALUE} is not defined,
@code{FUNCTION_OUTGOING_VALUE} is not used for return vales with
aggregate data types, because these are returned in another way. See
@code{STRUCT_VALUE_REGNUM} and related macros, below.
+@end defmac
-@findex LIBCALL_VALUE
-@item LIBCALL_VALUE (@var{mode})
+@defmac LIBCALL_VALUE (@var{mode})
A C expression to create an RTX representing the place where a library
function returns a value of mode @var{mode}. If the precise function
being called is known, @var{func} is a tree node
@@ -3895,9 +3853,9 @@ compiled.
The definition of @code{LIBRARY_VALUE} need not be concerned aggregate
data types, because none of the library functions returns such types.
+@end defmac
-@findex FUNCTION_VALUE_REGNO_P
-@item FUNCTION_VALUE_REGNO_P (@var{regno})
+@defmac FUNCTION_VALUE_REGNO_P (@var{regno})
A C expression that is nonzero if @var{regno} is the number of a hard
register in which the values of called function may come back.
@@ -3913,13 +3871,13 @@ suffices:
If the machine has register windows, so that the caller and the called
function use different registers for the return value, this macro
should recognize only the caller's register numbers.
+@end defmac
-@findex APPLY_RESULT_SIZE
-@item APPLY_RESULT_SIZE
+@defmac APPLY_RESULT_SIZE
Define this macro if @samp{untyped_call} and @samp{untyped_return}
need more space than is implied by @code{FUNCTION_VALUE_REGNO_P} for
saving and restoring an arbitrary return value.
-@end table
+@end defmac
@node Aggregate Return
@subsection How Large Values Are Returned
@@ -3937,9 +3895,7 @@ is called the @dfn{structure value address}.
This section describes how to control returning structure values in
memory.
-@table @code
-@findex RETURN_IN_MEMORY
-@item RETURN_IN_MEMORY (@var{type})
+@defmac RETURN_IN_MEMORY (@var{type})
A C expression which can inhibit the returning of certain function
values in registers, based on the type of value. A nonzero value says
to return the function value in memory, just as large structures are
@@ -3956,9 +3912,9 @@ values, and 0 otherwise.
Do not use this macro to indicate that structures and unions should always
be returned in memory. You should instead use @code{DEFAULT_PCC_STRUCT_RETURN}
to indicate this.
+@end defmac
-@findex DEFAULT_PCC_STRUCT_RETURN
-@item DEFAULT_PCC_STRUCT_RETURN
+@defmac DEFAULT_PCC_STRUCT_RETURN
Define this macro to be 1 if all structure and union return values must be
in memory. Since this results in slower code, this should be defined
only if needed for compatibility with other compilers or with an ABI@.
@@ -3966,21 +3922,21 @@ If you define this macro to be 0, then the conventions used for structure
and union return values are decided by the @code{RETURN_IN_MEMORY} macro.
If not defined, this defaults to the value 1.
+@end defmac
-@findex STRUCT_VALUE_REGNUM
-@item STRUCT_VALUE_REGNUM
+@defmac STRUCT_VALUE_REGNUM
If the structure value address is passed in a register, then
@code{STRUCT_VALUE_REGNUM} should be the number of that register.
+@end defmac
-@findex STRUCT_VALUE
-@item STRUCT_VALUE
+@defmac STRUCT_VALUE
If the structure value address is not passed in a register, define
@code{STRUCT_VALUE} as an expression returning an RTX for the place
where the address is passed. If it returns 0, the address is passed as
an ``invisible'' first argument.
+@end defmac
-@findex STRUCT_VALUE_INCOMING_REGNUM
-@item STRUCT_VALUE_INCOMING_REGNUM
+@defmac STRUCT_VALUE_INCOMING_REGNUM
On some architectures the place where the structure value address
is found by the called function is not the same place that the
caller put it. This can be due to register windows, or it could
@@ -3988,18 +3944,18 @@ be because the function prologue moves it to a different place.
If the incoming location of the structure value address is in a
register, define this macro as the register number.
+@end defmac
-@findex STRUCT_VALUE_INCOMING
-@item STRUCT_VALUE_INCOMING
+@defmac STRUCT_VALUE_INCOMING
If the incoming location is not a register, then you should define
@code{STRUCT_VALUE_INCOMING} as an expression for an RTX for where the
called function should find the value. If it should find the value on
the stack, define this to create a @code{mem} which refers to the frame
pointer. A definition of 0 means that the address is passed as an
``invisible'' first argument.
+@end defmac
-@findex PCC_STATIC_STRUCT_RETURN
-@item PCC_STATIC_STRUCT_RETURN
+@defmac PCC_STATIC_STRUCT_RETURN
Define this macro if the usual system convention on the target machine
for returning structures and unions is for the called function to return
the address of a static variable containing the value.
@@ -4009,7 +3965,7 @@ pass an address to the subroutine.
This macro has effect in @option{-fpcc-struct-return} mode, but it does
nothing when you use @option{-freg-struct-return} mode.
-@end table
+@end defmac
@node Caller Saves
@subsection Caller-Saves Register Allocation
@@ -4018,17 +3974,15 @@ If you enable it, GCC can save registers around function calls. This
makes it possible to use call-clobbered registers to hold variables that
must live across calls.
-@table @code
-@findex DEFAULT_CALLER_SAVES
-@item DEFAULT_CALLER_SAVES
+@defmac 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. When defined, this macro enables @option{-fcaller-saves}
by default for all optimization levels. It has no effect for optimization
levels 2 and higher, where @option{-fcaller-saves} is the default.
+@end defmac
-@findex CALLER_SAVE_PROFITABLE
-@item CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
+@defmac CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
A C expression to determine whether it is worthwhile to consider placing
a pseudo-register in a call-clobbered hard register and saving and
restoring it around each function call. The expression should be 1 when
@@ -4036,15 +3990,15 @@ this is worth doing, and 0 otherwise.
If you don't define this macro, a default is used which is good on most
machines: @code{4 * @var{calls} < @var{refs}}.
+@end defmac
-@findex HARD_REGNO_CALLER_SAVE_MODE
-@item HARD_REGNO_CALLER_SAVE_MODE (@var{regno}, @var{nregs})
+@defmac HARD_REGNO_CALLER_SAVE_MODE (@var{regno}, @var{nregs})
A C expression specifying which mode is required for saving @var{nregs}
of a pseudo-register in call-clobbered hard register @var{regno}. If
@var{regno} is unsuitable for caller save, @code{VOIDmode} should be
returned. For most machines this macro need not be defined since GCC
will select the smallest suitable mode.
-@end table
+@end defmac
@node Function Entry
@subsection Function Entry and Exit
@@ -4162,8 +4116,6 @@ arguments that a function should pop. @xref{Scalar Return}.
@c tell? --mew 5feb93
@end deftypefn
-@table @code
-
@itemize @bullet
@item
@findex current_function_pretend_args_size
@@ -4204,8 +4156,7 @@ Normally, it is necessary for the macros
The C variable @code{current_function_is_leaf} is nonzero for such a
function.
-@findex EXIT_IGNORE_STACK
-@item EXIT_IGNORE_STACK
+@defmac EXIT_IGNORE_STACK
Define this macro as a C expression that is nonzero if the return
instruction or the function epilogue ignores the value of the stack
pointer; in other words, if it is safe to delete an instruction to
@@ -4215,28 +4166,28 @@ Note that this macro's value is relevant only for functions for which
frame pointers are maintained. It is never safe to delete a final
stack adjustment in a function that has no frame pointer, and the
compiler knows this regardless of @code{EXIT_IGNORE_STACK}.
+@end defmac
-@findex EPILOGUE_USES
-@item EPILOGUE_USES (@var{regno})
+@defmac EPILOGUE_USES (@var{regno})
Define this macro as a C expression that is nonzero for registers that are
used by the epilogue or the @samp{return} pattern. The stack and frame
pointer registers are already be assumed to be used as needed.
+@end defmac
-@findex EH_USES
-@item EH_USES (@var{regno})
+@defmac EH_USES (@var{regno})
Define this macro as a C expression that is nonzero for registers that are
used by the exception handling mechanism, and so should be considered live
on entry to an exception edge.
+@end defmac
-@findex DELAY_SLOTS_FOR_EPILOGUE
-@item DELAY_SLOTS_FOR_EPILOGUE
+@defmac DELAY_SLOTS_FOR_EPILOGUE
Define this macro if the function epilogue contains delay slots to which
instructions from the rest of the function can be ``moved''. The
definition should be a C expression whose value is an integer
representing the number of delay slots there.
+@end defmac
-@findex ELIGIBLE_FOR_EPILOGUE_DELAY
-@item ELIGIBLE_FOR_EPILOGUE_DELAY (@var{insn}, @var{n})
+@defmac ELIGIBLE_FOR_EPILOGUE_DELAY (@var{insn}, @var{n})
A C expression that returns 1 if @var{insn} can be placed in delay
slot number @var{n} of the epilogue.
@@ -4261,10 +4212,8 @@ outputting the insns in this list, usually by calling
You need not define this macro if you did not define
@code{DELAY_SLOTS_FOR_EPILOGUE}.
+@end defmac
-@end table
-
-@findex TARGET_ASM_OUTPUT_MI_THUNK
@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_MI_THUNK (FILE *@var{file}, tree @var{thunk_fndecl}, HOST_WIDE_INT @var{delta}, tree @var{function})
A function that outputs the assembler code for a thunk
function, used to implement C++ virtual function calls with multiple
@@ -4299,7 +4248,6 @@ front end will generate a less efficient heavyweight thunk that calls
not support varargs.
@end deftypefn
-@findex TARGET_ASM_OUTPUT_MI_VCALL_THUNK
@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_MI_VCALL_THUNK (FILE *@var{file}, tree @var{thunk_fndecl}, HOST_WIDE_INT @var{delta}, int @var{vcall_offset}, tree @var{function})
A function like @code{TARGET_ASM_OUTPUT_MI_THUNK}, except that if
@var{vcall_offset} is nonzero, an additional adjustment should be made
@@ -4313,7 +4261,6 @@ p += (*((ptrdiff_t **)p))[vcall_offset/sizeof(ptrdiff_t)]
@noindent
If this function is defined, it will always be used in place of
@code{TARGET_ASM_OUTPUT_MI_THUNK}.
-
@end deftypefn
@node Profiling
@@ -4322,9 +4269,7 @@ If this function is defined, it will always be used in place of
These macros will help you generate code for profiling.
-@table @code
-@findex FUNCTION_PROFILER
-@item FUNCTION_PROFILER (@var{file}, @var{labelno})
+@defmac FUNCTION_PROFILER (@var{file}, @var{labelno})
A C statement or compound statement to output to @var{file} some
assembler code to call the profiling subroutine @code{mcount}.
@@ -4338,25 +4283,25 @@ Older implementations of @code{mcount} expect the address of a counter
variable to be loaded into some register. The name of this variable is
@samp{LP} followed by the number @var{labelno}, so you would generate
the name using @samp{LP%d} in a @code{fprintf}.
+@end defmac
-@findex PROFILE_HOOK
-@item PROFILE_HOOK
+@defmac PROFILE_HOOK
A C statement or compound statement to output to @var{file} some assembly
code to call the profiling subroutine @code{mcount} even the target does
not support profiling.
+@end defmac
-@findex NO_PROFILE_COUNTERS
-@item NO_PROFILE_COUNTERS
+@defmac NO_PROFILE_COUNTERS
Define this macro if the @code{mcount} subroutine on your system does
not need a counter variable allocated for each function. This is true
for almost all modern implementations. If you define this macro, you
must not use the @var{labelno} argument to @code{FUNCTION_PROFILER}.
+@end defmac
-@findex PROFILE_BEFORE_PROLOGUE
-@item PROFILE_BEFORE_PROLOGUE
+@defmac PROFILE_BEFORE_PROLOGUE
Define this macro if the code for function profiling should come before
the function prologue. Normally, the profiling code comes after.
-@end table
+@end defmac
@node Tail Calls
@subsection Permitting tail calls
@@ -4396,9 +4341,7 @@ However, @code{va_start} should not use this argument. The way to find
the end of the named arguments is with the built-in functions described
below.
-@table @code
-@findex __builtin_saveregs
-@item __builtin_saveregs ()
+@defmac __builtin_saveregs ()
Use this built-in function to save the argument registers in memory so
that the varargs mechanism can access them. Both ISO and traditional
versions of @code{va_start} must use @code{__builtin_saveregs}, unless
@@ -4416,9 +4359,9 @@ This is because the registers must be saved before the function starts
to use them for its own purposes.
@c i rewrote the first sentence above to fix an overfull hbox. --mew
@c 10feb93
+@end defmac
-@findex __builtin_args_info
-@item __builtin_args_info (@var{category})
+@defmac __builtin_args_info (@var{category})
Use this built-in function to find the first anonymous arguments in
registers.
@@ -4440,9 +4383,9 @@ of @code{va_start}, accessing each category just once and storing the
value in the @code{va_list} object. This is because @code{va_list} will
have to update the values, and there is no way to alter the
values accessed by @code{__builtin_args_info}.
+@end defmac
-@findex __builtin_next_arg
-@item __builtin_next_arg (@var{lastarg})
+@defmac __builtin_next_arg (@var{lastarg})
This is the equivalent of @code{__builtin_args_info}, for stack
arguments. It returns the address of the first anonymous stack
argument, as type @code{void *}. If @code{ARGS_GROW_DOWNWARD}, it
@@ -4451,9 +4394,9 @@ argument. Use it in @code{va_start} to initialize the pointer for
fetching arguments from the stack. Also use it in @code{va_start} to
verify that the second parameter @var{lastarg} is the last named argument
of the current function.
+@end defmac
-@findex __builtin_classify_type
-@item __builtin_classify_type (@var{object})
+@defmac __builtin_classify_type (@var{object})
Since each machine has its own conventions for which data types are
passed in which kind of register, your implementation of @code{va_arg}
has to embody these conventions. The easiest way to categorize the
@@ -4466,21 +4409,19 @@ kind of type that is---integer, floating, pointer, structure, and so on.
The file @file{typeclass.h} defines an enumeration that you can use to
interpret the values of @code{__builtin_classify_type}.
-@end table
+@end defmac
These machine description macros help implement varargs:
-@table @code
-@findex EXPAND_BUILTIN_SAVEREGS
-@item EXPAND_BUILTIN_SAVEREGS ()
+@defmac EXPAND_BUILTIN_SAVEREGS ()
If defined, is a C expression that produces the machine-specific code
for a call to @code{__builtin_saveregs}. This code will be moved to the
very beginning of the function, before any parameter access are made.
The return value of this function should be an RTX that contains the
value to use as the return of @code{__builtin_saveregs}.
+@end defmac
-@findex SETUP_INCOMING_VARARGS
-@item SETUP_INCOMING_VARARGS (@var{args_so_far}, @var{mode}, @var{type}, @var{pretend_args_size}, @var{second_time})
+@defmac SETUP_INCOMING_VARARGS (@var{args_so_far}, @var{mode}, @var{type}, @var{pretend_args_size}, @var{second_time})
This macro offers an alternative to using @code{__builtin_saveregs} and
defining the macro @code{EXPAND_BUILTIN_SAVEREGS}. Use it to store the
anonymous register arguments into the stack so that all the arguments
@@ -4511,9 +4452,9 @@ arguments of the function are being analyzed for the second time. This
happens for an inline function, which is not actually compiled until the
end of the source file. The macro @code{SETUP_INCOMING_VARARGS} should
not generate any instructions in this case.
+@end defmac
-@findex STRICT_ARGUMENT_NAMING
-@item STRICT_ARGUMENT_NAMING
+@defmac STRICT_ARGUMENT_NAMING
Define this macro to be a nonzero value if the location where a function
argument is passed depends on whether or not it is a named argument.
@@ -4526,16 +4467,16 @@ are treated as named. Otherwise, all named arguments except the last
are treated as named.
You need not define this macro if it always returns zero.
+@end defmac
-@findex PRETEND_OUTGOING_VARARGS_NAMED
-@item PRETEND_OUTGOING_VARARGS_NAMED
+@defmac PRETEND_OUTGOING_VARARGS_NAMED
If you need to conditionally change ABIs so that one works with
@code{SETUP_INCOMING_VARARGS}, but the other works like neither
@code{SETUP_INCOMING_VARARGS} nor @code{STRICT_ARGUMENT_NAMING} was
defined, then define this macro to return nonzero if
@code{SETUP_INCOMING_VARARGS} is used, zero otherwise.
Otherwise, you should not define this macro.
-@end table
+@end defmac
@node Trampolines
@section Trampolines for Nested Functions
@@ -4565,9 +4506,7 @@ proper offset from the start of the trampoline. On a RISC machine, it
may be necessary to take out pieces of the address and store them
separately.
-@table @code
-@findex TRAMPOLINE_TEMPLATE
-@item TRAMPOLINE_TEMPLATE (@var{file})
+@defmac TRAMPOLINE_TEMPLATE (@var{file})
A C statement to output, on the stream @var{file}, assembler code for a
block of data that contains the constant parts of a trampoline. This
code should not include a label---the label is taken care of
@@ -4577,35 +4516,35 @@ If you do not define this macro, it means no template is needed
for the target. Do not define this macro on systems where the block move
code to copy the trampoline into place would be larger than the code
to generate it on the spot.
+@end defmac
-@findex TRAMPOLINE_SECTION
-@item TRAMPOLINE_SECTION
+@defmac TRAMPOLINE_SECTION
The name of a subroutine to switch to the section in which the
trampoline template is to be placed (@pxref{Sections}). The default is
a value of @samp{readonly_data_section}, which places the trampoline in
the section containing read-only data.
+@end defmac
-@findex TRAMPOLINE_SIZE
-@item TRAMPOLINE_SIZE
+@defmac TRAMPOLINE_SIZE
A C expression for the size in bytes of the trampoline, as an integer.
+@end defmac
-@findex TRAMPOLINE_ALIGNMENT
-@item TRAMPOLINE_ALIGNMENT
+@defmac TRAMPOLINE_ALIGNMENT
Alignment required for trampolines, in bits.
If you don't define this macro, the value of @code{BIGGEST_ALIGNMENT}
is used for aligning trampolines.
+@end defmac
-@findex INITIALIZE_TRAMPOLINE
-@item INITIALIZE_TRAMPOLINE (@var{addr}, @var{fnaddr}, @var{static_chain})
+@defmac INITIALIZE_TRAMPOLINE (@var{addr}, @var{fnaddr}, @var{static_chain})
A C statement to initialize the variable parts of a trampoline.
@var{addr} is an RTX for the address of the trampoline; @var{fnaddr} is
an RTX for the address of the nested function; @var{static_chain} is an
RTX for the static chain value that should be passed to the function
when it is called.
+@end defmac
-@findex TRAMPOLINE_ADJUST_ADDRESS
-@item TRAMPOLINE_ADJUST_ADDRESS (@var{addr})
+@defmac TRAMPOLINE_ADJUST_ADDRESS (@var{addr})
A C statement that should perform any machine-specific adjustment in
the address of the trampoline. Its argument contains the address that
was passed to @code{INITIALIZE_TRAMPOLINE}. In case the address to be
@@ -4629,7 +4568,7 @@ the function which the trampoline is for. The stack slot for the
trampoline is in the stack frame of this containing function. Other
allocation strategies probably must do something analogous with this
information.
-@end table
+@end defmac
Implementing trampolines is difficult on many machines because they have
separate instruction and data caches. Writing into a stack location
@@ -4645,14 +4584,12 @@ latter makes initialization faster.
To clear the instruction cache when a trampoline is initialized, define
the following macro.
-@table @code
-@findex CLEAR_INSN_CACHE
-@item CLEAR_INSN_CACHE (@var{beg}, @var{end})
+@defmac CLEAR_INSN_CACHE (@var{beg}, @var{end})
If defined, expands to a C expression clearing the @emph{instruction
cache} in the specified interval. The definition of this macro would
typically be a series of @code{asm} statements. Both @var{beg} and
@var{end} are both pointer expressions.
-@end table
+@end defmac
To use a standard subroutine, define the following macro. In addition,
you must make sure that the instructions in a trampoline fill an entire
@@ -4660,9 +4597,7 @@ cache line with identical instructions, or else ensure that the
beginning of the trampoline code is always aligned at the same point in
its cache line. Look in @file{m68k.h} as a guide.
-@table @code
-@findex TRANSFER_FROM_TRAMPOLINE
-@item TRANSFER_FROM_TRAMPOLINE
+@defmac TRANSFER_FROM_TRAMPOLINE
Define this macro if trampolines need a special subroutine to do their
work. The macro should expand to a series of @code{asm} statements
which will be compiled with GCC@. They go in a library function named
@@ -4674,7 +4609,7 @@ special label of your own in the assembler code. Use one @code{asm}
statement to generate an assembler label, and another to make the label
global. Then trampolines can use that label to jump directly to your
special assembler code.
-@end table
+@end defmac
@node Library Calls
@section Implicit Calls to Library Routines
@@ -4684,102 +4619,101 @@ special assembler code.
@c prevent bad page break with this line
Here is an explanation of implicit calls to library routines.
-@table @code
-@findex MULSI3_LIBCALL
-@item MULSI3_LIBCALL
+@defmac MULSI3_LIBCALL
A C string constant giving the name of the function to call for
multiplication of one signed full-word by another. If you do not
define this macro, the default name is used, which is @code{__mulsi3},
a function defined in @file{libgcc.a}.
+@end defmac
-@findex DIVSI3_LIBCALL
-@item DIVSI3_LIBCALL
+@defmac DIVSI3_LIBCALL
A C string constant giving the name of the function to call for
division of one signed full-word by another. If you do not define
this macro, the default name is used, which is @code{__divsi3}, a
function defined in @file{libgcc.a}.
+@end defmac
-@findex UDIVSI3_LIBCALL
-@item UDIVSI3_LIBCALL
+@defmac UDIVSI3_LIBCALL
A C string constant giving the name of the function to call for
division of one unsigned full-word by another. If you do not define
this macro, the default name is used, which is @code{__udivsi3}, a
function defined in @file{libgcc.a}.
+@end defmac
-@findex MODSI3_LIBCALL
-@item MODSI3_LIBCALL
+@defmac MODSI3_LIBCALL
A C string constant giving the name of the function to call for the
remainder in division of one signed full-word by another. If you do
not define this macro, the default name is used, which is
@code{__modsi3}, a function defined in @file{libgcc.a}.
+@end defmac
-@findex UMODSI3_LIBCALL
-@item UMODSI3_LIBCALL
+@defmac UMODSI3_LIBCALL
A C string constant giving the name of the function to call for the
remainder in division of one unsigned full-word by another. If you do
not define this macro, the default name is used, which is
@code{__umodsi3}, a function defined in @file{libgcc.a}.
+@end defmac
-@findex MULDI3_LIBCALL
-@item MULDI3_LIBCALL
+@defmac MULDI3_LIBCALL
A C string constant giving the name of the function to call for
multiplication of one signed double-word by another. If you do not
define this macro, the default name is used, which is @code{__muldi3},
a function defined in @file{libgcc.a}.
+@end defmac
-@findex DIVDI3_LIBCALL
-@item DIVDI3_LIBCALL
+@defmac DIVDI3_LIBCALL
A C string constant giving the name of the function to call for
division of one signed double-word by another. If you do not define
this macro, the default name is used, which is @code{__divdi3}, a
function defined in @file{libgcc.a}.
+@end defmac
-@findex UDIVDI3_LIBCALL
-@item UDIVDI3_LIBCALL
+@defmac UDIVDI3_LIBCALL
A C string constant giving the name of the function to call for
division of one unsigned full-word by another. If you do not define
this macro, the default name is used, which is @code{__udivdi3}, a
function defined in @file{libgcc.a}.
+@end defmac
-@findex MODDI3_LIBCALL
-@item MODDI3_LIBCALL
+@defmac MODDI3_LIBCALL
A C string constant giving the name of the function to call for the
remainder in division of one signed double-word by another. If you do
not define this macro, the default name is used, which is
@code{__moddi3}, a function defined in @file{libgcc.a}.
+@end defmac
-@findex UMODDI3_LIBCALL
-@item UMODDI3_LIBCALL
+@defmac UMODDI3_LIBCALL
A C string constant giving the name of the function to call for the
remainder in division of one unsigned full-word by another. If you do
not define this macro, the default name is used, which is
@code{__umoddi3}, a function defined in @file{libgcc.a}.
+@end defmac
-@findex DECLARE_LIBRARY_RENAMES
-@item DECLARE_LIBRARY_RENAMES
+@defmac DECLARE_LIBRARY_RENAMES
This macro, if defined, should expand to a piece of C code that will get
expanded when compiling functions for libgcc.a. It can be used to
provide alternate names for gcc's internal library functions if there
are ABI-mandated names that the compiler should provide.
+@end defmac
-@findex INIT_TARGET_OPTABS
-@item INIT_TARGET_OPTABS
+@defmac INIT_TARGET_OPTABS
Define this macro as a C statement that declares additional library
routines renames existing ones. @code{init_optabs} calls this macro after
initializing all the normal library routines.
+@end defmac
-@findex FLOAT_LIB_COMPARE_RETURNS_BOOL (@var{mode}, @var{comparison})
-@item FLOAT_LIB_COMPARE_RETURNS_BOOL
+@defmac FLOAT_LIB_COMPARE_RETURNS_BOOL (@var{mode}, @var{comparison})
Define this macro as a C statement that returns nonzero if a call to
the floating point comparison library function will return a boolean
value that indicates the result of the comparison. It should return
zero if one of gcc's own libgcc functions is called.
Most ports don't need to define this macro.
+@end defmac
-@findex TARGET_EDOM
@cindex @code{EDOM}, implicit usage
-@item TARGET_EDOM
+@findex matherr
+@defmac TARGET_EDOM
The value of @code{EDOM} on the target machine, as a C integer constant
expression. If you don't define this macro, GCC does not attempt to
deposit the value of @code{EDOM} into @code{errno} directly. Look in
@@ -4791,46 +4725,46 @@ domain errors by calling the library function and letting it report the
error. If mathematical functions on your system use @code{matherr} when
there is an error, then you should leave @code{TARGET_EDOM} undefined so
that @code{matherr} is used normally.
+@end defmac
-@findex GEN_ERRNO_RTX
@cindex @code{errno}, implicit usage
-@item GEN_ERRNO_RTX
+@defmac GEN_ERRNO_RTX
Define this macro as a C expression to create an rtl expression that
refers to the global ``variable'' @code{errno}. (On certain systems,
@code{errno} may not actually be a variable.) If you don't define this
macro, a reasonable default is used.
+@end defmac
-@findex TARGET_MEM_FUNCTIONS
@cindex @code{bcopy}, implicit usage
@cindex @code{memcpy}, implicit usage
@cindex @code{memmove}, implicit usage
@cindex @code{bzero}, implicit usage
@cindex @code{memset}, implicit usage
-@item TARGET_MEM_FUNCTIONS
+@defmac TARGET_MEM_FUNCTIONS
Define this macro if GCC should generate calls to the ISO C
(and System V) library functions @code{memcpy}, @code{memmove} and
@code{memset} rather than the BSD functions @code{bcopy} and @code{bzero}.
+@end defmac
-@findex TARGET_C99_FUNCTIONS
@cindex C99 math functions, implicit usage
-@item TARGET_C99_FUNCTIONS
+@defmac TARGET_C99_FUNCTIONS
When this macro is nonzero, GCC will implicitly optimize @code{sin} calls into
@code{sinf} and similarly for other functions defined by C99 standard. The
default is nonzero that should be proper value for most modern systems, however
number of existing systems lacks support for these functions in the runtime so
they needs this macro to be redefined to 0.
+@end defmac
-@findex LIBGCC_NEEDS_DOUBLE
-@item LIBGCC_NEEDS_DOUBLE
+@defmac LIBGCC_NEEDS_DOUBLE
Define this macro if @code{float} arguments cannot be passed to library
routines (so they must be converted to @code{double}). This macro
affects both how library calls are generated and how the library
routines in @file{libgcc.a} accept their arguments. It is useful on
machines where floating and fixed point arguments are passed
differently, such as the i860.
+@end defmac
-@findex NEXT_OBJC_RUNTIME
-@item NEXT_OBJC_RUNTIME
+@defmac NEXT_OBJC_RUNTIME
Define this macro to generate code for Objective-C message sending using
the calling convention of the NeXT system. This calling convention
involves passing the object, the selector and the method arguments all
@@ -4838,7 +4772,7 @@ at once to the method-lookup library function.
The default calling convention passes just the object and the selector
to the lookup function, which returns a pointer to the method.
-@end table
+@end defmac
@node Addressing Modes
@section Addressing Modes
@@ -4847,55 +4781,50 @@ to the lookup function, which returns a pointer to the method.
@c prevent bad page break with this line
This is about addressing modes.
-@table @code
-@findex HAVE_PRE_INCREMENT
-@findex HAVE_PRE_DECREMENT
-@findex HAVE_POST_INCREMENT
-@findex HAVE_POST_DECREMENT
-@item HAVE_PRE_INCREMENT
-@itemx HAVE_PRE_DECREMENT
-@itemx HAVE_POST_INCREMENT
-@itemx HAVE_POST_DECREMENT
+@defmac HAVE_PRE_INCREMENT
+@defmacx HAVE_PRE_DECREMENT
+@defmacx HAVE_POST_INCREMENT
+@defmacx HAVE_POST_DECREMENT
A C expression that is nonzero if the machine supports pre-increment,
pre-decrement, post-increment, or post-decrement addressing respectively.
+@end defmac
-@findex HAVE_POST_MODIFY_DISP
-@findex HAVE_PRE_MODIFY_DISP
-@item HAVE_PRE_MODIFY_DISP
-@itemx HAVE_POST_MODIFY_DISP
+@defmac HAVE_PRE_MODIFY_DISP
+@defmacx HAVE_POST_MODIFY_DISP
A C expression that is nonzero if the machine supports pre- or
post-address side-effect generation involving constants other than
the size of the memory operand.
+@end defmac
-@findex HAVE_POST_MODIFY_REG
-@findex HAVE_PRE_MODIFY_REG
-@item HAVE_PRE_MODIFY_REG
-@itemx HAVE_POST_MODIFY_REG
+@defmac HAVE_PRE_MODIFY_REG
+@defmacx HAVE_POST_MODIFY_REG
A C expression that is nonzero if the machine supports pre- or
post-address side-effect generation involving a register displacement.
+@end defmac
-@findex CONSTANT_ADDRESS_P
-@item CONSTANT_ADDRESS_P (@var{x})
+@defmac CONSTANT_ADDRESS_P (@var{x})
A C expression that is 1 if the RTX @var{x} is a constant which
is a valid address. On most machines, this can be defined as
@code{CONSTANT_P (@var{x})}, but a few machines are more restrictive
in which constant addresses are supported.
+@end defmac
-@findex CONSTANT_P
-@code{CONSTANT_P} accepts integer-values expressions whose values are
-not explicitly known, such as @code{symbol_ref}, @code{label_ref}, and
-@code{high} expressions and @code{const} arithmetic expressions, in
-addition to @code{const_int} and @code{const_double} expressions.
+@defmac CONSTANT_P (@var{x})
+@code{CONSTANT_P}, which is defined by target-independent code,
+accepts integer-values expressions whose values are not explicitly
+known, such as @code{symbol_ref}, @code{label_ref}, and @code{high}
+expressions and @code{const} arithmetic expressions, in addition to
+@code{const_int} and @code{const_double} expressions.
+@end defmac
-@findex MAX_REGS_PER_ADDRESS
-@item MAX_REGS_PER_ADDRESS
+@defmac MAX_REGS_PER_ADDRESS
A number, the maximum number of registers that can appear in a valid
memory address. Note that it is up to you to specify a value equal to
the maximum number that @code{GO_IF_LEGITIMATE_ADDRESS} would ever
accept.
+@end defmac
-@findex GO_IF_LEGITIMATE_ADDRESS
-@item GO_IF_LEGITIMATE_ADDRESS (@var{mode}, @var{x}, @var{label})
+@defmac GO_IF_LEGITIMATE_ADDRESS (@var{mode}, @var{x}, @var{label})
A C compound statement with a conditional @code{goto @var{label};}
executed if @var{x} (an RTX) is a legitimate memory address on the
target machine for a memory operand of mode @var{mode}.
@@ -4947,21 +4876,9 @@ into the @code{symbol_ref}, and then check for it here. When you see a
@code{const}, you will have to look inside it to find the
@code{symbol_ref} in order to determine the section. @xref{Assembler
Format}.
+@end defmac
-@findex saveable_obstack
-The best way to modify the name string is by adding text to the
-beginning, with suitable punctuation to prevent any ambiguity. Allocate
-the new name in @code{saveable_obstack}. You will have to modify
-@code{ASM_OUTPUT_LABELREF} to remove and decode the added text and
-output the name accordingly, and define @code{TARGET_STRIP_NAME_ENCODING}
-to access the original name string.
-
-You can check the information stored here into the @code{symbol_ref} in
-the definitions of the macros @code{GO_IF_LEGITIMATE_ADDRESS} and
-@code{PRINT_OPERAND_ADDRESS}.
-
-@findex REG_OK_FOR_BASE_P
-@item REG_OK_FOR_BASE_P (@var{x})
+@defmac REG_OK_FOR_BASE_P (@var{x})
A C expression that is nonzero if @var{x} (assumed to be a @code{reg}
RTX) is valid for use as a base register. For hard registers, it
should always accept those which the hardware permits and reject the
@@ -4969,18 +4886,18 @@ others. Whether the macro accepts or rejects pseudo registers must be
controlled by @code{REG_OK_STRICT} as described above. This usually
requires two variant definitions, of which @code{REG_OK_STRICT}
controls the one actually used.
+@end defmac
-@findex REG_MODE_OK_FOR_BASE_P
-@item REG_MODE_OK_FOR_BASE_P (@var{x}, @var{mode})
+@defmac REG_MODE_OK_FOR_BASE_P (@var{x}, @var{mode})
A C expression that is just like @code{REG_OK_FOR_BASE_P}, except that
that expression may examine the mode of the memory reference in
@var{mode}. You should define this macro if the mode of the memory
reference affects whether a register may be used as a base register. If
you define this macro, the compiler will use it instead of
@code{REG_OK_FOR_BASE_P}.
+@end defmac
-@findex REG_OK_FOR_INDEX_P
-@item REG_OK_FOR_INDEX_P (@var{x})
+@defmac REG_OK_FOR_INDEX_P (@var{x})
A C expression that is nonzero if @var{x} (assumed to be a @code{reg}
RTX) is valid for use as an index register.
@@ -4992,9 +4909,9 @@ labeling is used must fit the machine's constraints of which registers
may serve in each capacity. The compiler will try both labelings,
looking for one that is valid, and will reload one or both registers
only if neither labeling works.
+@end defmac
-@findex FIND_BASE_TERM
-@item FIND_BASE_TERM (@var{x})
+@defmac FIND_BASE_TERM (@var{x})
A C expression to determine the base term of address @var{x}.
This macro is used in only one place: `find_base_term' in alias.c.
@@ -5003,9 +4920,9 @@ that alias analysis can understand machine-dependent addresses.
The typical use of this macro is to handle addresses containing
a label_ref or symbol_ref within an UNSPEC@.
+@end defmac
-@findex LEGITIMIZE_ADDRESS
-@item LEGITIMIZE_ADDRESS (@var{x}, @var{oldx}, @var{mode}, @var{win})
+@defmac LEGITIMIZE_ADDRESS (@var{x}, @var{oldx}, @var{mode}, @var{win})
A C compound statement that attempts to replace @var{x} with a valid
memory address for an operand of mode @var{mode}. @var{win} will be a
C statement label elsewhere in the code; the macro definition may use
@@ -5030,9 +4947,9 @@ It is not necessary for this macro to come up with a legitimate
address. The compiler has standard ways of doing so in all cases. In
fact, it is safe for this macro to do nothing. But often a
machine-dependent strategy can generate better code.
+@end defmac
-@findex LEGITIMIZE_RELOAD_ADDRESS
-@item LEGITIMIZE_RELOAD_ADDRESS (@var{x}, @var{mode}, @var{opnum}, @var{type}, @var{ind_levels}, @var{win})
+@defmac LEGITIMIZE_RELOAD_ADDRESS (@var{x}, @var{mode}, @var{opnum}, @var{type}, @var{ind_levels}, @var{win})
A C compound statement that attempts to replace @var{x}, which is an address
that needs reloading, with a valid memory address for an operand of mode
@var{mode}. @var{win} will be a C statement label elsewhere in the code.
@@ -5079,9 +4996,9 @@ single level of rtl. Thus, if the part to be changed is not at the
top level, you'll need to replace first the top level.
It is not necessary for this macro to come up with a legitimate
address; but often a machine-dependent strategy can generate better code.
+@end defmac
-@findex GO_IF_MODE_DEPENDENT_ADDRESS
-@item GO_IF_MODE_DEPENDENT_ADDRESS (@var{addr}, @var{label})
+@defmac GO_IF_MODE_DEPENDENT_ADDRESS (@var{addr}, @var{label})
A C statement or compound statement with a conditional @code{goto
@var{label};} executed if memory address @var{x} (an RTX) can have
different meanings depending on the machine mode of the memory
@@ -5094,15 +5011,15 @@ of the operand being addressed. Some machines have other mode-dependent
addresses. Many RISC machines have no mode-dependent addresses.
You may assume that @var{addr} is a valid address for the machine.
+@end defmac
-@findex LEGITIMATE_CONSTANT_P
-@item LEGITIMATE_CONSTANT_P (@var{x})
+@defmac LEGITIMATE_CONSTANT_P (@var{x})
A C expression that is nonzero if @var{x} is a legitimate constant for
an immediate operand on the target machine. You can assume that
@var{x} satisfies @code{CONSTANT_P}, so you need not check this. In fact,
@samp{1} is a suitable definition for this macro on machines where
anything @code{CONSTANT_P} is valid.
-@end table
+@end defmac
@node Condition Code
@section Condition Code Status
@@ -5122,25 +5039,23 @@ Sometimes additional machine-specific flags must be defined in the machine
description header file. It can also add additional machine-specific
information by defining @code{CC_STATUS_MDEP}.
-@table @code
-@findex CC_STATUS_MDEP
-@item CC_STATUS_MDEP
+@defmac CC_STATUS_MDEP
C code for a data type which is used for declaring the @code{mdep}
component of @code{cc_status}. It defaults to @code{int}.
This macro is not used on machines that do not use @code{cc0}.
+@end defmac
-@findex CC_STATUS_MDEP_INIT
-@item CC_STATUS_MDEP_INIT
+@defmac CC_STATUS_MDEP_INIT
A C expression to initialize the @code{mdep} field to ``empty''.
The default definition does nothing, since most machines don't use
the field anyway. If you want to use the field, you should probably
define this macro to initialize it.
This macro is not used on machines that do not use @code{cc0}.
+@end defmac
-@findex NOTICE_UPDATE_CC
-@item NOTICE_UPDATE_CC (@var{exp}, @var{insn})
+@defmac NOTICE_UPDATE_CC (@var{exp}, @var{insn})
A C compound statement to set the components of @code{cc_status}
appropriately for an insn @var{insn} whose body is @var{exp}. It is
this macro's responsibility to recognize insns that set the condition
@@ -5175,9 +5090,9 @@ A possible definition of @code{NOTICE_UPDATE_CC} is to call a function
that looks at an attribute (@pxref{Insn Attributes}) named, for example,
@samp{cc}. This avoids having detailed information about patterns in
two places, the @file{md} file and in @code{NOTICE_UPDATE_CC}.
+@end defmac
-@findex EXTRA_CC_MODES
-@item EXTRA_CC_MODES
+@defmac EXTRA_CC_MODES
Condition codes are represented in registers by machine modes of class
@code{MODE_CC}. By default, there is just one mode, @code{CCmode}, with
this class. If you need more such modes, create a file named
@@ -5200,9 +5115,9 @@ CC (CCFPE) /* @r{Floating point comparison that may trap.} */
When you create this file, the macro @code{EXTRA_CC_MODES} is
automatically defined by @command{configure}, with value @samp{1}.
+@end defmac
-@findex SELECT_CC_MODE
-@item SELECT_CC_MODE (@var{op}, @var{x}, @var{y})
+@defmac SELECT_CC_MODE (@var{op}, @var{x}, @var{y})
Returns a mode from class @code{MODE_CC} to be used when comparison
operation code @var{op} is applied to rtx @var{x} and @var{y}. For
example, on the SPARC, @code{SELECT_CC_MODE} is defined as (see
@@ -5219,9 +5134,9 @@ definition)
@end smallexample
You need not define this macro if @code{EXTRA_CC_MODES} is not defined.
+@end defmac
-@findex CANONICALIZE_COMPARISON
-@item CANONICALIZE_COMPARISON (@var{code}, @var{op0}, @var{op1})
+@defmac CANONICALIZE_COMPARISON (@var{code}, @var{op0}, @var{op1})
On some machines not all possible comparisons are defined, but you can
convert an invalid comparison into a valid one. For example, the Alpha
does not have a @code{GT} comparison, but you can use an @code{LT}
@@ -5239,9 +5154,9 @@ valid but will see if the resulting insn matches a pattern in the
You need not define this macro if it would never change the comparison
code or operands.
+@end defmac
-@findex REVERSIBLE_CC_MODE
-@item REVERSIBLE_CC_MODE (@var{mode})
+@defmac REVERSIBLE_CC_MODE (@var{mode})
A C expression whose value is one if it is always safe to reverse a
comparison whose mode is @var{mode}. If @code{SELECT_CC_MODE}
can ever return @var{mode} for a floating-point inequality comparison,
@@ -5255,8 +5170,9 @@ inequality comparisons are always given @code{CCFPEmode}:
@smallexample
#define REVERSIBLE_CC_MODE(MODE) ((MODE) != CCFPEmode)
@end smallexample
+@end defmac
-@findex REVERSE_CONDITION (@var{code}, @var{mode})
+@defmac REVERSE_CONDITION (@var{code}, @var{mode})
A C expression whose value is reversed condition code of the @var{code} for
comparison done in CC_MODE @var{mode}. The macro is used only in case
@code{REVERSIBLE_CC_MODE (@var{mode})} is nonzero. Define this macro in case
@@ -5270,9 +5186,9 @@ like:
((MODE) != CCFPmode ? reverse_condition (CODE) \
: reverse_condition_maybe_unordered (CODE))
@end smallexample
+@end defmac
-@findex REVERSE_CONDEXEC_PREDICATES_P
-@item REVERSE_CONDEXEC_PREDICATES_P (@var{code1}, @var{code2})
+@defmac REVERSE_CONDEXEC_PREDICATES_P (@var{code1}, @var{code2})
A C expression that returns true if the conditional execution predicate
@var{code1} is the inverse of @var{code2} and vice versa. Define this to
return 0 if the target has conditional execution predicates that cannot be
@@ -5283,8 +5199,7 @@ follows:
#define REVERSE_CONDEXEC_PREDICATES_P (x, y) \
((x) == reverse_condition (y))
@end smallexample
-
-@end table
+@end defmac
@node Costs
@section Describing Relative Costs of Operations
@@ -5295,9 +5210,7 @@ follows:
These macros let you describe the relative speed of various operations
on the target machine.
-@table @code
-@findex REGISTER_MOVE_COST
-@item REGISTER_MOVE_COST (@var{mode}, @var{from}, @var{to})
+@defmac REGISTER_MOVE_COST (@var{mode}, @var{from}, @var{to})
A C expression for the cost of moving data of mode @var{mode} from a
register in class @var{from} to one in class @var{to}. The classes are
expressed using the enumeration values such as @code{GENERAL_REGS}. A
@@ -5314,9 +5227,9 @@ classes returns a value of 2, reload does not check to ensure that the
constraints of the insn are met. Setting a cost of other than 2 will
allow reload to verify that the constraints are met. You should do this
if the @samp{mov@var{m}} pattern's constraints do not allow such copying.
+@end defmac
-@findex MEMORY_MOVE_COST
-@item MEMORY_MOVE_COST (@var{mode}, @var{class}, @var{in})
+@defmac MEMORY_MOVE_COST (@var{mode}, @var{class}, @var{in})
A C expression for the cost of moving data of mode @var{mode} between a
register of class @var{class} and memory; @var{in} is zero if the value
is to be written to memory, nonzero if it is to be read in. This cost
@@ -5338,20 +5251,18 @@ secondary register in the conventional way but the default base value of
4 is not correct for your machine, define this macro to add some other
value to the result of that function. The arguments to that function
are the same as to this macro.
+@end defmac
-@findex BRANCH_COST
-@item BRANCH_COST
+@defmac BRANCH_COST
A C expression for the cost of a branch instruction. A value of 1 is
the default; other values are interpreted relative to that.
-@end table
+@end defmac
Here are additional macros which do not specify precise relative costs,
but only that certain actions are more expensive than GCC would
ordinarily expect.
-@table @code
-@findex SLOW_BYTE_ACCESS
-@item SLOW_BYTE_ACCESS
+@defmac SLOW_BYTE_ACCESS
Define this macro as a C expression which is nonzero if accessing less
than a word of memory (i.e.@: a @code{char} or a @code{short}) is no
faster than accessing a word of memory, i.e., if such access
@@ -5364,9 +5275,9 @@ load will be used if alignment permits. Unless bytes accesses are
faster than word accesses, using word accesses is preferable since it
may eliminate subsequent memory access if subsequent accesses occur to
other fields in the same word of the structure, but to different bytes.
+@end defmac
-@findex SLOW_UNALIGNED_ACCESS
-@item SLOW_UNALIGNED_ACCESS (@var{mode}, @var{alignment})
+@defmac SLOW_UNALIGNED_ACCESS (@var{mode}, @var{alignment})
Define this macro to be the value 1 if memory accesses described by the
@var{mode} and @var{alignment} parameters have a cost many times greater
than aligned accesses, for example if they are emulated in a trap
@@ -5381,9 +5292,9 @@ cycle or two to the time for a memory access.
If the value of this macro is always zero, it need not be defined. If
this macro is defined, it should produce a nonzero value when
@code{STRICT_ALIGNMENT} is nonzero.
+@end defmac
-@findex MOVE_RATIO
-@item MOVE_RATIO
+@defmac MOVE_RATIO
The threshold of number of scalar memory-to-memory move insns, @emph{below}
which a sequence of insns should be generated instead of a
string move insn or a library call. Increasing the value will always
@@ -5394,109 +5305,109 @@ Note that on machines where the corresponding move insn is a
the number of such sequences.
If you don't define this, a reasonable default is used.
+@end defmac
-@findex MOVE_BY_PIECES_P
-@item MOVE_BY_PIECES_P (@var{size}, @var{alignment})
+@defmac MOVE_BY_PIECES_P (@var{size}, @var{alignment})
A C expression used to determine whether @code{move_by_pieces} will be used to
copy a chunk of memory, or whether some other block move mechanism
will be used. Defaults to 1 if @code{move_by_pieces_ninsns} returns less
than @code{MOVE_RATIO}.
+@end defmac
-@findex MOVE_MAX_PIECES
-@item MOVE_MAX_PIECES
+@defmac MOVE_MAX_PIECES
A C expression used by @code{move_by_pieces} to determine the largest unit
a load or store used to copy memory is. Defaults to @code{MOVE_MAX}.
+@end defmac
-@findex CLEAR_RATIO
-@item CLEAR_RATIO
+@defmac CLEAR_RATIO
The threshold of number of scalar move insns, @emph{below} which a sequence
of insns should be generated to clear memory instead of a string clear insn
or a library call. 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.
+@end defmac
-@findex CLEAR_BY_PIECES_P
-@item CLEAR_BY_PIECES_P (@var{size}, @var{alignment})
+@defmac CLEAR_BY_PIECES_P (@var{size}, @var{alignment})
A C expression used to determine whether @code{clear_by_pieces} will be used
to clear a chunk of memory, or whether some other block clear mechanism
will be used. Defaults to 1 if @code{move_by_pieces_ninsns} returns less
than @code{CLEAR_RATIO}.
+@end defmac
-@findex STORE_BY_PIECES_P
-@item STORE_BY_PIECES_P (@var{size}, @var{alignment})
+@defmac STORE_BY_PIECES_P (@var{size}, @var{alignment})
A C expression used to determine whether @code{store_by_pieces} will be
used to set a chunk of memory to a constant value, or whether some other
mechanism will be used. Used by @code{__builtin_memset} when storing
values other than constant zero and by @code{__builtin_strcpy} when
when called with a constant source string.
Defaults to @code{MOVE_BY_PIECES_P}.
+@end defmac
-@findex USE_LOAD_POST_INCREMENT
-@item USE_LOAD_POST_INCREMENT (@var{mode})
+@defmac USE_LOAD_POST_INCREMENT (@var{mode})
A C expression used to determine whether a load postincrement is a good
thing to use for a given mode. Defaults to the value of
@code{HAVE_POST_INCREMENT}.
+@end defmac
-@findex USE_LOAD_POST_DECREMENT
-@item USE_LOAD_POST_DECREMENT (@var{mode})
+@defmac USE_LOAD_POST_DECREMENT (@var{mode})
A C expression used to determine whether a load postdecrement is a good
thing to use for a given mode. Defaults to the value of
@code{HAVE_POST_DECREMENT}.
+@end defmac
-@findex USE_LOAD_PRE_INCREMENT
-@item USE_LOAD_PRE_INCREMENT (@var{mode})
+@defmac USE_LOAD_PRE_INCREMENT (@var{mode})
A C expression used to determine whether a load preincrement is a good
thing to use for a given mode. Defaults to the value of
@code{HAVE_PRE_INCREMENT}.
+@end defmac
-@findex USE_LOAD_PRE_DECREMENT
-@item USE_LOAD_PRE_DECREMENT (@var{mode})
+@defmac USE_LOAD_PRE_DECREMENT (@var{mode})
A C expression used to determine whether a load predecrement is a good
thing to use for a given mode. Defaults to the value of
@code{HAVE_PRE_DECREMENT}.
+@end defmac
-@findex USE_STORE_POST_INCREMENT
-@item USE_STORE_POST_INCREMENT (@var{mode})
+@defmac USE_STORE_POST_INCREMENT (@var{mode})
A C expression used to determine whether a store postincrement is a good
thing to use for a given mode. Defaults to the value of
@code{HAVE_POST_INCREMENT}.
+@end defmac
-@findex USE_STORE_POST_DECREMENT
-@item USE_STORE_POST_DECREMENT (@var{mode})
+@defmac USE_STORE_POST_DECREMENT (@var{mode})
A C expression used to determine whether a store postdecrement is a good
thing to use for a given mode. Defaults to the value of
@code{HAVE_POST_DECREMENT}.
+@end defmac
-@findex USE_STORE_PRE_INCREMENT
-@item USE_STORE_PRE_INCREMENT (@var{mode})
+@defmac USE_STORE_PRE_INCREMENT (@var{mode})
This macro is used to determine whether a store preincrement is a good
thing to use for a given mode. Defaults to the value of
@code{HAVE_PRE_INCREMENT}.
+@end defmac
-@findex USE_STORE_PRE_DECREMENT
-@item USE_STORE_PRE_DECREMENT (@var{mode})
+@defmac USE_STORE_PRE_DECREMENT (@var{mode})
This macro is used to determine whether a store predecrement is a good
thing to use for a given mode. Defaults to the value of
@code{HAVE_PRE_DECREMENT}.
+@end defmac
-@findex NO_FUNCTION_CSE
-@item NO_FUNCTION_CSE
+@defmac NO_FUNCTION_CSE
Define this macro if it is as good or better to call a constant
function address than to call an address kept in a register.
+@end defmac
-@findex NO_RECURSIVE_FUNCTION_CSE
-@item NO_RECURSIVE_FUNCTION_CSE
+@defmac NO_RECURSIVE_FUNCTION_CSE
Define this macro if it is as good or better for a function to call
itself with an explicit address than to call an address kept in a
register.
+@end defmac
-@findex RANGE_TEST_NON_SHORT_CIRCUIT
-@item RANGE_TEST_NON_SHORT_CIRCUIT
+@defmac RANGE_TEST_NON_SHORT_CIRCUIT
Define this macro if a non-short-circuit operation produced by
@samp{fold_range_test ()} is optimal. This macro defaults to true if
@code{BRANCH_COST} is greater than or equal to the value 2.
-@end table
+@end defmac
@deftypefn {Target Hook} bool TARGET_RTX_COSTS (rtx @var{x}, int @var{code}, int @var{outer_code}, int *@var{total})
This target hook describes the relative costs of RTL expressions.
@@ -5800,34 +5711,31 @@ insns with indexes greater than given index.
Macros in the following table are generated by the program
@file{genattr} and can be useful for writing the hooks.
-@table @code
-@findex TRADITIONAL_PIPELINE_INTERFACE
-@item TRADITIONAL_PIPELINE_INTERFACE
+@defmac TRADITIONAL_PIPELINE_INTERFACE
The macro definition is generated if there is a traditional pipeline
description in @file{.md} file. You should also remember that to
simplify the insn scheduler sources an empty traditional pipeline
description interface is generated even if there is no a traditional
pipeline description in the @file{.md} file. The macro can be used to
distinguish the two types of the traditional interface.
+@end defmac
-@findex DFA_PIPELINE_INTERFACE
-@item DFA_PIPELINE_INTERFACE
+@defmac DFA_PIPELINE_INTERFACE
The macro definition is generated if there is an automaton pipeline
description in @file{.md} file. You should also remember that to
simplify the insn scheduler sources an empty automaton pipeline
description interface is generated even if there is no an automaton
pipeline description in the @file{.md} file. The macro can be used to
distinguish the two types of the automaton interface.
+@end defmac
-@findex MAX_DFA_ISSUE_RATE
-@item MAX_DFA_ISSUE_RATE
+@defmac MAX_DFA_ISSUE_RATE
The macro definition is generated in the automaton based pipeline
description interface. Its value is calculated from the automaton
based pipeline description and is equal to maximal number of all insns
described in constructions @samp{define_insn_reservation} which can be
issued on the same processor cycle.
-
-@end table
+@end defmac
@node Sections
@section Dividing the Output into Sections (Texts, Data, @dots{})
@@ -5845,45 +5753,43 @@ The compiler must tell the assembler when to switch sections. These
macros control what commands to output to tell the assembler this. You
can also define additional sections.
-@table @code
-@findex TEXT_SECTION_ASM_OP
-@item TEXT_SECTION_ASM_OP
+@defmac TEXT_SECTION_ASM_OP
A C expression whose value is a string, including spacing, containing the
assembler operation that should precede instructions and read-only data.
Normally @code{"\t.text"} is right.
+@end defmac
-@findex TEXT_SECTION
-@item TEXT_SECTION
+@defmac TEXT_SECTION
A C statement that switches to the default section containing instructions.
Normally this is not needed, as simply defining @code{TEXT_SECTION_ASM_OP}
is enough. The MIPS port uses this to sort all functions after all data
declarations.
+@end defmac
-@findex HOT_TEXT_SECTION_NAME
-@item HOT_TEXT_SECTION_NAME
+@defmac HOT_TEXT_SECTION_NAME
If defined, a C string constant for the name of the section containing most
frequently executed functions of the program. If not defined, GCC will provide
a default definition if the target supports named sections.
+@end defmac
-@findex UNLIKELY_EXECUTED_TEXT_SECTION_NAME
-@item UNLIKELY_EXECUTED_TEXT_SECTION_NAME
+@defmac UNLIKELY_EXECUTED_TEXT_SECTION_NAME
If defined, a C string constant for the name of the section containing unlikely
executed functions in the program.
+@end defmac
-@findex DATA_SECTION_ASM_OP
-@item DATA_SECTION_ASM_OP
+@defmac DATA_SECTION_ASM_OP
A C expression whose value is a string, including spacing, containing the
assembler operation to identify the following data as writable initialized
data. Normally @code{"\t.data"} is right.
+@end defmac
-@findex READONLY_DATA_SECTION_ASM_OP
-@item READONLY_DATA_SECTION_ASM_OP
+@defmac READONLY_DATA_SECTION_ASM_OP
A C expression whose value is a string, including spacing, containing the
assembler operation to identify the following data as read-only initialized
data.
+@end defmac
-@findex READONLY_DATA_SECTION
-@item READONLY_DATA_SECTION
+@defmac READONLY_DATA_SECTION
A macro naming a function to call to switch to the proper section for
read-only data. The default is to use @code{READONLY_DATA_SECTION_ASM_OP}
if defined, else fall back to @code{text_section}.
@@ -5891,15 +5797,15 @@ if defined, else fall back to @code{text_section}.
The most common definition will be @code{data_section}, if the target
does not have a special read-only data section, and does not put data
in the text section.
+@end defmac
-@findex SHARED_SECTION_ASM_OP
-@item SHARED_SECTION_ASM_OP
+@defmac SHARED_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
shared data. If not defined, @code{DATA_SECTION_ASM_OP} will be used.
+@end defmac
-@findex BSS_SECTION_ASM_OP
-@item BSS_SECTION_ASM_OP
+@defmac BSS_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
uninitialized global data. If not defined, and neither
@@ -5907,30 +5813,30 @@ uninitialized global data. If not defined, and neither
uninitialized global data will be output in the data section if
@option{-fno-common} is passed, otherwise @code{ASM_OUTPUT_COMMON} will be
used.
+@end defmac
-@findex SHARED_BSS_SECTION_ASM_OP
-@item SHARED_BSS_SECTION_ASM_OP
+@defmac SHARED_BSS_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
uninitialized global shared data. If not defined, and
@code{BSS_SECTION_ASM_OP} is, the latter will be used.
+@end defmac
-@findex INIT_SECTION_ASM_OP
-@item INIT_SECTION_ASM_OP
+@defmac INIT_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
initialization code. If not defined, GCC will assume such a section does
not exist.
+@end defmac
-@findex FINI_SECTION_ASM_OP
-@item FINI_SECTION_ASM_OP
+@defmac FINI_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
finalization code. If not defined, GCC will assume such a section does
not exist.
+@end defmac
-@findex CRT_CALL_STATIC_FUNCTION
-@item CRT_CALL_STATIC_FUNCTION (@var{section_op}, @var{function})
+@defmac CRT_CALL_STATIC_FUNCTION (@var{section_op}, @var{function})
If defined, an ASM statement that switches to a different section
via @var{section_op}, calls @var{function}, and switches back to
the text section. This is used in @file{crtstuff.c} if
@@ -5940,40 +5846,40 @@ sections. By default, this macro uses a simple function call. Some
ports need hand-crafted assembly code to avoid dependencies on
registers initialized in the function prologue or to ensure that
constant pools don't end up too far way in the text section.
+@end defmac
-@findex FORCE_CODE_SECTION_ALIGN
-@item FORCE_CODE_SECTION_ALIGN
+@defmac FORCE_CODE_SECTION_ALIGN
If defined, an ASM statement that aligns a code section to some
arbitrary boundary. This is used to force all fragments of the
@code{.init} and @code{.fini} sections to have to same alignment
and thus prevent the linker from having to add any padding.
+@end defmac
-@findex EXTRA_SECTIONS
@findex in_text
@findex in_data
-@item EXTRA_SECTIONS
+@defmac EXTRA_SECTIONS
A list of names for sections other than the standard two, which are
@code{in_text} and @code{in_data}. You need not define this macro
on a system with no other sections (that GCC needs to use).
+@end defmac
-@findex EXTRA_SECTION_FUNCTIONS
@findex text_section
@findex data_section
-@item EXTRA_SECTION_FUNCTIONS
+@defmac EXTRA_SECTION_FUNCTIONS
One or more functions to be defined in @file{varasm.c}. These
functions should do jobs analogous to those of @code{text_section} and
@code{data_section}, for your additional sections. Do not define this
macro if you do not define @code{EXTRA_SECTIONS}.
+@end defmac
-@findex JUMP_TABLES_IN_TEXT_SECTION
-@item JUMP_TABLES_IN_TEXT_SECTION
+@defmac JUMP_TABLES_IN_TEXT_SECTION
Define this macro to be an expression with a nonzero value if jump
tables (for @code{tablejump} insns) should be output in the text
section, along with the assembler instructions. Otherwise, the
readonly data section is used.
This macro is irrelevant if there is no separate readonly data section.
-@end table
+@end defmac
@deftypefn {Target Hook} void TARGET_ASM_SELECT_SECTION (tree @var{exp}, int @var{reloc}, unsigned HOST_WIDE_INT @var{align})
Switches to the appropriate section for output of @var{exp}. You can
@@ -6100,9 +6006,7 @@ switch statements so that they use relative addresses.
@c i rearranged the order of the macros above to try to force one of
@c them to the next line, to eliminate an overfull hbox. --mew 10feb93
-@table @code
-@findex PIC_OFFSET_TABLE_REGNUM
-@item PIC_OFFSET_TABLE_REGNUM
+@defmac PIC_OFFSET_TABLE_REGNUM
The register number of the register used to address a table of static
data addresses in memory. In some cases this register is defined by a
processor's ``application binary interface'' (ABI)@. When this macro
@@ -6111,15 +6015,15 @@ pointer and frame pointer registers. If this macro is not defined, it
is up to the machine-dependent files to allocate such a register (if
necessary). Note that this register must be fixed when in use (e.g.@:
when @code{flag_pic} is true).
+@end defmac
-@findex PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
-@item PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
+@defmac 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{PIC_OFFSET_TABLE_REGNUM} is not defined.
+@end defmac
-@findex FINALIZE_PIC
-@item FINALIZE_PIC
+@defmac FINALIZE_PIC
By generating position-independent code, when two different programs (A
and B) share a common library (libC.a), the text of the library can be
shared whether or not the library is linked at the same address for both
@@ -6133,9 +6037,9 @@ before. (It is not done before, because in the case of compiling an
inline function, it would lead to multiple PIC prologues being
included in functions which used inline functions and were compiled to
assembly language.)
+@end defmac
-@findex LEGITIMATE_PIC_OPERAND_P
-@item LEGITIMATE_PIC_OPERAND_P (@var{x})
+@defmac LEGITIMATE_PIC_OPERAND_P (@var{x})
A C expression that is nonzero if @var{x} is a legitimate immediate
operand on the target machine when generating position independent code.
You can assume that @var{x} satisfies @code{CONSTANT_P}, so you need not
@@ -6143,7 +6047,7 @@ check this. You can also assume @var{flag_pic} is true, so you need not
check it either. You need not define this macro if all constants
(including @code{SYMBOL_REF}) can be immediate operands when generating
position independent code.
-@end table
+@end defmac
@node Assembler Format
@section Defining the Output Assembler Language
@@ -6174,19 +6078,38 @@ instructions do.
@cindex output of assembler code
@c prevent bad page break with this line
-This describes the overall framework of an assembler file.
+This describes the overall framework of an assembly file.
+
+@deftypefn {Target Hook} void TARGET_ASM_FILE_START ()
+@findex default_file_start
+Output to @code{asm_out_file} any text which the assembler expects to
+find at the beginning of a file. The default behavior is controlled
+by two flags, documented below. Unless your target's assembler is
+quite unusual, if you override the default, you should call
+@code{default_file_start} at some point in your target hook. This
+lets other target files rely on these variables.
+@end deftypefn
-@table @code
-@findex ASM_FILE_START
-@item ASM_FILE_START (@var{stream})
-A C expression which outputs to the stdio stream @var{stream}
-some appropriate text to go at the start of an assembler file.
+@deftypevr {Target Hook} bool TARGET_ASM_FILE_START_APP_OFF
+If this flag is true, the text of the macro @code{ASM_APP_OFF} will be
+printed as the very first line in the assembly file, unless
+@option{-fverbose-asm} is in effect. (If that macro has been defined
+to the empty string, this variable has no effect.) With the normal
+definition of @code{ASM_APP_OFF}, the effect is to notify the GNU
+assembler that it need not bother stripping comments or extra
+whitespace from its input. This allows it to work a bit faster.
+
+The default is false. You should not set it to true unless you have
+verified that your port does not generate any extra whitespace or
+comments that will cause GAS to issue errors in NO_APP mode.
+@end deftypevr
-Normally this macro is defined to output a line containing
-@samp{#NO_APP}, which is a comment that has no effect on most
-assemblers but tells the GNU assembler that it can save time by not
-checking for certain assembler constructs.
-@end table
+@deftypevr {Target Hook} bool TARGET_ASM_FILE_START_FILE_DIRECTIVE
+If this flag is true, @code{output_file_directive} will be called
+for the primary source file, immediately after printing
+@code{ASM_APP_OFF} (if that is enabled). Most ELF assemblers expect
+this to be done. The default is false.
+@end deftypevr
@deftypefn {Target Hook} void TARGET_ASM_FILE_END ()
Output to @code{asm_out_file} any text which the assembler expects
@@ -6202,60 +6125,60 @@ need to do other things in that hook, have your hook function call
this function.
@end deftypefun
-@table @code
-@findex ASM_COMMENT_START
-@item ASM_COMMENT_START
+@defmac ASM_COMMENT_START
A C string constant describing how to begin a comment in the target
assembler language. The compiler assumes that the comment will end at
the end of the line.
+@end defmac
-@findex ASM_APP_ON
-@item ASM_APP_ON
+@defmac ASM_APP_ON
A C string constant for text to be output before each @code{asm}
statement or group of consecutive ones. Normally this is
@code{"#APP"}, which is a comment that has no effect on most
assemblers but tells the GNU assembler that it must check the lines
that follow for all valid assembler constructs.
+@end defmac
-@findex ASM_APP_OFF
-@item ASM_APP_OFF
+@defmac ASM_APP_OFF
A C string constant for text to be output after each @code{asm}
statement or group of consecutive ones. Normally this is
@code{"#NO_APP"}, which tells the GNU assembler to resume making the
time-saving assumptions that are valid for ordinary compiler output.
+@end defmac
-@findex ASM_OUTPUT_SOURCE_FILENAME
-@item ASM_OUTPUT_SOURCE_FILENAME (@var{stream}, @var{name})
+@defmac ASM_OUTPUT_SOURCE_FILENAME (@var{stream}, @var{name})
A C statement to output COFF information or DWARF debugging information
which indicates that filename @var{name} is the current source file to
the stdio stream @var{stream}.
This macro need not be defined if the standard form of output
for the file format in use is appropriate.
+@end defmac
-@findex OUTPUT_QUOTED_STRING
-@item OUTPUT_QUOTED_STRING (@var{stream}, @var{string})
+@defmac OUTPUT_QUOTED_STRING (@var{stream}, @var{string})
A C statement to output the string @var{string} to the stdio stream
@var{stream}. If you do not call the function @code{output_quoted_string}
in your config files, GCC will only call it to output filenames to
the assembler source. So you can use it to canonicalize the format
of the filename using this macro.
+@end defmac
-@findex ASM_OUTPUT_SOURCE_LINE
-@item ASM_OUTPUT_SOURCE_LINE (@var{stream}, @var{line})
+@defmac ASM_OUTPUT_SOURCE_LINE (@var{stream}, @var{line}, @var{counter})
A C statement to output DBX or SDB debugging information before code
for line number @var{line} of the current source file to the
-stdio stream @var{stream}.
+stdio stream @var{stream}. @var{counter} is the number of time the
+macro was invoked, including the current invocation; it is intended
+to generate unique labels in the assembly output.
This macro need not be defined if the standard form of debugging
information for the debugger in use is appropriate.
+@end defmac
-@findex ASM_OUTPUT_IDENT
-@item ASM_OUTPUT_IDENT (@var{stream}, @var{string})
+@defmac ASM_OUTPUT_IDENT (@var{stream}, @var{string})
A C statement to output something to the assembler file to handle a
@samp{#ident} directive containing the text @var{string}. If this
macro is not defined, nothing is output for a @samp{#ident} directive.
-@end table
+@end defmac
@deftypefn {Target Hook} void TARGET_ASM_NAMED_SECTION (const char *@var{name}, unsigned int @var{flags}, unsigned int @var{align})
Output assembly directives to switch to section @var{name}. The section
@@ -6321,9 +6244,7 @@ The default implementation of this hook will use the
when the relevant string is @code{NULL}.
@end deftypefn
-@table @code
-@findex OUTPUT_ADDR_CONST_EXTRA
-@item OUTPUT_ADDR_CONST_EXTRA (@var{stream}, @var{x}, @var{fail})
+@defmac OUTPUT_ADDR_CONST_EXTRA (@var{stream}, @var{x}, @var{fail})
A C statement to recognize @var{rtx} patterns that
@code{output_addr_const} can't deal with, and output assembly code to
@var{stream} corresponding to the pattern @var{x}. This may be used to
@@ -6333,9 +6254,9 @@ If @code{OUTPUT_ADDR_CONST_EXTRA} fails to recognize a pattern, it must
@code{goto fail}, so that a standard error message is printed. If it
prints an error message itself, by calling, for example,
@code{output_operand_lossage}, it may just complete normally.
+@end defmac
-@findex ASM_OUTPUT_ASCII
-@item ASM_OUTPUT_ASCII (@var{stream}, @var{ptr}, @var{len})
+@defmac ASM_OUTPUT_ASCII (@var{stream}, @var{ptr}, @var{len})
A C statement to output to the stdio stream @var{stream} an assembler
instruction to assemble a string constant containing the @var{len}
bytes at @var{ptr}. @var{ptr} will be a C expression of type
@@ -6344,24 +6265,24 @@ bytes at @var{ptr}. @var{ptr} will be a C expression of type
If the assembler has a @code{.ascii} pseudo-op as found in the
Berkeley Unix assembler, do not define the macro
@code{ASM_OUTPUT_ASCII}.
+@end defmac
-@findex ASM_OUTPUT_FDESC
-@item ASM_OUTPUT_FDESC (@var{stream}, @var{decl}, @var{n})
+@defmac ASM_OUTPUT_FDESC (@var{stream}, @var{decl}, @var{n})
A C statement to output word @var{n} of a function descriptor for
@var{decl}. This must be defined if @code{TARGET_VTABLE_USES_DESCRIPTORS}
is defined, and is otherwise unused.
+@end defmac
-@findex CONSTANT_POOL_BEFORE_FUNCTION
-@item CONSTANT_POOL_BEFORE_FUNCTION
+@defmac CONSTANT_POOL_BEFORE_FUNCTION
You may define this macro as a C expression. You should define the
expression to have a nonzero value if GCC should output the constant
pool for a function before the code for the function, or a zero value if
GCC should output the constant pool after the function. If you do
not define this macro, the usual case, GCC will output the constant
pool before the function.
+@end defmac
-@findex ASM_OUTPUT_POOL_PROLOGUE
-@item ASM_OUTPUT_POOL_PROLOGUE (@var{file}, @var{funname}, @var{fundecl}, @var{size})
+@defmac ASM_OUTPUT_POOL_PROLOGUE (@var{file}, @var{funname}, @var{fundecl}, @var{size})
A C statement to output assembler commands to define the start of the
constant pool for a function. @var{funname} is a string giving
the name of the function. Should the return type of the function
@@ -6371,9 +6292,9 @@ immediately after this call.
If no constant-pool prefix is required, the usual case, this macro need
not be defined.
+@end defmac
-@findex ASM_OUTPUT_SPECIAL_POOL_ENTRY
-@item ASM_OUTPUT_SPECIAL_POOL_ENTRY (@var{file}, @var{x}, @var{mode}, @var{align}, @var{labelno}, @var{jumpto})
+@defmac ASM_OUTPUT_SPECIAL_POOL_ENTRY (@var{file}, @var{x}, @var{mode}, @var{align}, @var{labelno}, @var{jumpto})
A C statement (with or without semicolon) to output a constant in the
constant pool, if it needs special treatment. (This macro need not do
anything for RTL expressions that can be output normally.)
@@ -6399,9 +6320,9 @@ When you output a pool entry specially, you should end with a
entry from being output a second time in the usual manner.
You need not define this macro if it would do nothing.
+@end defmac
-@findex ASM_OUTPUT_POOL_EPILOGUE
-@item ASM_OUTPUT_POOL_EPILOGUE (@var{file} @var{funname} @var{fundecl} @var{size})
+@defmac ASM_OUTPUT_POOL_EPILOGUE (@var{file} @var{funname} @var{fundecl} @var{size})
A C statement to output assembler commands to at the end of the constant
pool for a function. @var{funname} is a string giving the name of the
function. Should the return type of the function be required, you can
@@ -6410,15 +6331,15 @@ constant pool that GCC wrote immediately before this call.
If no constant-pool epilogue is required, the usual case, you need not
define this macro.
+@end defmac
-@findex IS_ASM_LOGICAL_LINE_SEPARATOR
-@item IS_ASM_LOGICAL_LINE_SEPARATOR (@var{C})
+@defmac IS_ASM_LOGICAL_LINE_SEPARATOR (@var{C})
Define this macro as a C expression which is nonzero if @var{C} is
used as a logical line separator by the assembler.
If you do not define this macro, the default is that only
the character @samp{;} is treated as a logical line separator.
-@end table
+@end defmac
@deftypevr {Target Hook} {const char *} TARGET_ASM_OPEN_PAREN
@deftypevrx {Target Hook} {const char *} TARGET_ASM_CLOSE_PAREN
@@ -6430,13 +6351,9 @@ default to normal parentheses, which is correct for most assemblers.
These macros are provided by @file{real.h} for writing the definitions
of @code{ASM_OUTPUT_DOUBLE} and the like:
-@table @code
-@item REAL_VALUE_TO_TARGET_SINGLE (@var{x}, @var{l})
-@itemx REAL_VALUE_TO_TARGET_DOUBLE (@var{x}, @var{l})
-@itemx REAL_VALUE_TO_TARGET_LONG_DOUBLE (@var{x}, @var{l})
-@findex REAL_VALUE_TO_TARGET_SINGLE
-@findex REAL_VALUE_TO_TARGET_DOUBLE
-@findex REAL_VALUE_TO_TARGET_LONG_DOUBLE
+@defmac REAL_VALUE_TO_TARGET_SINGLE (@var{x}, @var{l})
+@defmacx REAL_VALUE_TO_TARGET_DOUBLE (@var{x}, @var{l})
+@defmacx REAL_VALUE_TO_TARGET_LONG_DOUBLE (@var{x}, @var{l})
These translate @var{x}, of type @code{REAL_VALUE_TYPE}, to the target's
floating point representation, and store its bit pattern in the variable
@var{l}. For @code{REAL_VALUE_TO_TARGET_SINGLE}, this variable should
@@ -6450,7 +6367,7 @@ host machine.
The array element values are designed so that you can print them out
using @code{fprintf} in the order they should appear in the target
machine's memory.
-@end table
+@end defmac
@node Uninitialized Data
@subsection Output of Uninitialized Variables
@@ -6458,9 +6375,7 @@ machine's memory.
Each of the macros in this section is used to do the whole job of
outputting a single uninitialized variable.
-@table @code
-@findex ASM_OUTPUT_COMMON
-@item ASM_OUTPUT_COMMON (@var{stream}, @var{name}, @var{size}, @var{rounded})
+@defmac ASM_OUTPUT_COMMON (@var{stream}, @var{name}, @var{size}, @var{rounded})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} the assembler definition of a common-label named
@var{name} whose size is @var{size} bytes. The variable @var{rounded}
@@ -6472,32 +6387,32 @@ assembler syntax for defining the name, and a newline.
This macro controls how the assembler definitions of uninitialized
common global variables are output.
+@end defmac
-@findex ASM_OUTPUT_ALIGNED_COMMON
-@item ASM_OUTPUT_ALIGNED_COMMON (@var{stream}, @var{name}, @var{size}, @var{alignment})
+@defmac ASM_OUTPUT_ALIGNED_COMMON (@var{stream}, @var{name}, @var{size}, @var{alignment})
Like @code{ASM_OUTPUT_COMMON} except takes the required alignment as a
separate, explicit argument. If you define this macro, it is used in
place of @code{ASM_OUTPUT_COMMON}, and gives you more flexibility in
handling the required alignment of the variable. The alignment is specified
as the number of bits.
+@end defmac
-@findex ASM_OUTPUT_ALIGNED_DECL_COMMON
-@item ASM_OUTPUT_ALIGNED_DECL_COMMON (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
+@defmac ASM_OUTPUT_ALIGNED_DECL_COMMON (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
Like @code{ASM_OUTPUT_ALIGNED_COMMON} except that @var{decl} of the
variable to be output, if there is one, or @code{NULL_TREE} if there
is no corresponding variable. If you define this macro, GCC will use it
in place of both @code{ASM_OUTPUT_COMMON} and
@code{ASM_OUTPUT_ALIGNED_COMMON}. Define this macro when you need to see
the variable's decl in order to chose what to output.
+@end defmac
-@findex ASM_OUTPUT_SHARED_COMMON
-@item ASM_OUTPUT_SHARED_COMMON (@var{stream}, @var{name}, @var{size}, @var{rounded})
+@defmac ASM_OUTPUT_SHARED_COMMON (@var{stream}, @var{name}, @var{size}, @var{rounded})
If defined, it is similar to @code{ASM_OUTPUT_COMMON}, except that it
is used when @var{name} is shared. If not defined, @code{ASM_OUTPUT_COMMON}
will be used.
+@end defmac
-@findex ASM_OUTPUT_BSS
-@item ASM_OUTPUT_BSS (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{rounded})
+@defmac ASM_OUTPUT_BSS (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{rounded})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} the assembler definition of uninitialized global @var{decl} named
@var{name} whose size is @var{size} bytes. The variable @var{rounded}
@@ -6516,9 +6431,9 @@ is not defined for all targets. If this macro and
@code{ASM_OUTPUT_ALIGNED_BSS} are not defined then @code{ASM_OUTPUT_COMMON}
or @code{ASM_OUTPUT_ALIGNED_COMMON} or
@code{ASM_OUTPUT_ALIGNED_DECL_COMMON} is used.
+@end defmac
-@findex ASM_OUTPUT_ALIGNED_BSS
-@item ASM_OUTPUT_ALIGNED_BSS (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
+@defmac ASM_OUTPUT_ALIGNED_BSS (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
Like @code{ASM_OUTPUT_BSS} except takes the required alignment as a
separate, explicit argument. If you define this macro, it is used in
place of @code{ASM_OUTPUT_BSS}, and gives you more flexibility in
@@ -6527,15 +6442,15 @@ as the number of bits.
Try to use function @code{asm_output_aligned_bss} defined in file
@file{varasm.c} when defining this macro.
+@end defmac
-@findex ASM_OUTPUT_SHARED_BSS
-@item ASM_OUTPUT_SHARED_BSS (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{rounded})
+@defmac ASM_OUTPUT_SHARED_BSS (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{rounded})
If defined, it is similar to @code{ASM_OUTPUT_BSS}, except that it
is used when @var{name} is shared. If not defined, @code{ASM_OUTPUT_BSS}
will be used.
+@end defmac
-@findex ASM_OUTPUT_LOCAL
-@item ASM_OUTPUT_LOCAL (@var{stream}, @var{name}, @var{size}, @var{rounded})
+@defmac ASM_OUTPUT_LOCAL (@var{stream}, @var{name}, @var{size}, @var{rounded})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} the assembler definition of a local-common-label named
@var{name} whose size is @var{size} bytes. The variable @var{rounded}
@@ -6547,30 +6462,30 @@ assembler syntax for defining the name, and a newline.
This macro controls how the assembler definitions of uninitialized
static variables are output.
+@end defmac
-@findex ASM_OUTPUT_ALIGNED_LOCAL
-@item ASM_OUTPUT_ALIGNED_LOCAL (@var{stream}, @var{name}, @var{size}, @var{alignment})
+@defmac ASM_OUTPUT_ALIGNED_LOCAL (@var{stream}, @var{name}, @var{size}, @var{alignment})
Like @code{ASM_OUTPUT_LOCAL} except takes the required alignment as a
separate, explicit argument. If you define this macro, it is used in
place of @code{ASM_OUTPUT_LOCAL}, and gives you more flexibility in
handling the required alignment of the variable. The alignment is specified
as the number of bits.
+@end defmac
-@findex ASM_OUTPUT_ALIGNED_DECL_LOCAL
-@item ASM_OUTPUT_ALIGNED_DECL_LOCAL (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
+@defmac ASM_OUTPUT_ALIGNED_DECL_LOCAL (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
Like @code{ASM_OUTPUT_ALIGNED_DECL} except that @var{decl} of the
variable to be output, if there is one, or @code{NULL_TREE} if there
is no corresponding variable. If you define this macro, GCC will use it
in place of both @code{ASM_OUTPUT_DECL} and
@code{ASM_OUTPUT_ALIGNED_DECL}. Define this macro when you need to see
the variable's decl in order to chose what to output.
+@end defmac
-@findex ASM_OUTPUT_SHARED_LOCAL
-@item ASM_OUTPUT_SHARED_LOCAL (@var{stream}, @var{name}, @var{size}, @var{rounded})
+@defmac ASM_OUTPUT_SHARED_LOCAL (@var{stream}, @var{name}, @var{size}, @var{rounded})
If defined, it is similar to @code{ASM_OUTPUT_LOCAL}, except that it
is used when @var{name} is shared. If not defined, @code{ASM_OUTPUT_LOCAL}
will be used.
-@end table
+@end defmac
@node Label Output
@subsection Output and Generation of Labels
@@ -6578,19 +6493,17 @@ will be used.
@c prevent bad page break with this line
This is about outputting labels.
-@table @code
-@findex ASM_OUTPUT_LABEL
@findex assemble_name
-@item ASM_OUTPUT_LABEL (@var{stream}, @var{name})
+@defmac ASM_OUTPUT_LABEL (@var{stream}, @var{name})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} the assembler definition of a label named @var{name}.
Use the expression @code{assemble_name (@var{stream}, @var{name})} to
output the name itself; before and after that, output the additional
assembler syntax for defining the name, and a newline. A default
definition of this macro is provided which is correct for most systems.
+@end defmac
-@findex SIZE_ASM_OP
-@item SIZE_ASM_OP
+@defmac SIZE_ASM_OP
A C string containing the appropriate assembler directive to specify the
size of a symbol, without any arguments. On systems that use ELF, the
default (in @file{config/elfos.h}) is @samp{"\t.size\t"}; on other
@@ -6601,17 +6514,17 @@ of @code{ASM_OUTPUT_SIZE_DIRECTIVE} and @code{ASM_OUTPUT_MEASURED_SIZE}
for your system. If you need your own custom definitions of those
macros, or if you do not need explicit symbol sizes at all, do not
define this macro.
+@end defmac
-@findex ASM_OUTPUT_SIZE_DIRECTIVE
-@item ASM_OUTPUT_SIZE_DIRECTIVE (@var{stream}, @var{name}, @var{size})
+@defmac ASM_OUTPUT_SIZE_DIRECTIVE (@var{stream}, @var{name}, @var{size})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} a directive telling the assembler that the size of the
symbol @var{name} is @var{size}. @var{size} is a @code{HOST_WIDE_INT}.
If you define @code{SIZE_ASM_OP}, a default definition of this macro is
provided.
+@end defmac
-@findex ASM_OUTPUT_MEASURED_SIZE
-@item ASM_OUTPUT_MEASURED_SIZE (@var{stream}, @var{name})
+@defmac ASM_OUTPUT_MEASURED_SIZE (@var{stream}, @var{name})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} a directive telling the assembler to calculate the size of
the symbol @var{name} by subtracting its address from the current
@@ -6623,9 +6536,9 @@ provided. The default assumes that the assembler recognizes a special
the difference between this and another symbol. If your assembler does
not recognize @samp{.} or cannot do calculations with it, you will need
to redefine @code{ASM_OUTPUT_MEASURED_SIZE} to use some other technique.
+@end defmac
-@findex TYPE_ASM_OP
-@item TYPE_ASM_OP
+@defmac TYPE_ASM_OP
A C string containing the appropriate assembler directive to specify the
type of a symbol, without any arguments. On systems that use ELF, the
default (in @file{config/elfos.h}) is @samp{"\t.type\t"}; on other
@@ -6635,9 +6548,9 @@ Define this macro only if it is correct to use the default definition of
@code{ASM_OUTPUT_TYPE_DIRECTIVE} for your system. If you need your own
custom definition of this macro, or if you do not need explicit symbol
types at all, do not define this macro.
+@end defmac
-@findex TYPE_OPERAND_FMT
-@item TYPE_OPERAND_FMT
+@defmac TYPE_OPERAND_FMT
A C string which specifies (using @code{printf} syntax) the format of
the second operand to @code{TYPE_ASM_OP}. On systems that use ELF, the
default (in @file{config/elfos.h}) is @samp{"@@%s"}; on other systems,
@@ -6647,9 +6560,9 @@ Define this macro only if it is correct to use the default definition of
@code{ASM_OUTPUT_TYPE_DIRECTIVE} for your system. If you need your own
custom definition of this macro, or if you do not need explicit symbol
types at all, do not define this macro.
+@end defmac
-@findex ASM_OUTPUT_TYPE_DIRECTIVE
-@item ASM_OUTPUT_TYPE_DIRECTIVE (@var{stream}, @var{type})
+@defmac ASM_OUTPUT_TYPE_DIRECTIVE (@var{stream}, @var{type})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} a directive telling the assembler that the type of the
symbol @var{name} is @var{type}. @var{type} is a C string; currently,
@@ -6658,9 +6571,9 @@ you should not count on this.
If you define @code{TYPE_ASM_OP} and @code{TYPE_OPERAND_FMT}, a default
definition of this macro is provided.
+@end defmac
-@findex ASM_DECLARE_FUNCTION_NAME
-@item ASM_DECLARE_FUNCTION_NAME (@var{stream}, @var{name}, @var{decl})
+@defmac ASM_DECLARE_FUNCTION_NAME (@var{stream}, @var{name}, @var{decl})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} any text necessary for declaring the name @var{name} of a
function which is being defined. This macro is responsible for
@@ -6673,9 +6586,9 @@ usual manner as a label (by means of @code{ASM_OUTPUT_LABEL}).
You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} in the definition
of this macro.
+@end defmac
-@findex ASM_DECLARE_FUNCTION_SIZE
-@item ASM_DECLARE_FUNCTION_SIZE (@var{stream}, @var{name}, @var{decl})
+@defmac ASM_DECLARE_FUNCTION_SIZE (@var{stream}, @var{name}, @var{decl})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} any text necessary for declaring the size of a function
which is being defined. The argument @var{name} is the name of the
@@ -6686,9 +6599,9 @@ If this macro is not defined, then the function size is not defined.
You may wish to use @code{ASM_OUTPUT_MEASURED_SIZE} in the definition
of this macro.
+@end defmac
-@findex ASM_DECLARE_OBJECT_NAME
-@item ASM_DECLARE_OBJECT_NAME (@var{stream}, @var{name}, @var{decl})
+@defmac ASM_DECLARE_OBJECT_NAME (@var{stream}, @var{name}, @var{decl})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} any text necessary for declaring the name @var{name} of an
initialized variable which is being defined. This macro must output the
@@ -6700,18 +6613,18 @@ usual manner as a label (by means of @code{ASM_OUTPUT_LABEL}).
You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} and/or
@code{ASM_OUTPUT_SIZE_DIRECTIVE} in the definition of this macro.
+@end defmac
-@findex ASM_DECLARE_REGISTER_GLOBAL
-@item ASM_DECLARE_REGISTER_GLOBAL (@var{stream}, @var{decl}, @var{regno}, @var{name})
+@defmac ASM_DECLARE_REGISTER_GLOBAL (@var{stream}, @var{decl}, @var{regno}, @var{name})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} any text necessary for claiming a register @var{regno}
for a global variable @var{decl} with name @var{name}.
If you don't define this macro, that is equivalent to defining it to do
nothing.
+@end defmac
-@findex ASM_FINISH_DECLARE_OBJECT
-@item ASM_FINISH_DECLARE_OBJECT (@var{stream}, @var{decl}, @var{toplevel}, @var{atend})
+@defmac ASM_FINISH_DECLARE_OBJECT (@var{stream}, @var{decl}, @var{toplevel}, @var{atend})
A C statement (sans semicolon) to finish up declaring a variable name
once the compiler has processed its initializer fully and thus has had a
chance to determine the size of an array when controlled by an
@@ -6723,7 +6636,7 @@ nothing.
You may wish to use @code{ASM_OUTPUT_SIZE_DIRECTIVE} and/or
@code{ASM_OUTPUT_MEASURED_SIZE} in the definition of this macro.
-@end table
+@end defmac
@deftypefn {Target Hook} void TARGET_ASM_GLOBALIZE_LABEL (FILE *@var{stream}, const char *@var{name})
This target hook is a function to output to the stdio stream
@@ -6734,9 +6647,7 @@ The default implementation relies on a proper definition of
@code{GLOBAL_ASM_OP}.
@end deftypefn
-@table @code
-@findex ASM_WEAKEN_LABEL
-@item ASM_WEAKEN_LABEL (@var{stream}, @var{name})
+@defmac ASM_WEAKEN_LABEL (@var{stream}, @var{name})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} some commands that will make the label @var{name} weak;
that is, available for reference from other files but only used if
@@ -6748,9 +6659,9 @@ for making that name weak, and a newline.
If you don't define this macro or @code{ASM_WEAKEN_DECL}, GCC will not
support weak symbols and you should not define the @code{SUPPORTS_WEAK}
macro.
+@end defmac
-@findex ASM_WEAKEN_DECL
-@item ASM_WEAKEN_DECL (@var{stream}, @var{decl}, @var{name}, @var{value})
+@defmac ASM_WEAKEN_DECL (@var{stream}, @var{decl}, @var{name}, @var{value})
Combines (and replaces) the function of @code{ASM_WEAKEN_LABEL} and
@code{ASM_OUTPUT_WEAK_ALIAS}, allowing access to the associated function
or variable decl. If @var{value} is not @code{NULL}, this C statement
@@ -6758,9 +6669,9 @@ should output to the stdio stream @var{stream} assembler code which
defines (equates) the weak symbol @var{name} to have the value
@var{value}. If @var{value} is @code{NULL}, it should output commands
to make @var{name} weak.
+@end defmac
-@findex SUPPORTS_WEAK
-@item SUPPORTS_WEAK
+@defmac SUPPORTS_WEAK
A C expression which evaluates to true if the target supports weak symbols.
If you don't define this macro, @file{defaults.h} provides a default
@@ -6768,18 +6679,18 @@ definition. If either @code{ASM_WEAKEN_LABEL} or @code{ASM_WEAKEN_DECL}
is defined, the default definition is @samp{1}; otherwise, it is
@samp{0}. Define this macro if you want to control weak symbol support
with a compiler flag such as @option{-melf}.
+@end defmac
-@findex MAKE_DECL_ONE_ONLY (@var{decl})
-@item MAKE_DECL_ONE_ONLY
+@defmac MAKE_DECL_ONE_ONLY (@var{decl})
A C statement (sans semicolon) to mark @var{decl} to be emitted as a
public symbol such that extra copies in multiple translation units will
be discarded by the linker. Define this macro if your object file
format provides support for this concept, such as the @samp{COMDAT}
section flags in the Microsoft Windows PE/COFF format, and this support
requires changes to @var{decl}, such as putting it in a separate section.
+@end defmac
-@findex SUPPORTS_ONE_ONLY
-@item SUPPORTS_ONE_ONLY
+@defmac SUPPORTS_ONE_ONLY
A C expression which evaluates to true if the target supports one-only
semantics.
@@ -6789,6 +6700,7 @@ definition is @samp{1}; otherwise, it is @samp{0}. Define this macro if
you want to control one-only symbol support with a compiler flag, or if
setting the @code{DECL_ONE_ONLY} flag is enough to mark a declaration to
be emitted as one-only.
+@end defmac
@deftypefn {Target Hook} void TARGET_ASM_ASSEMBLE_VISIBILITY (tree @var{decl}, const char *@var{visibility})
This target hook is a function to output to @var{asm_out_file} some
@@ -6796,8 +6708,7 @@ commands that will make the symbol(s) associated with @var{decl} have
hidden, protected or internal visibility as specified by @var{visibility}.
@end deftypefn
-@findex ASM_OUTPUT_EXTERNAL
-@item ASM_OUTPUT_EXTERNAL (@var{stream}, @var{decl}, @var{name})
+@defmac ASM_OUTPUT_EXTERNAL (@var{stream}, @var{decl}, @var{name})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} any text necessary for declaring the name of an external
symbol named @var{name} which is referenced in this compilation but
@@ -6806,9 +6717,9 @@ declaration.
This macro need not be defined if it does not need to output anything.
The GNU assembler and most Unix assemblers don't require anything.
+@end defmac
-@findex ASM_OUTPUT_EXTERNAL_LIBCALL
-@item ASM_OUTPUT_EXTERNAL_LIBCALL (@var{stream}, @var{symref})
+@defmac ASM_OUTPUT_EXTERNAL_LIBCALL (@var{stream}, @var{symref})
A C statement (sans semicolon) to output on @var{stream} an assembler
pseudo-op to declare a library function name external. The name of the
library function is given by @var{symref}, which has type @code{rtx} and
@@ -6816,25 +6727,25 @@ is a @code{symbol_ref}.
This macro need not be defined if it does not need to output anything.
The GNU assembler and most Unix assemblers don't require anything.
+@end defmac
-@findex ASM_OUTPUT_LABELREF
-@item ASM_OUTPUT_LABELREF (@var{stream}, @var{name})
+@defmac ASM_OUTPUT_LABELREF (@var{stream}, @var{name})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} a reference in assembler syntax to a label named
@var{name}. This should add @samp{_} to the front of the name, if that
is customary on your operating system, as it is in most Berkeley Unix
systems. This macro is used in @code{assemble_name}.
+@end defmac
-@findex ASM_OUTPUT_SYMBOL_REF
-@item ASM_OUTPUT_SYMBOL_REF (@var{stream}, @var{sym})
+@defmac ASM_OUTPUT_SYMBOL_REF (@var{stream}, @var{sym})
A C statement (sans semicolon) to output a reference to
@code{SYMBOL_REF} @var{sym}. If not defined, @code{assemble_name}
will be used to output the name of the symbol. This macro may be used
to modify the way a symbol is referenced depending on information
encoded by @code{TARGET_ENCODE_SECTION_INFO}.
+@end defmac
-@findex ASM_OUTPUT_LABEL_REF
-@item ASM_OUTPUT_LABEL_REF (@var{stream}, @var{buf})
+@defmac ASM_OUTPUT_LABEL_REF (@var{stream}, @var{buf})
A C statement (sans semicolon) to output a reference to @var{buf}, the
result of @code{ASM_GENERATE_INTERNAL_LABEL}. If not defined,
@code{assemble_name} will be used to output the name of the symbol.
@@ -6842,7 +6753,7 @@ This macro is not used by @code{output_asm_label}, or the @code{%l}
specifier that calls it; the intention is that this macro should be set
when it is necessary to output a label differently when its address is
being taken.
-@end table
+@end defmac
@deftypefn {Target Hook} void TARGET_ASM_INTERNAL_LABEL (FILE *@var{stream}, const char *@var{prefix}, unsigned long @var{labelno})
A function to output to the stdio stream @var{stream} a label whose
@@ -6859,12 +6770,9 @@ beginning of a label has this effect. You should find out what
convention your system uses, and follow it.
The default version of this function utilizes ASM_GENERATE_INTERNAL_LABEL.
-
@end deftypefn
-@table @code
-@findex ASM_OUTPUT_DEBUG_LABEL
-@item ASM_OUTPUT_DEBUG_LABEL (@var{stream}, @var{prefix}, @var{num})
+@defmac ASM_OUTPUT_DEBUG_LABEL (@var{stream}, @var{prefix}, @var{num})
A C statement to output to the stdio stream @var{stream} a debug info
label whose name is made from the string @var{prefix} and the number
@var{num}. This is useful for VLIW targets, where debug info labels
@@ -6875,9 +6783,9 @@ bundles.
If this macro is not defined, then @code{(*targetm.asm_out.internal_label)} will be
used.
+@end defmac
-@findex ASM_GENERATE_INTERNAL_LABEL
-@item ASM_GENERATE_INTERNAL_LABEL (@var{string}, @var{prefix}, @var{num})
+@defmac ASM_GENERATE_INTERNAL_LABEL (@var{string}, @var{prefix}, @var{num})
A C statement to store into the string @var{string} a label whose name
is made from the string @var{prefix} and the number @var{num}.
@@ -6892,9 +6800,9 @@ string doesn't start with @samp{*}, then @code{ASM_OUTPUT_LABELREF} gets
to output the string, and may change it. (Of course,
@code{ASM_OUTPUT_LABELREF} is also part of your machine description, so
you should know what it does on your machine.)
+@end defmac
-@findex ASM_FORMAT_PRIVATE_NAME
-@item ASM_FORMAT_PRIVATE_NAME (@var{outvar}, @var{name}, @var{number})
+@defmac ASM_FORMAT_PRIVATE_NAME (@var{outvar}, @var{name}, @var{number})
A C expression to assign to @var{outvar} (which is a variable of type
@code{char *}) a newly allocated string made from the string
@var{name} and the number @var{number}, with some suitable punctuation
@@ -6914,18 +6822,18 @@ between the name and the number will suffice.
If this macro is not defined, a default definition will be provided
which is correct for most systems.
+@end defmac
-@findex ASM_OUTPUT_DEF
-@item ASM_OUTPUT_DEF (@var{stream}, @var{name}, @var{value})
+@defmac ASM_OUTPUT_DEF (@var{stream}, @var{name}, @var{value})
A C statement to output to the stdio stream @var{stream} assembler code
which defines (equates) the symbol @var{name} to have the value @var{value}.
@findex SET_ASM_OP
If @code{SET_ASM_OP} is defined, a default definition is provided which is
correct for most systems.
+@end defmac
-@findex ASM_OUTPUT_DEF_FROM_DECLS
-@item ASM_OUTPUT_DEF_FROM_DECLS (@var{stream}, @var{decl_of_name}, @var{decl_of_value})
+@defmac ASM_OUTPUT_DEF_FROM_DECLS (@var{stream}, @var{decl_of_name}, @var{decl_of_value})
A C statement to output to the stdio stream @var{stream} assembler code
which defines (equates) the symbol whose tree node is @var{decl_of_name}
to have the value of the tree node @var{decl_of_value}. This macro will
@@ -6935,9 +6843,9 @@ the tree nodes are available.
@findex SET_ASM_OP
If @code{SET_ASM_OP} is defined, a default definition is provided which is
correct for most systems.
+@end defmac
-@findex ASM_OUTPUT_WEAK_ALIAS
-@item ASM_OUTPUT_WEAK_ALIAS (@var{stream}, @var{name}, @var{value})
+@defmac ASM_OUTPUT_WEAK_ALIAS (@var{stream}, @var{name}, @var{value})
A C statement to output to the stdio stream @var{stream} assembler code
which defines (equates) the weak symbol @var{name} to have the value
@var{value}. If @var{value} is @code{NULL}, it defines @var{name} as
@@ -6945,9 +6853,9 @@ an undefined weak symbol.
Define this macro if the target only supports weak aliases; define
@code{ASM_OUTPUT_DEF} instead if possible.
+@end defmac
-@findex OBJC_GEN_METHOD_LABEL
-@item OBJC_GEN_METHOD_LABEL (@var{buf}, @var{is_inst}, @var{class_name}, @var{cat_name}, @var{sel_name})
+@defmac OBJC_GEN_METHOD_LABEL (@var{buf}, @var{is_inst}, @var{class_name}, @var{cat_name}, @var{sel_name})
Define this macro to override the default assembler names used for
Objective-C methods.
@@ -6972,21 +6880,21 @@ in a category); and @var{sel_name} is the name of the selector.
On systems where the assembler can handle quoted names, you can use this
macro to provide more human-readable names.
+@end defmac
-@findex ASM_DECLARE_CLASS_REFERENCE
-@item ASM_DECLARE_CLASS_REFERENCE (@var{stream}, @var{name})
+@defmac ASM_DECLARE_CLASS_REFERENCE (@var{stream}, @var{name})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} commands to declare that the label @var{name} is an
Objective-C class reference. This is only needed for targets whose
linkers have special support for NeXT-style runtimes.
+@end defmac
-@findex ASM_DECLARE_UNRESOLVED_REFERENCE
-@item ASM_DECLARE_UNRESOLVED_REFERENCE (@var{stream}, @var{name})
+@defmac ASM_DECLARE_UNRESOLVED_REFERENCE (@var{stream}, @var{name})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} commands to declare that the label @var{name} is an
unresolved Objective-C class reference. This is only needed for targets
whose linkers have special support for NeXT-style runtimes.
-@end table
+@end defmac
@node Initialization
@subsection How Initialization Functions Are Handled
@@ -7117,34 +7025,33 @@ customize the handling of initialization and termination functions.
Here are the macros that control how the compiler handles initialization
and termination functions:
-@table @code
-@findex INIT_SECTION_ASM_OP
-@item INIT_SECTION_ASM_OP
+@defmac INIT_SECTION_ASM_OP
If defined, a C string constant, including spacing, for the assembler
operation to identify the following data as initialization code. If not
defined, GCC will assume such a section does not exist. When you are
using special sections for initialization and termination functions, this
macro also controls how @file{crtstuff.c} and @file{libgcc2.c} arrange to
run the initialization functions.
+@end defmac
-@item HAS_INIT_SECTION
-@findex HAS_INIT_SECTION
+@defmac HAS_INIT_SECTION
If defined, @code{main} will not call @code{__main} as described above.
This macro should be defined for systems that control start-up code
on a symbol-by-symbol basis, such as OSF/1, and should not
be defined explicitly for systems that support @code{INIT_SECTION_ASM_OP}.
+@end defmac
-@item LD_INIT_SWITCH
-@findex LD_INIT_SWITCH
+@defmac LD_INIT_SWITCH
If defined, a C string constant for a switch that tells the linker that
the following symbol is an initialization routine.
+@end defmac
-@item LD_FINI_SWITCH
-@findex LD_FINI_SWITCH
+@defmac LD_FINI_SWITCH
If defined, a C string constant for a switch that tells the linker that
the following symbol is a finalization routine.
+@end defmac
-@item COLLECT_SHARED_INIT_FUNC (@var{stream}, @var{func})
+@defmac COLLECT_SHARED_INIT_FUNC (@var{stream}, @var{func})
If defined, a C statement that will write a function that can be
automatically called when a shared library is loaded. The function
should call @var{func}, which takes no arguments. If not defined, and
@@ -7154,28 +7061,29 @@ function called @code{_GLOBAL__DI} will be generated.
This function and the following one are used by collect2 when linking a
shared library that needs constructors or destructors, or has DWARF2
exception tables embedded in the code.
+@end defmac
-@item COLLECT_SHARED_FINI_FUNC (@var{stream}, @var{func})
+@defmac COLLECT_SHARED_FINI_FUNC (@var{stream}, @var{func})
If defined, a C statement that will write a function that can be
automatically called when a shared library is unloaded. The function
should call @var{func}, which takes no arguments. If not defined, and
the object format requires an explicit finalization function, then a
function called @code{_GLOBAL__DD} will be generated.
+@end defmac
-@item INVOKE__main
-@findex INVOKE__main
+@defmac INVOKE__main
If defined, @code{main} will call @code{__main} despite the presence of
@code{INIT_SECTION_ASM_OP}. This macro should be defined for systems
where the init section is not actually run automatically, but is still
useful for collecting the lists of constructors and destructors.
+@end defmac
-@item SUPPORTS_INIT_PRIORITY
-@findex SUPPORTS_INIT_PRIORITY
+@defmac SUPPORTS_INIT_PRIORITY
If nonzero, the C++ @code{init_priority} attribute is supported and the
compiler should emit instructions to control the order of initialization
of objects. If zero, the compiler will issue an error message upon
encountering an @code{init_priority} attribute.
-@end table
+@end defmac
@deftypefn {Target Hook} bool TARGET_HAVE_CTORS_DTORS
This value is true if the target supports some ``native'' method of
@@ -7213,24 +7121,22 @@ an object file for constructor functions to be called.
On certain kinds of systems, you can define these macros to make
@command{collect2} work faster (and, in some cases, make it work at all):
-@table @code
-@findex OBJECT_FORMAT_COFF
-@item OBJECT_FORMAT_COFF
+@defmac OBJECT_FORMAT_COFF
Define this macro if the system uses COFF (Common Object File Format)
object files, so that @command{collect2} can assume this format and scan
object files directly for dynamic constructor/destructor functions.
+@end defmac
-@findex OBJECT_FORMAT_ROSE
-@item OBJECT_FORMAT_ROSE
+@defmac OBJECT_FORMAT_ROSE
Define this macro if the system uses ROSE format object files, so that
@command{collect2} can assume this format and scan object files directly
for dynamic constructor/destructor functions.
These macros are effective only in a native compiler; @command{collect2} as
part of a cross compiler always uses @command{nm} for the target machine.
+@end defmac
-@findex REAL_NM_FILE_NAME
-@item REAL_NM_FILE_NAME
+@defmac REAL_NM_FILE_NAME
Define this macro as a C string constant containing the file name to use
to execute @command{nm}. The default is to search the path normally for
@command{nm}.
@@ -7239,21 +7145,21 @@ If your system supports shared libraries and has a program to list the
dynamic dependencies of a given library or executable, you can define
these macros to enable support for running initialization and
termination functions in shared libraries:
+@end defmac
-@findex LDD_SUFFIX
-@item LDD_SUFFIX
+@defmac LDD_SUFFIX
Define this macro to a C string constant containing the name of the program
which lists dynamic dependencies, like @command{"ldd"} under SunOS 4.
+@end defmac
-@findex PARSE_LDD_OUTPUT
-@item PARSE_LDD_OUTPUT (@var{ptr})
+@defmac PARSE_LDD_OUTPUT (@var{ptr})
Define this macro to be C code that extracts filenames from the output
of the program denoted by @code{LDD_SUFFIX}. @var{ptr} is a variable
of type @code{char *} that points to the beginning of a line of output
from @code{LDD_SUFFIX}. If the line lists a dynamic dependency, the
code must advance @var{ptr} to the beginning of the filename on that
line. Otherwise, it must set @var{ptr} to @code{NULL}.
-@end table
+@end defmac
@node Instruction Output
@subsection Output of Assembler Instructions
@@ -7261,22 +7167,20 @@ line. Otherwise, it must set @var{ptr} to @code{NULL}.
@c prevent bad page break with this line
This describes assembler instruction output.
-@table @code
-@findex REGISTER_NAMES
-@item REGISTER_NAMES
+@defmac REGISTER_NAMES
A C initializer containing the assembler's names for the machine
registers, each one as a C string constant. This is what translates
register numbers in the compiler into assembler language.
+@end defmac
-@findex ADDITIONAL_REGISTER_NAMES
-@item ADDITIONAL_REGISTER_NAMES
+@defmac ADDITIONAL_REGISTER_NAMES
If defined, a C initializer for an array of structures containing a name
and a register number. This macro defines additional names for hard
registers, thus allowing the @code{asm} option in declarations to refer
to registers using alternate names.
+@end defmac
-@findex ASM_OUTPUT_OPCODE
-@item ASM_OUTPUT_OPCODE (@var{stream}, @var{ptr})
+@defmac ASM_OUTPUT_OPCODE (@var{stream}, @var{ptr})
Define this macro if you are using an unusual assembler that
requires different names for the machine instructions.
@@ -7301,9 +7205,9 @@ elements of @code{recog_data.operand}.
If the macro definition does nothing, the instruction is output
in the usual way.
+@end defmac
-@findex FINAL_PRESCAN_INSN
-@item FINAL_PRESCAN_INSN (@var{insn}, @var{opvec}, @var{noperands})
+@defmac FINAL_PRESCAN_INSN (@var{insn}, @var{opvec}, @var{noperands})
If defined, a C statement to be executed just prior to the output of
assembler code for @var{insn}, to modify the extracted operands so
they will be output differently.
@@ -7323,15 +7227,15 @@ syntax affecting individual insn patterns ought to be handled by
writing conditional output routines in those patterns.
If this macro is not defined, it is equivalent to a null statement.
+@end defmac
-@findex FINAL_PRESCAN_LABEL
-@item FINAL_PRESCAN_LABEL
+@defmac FINAL_PRESCAN_LABEL
If defined, @code{FINAL_PRESCAN_INSN} will be called on each
@code{CODE_LABEL}. In that case, @var{opvec} will be a null pointer and
@var{noperands} will be zero.
+@end defmac
-@findex PRINT_OPERAND
-@item PRINT_OPERAND (@var{stream}, @var{x}, @var{code})
+@defmac PRINT_OPERAND (@var{stream}, @var{x}, @var{code})
A C compound statement to output to stdio stream @var{stream} the
assembler syntax for an instruction operand @var{x}. @var{x} is an
RTL expression.
@@ -7354,17 +7258,17 @@ When the machine description has a specification @samp{%@var{punct}}
(a @samp{%} followed by a punctuation character), this macro is called
with a null pointer for @var{x} and the punctuation character for
@var{code}.
+@end defmac
-@findex PRINT_OPERAND_PUNCT_VALID_P
-@item PRINT_OPERAND_PUNCT_VALID_P (@var{code})
+@defmac PRINT_OPERAND_PUNCT_VALID_P (@var{code})
A C expression which evaluates to true if @var{code} is a valid
punctuation character for use in the @code{PRINT_OPERAND} macro. If
@code{PRINT_OPERAND_PUNCT_VALID_P} is not defined, it means that no
punctuation characters (except for the standard one, @samp{%}) are used
in this way.
+@end defmac
-@findex PRINT_OPERAND_ADDRESS
-@item PRINT_OPERAND_ADDRESS (@var{stream}, @var{x})
+@defmac PRINT_OPERAND_ADDRESS (@var{stream}, @var{x})
A C compound statement to output to stdio stream @var{stream} the
assembler syntax for an instruction operand that is a memory reference
whose address is @var{x}. @var{x} is an RTL expression.
@@ -7373,11 +7277,12 @@ whose address is @var{x}. @var{x} is an RTL expression.
On some machines, the syntax for a symbolic address depends on the
section that the address refers to. On these machines, define the hook
@code{TARGET_ENCODE_SECTION_INFO} to store the information into the
-@code{symbol_ref}, and then check for it here. @xref{Assembler Format}.
+@code{symbol_ref}, and then check for it here. @xref{Assembler
+Format}.
+@end defmac
-@findex DBR_OUTPUT_SEQEND
@findex dbr_sequence_length
-@item DBR_OUTPUT_SEQEND(@var{file})
+@defmac DBR_OUTPUT_SEQEND (@var{file})
A C statement, to be executed after all slot-filler instructions have
been output. If necessary, call @code{dbr_sequence_length} to
determine the number of slots filled in a sequence (zero if not
@@ -7387,6 +7292,7 @@ or whatever.
Don't define this macro if it has nothing to do, but it is helpful in
reading assembly output if the extent of the delay sequence is made
explicit (e.g.@: with white space).
+@end defmac
@findex final_sequence
Note that output routines for instructions with delay slots must be
@@ -7396,23 +7302,19 @@ found.) The variable @code{final_sequence} is null when not
processing a sequence, otherwise it contains the @code{sequence} rtx
being output.
-@findex REGISTER_PREFIX
-@findex LOCAL_LABEL_PREFIX
-@findex USER_LABEL_PREFIX
-@findex IMMEDIATE_PREFIX
@findex asm_fprintf
-@item REGISTER_PREFIX
-@itemx LOCAL_LABEL_PREFIX
-@itemx USER_LABEL_PREFIX
-@itemx IMMEDIATE_PREFIX
+@defmac REGISTER_PREFIX
+@defmacx LOCAL_LABEL_PREFIX
+@defmacx USER_LABEL_PREFIX
+@defmacx IMMEDIATE_PREFIX
If defined, C string expressions to be used for the @samp{%R}, @samp{%L},
@samp{%U}, and @samp{%I} options of @code{asm_fprintf} (see
@file{final.c}). These are useful when a single @file{md} file must
support multiple assembler formats. In that case, the various @file{tm.h}
files can define these macros differently.
+@end defmac
-@item ASM_FPRINTF_EXTENSIONS(@var{file}, @var{argptr}, @var{format})
-@findex ASM_FPRINTF_EXTENSIONS
+@defmac ASM_FPRINTF_EXTENSIONS (@var{file}, @var{argptr}, @var{format})
If defined this macro should expand to a series of @code{case}
statements which will be parsed inside the @code{switch} statement of
the @code{asm_fprintf} function. This allows targets to define extra
@@ -7423,9 +7325,9 @@ specific code. The output file is given by the parameter @var{file}.
The varargs input pointer is @var{argptr} and the rest of the format
string, starting the character after the one that is being switched
upon, is pointed to by @var{format}.
+@end defmac
-@findex ASSEMBLER_DIALECT
-@item ASSEMBLER_DIALECT
+@defmac ASSEMBLER_DIALECT
If your target supports multiple dialects of assembler language (such as
different opcodes), define this macro as a C expression that gives the
numeric index of the assembler language dialect to use, with zero as the
@@ -7454,21 +7356,21 @@ the variations in assembler language syntax with that mechanism. Define
@code{ASSEMBLER_DIALECT} and use the @samp{@{option0|option1@}} syntax
if the syntax variant are larger and involve such things as different
opcodes or operand order.
+@end defmac
-@findex ASM_OUTPUT_REG_PUSH
-@item ASM_OUTPUT_REG_PUSH (@var{stream}, @var{regno})
+@defmac ASM_OUTPUT_REG_PUSH (@var{stream}, @var{regno})
A C expression to output to @var{stream} some assembler code
which will push hard register number @var{regno} onto the stack.
The code need not be optimal, since this macro is used only when
profiling.
+@end defmac
-@findex ASM_OUTPUT_REG_POP
-@item ASM_OUTPUT_REG_POP (@var{stream}, @var{regno})
+@defmac ASM_OUTPUT_REG_POP (@var{stream}, @var{regno})
A C expression to output to @var{stream} some assembler code
which will pop hard register number @var{regno} off of the stack.
The code need not be optimal, since this macro is used only when
profiling.
-@end table
+@end defmac
@node Dispatch Tables
@subsection Output of Dispatch Tables
@@ -7476,10 +7378,8 @@ profiling.
@c prevent bad page break with this line
This concerns dispatch tables.
-@table @code
@cindex dispatch table
-@findex ASM_OUTPUT_ADDR_DIFF_ELT
-@item ASM_OUTPUT_ADDR_DIFF_ELT (@var{stream}, @var{body}, @var{value}, @var{rel})
+@defmac ASM_OUTPUT_ADDR_DIFF_ELT (@var{stream}, @var{body}, @var{value}, @var{rel})
A C statement to output to the stdio stream @var{stream} an assembler
pseudo-instruction to generate a difference between two labels.
@var{value} and @var{rel} are the numbers of two internal labels. The
@@ -7497,9 +7397,9 @@ dispatch table are relative to the table's own address. If defined, GCC
will also use this macro on all machines when producing PIC@.
@var{body} is the body of the @code{ADDR_DIFF_VEC}; it is provided so that the
mode and flags can be read.
+@end defmac
-@findex ASM_OUTPUT_ADDR_VEC_ELT
-@item ASM_OUTPUT_ADDR_VEC_ELT (@var{stream}, @var{value})
+@defmac ASM_OUTPUT_ADDR_VEC_ELT (@var{stream}, @var{value})
This macro should be provided on machines where the addresses
in a dispatch table are absolute.
@@ -7512,9 +7412,9 @@ For example,
@example
fprintf (@var{stream}, "\t.word L%d\n", @var{value})
@end example
+@end defmac
-@findex ASM_OUTPUT_CASE_LABEL
-@item ASM_OUTPUT_CASE_LABEL (@var{stream}, @var{prefix}, @var{num}, @var{table})
+@defmac ASM_OUTPUT_CASE_LABEL (@var{stream}, @var{prefix}, @var{num}, @var{table})
Define this if the label before a jump-table needs to be output
specially. The first three arguments are the same as for
@code{(*targetm.asm_out.internal_label)}; the fourth argument is the
@@ -7526,9 +7426,9 @@ for the table.
If this macro is not defined, these labels are output with
@code{(*targetm.asm_out.internal_label)}.
+@end defmac
-@findex ASM_OUTPUT_CASE_END
-@item ASM_OUTPUT_CASE_END (@var{stream}, @var{num}, @var{table})
+@defmac ASM_OUTPUT_CASE_END (@var{stream}, @var{num}, @var{table})
Define this if something special must be output at the end of a
jump-table. The definition should be a C statement to be executed
after the assembler code for the table is written. It should write
@@ -7538,7 +7438,7 @@ of the preceding label.
If this macro is not defined, nothing special is output at the end of
the jump-table.
-@end table
+@end defmac
@node Exception Region Output
@subsection Assembler Commands for Exception Regions
@@ -7548,9 +7448,7 @@ the jump-table.
This describes commands marking the start and the end of an exception
region.
-@table @code
-@findex EH_FRAME_SECTION_NAME
-@item EH_FRAME_SECTION_NAME
+@defmac EH_FRAME_SECTION_NAME
If defined, a C string constant for the name of the section containing
exception handling frame unwind information. If not defined, GCC will
provide a default definition if the target supports named sections.
@@ -7558,9 +7456,9 @@ provide a default definition if the target supports named sections.
You should define this symbol if your target supports DWARF 2 frame
unwind information and the default definition does not work.
+@end defmac
-@findex EH_FRAME_IN_DATA_SECTION
-@item EH_FRAME_IN_DATA_SECTION
+@defmac EH_FRAME_IN_DATA_SECTION
If defined, DWARF 2 frame unwind information will be placed in the
data section even though the target supports named sections. This
might be necessary, for instance, if the system linker does garbage
@@ -7568,14 +7466,14 @@ collection and sections cannot be marked as not to be collected.
Do not define this macro unless @code{TARGET_ASM_NAMED_SECTION} is
also defined.
+@end defmac
-@findex MASK_RETURN_ADDR
-@item MASK_RETURN_ADDR
+@defmac MASK_RETURN_ADDR
An rtx used to mask the return address found via @code{RETURN_ADDR_RTX}, so
that it does not contain any extraneous set bits in it.
+@end defmac
-@findex DWARF2_UNWIND_INFO
-@item DWARF2_UNWIND_INFO
+@defmac DWARF2_UNWIND_INFO
Define this macro to 0 if your target supports DWARF 2 frame unwind
information, but it does not yet work with exception handling.
Otherwise, if your target supports this information (if it defines
@@ -7589,17 +7487,16 @@ default.
If this macro is defined to anything, the DWARF 2 unwinder will be used
instead of inline unwinders and @code{__unwind_function} in the non-@code{setjmp} case.
+@end defmac
-@findex DWARF_CIE_DATA_ALIGNMENT
-@item DWARF_CIE_DATA_ALIGNMENT
+@defmac DWARF_CIE_DATA_ALIGNMENT
This macro need only be defined if the target might save registers in the
function prologue at an offset to the stack pointer that is not aligned to
@code{UNITS_PER_WORD}. The definition should be the negative minimum
alignment if @code{STACK_GROWS_DOWNWARD} is defined, and the positive
minimum alignment otherwise. @xref{SDB and DWARF}. Only applicable if
the target supports DWARF 2 frame unwind information.
-
-@end table
+@end defmac
@deftypefn {Target Hook} void TARGET_ASM_EXCEPTION_SECTION ()
If defined, a function that switches to the section in which the main
@@ -7641,9 +7538,7 @@ If not defined, the default is to return @code{NULL_RTX}.
@c prevent bad page break with this line
This describes commands for alignment.
-@table @code
-@findex JUMP_ALIGN
-@item JUMP_ALIGN (@var{label})
+@defmac JUMP_ALIGN (@var{label})
The alignment (log base 2) to put in front of @var{label}, which is
a common destination of jumps and has no fallthru incoming edge.
@@ -7655,24 +7550,24 @@ Unless it's necessary to inspect the @var{label} parameter, it is better
to set the variable @var{align_jumps} in the target's
@code{OVERRIDE_OPTIONS}. Otherwise, you should try to honor the user's
selection in @var{align_jumps} in a @code{JUMP_ALIGN} implementation.
+@end defmac
-@findex LABEL_ALIGN_AFTER_BARRIER
-@item LABEL_ALIGN_AFTER_BARRIER (@var{label})
+@defmac LABEL_ALIGN_AFTER_BARRIER (@var{label})
The alignment (log base 2) to put in front of @var{label}, which follows
a @code{BARRIER}.
This macro need not be defined if you don't want any special alignment
to be done at such a time. Most machine descriptions do not currently
define the macro.
+@end defmac
-@findex LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
-@item LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
+@defmac LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
The maximum number of bytes to skip when applying
@code{LABEL_ALIGN_AFTER_BARRIER}. This works only if
@code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
+@end defmac
-@findex LOOP_ALIGN
-@item LOOP_ALIGN (@var{label})
+@defmac LOOP_ALIGN (@var{label})
The alignment (log base 2) to put in front of @var{label}, which follows
a @code{NOTE_INSN_LOOP_BEG} note.
@@ -7684,14 +7579,14 @@ Unless it's necessary to inspect the @var{label} parameter, it is better
to set the variable @code{align_loops} in the target's
@code{OVERRIDE_OPTIONS}. Otherwise, you should try to honor the user's
selection in @code{align_loops} in a @code{LOOP_ALIGN} implementation.
+@end defmac
-@findex LOOP_ALIGN_MAX_SKIP
-@item LOOP_ALIGN_MAX_SKIP
+@defmac LOOP_ALIGN_MAX_SKIP
The maximum number of bytes to skip when applying @code{LOOP_ALIGN}.
This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
+@end defmac
-@findex LABEL_ALIGN
-@item LABEL_ALIGN (@var{label})
+@defmac LABEL_ALIGN (@var{label})
The alignment (log base 2) to put in front of @var{label}.
If @code{LABEL_ALIGN_AFTER_BARRIER} / @code{LOOP_ALIGN} specify a different alignment,
the maximum of the specified values is used.
@@ -7700,46 +7595,46 @@ Unless it's necessary to inspect the @var{label} parameter, it is better
to set the variable @code{align_labels} in the target's
@code{OVERRIDE_OPTIONS}. Otherwise, you should try to honor the user's
selection in @code{align_labels} in a @code{LABEL_ALIGN} implementation.
+@end defmac
-@findex LABEL_ALIGN_MAX_SKIP
-@item LABEL_ALIGN_MAX_SKIP
+@defmac LABEL_ALIGN_MAX_SKIP
The maximum number of bytes to skip when applying @code{LABEL_ALIGN}.
This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
+@end defmac
-@findex ASM_OUTPUT_SKIP
-@item ASM_OUTPUT_SKIP (@var{stream}, @var{nbytes})
+@defmac ASM_OUTPUT_SKIP (@var{stream}, @var{nbytes})
A C statement to output to the stdio stream @var{stream} an assembler
instruction to advance the location counter by @var{nbytes} bytes.
Those bytes should be zero when loaded. @var{nbytes} will be a C
expression of type @code{int}.
+@end defmac
-@findex ASM_NO_SKIP_IN_TEXT
-@item ASM_NO_SKIP_IN_TEXT
+@defmac ASM_NO_SKIP_IN_TEXT
Define this macro if @code{ASM_OUTPUT_SKIP} should not be used in the
text section because it fails to put zeros in the bytes that are skipped.
This is true on many Unix systems, where the pseudo--op to skip bytes
produces no-op instructions rather than zeros when used in the text
section.
+@end defmac
-@findex ASM_OUTPUT_ALIGN
-@item ASM_OUTPUT_ALIGN (@var{stream}, @var{power})
+@defmac ASM_OUTPUT_ALIGN (@var{stream}, @var{power})
A C statement to output to the stdio stream @var{stream} an assembler
command to advance the location counter to a multiple of 2 to the
@var{power} bytes. @var{power} will be a C expression of type @code{int}.
+@end defmac
-@findex ASM_OUTPUT_ALIGN_WITH_NOP
-@item ASM_OUTPUT_ALIGN_WITH_NOP (@var{stream}, @var{power})
+@defmac ASM_OUTPUT_ALIGN_WITH_NOP (@var{stream}, @var{power})
Like @code{ASM_OUTPUT_ALIGN}, except that the ``nop'' instruction is used
for padding, if necessary.
+@end defmac
-@findex ASM_OUTPUT_MAX_SKIP_ALIGN
-@item ASM_OUTPUT_MAX_SKIP_ALIGN (@var{stream}, @var{power}, @var{max_skip})
+@defmac ASM_OUTPUT_MAX_SKIP_ALIGN (@var{stream}, @var{power}, @var{max_skip})
A C statement to output to the stdio stream @var{stream} an assembler
command to advance the location counter to a multiple of 2 to the
@var{power} bytes, but only if @var{max_skip} or fewer bytes are needed to
satisfy the alignment request. @var{power} and @var{max_skip} will be
a C expression of type @code{int}.
-@end table
+@end defmac
@need 3000
@node Debugging Info
@@ -7763,9 +7658,7 @@ This describes how to specify debugging information.
@c prevent bad page break with this line
These macros affect all debugging formats.
-@table @code
-@findex DBX_REGISTER_NUMBER
-@item DBX_REGISTER_NUMBER (@var{regno})
+@defmac DBX_REGISTER_NUMBER (@var{regno})
A C expression that returns the DBX register number for the compiler
register number @var{regno}. In the default macro provided, the value
of this expression will be @var{regno} itself. But sometimes there are
@@ -7782,9 +7675,9 @@ expect register pairs to be consecutive in their own numbering scheme.
If you find yourself defining @code{DBX_REGISTER_NUMBER} in way that
does not preserve register pairs, then what you must do instead is
redefine the actual register numbering scheme.
+@end defmac
-@findex DEBUGGER_AUTO_OFFSET
-@item DEBUGGER_AUTO_OFFSET (@var{x})
+@defmac DEBUGGER_AUTO_OFFSET (@var{x})
A C expression that returns the integer offset value for an automatic
variable having address @var{x} (an RTL expression). The default
computation assumes that @var{x} is based on the frame-pointer and
@@ -7792,15 +7685,15 @@ gives the offset from the frame-pointer. This is required for targets
that produce debugging output for DBX or COFF-style debugging output
for SDB and allow the frame-pointer to be eliminated when the
@option{-g} options is used.
+@end defmac
-@findex DEBUGGER_ARG_OFFSET
-@item DEBUGGER_ARG_OFFSET (@var{offset}, @var{x})
+@defmac DEBUGGER_ARG_OFFSET (@var{offset}, @var{x})
A C expression that returns the integer offset value for an argument
having address @var{x} (an RTL expression). The nominal offset is
@var{offset}.
+@end defmac
-@findex PREFERRED_DEBUGGING_TYPE
-@item PREFERRED_DEBUGGING_TYPE
+@defmac PREFERRED_DEBUGGING_TYPE
A C expression that returns the type of debugging output GCC should
produce when the user specifies just @option{-g}. Define
this if you have arranged for GCC to support more than one format of
@@ -7819,7 +7712,7 @@ The value of this macro only affects the default debugging output; the
user can always get a specific type of output by using @option{-gstabs},
@option{-gcoff}, @option{-gdwarf-1}, @option{-gdwarf-2}, @option{-gxcoff},
or @option{-gvms}.
-@end table
+@end defmac
@node DBX Options
@subsection Specific Options for DBX Output
@@ -7827,61 +7720,59 @@ or @option{-gvms}.
@c prevent bad page break with this line
These are specific options for DBX output.
-@table @code
-@findex DBX_DEBUGGING_INFO
-@item DBX_DEBUGGING_INFO
+@defmac DBX_DEBUGGING_INFO
Define this macro if GCC should produce debugging output for DBX
in response to the @option{-g} option.
+@end defmac
-@findex XCOFF_DEBUGGING_INFO
-@item XCOFF_DEBUGGING_INFO
+@defmac XCOFF_DEBUGGING_INFO
Define this macro if GCC should produce XCOFF format debugging output
in response to the @option{-g} option. This is a variant of DBX format.
+@end defmac
-@findex DEFAULT_GDB_EXTENSIONS
-@item DEFAULT_GDB_EXTENSIONS
+@defmac DEFAULT_GDB_EXTENSIONS
Define this macro to control whether GCC should by default generate
GDB's extended version of DBX debugging information (assuming DBX-format
debugging information is enabled at all). If you don't define the
macro, the default is 1: always generate the extended information
if there is any occasion to.
+@end defmac
-@findex DEBUG_SYMS_TEXT
-@item DEBUG_SYMS_TEXT
+@defmac DEBUG_SYMS_TEXT
Define this macro if all @code{.stabs} commands should be output while
in the text section.
+@end defmac
-@findex ASM_STABS_OP
-@item ASM_STABS_OP
+@defmac ASM_STABS_OP
A C string constant, including spacing, naming the assembler pseudo op to
use instead of @code{"\t.stabs\t"} to define an ordinary debugging symbol.
If you don't define this macro, @code{"\t.stabs\t"} is used. This macro
applies only to DBX debugging information format.
+@end defmac
-@findex ASM_STABD_OP
-@item ASM_STABD_OP
+@defmac ASM_STABD_OP
A C string constant, including spacing, naming the assembler pseudo op to
use instead of @code{"\t.stabd\t"} to define a debugging symbol whose
value is the current location. If you don't define this macro,
@code{"\t.stabd\t"} is used. This macro applies only to DBX debugging
information format.
+@end defmac
-@findex ASM_STABN_OP
-@item ASM_STABN_OP
+@defmac ASM_STABN_OP
A C string constant, including spacing, naming the assembler pseudo op to
use instead of @code{"\t.stabn\t"} to define a debugging symbol with no
name. If you don't define this macro, @code{"\t.stabn\t"} is used. This
macro applies only to DBX debugging information format.
+@end defmac
-@findex DBX_NO_XREFS
-@item DBX_NO_XREFS
+@defmac DBX_NO_XREFS
Define this macro if DBX on your system does not support the construct
@samp{xs@var{tagname}}. On some systems, this construct is used to
describe a forward reference to a structure named @var{tagname}.
On other systems, this construct is not supported at all.
+@end defmac
-@findex DBX_CONTIN_LENGTH
-@item DBX_CONTIN_LENGTH
+@defmac DBX_CONTIN_LENGTH
A symbol name in DBX-format debugging information is normally
continued (split into two separate @code{.stabs} directives) when it
exceeds a certain length (by default, 80 characters). On some
@@ -7889,71 +7780,71 @@ operating systems, DBX requires this splitting; on others, splitting
must not be done. You can inhibit splitting by defining this macro
with the value zero. You can override the default splitting-length by
defining this macro as an expression for the length you desire.
+@end defmac
-@findex DBX_CONTIN_CHAR
-@item DBX_CONTIN_CHAR
+@defmac DBX_CONTIN_CHAR
Normally continuation is indicated by adding a @samp{\} character to
the end of a @code{.stabs} string when a continuation follows. To use
a different character instead, define this macro as a character
constant for the character you want to use. Do not define this macro
if backslash is correct for your system.
+@end defmac
-@findex DBX_STATIC_STAB_DATA_SECTION
-@item DBX_STATIC_STAB_DATA_SECTION
+@defmac DBX_STATIC_STAB_DATA_SECTION
Define this macro if it is necessary to go to the data section before
outputting the @samp{.stabs} pseudo-op for a non-global static
variable.
+@end defmac
-@findex DBX_TYPE_DECL_STABS_CODE
-@item DBX_TYPE_DECL_STABS_CODE
+@defmac DBX_TYPE_DECL_STABS_CODE
The value to use in the ``code'' field of the @code{.stabs} directive
for a typedef. The default is @code{N_LSYM}.
+@end defmac
-@findex DBX_STATIC_CONST_VAR_CODE
-@item DBX_STATIC_CONST_VAR_CODE
+@defmac DBX_STATIC_CONST_VAR_CODE
The value to use in the ``code'' field of the @code{.stabs} directive
for a static variable located in the text section. DBX format does not
provide any ``right'' way to do this. The default is @code{N_FUN}.
+@end defmac
-@findex DBX_REGPARM_STABS_CODE
-@item DBX_REGPARM_STABS_CODE
+@defmac DBX_REGPARM_STABS_CODE
The value to use in the ``code'' field of the @code{.stabs} directive
for a parameter passed in registers. DBX format does not provide any
``right'' way to do this. The default is @code{N_RSYM}.
+@end defmac
-@findex DBX_REGPARM_STABS_LETTER
-@item DBX_REGPARM_STABS_LETTER
+@defmac DBX_REGPARM_STABS_LETTER
The letter to use in DBX symbol data to identify a symbol as a parameter
passed in registers. DBX format does not customarily provide any way to
do this. The default is @code{'P'}.
+@end defmac
-@findex DBX_MEMPARM_STABS_LETTER
-@item DBX_MEMPARM_STABS_LETTER
+@defmac DBX_MEMPARM_STABS_LETTER
The letter to use in DBX symbol data to identify a symbol as a stack
parameter. The default is @code{'p'}.
+@end defmac
-@findex DBX_FUNCTION_FIRST
-@item DBX_FUNCTION_FIRST
+@defmac DBX_FUNCTION_FIRST
Define this macro if the DBX information for a function and its
arguments should precede the assembler code for the function. Normally,
in DBX format, the debugging information entirely follows the assembler
code.
+@end defmac
-@findex DBX_BLOCKS_FUNCTION_RELATIVE
-@item DBX_BLOCKS_FUNCTION_RELATIVE
+@defmac DBX_BLOCKS_FUNCTION_RELATIVE
Define this macro if the value of a symbol describing the scope of a
block (@code{N_LBRAC} or @code{N_RBRAC}) should be relative to the start
of the enclosing function. Normally, GCC uses an absolute address.
+@end defmac
-@findex DBX_USE_BINCL
-@item DBX_USE_BINCL
+@defmac DBX_USE_BINCL
Define this macro if GCC should generate @code{N_BINCL} and
@code{N_EINCL} stabs for included header files, as on Sun systems. This
macro also directs GCC to output a type number as a pair of a file
number and a type number within the file. Normally, GCC does not
generate @code{N_BINCL} or @code{N_EINCL} stabs, and it outputs a single
number for a type number.
-@end table
+@end defmac
@node DBX Hooks
@subsection Open-Ended Hooks for DBX Format
@@ -7961,33 +7852,31 @@ number for a type number.
@c prevent bad page break with this line
These are hooks for DBX format.
-@table @code
-@findex DBX_OUTPUT_LBRAC
-@item DBX_OUTPUT_LBRAC (@var{stream}, @var{name})
+@defmac DBX_OUTPUT_LBRAC (@var{stream}, @var{name})
Define this macro to say how to output to @var{stream} the debugging
information for the start of a scope level for variable names. The
argument @var{name} is the name of an assembler symbol (for use with
@code{assemble_name}) whose value is the address where the scope begins.
+@end defmac
-@findex DBX_OUTPUT_RBRAC
-@item DBX_OUTPUT_RBRAC (@var{stream}, @var{name})
+@defmac DBX_OUTPUT_RBRAC (@var{stream}, @var{name})
Like @code{DBX_OUTPUT_LBRAC}, but for the end of a scope level.
+@end defmac
-@findex DBX_OUTPUT_NFUN
-@item DBX_OUTPUT_NFUN (@var{stream}, @var{lscope_label}, @var{decl})
+@defmac DBX_OUTPUT_NFUN (@var{stream}, @var{lscope_label}, @var{decl})
Define this macro if the target machine requires special handling to
output an @code{N_FUN} entry for the function @var{decl}.
+@end defmac
-@findex DBX_OUTPUT_FUNCTION_END
-@item DBX_OUTPUT_FUNCTION_END (@var{stream}, @var{function})
+@defmac DBX_OUTPUT_FUNCTION_END (@var{stream}, @var{function})
Define this macro if the target machine requires special output at the
end of the debugging information for a function. The definition should
be a C statement (sans semicolon) to output the appropriate information
to @var{stream}. @var{function} is the @code{FUNCTION_DECL} node for
the function.
+@end defmac
-@findex DBX_OUTPUT_STANDARD_TYPES
-@item DBX_OUTPUT_STANDARD_TYPES (@var{syms})
+@defmac DBX_OUTPUT_STANDARD_TYPES (@var{syms})
Define this macro if you need to control the order of output of the
standard data types at the beginning of compilation. The argument
@var{syms} is a @code{tree} which is a chain of all the predefined
@@ -8044,15 +7933,14 @@ Here is another way of finding a particular type:
@}
@end group
@end smallexample
+@end defmac
-@findex NO_DBX_FUNCTION_END
-@item NO_DBX_FUNCTION_END
+@defmac NO_DBX_FUNCTION_END
Some stabs encapsulation formats (in particular ECOFF), cannot handle the
@code{.stabs "",N_FUN,,0,0,Lscope-function-1} gdb dbx extension construct.
On those machines, define this macro to turn this feature off without
disturbing the rest of the gdb extensions.
-
-@end table
+@end defmac
@node File Names and DBX
@subsection File Names in DBX Format
@@ -8060,9 +7948,7 @@ disturbing the rest of the gdb extensions.
@c prevent bad page break with this line
This describes file names in DBX format.
-@table @code
-@findex DBX_OUTPUT_MAIN_SOURCE_FILENAME
-@item DBX_OUTPUT_MAIN_SOURCE_FILENAME (@var{stream}, @var{name})
+@defmac DBX_OUTPUT_MAIN_SOURCE_FILENAME (@var{stream}, @var{name})
A C statement to output DBX debugging information to the stdio stream
@var{stream} which indicates that file @var{name} is the main source
file---the file specified as the input file for compilation.
@@ -8070,24 +7956,24 @@ This macro is called only once, at the beginning of compilation.
This macro need not be defined if the standard form of output
for DBX debugging information is appropriate.
+@end defmac
-@findex DBX_OUTPUT_MAIN_SOURCE_DIRECTORY
-@item DBX_OUTPUT_MAIN_SOURCE_DIRECTORY (@var{stream}, @var{name})
+@defmac DBX_OUTPUT_MAIN_SOURCE_DIRECTORY (@var{stream}, @var{name})
A C statement to output DBX debugging information to the stdio stream
@var{stream} which indicates that the current directory during
compilation is named @var{name}.
This macro need not be defined if the standard form of output
for DBX debugging information is appropriate.
+@end defmac
-@findex DBX_OUTPUT_MAIN_SOURCE_FILE_END
-@item DBX_OUTPUT_MAIN_SOURCE_FILE_END (@var{stream}, @var{name})
+@defmac DBX_OUTPUT_MAIN_SOURCE_FILE_END (@var{stream}, @var{name})
A C statement to output DBX debugging information at the end of
compilation of the main source file @var{name}.
If you don't define this macro, nothing special is output at the end
of compilation, which is correct for most machines.
-@end table
+@end defmac
@need 2000
@node SDB and DWARF
@@ -8096,19 +7982,17 @@ of compilation, which is correct for most machines.
@c prevent bad page break with this line
Here are macros for SDB and DWARF output.
-@table @code
-@findex SDB_DEBUGGING_INFO
-@item SDB_DEBUGGING_INFO
+@defmac SDB_DEBUGGING_INFO
Define this macro if GCC should produce COFF-style debugging output
for SDB in response to the @option{-g} option.
+@end defmac
-@findex DWARF_DEBUGGING_INFO
-@item DWARF_DEBUGGING_INFO
+@defmac DWARF_DEBUGGING_INFO
Define this macro if GCC should produce dwarf format debugging output
in response to the @option{-g} option.
+@end defmac
-@findex DWARF2_DEBUGGING_INFO
-@item DWARF2_DEBUGGING_INFO
+@defmac DWARF2_DEBUGGING_INFO
Define this macro if GCC should produce dwarf version 2 format
debugging output in response to the @option{-g} option.
@@ -8117,84 +8001,84 @@ define @code{INCOMING_RETURN_ADDR_RTX} and either set
@code{RTX_FRAME_RELATED_P} on the prologue insns if you use RTL for the
prologue, or call @code{dwarf2out_def_cfa} and @code{dwarf2out_reg_save}
as appropriate from @code{TARGET_ASM_FUNCTION_PROLOGUE} if you don't.
+@end defmac
-@findex DWARF2_FRAME_INFO
-@item DWARF2_FRAME_INFO
+@defmac DWARF2_FRAME_INFO
Define this macro to a nonzero value if GCC should always output
Dwarf 2 frame information. If @code{DWARF2_UNWIND_INFO}
(@pxref{Exception Region Output} is nonzero, GCC will output this
information not matter how you define @code{DWARF2_FRAME_INFO}.
+@end defmac
-@findex LINKER_DOES_NOT_WORK_WITH_DWARF2
-@item LINKER_DOES_NOT_WORK_WITH_DWARF2
+@defmac LINKER_DOES_NOT_WORK_WITH_DWARF2
Define this macro if the linker does not work with Dwarf version 2.
Normally, if the user specifies only @option{-ggdb} GCC will use Dwarf
version 2 if available; this macro disables this. See the description
of the @code{PREFERRED_DEBUGGING_TYPE} macro for more details.
+@end defmac
-@findex DWARF2_GENERATE_TEXT_SECTION_LABEL
-@item DWARF2_GENERATE_TEXT_SECTION_LABEL
+@defmac DWARF2_GENERATE_TEXT_SECTION_LABEL
By default, the Dwarf 2 debugging information generator will generate a
label to mark the beginning of the text section. If it is better simply
to use the name of the text section itself, rather than an explicit label,
to indicate the beginning of the text section, define this macro to zero.
+@end defmac
-@findex DWARF2_ASM_LINE_DEBUG_INFO
-@item DWARF2_ASM_LINE_DEBUG_INFO
+@defmac DWARF2_ASM_LINE_DEBUG_INFO
Define this macro to be a nonzero value if the assembler can generate Dwarf 2
line debug info sections. This will result in much more compact line number
tables, and hence is desirable if it works.
+@end defmac
-@findex ASM_OUTPUT_DWARF_DELTA
-@item ASM_OUTPUT_DWARF_DELTA (@var{stream}, @var{size}, @var{label1}, @var{label2})
+@defmac ASM_OUTPUT_DWARF_DELTA (@var{stream}, @var{size}, @var{label1}, @var{label2})
A C statement to issue assembly directives that create a difference
between the two given labels, using an integer of the given size.
+@end defmac
-@findex ASM_OUTPUT_DWARF_OFFSET
-@item ASM_OUTPUT_DWARF_OFFSET (@var{stream}, @var{size}, @var{label})
+@defmac ASM_OUTPUT_DWARF_OFFSET (@var{stream}, @var{size}, @var{label})
A C statement to issue assembly directives that create a
section-relative reference to the given label, using an integer of the
given size.
+@end defmac
-@findex ASM_OUTPUT_DWARF_PCREL
-@item ASM_OUTPUT_DWARF_PCREL (@var{stream}, @var{size}, @var{label})
+@defmac ASM_OUTPUT_DWARF_PCREL (@var{stream}, @var{size}, @var{label})
A C statement to issue assembly directives that create a self-relative
reference to the given label, using an integer of the given size.
+@end defmac
-@findex PUT_SDB_@dots{}
-@item PUT_SDB_@dots{}
+@defmac PUT_SDB_@dots{}
Define these macros to override the assembler syntax for the special
SDB assembler directives. See @file{sdbout.c} for a list of these
macros and their arguments. If the standard syntax is used, you need
not define them yourself.
+@end defmac
-@findex SDB_DELIM
-@item SDB_DELIM
+@defmac SDB_DELIM
Some assemblers do not support a semicolon as a delimiter, even between
SDB assembler directives. In that case, define this macro to be the
delimiter to use (usually @samp{\n}). It is not necessary to define
a new set of @code{PUT_SDB_@var{op}} macros if this is the only change
required.
+@end defmac
-@findex SDB_GENERATE_FAKE
-@item SDB_GENERATE_FAKE
+@defmac SDB_GENERATE_FAKE
Define this macro to override the usual method of constructing a dummy
name for anonymous structure and union types. See @file{sdbout.c} for
more information.
+@end defmac
-@findex SDB_ALLOW_UNKNOWN_REFERENCES
-@item SDB_ALLOW_UNKNOWN_REFERENCES
+@defmac SDB_ALLOW_UNKNOWN_REFERENCES
Define this macro to allow references to unknown structure,
union, or enumeration tags to be emitted. Standard COFF does not
allow handling of unknown references, MIPS ECOFF has support for
it.
+@end defmac
-@findex SDB_ALLOW_FORWARD_REFERENCES
-@item SDB_ALLOW_FORWARD_REFERENCES
+@defmac SDB_ALLOW_FORWARD_REFERENCES
Define this macro to allow references to structure, union, or
enumeration tags that have not yet been seen to be handled. Some
assemblers choke if forward tags are used, while some require it.
-@end table
+@end defmac
@need 2000
@node VMS Debug
@@ -8203,16 +8087,14 @@ assemblers choke if forward tags are used, while some require it.
@c prevent bad page break with this line
Here are macros for VMS debug format.
-@table @code
-@findex VMS_DEBUGGING_INFO
-@item VMS_DEBUGGING_INFO
+@defmac VMS_DEBUGGING_INFO
Define this macro if GCC should produce debugging output for VMS
in response to the @option{-g} option. The default behavior for VMS
is to generate minimal debug info for a traceback in the absence of
@option{-g} unless explicitly overridden with @option{-g0}. This
behavior is controlled by @code{OPTIMIZATION_OPTIONS} and
@code{OVERRIDE_OPTIONS}.
-@end table
+@end defmac
@node Floating Point
@section Cross Compilation and Floating Point
@@ -8321,7 +8203,6 @@ integral, it is truncated.
@end deftypefn
@deftypefn Macro void REAL_VALUE_FROM_INT (REAL_VALUE_TYPE @var{x}, HOST_WIDE_INT @var{low}, HOST_WIDE_INT @var{high}, enum machine_mode @var{mode})
-@findex REAL_VALUE_FROM_INT
Converts a double-precision integer found in @var{low} and @var{high},
into a floating point value which is then stored into @var{x}. The
value is truncated to fit in mode @var{mode}.
@@ -8332,9 +8213,7 @@ value is truncated to fit in mode @var{mode}.
@cindex mode switching
The following macros control mode switching optimizations:
-@table @code
-@findex OPTIMIZE_MODE_SWITCHING
-@item OPTIMIZE_MODE_SWITCHING (@var{entity})
+@defmac OPTIMIZE_MODE_SWITCHING (@var{entity})
Define this macro if the port needs extra instructions inserted for mode
switching in an optimizing compilation.
@@ -8353,9 +8232,9 @@ If you define this macro, you also have to define
@code{NUM_MODES_FOR_MODE_SWITCHING}, @code{MODE_NEEDED},
@code{MODE_PRIORITY_TO_MODE} and @code{EMIT_MODE_SET}.
@code{NORMAL_MODE} is optional.
+@end defmac
-@findex NUM_MODES_FOR_MODE_SWITCHING
-@item NUM_MODES_FOR_MODE_SWITCHING
+@defmac NUM_MODES_FOR_MODE_SWITCHING
If you define @code{OPTIMIZE_MODE_SWITCHING}, you have to define this as
initializer for an array of integers. Each initializer element
N refers to an entity that needs mode switching, and specifies the number
@@ -8366,36 +8245,36 @@ entity in question.
In macros that take mode arguments / yield a mode result, modes are
represented as numbers 0 @dots{} N @minus{} 1. N is used to specify that no mode
switch is needed / supplied.
+@end defmac
-@findex MODE_NEEDED
-@item MODE_NEEDED (@var{entity}, @var{insn})
+@defmac MODE_NEEDED (@var{entity}, @var{insn})
@var{entity} is an integer specifying a mode-switched entity. If
@code{OPTIMIZE_MODE_SWITCHING} is defined, you must define this macro to
return an integer value not larger than the corresponding element in
@code{NUM_MODES_FOR_MODE_SWITCHING}, to denote the mode that @var{entity} must
be switched into prior to the execution of @var{insn}.
+@end defmac
-@findex NORMAL_MODE
-@item NORMAL_MODE (@var{entity})
+@defmac NORMAL_MODE (@var{entity})
If this macro is defined, it is evaluated for every @var{entity} that needs
mode switching. It should evaluate to an integer, which is a mode that
@var{entity} is assumed to be switched to at function entry and exit.
+@end defmac
-@findex MODE_PRIORITY_TO_MODE
-@item MODE_PRIORITY_TO_MODE (@var{entity}, @var{n})
+@defmac MODE_PRIORITY_TO_MODE (@var{entity}, @var{n})
This macro specifies the order in which modes for @var{entity} are processed.
0 is the highest priority, @code{NUM_MODES_FOR_MODE_SWITCHING[@var{entity}] - 1} the
lowest. The value of the macro should be an integer designating a mode
for @var{entity}. For any fixed @var{entity}, @code{mode_priority_to_mode}
(@var{entity}, @var{n}) shall be a bijection in 0 @dots{}
@code{num_modes_for_mode_switching[@var{entity}] - 1}.
+@end defmac
-@findex EMIT_MODE_SET
-@item EMIT_MODE_SET (@var{entity}, @var{mode}, @var{hard_regs_live})
+@defmac EMIT_MODE_SET (@var{entity}, @var{mode}, @var{hard_regs_live})
Generate one or more insns to set @var{entity} to @var{mode}.
@var{hard_reg_live} is the set of hard registers live at the point where
the insn(s) are to be inserted.
-@end table
+@end defmac
@node Target Attributes
@section Defining target-specific uses of @code{__attribute__}
@@ -8507,18 +8386,14 @@ floating-point support; they are not included in this mechanism.
There is one macro used in defining the MIPS coprocessor interface which
you may want to override in subtargets; it is described below.
-@table @code
-
-@item ALL_COP_ADDITIONAL_REGISTER_NAMES
-@findex ALL_COP_ADDITIONAL_REGISTER_NAMES
+@defmac ALL_COP_ADDITIONAL_REGISTER_NAMES
A comma-separated list (with leading comma) of pairs describing the
alternate names of coprocessor registers. The format of each entry should be
@smallexample
@{ @var{alternatename}, @var{register_number}@}
@end smallexample
Default: empty.
-
-@end table
+@end defmac
@node Misc
@section Miscellaneous Parameters
@@ -8527,9 +8402,7 @@ Default: empty.
@c prevent bad page break with this line
Here are several miscellaneous parameters.
-@table @code
-@item PREDICATE_CODES
-@findex PREDICATE_CODES
+@defmac PREDICATE_CODES
Define this if you have defined special-purpose predicates in the file
@file{@var{machine}.c}. This macro is called within an initializer of an
array of structures. The first field in the structure is the name of a
@@ -8554,9 +8427,9 @@ patterns.
For each predicate function named in @code{PREDICATE_CODES}, a
declaration will be generated in @file{insn-codes.h}.
+@end defmac
-@item SPECIAL_MODE_PREDICATES
-@findex SPECIAL_MODE_PREDICATES
+@defmac SPECIAL_MODE_PREDICATES
Define this if you have special predicates that know special things
about modes. Genrecog will warn about certain forms of
@code{match_operand} without a mode; if the operand predicate is
@@ -8571,14 +8444,14 @@ for a byte extraction from @code{%ah} etc.).
#define SPECIAL_MODE_PREDICATES \
"ext_register_operand",
@end smallexample
+@end defmac
-@findex CASE_VECTOR_MODE
-@item CASE_VECTOR_MODE
+@defmac CASE_VECTOR_MODE
An alias for a machine mode name. This is the machine mode that
elements of a jump-table should have.
+@end defmac
-@findex CASE_VECTOR_SHORTEN_MODE
-@item CASE_VECTOR_SHORTEN_MODE (@var{min_offset}, @var{max_offset}, @var{body})
+@defmac CASE_VECTOR_SHORTEN_MODE (@var{min_offset}, @var{max_offset}, @var{body})
Optional: return the preferred mode for an @code{addr_diff_vec}
when the minimum and maximum offset are known. If you define this,
it enables extra code in branch shortening to deal with @code{addr_diff_vec}.
@@ -8586,28 +8459,28 @@ To make this work, you also have to define @code{INSN_ALIGN} and
make the alignment for @code{addr_diff_vec} explicit.
The @var{body} argument is provided so that the offset_unsigned and scale
flags can be updated.
+@end defmac
-@findex CASE_VECTOR_PC_RELATIVE
-@item CASE_VECTOR_PC_RELATIVE
+@defmac CASE_VECTOR_PC_RELATIVE
Define this macro to be a C expression to indicate when jump-tables
should contain relative addresses. If jump-tables never contain
relative addresses, then you need not define this macro.
+@end defmac
-@findex CASE_DROPS_THROUGH
-@item CASE_DROPS_THROUGH
+@defmac CASE_DROPS_THROUGH
Define this if control falls through a @code{case} insn when the index
value is out of range. This means the specified default-label is
actually ignored by the @code{case} insn proper.
+@end defmac
-@findex CASE_VALUES_THRESHOLD
-@item CASE_VALUES_THRESHOLD
+@defmac CASE_VALUES_THRESHOLD
Define this to be the smallest number of different values for which it
is best to use a jump-table instead of a tree of conditional branches.
The default is four for machines with a @code{casesi} instruction and
five otherwise. This is best for most machines.
+@end defmac
-@findex CASE_USE_BIT_TESTS
-@item CASE_USE_BIT_TESTS
+@defmac CASE_USE_BIT_TESTS
Define this macro to be a C expression to indicate whether C switch
statements may be implemented by a sequence of bit tests. This is
advantageous on processors that can efficiently implement left shift
@@ -8615,15 +8488,15 @@ of 1 by the number of bits held in a register, but inappropriate on
targets that would require a loop. By default, this macro returns
@code{true} if the target defines an @code{ashlsi3} pattern, and
@code{false} otherwise.
+@end defmac
-@findex WORD_REGISTER_OPERATIONS
-@item WORD_REGISTER_OPERATIONS
+@defmac WORD_REGISTER_OPERATIONS
Define this macro if operations between registers with integral mode
smaller than a word are always performed on the entire register.
Most RISC machines have this property and most CISC machines do not.
+@end defmac
-@findex LOAD_EXTEND_OP
-@item LOAD_EXTEND_OP (@var{mode})
+@defmac LOAD_EXTEND_OP (@var{mode})
Define this macro to be a C expression indicating when insns that read
memory in @var{mode}, an integral mode narrower than a word, set the
bits outside of @var{mode} to be either the sign-extension or the
@@ -8637,33 +8510,33 @@ greater than or equal to @code{BITS_PER_WORD}, so you may return any
value in this case. Do not define this macro if it would always return
@code{NIL}. On machines where this macro is defined, you will normally
define it as the constant @code{SIGN_EXTEND} or @code{ZERO_EXTEND}.
+@end defmac
-@findex SHORT_IMMEDIATES_SIGN_EXTEND
-@item SHORT_IMMEDIATES_SIGN_EXTEND
+@defmac SHORT_IMMEDIATES_SIGN_EXTEND
Define this macro if loading short immediate values into registers sign
extends.
+@end defmac
-@findex FIXUNS_TRUNC_LIKE_FIX_TRUNC
-@item FIXUNS_TRUNC_LIKE_FIX_TRUNC
+@defmac FIXUNS_TRUNC_LIKE_FIX_TRUNC
Define this macro if the same instructions that convert a floating
point number to a signed fixed point number also convert validly to an
unsigned one.
+@end defmac
-@findex MOVE_MAX
-@item MOVE_MAX
+@defmac MOVE_MAX
The maximum number of bytes that a single instruction can move quickly
between memory and registers or between two memory locations.
+@end defmac
-@findex MAX_MOVE_MAX
-@item MAX_MOVE_MAX
+@defmac MAX_MOVE_MAX
The maximum number of bytes that a single instruction can move quickly
between memory and registers or between two memory locations. If this
is undefined, the default is @code{MOVE_MAX}. Otherwise, it is the
constant value that is the largest value that @code{MOVE_MAX} can have
at run-time.
+@end defmac
-@findex SHIFT_COUNT_TRUNCATED
-@item SHIFT_COUNT_TRUNCATED
+@defmac SHIFT_COUNT_TRUNCATED
A C expression that is nonzero if on this machine the number of bits
actually used for the count of a shift operation is equal to the number
of bits needed to represent the size of the object being shifted. When
@@ -8686,9 +8559,9 @@ such machines. Instead, add patterns to the @file{md} file that include
the implied truncation of the shift instructions.
You need not define this macro if it would always have the value of zero.
+@end defmac
-@findex TRULY_NOOP_TRUNCATION
-@item TRULY_NOOP_TRUNCATION (@var{outprec}, @var{inprec})
+@defmac TRULY_NOOP_TRUNCATION (@var{outprec}, @var{inprec})
A C expression which is nonzero if on this machine it is safe to
``convert'' an integer of @var{inprec} bits to one of @var{outprec}
bits (where @var{outprec} is smaller than @var{inprec}) by merely
@@ -8702,9 +8575,9 @@ When @code{TRULY_NOOP_TRUNCATION} returns 1 for a pair of sizes for
modes for which @code{MODES_TIEABLE_P} is 0, suboptimal code can result.
If this is the case, making @code{TRULY_NOOP_TRUNCATION} return 0 in
such cases may improve things.
+@end defmac
-@findex STORE_FLAG_VALUE
-@item STORE_FLAG_VALUE
+@defmac STORE_FLAG_VALUE
A C expression describing the value returned by a comparison operator
with an integral mode and stored by a store-flag instruction
(@samp{s@var{cond}}) when the condition is true. This description must
@@ -8800,19 +8673,18 @@ find such instruction sequences on other machines.
If this macro is not defined, the default value, 1, is used. You need
not define @code{STORE_FLAG_VALUE} if the machine has no store-flag
instructions, or if the value generated by these instructions is 1.
+@end defmac
-@findex FLOAT_STORE_FLAG_VALUE
-@item FLOAT_STORE_FLAG_VALUE (@var{mode})
+@defmac FLOAT_STORE_FLAG_VALUE (@var{mode})
A C expression that gives a nonzero @code{REAL_VALUE_TYPE} value that is
returned when comparison operators with floating-point results are true.
Define this macro on machine that have comparison operations that return
floating-point values. If there are no such operations, do not define
this macro.
+@end defmac
-@findex CLZ_DEFINED_VALUE_AT_ZERO
-@findex CTZ_DEFINED_VALUE_AT_ZERO
-@item CLZ_DEFINED_VALUE_AT_ZERO (@var{mode}, @var{value})
-@itemx CTZ_DEFINED_VALUE_AT_ZERO (@var{mode}, @var{value})
+@defmac CLZ_DEFINED_VALUE_AT_ZERO (@var{mode}, @var{value})
+@defmacx CTZ_DEFINED_VALUE_AT_ZERO (@var{mode}, @var{value})
A C expression that evaluates to true if the architecture defines a value
for @code{clz} or @code{ctz} with a zero operand. If so, @var{value}
should be set to this value. If this macro is not defined, the value of
@@ -8827,9 +8699,9 @@ and @code{ctz} at zero do @emph{not} extend to the builtin functions
visible to the user. Thus one may be free to adjust the value at will
to match the target expansion of these operations without fear of
breaking the API.
+@end defmac
-@findex Pmode
-@item Pmode
+@defmac Pmode
An alias for the machine mode for pointers. On most machines, define
this to be the integer mode corresponding to the width of a hardware
pointer; @code{SImode} on 32-bit machine or @code{DImode} on 64-bit machines.
@@ -8840,15 +8712,15 @@ The width of @code{Pmode} must be at least as large as the value of
@code{POINTER_SIZE}. If it is not equal, you must define the macro
@code{POINTERS_EXTEND_UNSIGNED} to specify how pointers are extended
to @code{Pmode}.
+@end defmac
-@findex FUNCTION_MODE
-@item FUNCTION_MODE
+@defmac FUNCTION_MODE
An alias for the machine mode used for memory references to functions
being called, in @code{call} RTL expressions. On most machines this
should be @code{QImode}.
+@end defmac
-@findex INTEGRATE_THRESHOLD
-@item INTEGRATE_THRESHOLD (@var{decl})
+@defmac INTEGRATE_THRESHOLD (@var{decl})
A C expression for the maximum number of instructions above which the
function @var{decl} should not be inlined. @var{decl} is a
@code{FUNCTION_DECL} node.
@@ -8856,9 +8728,9 @@ function @var{decl} should not be inlined. @var{decl} is a
The default definition of this macro is 64 plus 8 times the number of
arguments that the function accepts. Some people think a larger
threshold should be used on RISC machines.
+@end defmac
-@findex STDC_0_IN_SYSTEM_HEADERS
-@item STDC_0_IN_SYSTEM_HEADERS
+@defmac STDC_0_IN_SYSTEM_HEADERS
In normal operation, the preprocessor expands @code{__STDC__} to the
constant 1, to signify that GCC conforms to ISO Standard C@. On some
hosts, like Solaris, the system compiler uses a different convention,
@@ -8868,18 +8740,18 @@ strict conformance to the C Standard.
Defining @code{STDC_0_IN_SYSTEM_HEADERS} makes GNU CPP follows the host
convention when processing system header files, but when processing user
files @code{__STDC__} will always expand to 1.
+@end defmac
-@findex NO_IMPLICIT_EXTERN_C
-@item NO_IMPLICIT_EXTERN_C
+@defmac NO_IMPLICIT_EXTERN_C
Define this macro if the system header files support C++ as well as C@.
This macro inhibits the usual method of using system header files in
C++, which is to pretend that the file's contents are enclosed in
@samp{extern "C" @{@dots{}@}}.
+@end defmac
-@findex REGISTER_TARGET_PRAGMAS
@findex #pragma
@findex pragma
-@item REGISTER_TARGET_PRAGMAS ()
+@defmac REGISTER_TARGET_PRAGMAS ()
Define this macro if you want to implement any target-specific pragmas.
If defined, it is a C expression which makes a series of calls to
@code{c_register_pragma} for each pragma. The macro may also do any
@@ -8895,6 +8767,7 @@ defining the target hook @samp{TARGET_INSERT_ATTRIBUTES} as well.
Preprocessor macros that appear on pragma lines are not expanded. All
@samp{#pragma} directives that do not match any registered pragma are
silently ignored, unless the user specifies @option{-Wunknown-pragmas}.
+@end defmac
@deftypefun void c_register_pragma (const char *@var{space}, const char *@var{name}, void (*@var{callback}) (struct cpp_reader *))
@@ -8912,7 +8785,7 @@ routine receives @var{pfile} as its first argument, which can be passed
on to cpplib's functions if necessary. You can lex tokens after the
@var{name} by calling @code{c_lex}. Tokens that are not read by the
callback will be silently ignored. The end of the line is indicated by
-a token of type @code{CPP_EOF}.
+a token of type @code{CPP_EOF}
For an example use of this routine, see @file{c4x.h} and the callback
routines defined in @file{c4x-c.c}.
@@ -8930,10 +8803,9 @@ rule to the makefile fragment pointed to by @code{tmake_file} that shows
how to build this object file.
@end deftypefun
-@findex HANDLE_SYSV_PRAGMA
@findex #pragma
@findex pragma
-@item HANDLE_SYSV_PRAGMA
+@defmac HANDLE_SYSV_PRAGMA
Define this macro (to a value of 1) if you want the System V style
pragmas @samp{#pragma pack(<n>)} and @samp{#pragma weak <name>
[=<value>]} to be supported by gcc.
@@ -8961,11 +8833,11 @@ may affect its placement.
The weak pragma only works if @code{SUPPORTS_WEAK} and
@code{ASM_WEAKEN_LABEL} are defined. If enabled it allows the creation
of specifically named weak labels, optionally with a value.
+@end defmac
-@findex HANDLE_PRAGMA_PACK_PUSH_POP
@findex #pragma
@findex pragma
-@item HANDLE_PRAGMA_PACK_PUSH_POP
+@defmac HANDLE_PRAGMA_PACK_PUSH_POP
Define this macro (to a value of 1) if you want to support the Win32
style pragmas @samp{#pragma pack(push,@var{n})} and @samp{#pragma
pack(pop)}. The @samp{pack(push,@var{n})} pragma specifies the maximum alignment
@@ -8975,30 +8847,30 @@ pack value of zero resets the behavior to the default. Successive
invocations of this pragma cause the previous values to be stacked, so
that invocations of @samp{#pragma pack(pop)} will return to the previous
value.
+@end defmac
-@findex DOLLARS_IN_IDENTIFIERS
-@item DOLLARS_IN_IDENTIFIERS
+@defmac DOLLARS_IN_IDENTIFIERS
Define this macro to control use of the character @samp{$} in
identifier names for the C family of languages. 0 means @samp{$} is
not allowed by default; 1 means it is allowed. 1 is the default;
there is no need to define this macro in that case.
+@end defmac
-@findex NO_DOLLAR_IN_LABEL
-@item NO_DOLLAR_IN_LABEL
+@defmac NO_DOLLAR_IN_LABEL
Define this macro if the assembler does not accept the character
@samp{$} in label names. By default constructors and destructors in
G++ have @samp{$} in the identifiers. If this macro is defined,
@samp{.} is used instead.
+@end defmac
-@findex NO_DOT_IN_LABEL
-@item NO_DOT_IN_LABEL
+@defmac NO_DOT_IN_LABEL
Define this macro if the assembler does not accept the character
@samp{.} in label names. By default constructors and destructors in G++
have names that use @samp{.}. If this macro is defined, these names
are rewritten to avoid @samp{.}.
+@end defmac
-@findex DEFAULT_MAIN_RETURN
-@item DEFAULT_MAIN_RETURN
+@defmac DEFAULT_MAIN_RETURN
Define this macro if the target system expects every program's @code{main}
function to return a standard ``success'' value by default (if no other
value is explicitly returned).
@@ -9006,9 +8878,9 @@ value is explicitly returned).
The definition should be a C statement (sans semicolon) to generate the
appropriate rtl instructions. It is used only when compiling the end of
@code{main}.
+@end defmac
-@findex INSN_SETS_ARE_DELAYED
-@item INSN_SETS_ARE_DELAYED (@var{insn})
+@defmac INSN_SETS_ARE_DELAYED (@var{insn})
Define this macro as a C expression that is nonzero if it is safe for the
delay slot scheduler to place instructions in the delay slot of @var{insn},
even if they appear to use a resource set or clobbered in @var{insn}.
@@ -9018,9 +8890,9 @@ or @code{jump_insn} is really a function call and hence has this behavior,
you should define this macro.
You need not define this macro if it would always return zero.
+@end defmac
-@findex INSN_REFERENCES_ARE_DELAYED
-@item INSN_REFERENCES_ARE_DELAYED (@var{insn})
+@defmac INSN_REFERENCES_ARE_DELAYED (@var{insn})
Define this macro as a C expression that is nonzero if it is safe for the
delay slot scheduler to place instructions in the delay slot of @var{insn},
even if they appear to set or clobber a resource referenced in @var{insn}.
@@ -9032,62 +8904,62 @@ instructions which copy arguments into the argument registers into the delay
slot of @var{insn}.
You need not define this macro if it would always return zero.
+@end defmac
-@findex MULTIPLE_SYMBOL_SPACES
-@item MULTIPLE_SYMBOL_SPACES
+@defmac MULTIPLE_SYMBOL_SPACES
Define this macro if in some cases global symbols from one translation
unit may not be bound to undefined symbols in another translation unit
without user intervention. For instance, under Microsoft Windows
symbols must be explicitly imported from shared libraries (DLLs).
+@end defmac
-@findex MD_ASM_CLOBBERS
-@item MD_ASM_CLOBBERS (@var{clobbers})
+@defmac MD_ASM_CLOBBERS (@var{clobbers})
A C statement that adds to @var{clobbers} @code{STRING_CST} trees for
any hard regs the port wishes to automatically clobber for all asms.
+@end defmac
-@findex MAX_INTEGER_COMPUTATION_MODE
-@item MAX_INTEGER_COMPUTATION_MODE
+@defmac MAX_INTEGER_COMPUTATION_MODE
Define this to the largest integer machine mode which can be used for
operations other than load, store and copy operations.
You need only define this macro if the target holds values larger than
@code{word_mode} in general purpose registers. Most targets should not define
this macro.
+@end defmac
-@findex MATH_LIBRARY
-@item MATH_LIBRARY
+@defmac MATH_LIBRARY
Define this macro as a C string constant for the linker argument to link
in the system math library, or @samp{""} if the target does not have a
separate math library.
You need only define this macro if the default of @samp{"-lm"} is wrong.
+@end defmac
-@findex LIBRARY_PATH_ENV
-@item LIBRARY_PATH_ENV
+@defmac LIBRARY_PATH_ENV
Define this macro as a C string constant for the environment variable that
specifies where the linker should look for libraries.
You need only define this macro if the default of @samp{"LIBRARY_PATH"}
is wrong.
+@end defmac
-@findex TARGET_HAS_F_SETLKW
-@item TARGET_HAS_F_SETLKW
+@defmac TARGET_HAS_F_SETLKW
Define this macro if the target supports file locking with fcntl / F_SETLKW@.
Note that this functionality is part of POSIX@.
Defining @code{TARGET_HAS_F_SETLKW} will enable the test coverage code
to use file locking when exiting a program, which avoids race conditions
if the program has forked.
+@end defmac
-@findex MAX_CONDITIONAL_EXECUTE
-@item MAX_CONDITIONAL_EXECUTE
+@defmac MAX_CONDITIONAL_EXECUTE
A C expression for the maximum number of instructions to execute via
conditional execution instructions instead of a branch. A value of
@code{BRANCH_COST}+1 is the default if the machine does not use cc0, and
1 if it does use cc0.
+@end defmac
-@findex IFCVT_MODIFY_TESTS
-@item IFCVT_MODIFY_TESTS(@var{ce_info}, @var{true_expr}, @var{false_expr})
+@defmac IFCVT_MODIFY_TESTS (@var{ce_info}, @var{true_expr}, @var{false_expr})
Used if the target needs to perform machine-dependent modifications on the
conditionals used for turning basic blocks into conditionally executed code.
@var{ce_info} points to a data structure, @code{struct ce_if_block}, which
@@ -9095,49 +8967,47 @@ contains information about the currently processed blocks. @var{true_expr}
and @var{false_expr} are the tests that are used for converting the
then-block and the else-block, respectively. Set either @var{true_expr} or
@var{false_expr} to a null pointer if the tests cannot be converted.
+@end defmac
-@findex IFCVT_MODIFY_MULTIPLE_TESTS
-@item IFCVT_MODIFY_MULTIPLE_TESTS(@var{ce_info}, @var{bb}, @var{true_expr}, @var{false_expr})
+@defmac IFCVT_MODIFY_MULTIPLE_TESTS (@var{ce_info}, @var{bb}, @var{true_expr}, @var{false_expr})
Like @code{IFCVT_MODIFY_TESTS}, but used when converting more complicated
if-statements into conditions combined by @code{and} and @code{or} operations.
@var{bb} contains the basic block that contains the test that is currently
being processed and about to be turned into a condition.
+@end defmac
-@findex IFCVT_MODIFY_INSN
-@item IFCVT_MODIFY_INSN(@var{ce_info}, @var{pattern}, @var{insn})
+@defmac IFCVT_MODIFY_INSN (@var{ce_info}, @var{pattern}, @var{insn})
A C expression to modify the @var{PATTERN} of an @var{INSN} that is to
be converted to conditional execution format. @var{ce_info} points to
a data structure, @code{struct ce_if_block}, which contains information
about the currently processed blocks.
+@end defmac
-@findex IFCVT_MODIFY_FINAL
-@item IFCVT_MODIFY_FINAL(@var{ce_info})
+@defmac IFCVT_MODIFY_FINAL (@var{ce_info})
A C expression to perform any final machine dependent modifications in
converting code to conditional execution. The involved basic blocks
can be found in the @code{struct ce_if_block} structure that is pointed
to by @var{ce_info}.
+@end defmac
-@findex IFCVT_MODIFY_CANCEL
-@item IFCVT_MODIFY_CANCEL(@var{ce_info})
+@defmac IFCVT_MODIFY_CANCEL (@var{ce_info})
A C expression to cancel any machine dependent modifications in
converting code to conditional execution. The involved basic blocks
can be found in the @code{struct ce_if_block} structure that is pointed
to by @var{ce_info}.
+@end defmac
-@findex IFCVT_INIT_EXTRA_FIELDS
-@item IFCVT_INIT_EXTRA_FIELDS(@var{ce_info})
+@defmac IFCVT_INIT_EXTRA_FIELDS (@var{ce_info})
A C expression to initialize any extra fields in a @code{struct ce_if_block}
structure, which are defined by the @code{IFCVT_EXTRA_FIELDS} macro.
+@end defmac
-@findex IFCVT_EXTRA_FIELDS
-@item IFCVT_EXTRA_FIELDS
+@defmac IFCVT_EXTRA_FIELDS
If defined, it should expand to a set of field declarations that will be
added to the @code{struct ce_if_block} structure. These should be initialized
by the @code{IFCVT_INIT_EXTRA_FIELDS} macro.
+@end defmac
-@end table
-
-@findex TARGET_MACHINE_DEPENDENT_REORG
@deftypefn {Target Hook} void TARGET_MACHINE_DEPENDENT_REORG ()
If non-null, this hook performs a target-specific pass over the
instruction stream. The compiler will run it at all optimization levels,
@@ -9181,9 +9051,7 @@ ignored. This function should return the result of the call to the
built-in function.
@end deftypefn
-@table @code
-@findex MD_CAN_REDIRECT_BRANCH
-@item MD_CAN_REDIRECT_BRANCH(@var{branch1}, @var{branch2})
+@defmac MD_CAN_REDIRECT_BRANCH (@var{branch1}, @var{branch2})
Take a branch insn in @var{branch1} and another in @var{branch2}.
Return true if redirecting @var{branch1} to the destination of
@@ -9192,9 +9060,9 @@ Return true if redirecting @var{branch1} to the destination of
On some targets, branches may have a limited range. Optimizing the
filling of delay slots can result in branches being redirected, and this
may in turn cause a branch offset to overflow.
+@end defmac
-@findex ALLOCATE_INITIAL_VALUE
-@item ALLOCATE_INITIAL_VALUE(@var{hard_reg})
+@defmac ALLOCATE_INITIAL_VALUE (@var{hard_reg})
When the initial value of a hard register has been copied in a pseudo
register, it is often not necessary to actually allocate another register
@@ -9212,30 +9080,30 @@ it might decide to use another register anyways.
You may use @code{current_function_leaf_function} in the definition of the
macro, functions that use @code{REG_N_SETS}, to determine if the hard
register in question will not be clobbered.
+@end defmac
-@findex TARGET_OBJECT_SUFFIX
-@item TARGET_OBJECT_SUFFIX
+@defmac TARGET_OBJECT_SUFFIX
Define this macro to be a C string representing the suffix for object
files on your target machine. If you do not define this macro, GCC will
use @samp{.o} as the suffix for object files.
+@end defmac
-@findex TARGET_EXECUTABLE_SUFFIX
-@item TARGET_EXECUTABLE_SUFFIX
+@defmac TARGET_EXECUTABLE_SUFFIX
Define this macro to be a C string representing the suffix to be
automatically added to executable files on your target machine. If you
do not define this macro, GCC will use the null string as the suffix for
executable files.
+@end defmac
-@findex COLLECT_EXPORT_LIST
-@item COLLECT_EXPORT_LIST
+@defmac COLLECT_EXPORT_LIST
If defined, @code{collect2} will scan the individual object files
specified on its command line and create an export list for the linker.
Define this macro for systems like AIX, where the linker discards
object files that are not referenced from @code{main} and uses export
lists.
+@end defmac
-@findex MODIFY_JNI_METHOD_CALL
-@item MODIFY_JNI_METHOD_CALL (@var{mdecl})
+@defmac MODIFY_JNI_METHOD_CALL (@var{mdecl})
Define this macro to a C expression representing a variant of the
method call @var{mdecl}, if Java Native Interface (JNI) methods
must be invoked differently from other methods on your target.
@@ -9249,8 +9117,7 @@ build_type_attribute_variant (@var{mdecl},
(get_identifier ("stdcall"),
NULL))
@end smallexample
-
-@end table
+@end defmac
@deftypefn {Target Hook} bool TARGET_CANNOT_MODIFY_JUMPS_P (void)
This target hook returns @code{true} past the point in which new jump
@@ -9266,3 +9133,36 @@ cannot_modify_jumps_past_reload_p ()
@}
@end smallexample
@end deftypefn
+
+@deftypefn {Target Hook} int TARGET_BRANCH_TARGET_REGISTER_CLASS (void)
+This target hook returns a register class for which branch target register
+optimizations should be applied. All registers in this class should be
+usable interchangably. After reload, registers in this class will be
+re-allocated and loads will be hoisted out of loops and be subjected
+to inter-block scheduling.
+@end deftypefn
+
+@deftypefn {Target Hook} bool TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED (bool @var{after_prologue_epilogue_gen})
+Branch target register optimization will by default exclude callee-saved
+registers
+that are not already live during the current function; if this target hook
+returns true, they will be included. The target code must than make sure
+that all target registers in the class returned by
+@samp{TARGET_BRANCH_TARGET_REGISTER_CLASS} that might need saving are
+saved. @var{after_prologue_epilogue_gen} indicates if prologues and
+epilogues have already been generated. Note, even if you only return
+true when @var{after_prologue_epilogue_gen} is false, you still are likely
+to have to make special provisions in @code{INITIAL_ELIMINATION_OFFSET}
+to reserve space for caller-saved target registers.
+@end deftypefn
+
+@defmac POWI_MAX_MULTS
+If defined, this macro is interpreted as a signed integer C expression
+that specifies the maximum number of floating point multiplications
+that should be emitted when expanding exponentiation by an integer
+constant inline. When this value is defined, exponentiation requiring
+more than this number of multiplications is implemented by calling the
+system library's @code{pow}, @code{powf} or @code{powl} routines.
+The default value places no upper bound on the multiplication count.
+@end defmac
+
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 62528b8979a..6890e5a2797 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -1,4 +1,4 @@
-/* Output Dwarf2 format symbol table information from the GNU C compiler.
+/* Output Dwarf2 format symbol table information from GCC.
Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003 Free Software Foundation, Inc.
Contributed by Gary Funck (gary@intrepid.com).
@@ -3588,10 +3588,10 @@ static int current_function_has_inlines;
static int comp_unit_has_inlines;
#endif
-/* Number of file tables emited in maybe_emit_file(). */
+/* Number of file tables emited in maybe_emit_file(). */
static GTY(()) int emitcount = 0;
-/* Number of internal labels generated by gen_internal_sym(). */
+/* Number of internal labels generated by gen_internal_sym(). */
static GTY(()) int label_num;
#ifdef DWARF2_DEBUGGING_INFO
@@ -4692,7 +4692,7 @@ add_AT_string (die, attr_kind, str)
{
dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
struct indirect_string_node *node;
- PTR *slot;
+ void **slot;
if (! debug_str_hash)
debug_str_hash = htab_create_ggc (10, debug_str_do_hash,
@@ -8809,6 +8809,7 @@ loc_descriptor_from_tree (loc, addressp)
case NON_LVALUE_EXPR:
case VIEW_CONVERT_EXPR:
case SAVE_EXPR:
+ case MODIFY_EXPR:
return loc_descriptor_from_tree (TREE_OPERAND (loc, 0), addressp);
case COMPONENT_REF:
@@ -9351,7 +9352,7 @@ add_data_member_location_attribute (die, decl)
add_AT_loc (die, DW_AT_data_member_location, loc_descr);
}
-/* Attach an DW_AT_const_value attribute for a variable or a parameter which
+/* Attach a DW_AT_const_value attribute for a variable or a parameter which
does not have a "location" either in memory or in a register. These
things can arise in GNU C when a constant is passed as an actual parameter
to an inlined function. They can also arise in C++ where declared
@@ -9683,7 +9684,7 @@ rtl_for_decl_location (decl)
return rtl;
}
-/* Generate *either* an DW_AT_location attribute or else an DW_AT_const_value
+/* Generate *either* a DW_AT_location attribute or else a DW_AT_const_value
data attribute for a variable or a parameter. We generate the
DW_AT_const_value attribute only in those cases where the given variable
or parameter does not have a true "location" either in memory or in a
@@ -9787,7 +9788,7 @@ tree_add_const_value_attribute (var_die, decl)
}
}
-/* Generate an DW_AT_name attribute given some string value to be included as
+/* Generate a DW_AT_name attribute given some string value to be included as
the value of the attribute. */
static void
@@ -9804,7 +9805,7 @@ add_name_attribute (die, name_string)
}
}
-/* Generate an DW_AT_comp_dir attribute for DIE. */
+/* Generate a DW_AT_comp_dir attribute for DIE. */
static void
add_comp_dir_attribute (die)
@@ -10236,7 +10237,7 @@ add_src_coords_attributes (die, decl)
add_AT_unsigned (die, DW_AT_decl_line, DECL_SOURCE_LINE (decl));
}
-/* Add an DW_AT_name attribute and source coordinate attribute for the
+/* Add a DW_AT_name attribute and source coordinate attribute for the
given decl, but only if it actually has a name. */
static void
@@ -10380,7 +10381,7 @@ class_scope_p (context_die)
/* Many forms of DIEs require a "type description" attribute. This
routine locates the proper "type descriptor" die for the type given
- by 'type', and adds an DW_AT_type attribute below the given die. */
+ by 'type', and adds a DW_AT_type attribute below the given die. */
static void
add_type_attribute (object_die, type, decl_const, decl_volatile, context_die)
@@ -11404,8 +11405,12 @@ gen_field_die (decl, context_die)
tree decl;
dw_die_ref context_die;
{
- dw_die_ref decl_die = new_die (DW_TAG_member, context_die, decl);
+ dw_die_ref decl_die;
+ if (TREE_TYPE (decl) == error_mark_node)
+ return;
+
+ decl_die = new_die (DW_TAG_member, context_die, decl);
add_name_and_src_coords_attributes (decl_die, decl);
add_type_attribute (decl_die, member_declared_type (decl),
TREE_READONLY (decl), TREE_THIS_VOLATILE (decl),
diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c
index 663bb9fa9a5..6210ab91f85 100644
--- a/gcc/dwarfout.c
+++ b/gcc/dwarfout.c
@@ -1,4 +1,4 @@
-/* Output Dwarf format symbol table information from the GNU C compiler.
+/* Output Dwarf format symbol table information from GCC.
Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@monkeys.com) of Network Computing Devices.
@@ -6367,7 +6367,7 @@ dwarfout_init (main_input_filename)
fputc ('\n', asm_out_file);
ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SECTION);
ASM_OUTPUT_LABEL (asm_out_file, DEBUG_BEGIN_LABEL);
- output_die (output_compile_unit_die, (PTR) main_input_filename);
+ output_die (output_compile_unit_die, (void *) main_input_filename);
ASM_OUTPUT_POP_SECTION (asm_out_file);
fputc ('\n', asm_out_file);
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 4590bf25270..d54d1885258 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1,4 +1,4 @@
-/* Emit RTL for the GNU C-Compiler expander.
+/* Emit RTL for the GCC expander.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
@@ -170,8 +170,7 @@ static GTY ((if_marked ("ggc_marked_p"), param_is (struct rtx_def)))
#define first_insn (cfun->emit->x_first_insn)
#define last_insn (cfun->emit->x_last_insn)
#define cur_insn_uid (cfun->emit->x_cur_insn_uid)
-#define last_linenum (cfun->emit->x_last_linenum)
-#define last_filename (cfun->emit->x_last_filename)
+#define last_location (cfun->emit->x_last_location)
#define first_label_num (cfun->emit->x_first_label_num)
static rtx make_jump_insn_raw PARAMS ((rtx));
@@ -3511,8 +3510,10 @@ try_split (pat, trial, last)
for (insn = insn_last; insn ; insn = PREV_INSN (insn))
if (GET_CODE (insn) == CALL_INSN)
{
- CALL_INSN_FUNCTION_USAGE (insn)
- = CALL_INSN_FUNCTION_USAGE (trial);
+ rtx *p = &CALL_INSN_FUNCTION_USAGE (insn);
+ while (*p)
+ p = &XEXP (*p, 1);
+ *p = CALL_INSN_FUNCTION_USAGE (trial);
SIBLING_CALL_P (insn) = SIBLING_CALL_P (trial);
}
}
@@ -4636,7 +4637,9 @@ emit_line_note_after (file, line, after)
{
rtx note;
- if (no_line_numbers && line > 0)
+ if (line < 0)
+ abort ();
+ if (no_line_numbers)
{
cur_insn_uid++;
return 0;
@@ -4896,47 +4899,44 @@ emit_line_note (file, line)
const char *file;
int line;
{
+ rtx note;
+
+ if (line < 0)
+ abort ();
+
set_file_and_line_for_stmt (file, line);
-#if 0
+ if (file && last_location.file && !strcmp (file, last_location.file)
+ && line == last_location.line)
+ return NULL_RTX;
+ last_location.file = file;
+ last_location.line = line;
+
if (no_line_numbers)
- return 0;
-#endif
+ {
+ cur_insn_uid++;
+ return NULL_RTX;
+ }
- return emit_note (file, line);
+ note = emit_note (line);
+ NOTE_SOURCE_FILE (note) = file;
+
+ return note;
}
-/* Make an insn of code NOTE
- with data-fields specified by FILE and LINE
- and add it to the end of the doubly-linked list.
- If it is a line-number NOTE, omit it if it matches the previous one. */
+/* Make an insn of code NOTE or type NOTE_NO
+ and add it to the end of the doubly-linked list. */
rtx
-emit_note (file, line)
- const char *file;
- int line;
+emit_note (note_no)
+ int note_no;
{
rtx note;
- if (line > 0)
- {
- if (file && last_filename && !strcmp (file, last_filename)
- && line == last_linenum)
- return 0;
- last_filename = file;
- last_linenum = line;
- }
-
- if (no_line_numbers && line > 0)
- {
- cur_insn_uid++;
- return 0;
- }
-
note = rtx_alloc (NOTE);
INSN_UID (note) = cur_insn_uid++;
- NOTE_SOURCE_FILE (note) = file;
- NOTE_LINE_NUMBER (note) = line;
+ NOTE_LINE_NUMBER (note) = note_no;
+ NOTE_DATA (note) = 0;
BLOCK_FOR_INSN (note) = NULL;
add_insn (note);
return note;
@@ -4949,7 +4949,7 @@ emit_line_note_force (file, line)
const char *file;
int line;
{
- last_linenum = -1;
+ last_location.line = -1;
return emit_line_note (file, line);
}
@@ -4959,7 +4959,7 @@ emit_line_note_force (file, line)
void
force_next_line_note ()
{
- last_linenum = -1;
+ last_location.line = -1;
}
/* Place a note of KIND on insn INSN with DATUM as the datum. If a
@@ -5438,8 +5438,8 @@ init_emit ()
seq_rtl_expr = NULL;
cur_insn_uid = 1;
reg_rtx_no = LAST_VIRTUAL_REGISTER + 1;
- last_linenum = 0;
- last_filename = 0;
+ last_location.line = 0;
+ last_location.file = 0;
first_label_num = label_num;
last_label_num = 0;
seq_stack = NULL;
diff --git a/gcc/except.c b/gcc/except.c
index 28b8efe5cad..39e72dfa70d 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -255,9 +255,9 @@ struct eh_status GTY(())
};
-static int t2r_eq PARAMS ((const PTR,
- const PTR));
-static hashval_t t2r_hash PARAMS ((const PTR));
+static int t2r_eq PARAMS ((const void *,
+ const void *));
+static hashval_t t2r_hash PARAMS ((const void *));
static void add_type_for_runtime PARAMS ((tree));
static tree lookup_type_for_runtime PARAMS ((tree));
@@ -275,12 +275,12 @@ static struct eh_region *duplicate_eh_region_1 PARAMS ((struct eh_region *,
struct inline_remap *));
static void duplicate_eh_region_2 PARAMS ((struct eh_region *,
struct eh_region **));
-static int ttypes_filter_eq PARAMS ((const PTR,
- const PTR));
-static hashval_t ttypes_filter_hash PARAMS ((const PTR));
-static int ehspec_filter_eq PARAMS ((const PTR,
- const PTR));
-static hashval_t ehspec_filter_hash PARAMS ((const PTR));
+static int ttypes_filter_eq PARAMS ((const void *,
+ const void *));
+static hashval_t ttypes_filter_hash PARAMS ((const void *));
+static int ehspec_filter_eq PARAMS ((const void *,
+ const void *));
+static hashval_t ehspec_filter_hash PARAMS ((const void *));
static int add_ttypes_entry PARAMS ((htab_t, tree));
static int add_ehspec_entry PARAMS ((htab_t, htab_t,
tree));
@@ -302,14 +302,14 @@ static void sjlj_emit_dispatch_table
PARAMS ((rtx, struct sjlj_lp_info *));
static void sjlj_build_landing_pads PARAMS ((void));
-static hashval_t ehl_hash PARAMS ((const PTR));
-static int ehl_eq PARAMS ((const PTR,
- const PTR));
+static hashval_t ehl_hash PARAMS ((const void *));
+static int ehl_eq PARAMS ((const void *,
+ const void *));
static void add_ehl_entry PARAMS ((rtx,
struct eh_region *));
static void remove_exception_handler_label PARAMS ((rtx));
static void remove_eh_handler PARAMS ((struct eh_region *));
-static int for_each_eh_label_1 PARAMS ((PTR *, PTR));
+static int for_each_eh_label_1 PARAMS ((void **, void *));
struct reachable_info;
@@ -333,9 +333,9 @@ static void add_reachable_handler
static enum reachable_code reachable_next_level
PARAMS ((struct eh_region *, tree, struct reachable_info *));
-static int action_record_eq PARAMS ((const PTR,
- const PTR));
-static hashval_t action_record_hash PARAMS ((const PTR));
+static int action_record_eq PARAMS ((const void *,
+ const void *));
+static hashval_t action_record_hash PARAMS ((const void *));
static int add_action_record PARAMS ((htab_t, int, int));
static int collect_one_action_chain PARAMS ((htab_t,
struct eh_region *));
@@ -510,7 +510,7 @@ expand_eh_region_start ()
/* Create a note marking the start of this region. */
new_region->region_number = ++cfun->eh->last_region_number;
- note = emit_note (NULL, NOTE_INSN_EH_REGION_BEG);
+ note = emit_note (NOTE_INSN_EH_REGION_BEG);
NOTE_EH_HANDLER (note) = new_region->region_number;
}
@@ -523,7 +523,7 @@ expand_eh_region_end ()
rtx note;
/* Create a note marking the end of this region. */
- note = emit_note (NULL, NOTE_INSN_EH_REGION_END);
+ note = emit_note (NOTE_INSN_EH_REGION_END);
NOTE_EH_HANDLER (note) = cur_region->region_number;
/* Pop. */
@@ -1418,8 +1418,8 @@ duplicate_eh_regions (ifun, map)
static int
t2r_eq (pentry, pdata)
- const PTR pentry;
- const PTR pdata;
+ const void *pentry;
+ const void *pdata;
{
tree entry = (tree) pentry;
tree data = (tree) pdata;
@@ -1429,7 +1429,7 @@ t2r_eq (pentry, pdata)
static hashval_t
t2r_hash (pentry)
- const PTR pentry;
+ const void *pentry;
{
tree entry = (tree) pentry;
return TYPE_HASH (TREE_PURPOSE (entry));
@@ -1477,8 +1477,8 @@ struct ttypes_filter GTY(())
static int
ttypes_filter_eq (pentry, pdata)
- const PTR pentry;
- const PTR pdata;
+ const void *pentry;
+ const void *pdata;
{
const struct ttypes_filter *entry = (const struct ttypes_filter *) pentry;
tree data = (tree) pdata;
@@ -1488,7 +1488,7 @@ ttypes_filter_eq (pentry, pdata)
static hashval_t
ttypes_filter_hash (pentry)
- const PTR pentry;
+ const void *pentry;
{
const struct ttypes_filter *entry = (const struct ttypes_filter *) pentry;
return TYPE_HASH (entry->t);
@@ -1501,8 +1501,8 @@ ttypes_filter_hash (pentry)
static int
ehspec_filter_eq (pentry, pdata)
- const PTR pentry;
- const PTR pdata;
+ const void *pentry;
+ const void *pdata;
{
const struct ttypes_filter *entry = (const struct ttypes_filter *) pentry;
const struct ttypes_filter *data = (const struct ttypes_filter *) pdata;
@@ -1514,7 +1514,7 @@ ehspec_filter_eq (pentry, pdata)
static hashval_t
ehspec_filter_hash (pentry)
- const PTR pentry;
+ const void *pentry;
{
const struct ttypes_filter *entry = (const struct ttypes_filter *) pentry;
hashval_t h = 0;
@@ -2119,7 +2119,7 @@ sjlj_emit_function_enter (dispatch_label)
plus_constant (XEXP (fc, 0),
sjlj_fc_jbuf_ofs), Pmode);
- note = emit_note (NULL, NOTE_INSN_EXPECTED_VALUE);
+ note = emit_note (NOTE_INSN_EXPECTED_VALUE);
NOTE_EXPECTED_VALUE (note) = gen_rtx_EQ (VOIDmode, x, const0_rtx);
emit_cmp_and_jump_insns (x, const0_rtx, NE, 0,
@@ -2314,7 +2314,7 @@ finish_eh_generation ()
static hashval_t
ehl_hash (pentry)
- const PTR pentry;
+ const void *pentry;
{
struct ehl_map_entry *entry = (struct ehl_map_entry *) pentry;
@@ -2325,8 +2325,8 @@ ehl_hash (pentry)
static int
ehl_eq (pentry, pdata)
- const PTR pentry;
- const PTR pdata;
+ const void *pentry;
+ const void *pdata;
{
struct ehl_map_entry *entry = (struct ehl_map_entry *) pentry;
struct ehl_map_entry *data = (struct ehl_map_entry *) pdata;
@@ -2499,8 +2499,8 @@ for_each_eh_label (callback)
static int
for_each_eh_label_1 (pentry, data)
- PTR *pentry;
- PTR data;
+ void **pentry;
+ void *data;
{
struct ehl_map_entry *entry = *(struct ehl_map_entry **)pentry;
void (*callback) PARAMS ((rtx)) = (void (*) PARAMS ((rtx))) data;
@@ -3166,8 +3166,8 @@ struct action_record
static int
action_record_eq (pentry, pdata)
- const PTR pentry;
- const PTR pdata;
+ const void *pentry;
+ const void *pdata;
{
const struct action_record *entry = (const struct action_record *) pentry;
const struct action_record *data = (const struct action_record *) pdata;
@@ -3176,7 +3176,7 @@ action_record_eq (pentry, pdata)
static hashval_t
action_record_hash (pentry)
- const PTR pentry;
+ const void *pentry;
{
const struct action_record *entry = (const struct action_record *) pentry;
return entry->next * 1009 + entry->filter;
diff --git a/gcc/explow.c b/gcc/explow.c
index cd0a15836a3..883edf8e9f4 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -1588,13 +1588,13 @@ probe_stack_range (first, size)
|| REGNO (test_addr) < FIRST_PSEUDO_REGISTER)
test_addr = force_reg (Pmode, test_addr);
- emit_note (NULL, NOTE_INSN_LOOP_BEG);
+ emit_note (NOTE_INSN_LOOP_BEG);
emit_jump (test_lab);
emit_label (loop_lab);
emit_stack_probe (test_addr);
- emit_note (NULL, NOTE_INSN_LOOP_CONT);
+ emit_note (NOTE_INSN_LOOP_CONT);
#ifdef STACK_GROWS_DOWNWARD
#define CMP_OPCODE GTU
@@ -1613,7 +1613,7 @@ probe_stack_range (first, size)
emit_cmp_and_jump_insns (test_addr, last_addr, CMP_OPCODE,
NULL_RTX, Pmode, 1, loop_lab);
emit_jump (end_lab);
- emit_note (NULL, NOTE_INSN_LOOP_END);
+ emit_note (NOTE_INSN_LOOP_END);
emit_label (end_lab);
emit_stack_probe (last_addr);
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 43007569a6c..ff0f7f61bad 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -3950,7 +3950,7 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
{
/* Try to produce the remainder without producing the quotient.
If we seem to have a divmod pattern that does not require widening,
- don't try widening here. We should really have an WIDEN argument
+ don't try widening here. We should really have a WIDEN argument
to expand_twoval_binop, since what we'd really like to do here is
1) try a mod insn in compute_mode
2) try a divmod insn in compute_mode
diff --git a/gcc/expr.c b/gcc/expr.c
index 3131a33e50d..849e778b0cb 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -125,8 +125,8 @@ struct store_by_pieces
int explicit_inc_to;
unsigned HOST_WIDE_INT len;
HOST_WIDE_INT offset;
- rtx (*constfun) PARAMS ((PTR, HOST_WIDE_INT, enum machine_mode));
- PTR constfundata;
+ rtx (*constfun) PARAMS ((void *, HOST_WIDE_INT, enum machine_mode));
+ void *constfundata;
int reverse;
};
@@ -141,7 +141,7 @@ static bool emit_block_move_via_movstr PARAMS ((rtx, rtx, rtx, unsigned));
static rtx emit_block_move_via_libcall PARAMS ((rtx, rtx, rtx));
static tree emit_block_move_libcall_fn PARAMS ((int));
static void emit_block_move_via_loop PARAMS ((rtx, rtx, rtx, unsigned));
-static rtx clear_by_pieces_1 PARAMS ((PTR, HOST_WIDE_INT,
+static rtx clear_by_pieces_1 PARAMS ((void *, HOST_WIDE_INT,
enum machine_mode));
static void clear_by_pieces PARAMS ((rtx, unsigned HOST_WIDE_INT,
unsigned int));
@@ -2146,7 +2146,7 @@ emit_block_move_via_loop (x, y, size, align)
y_addr = force_operand (XEXP (y, 0), NULL_RTX);
do_pending_stack_adjust ();
- emit_note (NULL, NOTE_INSN_LOOP_BEG);
+ emit_note (NOTE_INSN_LOOP_BEG);
emit_jump (cmp_label);
emit_label (top_label);
@@ -2164,13 +2164,13 @@ emit_block_move_via_loop (x, y, size, align)
if (tmp != iter)
emit_move_insn (iter, tmp);
- emit_note (NULL, NOTE_INSN_LOOP_CONT);
+ emit_note (NOTE_INSN_LOOP_CONT);
emit_label (cmp_label);
emit_cmp_and_jump_insns (iter, size, LT, NULL_RTX, iter_mode,
true, top_label);
- emit_note (NULL, NOTE_INSN_LOOP_END);
+ emit_note (NOTE_INSN_LOOP_END);
}
/* Copy all or part of a value X into registers starting at REGNO.
@@ -2718,8 +2718,8 @@ use_group_regs (call_fusage, regs)
int
can_store_by_pieces (len, constfun, constfundata, align)
unsigned HOST_WIDE_INT len;
- rtx (*constfun) PARAMS ((PTR, HOST_WIDE_INT, enum machine_mode));
- PTR constfundata;
+ rtx (*constfun) PARAMS ((void *, HOST_WIDE_INT, enum machine_mode));
+ void *constfundata;
unsigned int align;
{
unsigned HOST_WIDE_INT max_size, l;
@@ -2801,8 +2801,8 @@ rtx
store_by_pieces (to, len, constfun, constfundata, align, endp)
rtx to;
unsigned HOST_WIDE_INT len;
- rtx (*constfun) PARAMS ((PTR, HOST_WIDE_INT, enum machine_mode));
- PTR constfundata;
+ rtx (*constfun) PARAMS ((void *, HOST_WIDE_INT, enum machine_mode));
+ void *constfundata;
unsigned int align;
int endp;
{
@@ -2871,7 +2871,7 @@ clear_by_pieces (to, len, align)
static rtx
clear_by_pieces_1 (data, offset, mode)
- PTR data ATTRIBUTE_UNUSED;
+ void *data ATTRIBUTE_UNUSED;
HOST_WIDE_INT offset ATTRIBUTE_UNUSED;
enum machine_mode mode ATTRIBUTE_UNUSED;
{
@@ -3343,8 +3343,8 @@ emit_move_insn_1 (x, y)
int stack = push_operand (x, GET_MODE (x));
#ifdef PUSH_ROUNDING
- /* In case we output to the stack, but the size is smaller machine can
- push exactly, we need to use move instructions. */
+ /* In case we output to the stack, but the size is smaller than the
+ machine can push exactly, we need to use move instructions. */
if (stack
&& (PUSH_ROUNDING (GET_MODE_SIZE (submode))
!= GET_MODE_SIZE (submode)))
@@ -4465,7 +4465,7 @@ store_expr (exp, target, want_value)
{
/* C++ can generate ?: expressions with a throw expression in one
branch and an rvalue in the other. Here, we resolve attempts to
- store the throw expression's nonexistant result. */
+ store the throw expression's nonexistant result. */
if (want_value)
abort ();
expand_expr (exp, const0_rtx, VOIDmode, 0);
@@ -7001,7 +7001,7 @@ expand_expr (exp, target, tmode, modifier)
return original_target;
}
- /* ... fall through ... */
+ /* ... fall through ... */
case STRING_CST:
temp = output_constant_def (exp, 1);
@@ -8226,7 +8226,11 @@ expand_expr (exp, target, tmode, modifier)
|| mode != ptr_mode)
{
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
- op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
+ if (! operand_equal_p (TREE_OPERAND (exp, 0),
+ TREE_OPERAND (exp, 1), 0))
+ op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
+ else
+ op1 = op0;
if (op0 == const0_rtx)
return op1;
if (op1 == const0_rtx)
@@ -8235,7 +8239,12 @@ expand_expr (exp, target, tmode, modifier)
}
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, modifier);
- op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, modifier);
+ if (! operand_equal_p (TREE_OPERAND (exp, 0),
+ TREE_OPERAND (exp, 1), 0))
+ op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX,
+ VOIDmode, modifier);
+ else
+ op1 = op0;
/* We come here from MINUS_EXPR when the second operand is a
constant. */
@@ -8457,7 +8466,11 @@ expand_expr (exp, target, tmode, modifier)
}
}
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0);
- op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
+ if (! operand_equal_p (TREE_OPERAND (exp, 0),
+ TREE_OPERAND (exp, 1), 0))
+ op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0);
+ else
+ op1 = op0;
return expand_mult (mode, op0, op1, target, unsignedp);
case TRUNC_DIV_EXPR:
@@ -10510,6 +10523,10 @@ const_vector_from_tree (exp)
inner);
}
+ /* Initialize remaining elements to 0. */
+ for (; i < units; ++i)
+ RTVEC_ELT (v, i) = CONST0_RTX (inner);
+
return gen_rtx_raw_CONST_VECTOR (mode, v);
}
diff --git a/gcc/expr.h b/gcc/expr.h
index 394d947f113..589e7f577b6 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -470,9 +470,9 @@ extern int can_move_by_pieces PARAMS ((unsigned HOST_WIDE_INT, unsigned int));
in every CONSTFUN call.
ALIGN is maximum alignment we can assume. */
extern int can_store_by_pieces PARAMS ((unsigned HOST_WIDE_INT,
- rtx (*) (PTR, HOST_WIDE_INT,
+ rtx (*) (void *, HOST_WIDE_INT,
enum machine_mode),
- PTR, unsigned int));
+ void *, unsigned int));
/* Generate several move instructions to store LEN bytes generated by
CONSTFUN to block TO. (A MEM rtx with BLKmode). CONSTFUNDATA is a
@@ -480,9 +480,9 @@ extern int can_store_by_pieces PARAMS ((unsigned HOST_WIDE_INT,
ALIGN is maximum alignment we can assume.
Returns TO + LEN. */
extern rtx store_by_pieces PARAMS ((rtx, unsigned HOST_WIDE_INT,
- rtx (*) (PTR, HOST_WIDE_INT,
+ rtx (*) (void *, HOST_WIDE_INT,
enum machine_mode),
- PTR, unsigned int, int));
+ void *, unsigned int, int));
/* Emit insns to set X from Y. */
extern rtx emit_move_insn PARAMS ((rtx, rtx));
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index f1923fad584..e1ac7ac5b91 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,3 +1,30 @@
+Thu Jun 26 07:06:29 2003 Neil Booth <neil@daikokuya.co.uk>
+
+ * top.c (ffe_handle_option): Don't check for missing arguments.
+
+Wed Jun 25 06:52:12 2003 Neil Booth <neil@daikokuya.co.uk>
+
+ * top.c (ffe_handle_option): Add missing break;.
+
+2003-06-24 Scott Snyder <snyder@fnal.gov>
+
+ PR fortran/11299
+ * com.c (ffe_init): Call push_srcloc() to ensure that
+ input_file_stack is initialized.
+
+Sat Jun 21 21:29:38 2003 Neil Booth <neil@daikokuya.co.uk>
+
+ * lang.opt: Add -fpreprocessed.
+ * top.c (ffe_handle_option): Handle it.
+
+Fri Jun 20 10:00:31 2003 Nathan Sidwell <nathan@codesourcery.com>
+
+ * com.c (finish_function): Adjust expand_function_end call.
+
+2003-06-17 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * Make-lang.in: Replace BUILD_CC references with CC_FOR_BUILD.
+
Sun Jun 15 15:56:51 2003 Neil Booth <neil@daikokuya.co.uk>
* lang.opt: Declare F77.
diff --git a/gcc/f/Make-lang.in b/gcc/f/Make-lang.in
index c243317e7ae..5e11dc3de6b 100644
--- a/gcc/f/Make-lang.in
+++ b/gcc/f/Make-lang.in
@@ -129,11 +129,11 @@ f/str-ot.h f/str-ot.j: f/fini$(build_exeext) f/str-ot.fin
./f/fini$(build_exeext) $(srcdir)/f/str-ot.fin f/str-ot.j f/str-ot.h
f/fini$(build_exeext): f/fini.o $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o f/fini$(build_exeext) \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o f/fini$(build_exeext) \
f/fini.o $(BUILD_LIBS)
f/fini.o:
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
-c $(srcdir)/f/fini.c $(OUTPUT_OPTION)
gt-f-lex.h gt-f-where.h gt-f-com.h gt-f-ste.h gtype-f.h : s-gtype; @true
@@ -219,7 +219,7 @@ $(srcdir)/f/intdoc.texi: $(INTDOC_DEPS) $(srcdir)/f/intdoc.in
f/intdoc$(build_exeext): $(INTDOC_DEPS) f/intdoc.h0 bconfig.h \
$(SYSTEM_H) coretypes.h $(TM_H) $(BUILD_LIBDEPS)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) $(INCLUDES) \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) $(INCLUDES) \
$(srcdir)/f/intdoc.c $(BUILD_LIBS) -o f/intdoc$(build_exeext)
f/intdoc.h0: f/intdoc.in f/ansify$(build_exeext)
@@ -227,7 +227,7 @@ f/intdoc.h0: f/intdoc.in f/ansify$(build_exeext)
< $(srcdir)/f/intdoc.in > f/intdoc.h0
f/ansify$(build_exeext): f/ansify.c bconfig.h $(SYSTEM_H) coretypes.h $(TM_H)
- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) $(INCLUDES) \
+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) $(INCLUDES) \
$(srcdir)/f/ansify.c -o f/ansify$(build_exeext)
$(srcdir)/f/BUGS: f/bugs0.texi f/bugs.texi f/root.texi
diff --git a/gcc/f/com.c b/gcc/f/com.c
index aec7ce33722..098cb3db721 100644
--- a/gcc/f/com.c
+++ b/gcc/f/com.c
@@ -13604,7 +13604,7 @@ finish_function (int nested)
/* Obey `register' declarations if `setjmp' is called in this fn. */
/* Generate rtl for function exit. */
- expand_function_end (input_filename, input_line, 0);
+ expand_function_end ();
/* If this is a nested function, protect the local variables in the stack
above us from being collected while we're compiling this function. */
@@ -14246,6 +14246,8 @@ ffe_init ()
to try doing this. */
ffelex_hash_kludge (finput);
+ push_srcloc (input_filename, 0);
+
/* FIXME: The ffelex_hash_kludge code needs to be cleaned up to
set the new file name. Maybe in ffe_post_options. */
return true;
diff --git a/gcc/f/lang.opt b/gcc/f/lang.opt
index c6e453e9c57..d53a0f50039 100644
--- a/gcc/f/lang.opt
+++ b/gcc/f/lang.opt
@@ -214,6 +214,9 @@ F77
fpedantic
F77
+fpreprocessed
+F77
+
fsecond-underscore
F77
diff --git a/gcc/f/top.c b/gcc/f/top.c
index 7ca2db998b8..359dd2b8d32 100644
--- a/gcc/f/top.c
+++ b/gcc/f/top.c
@@ -175,19 +175,12 @@ ffe_init_options ()
int
ffe_handle_option (size_t scode, const char *arg, int value)
{
- const struct cl_option *option = &cl_options[scode];
enum opt_code code = (enum opt_code) scode;
/* Ignore file names. */
if (code == N_OPTS)
return 1;
- if (arg == NULL && (option->flags & (CL_JOINED | CL_SEPARATE)))
- {
- error ("missing argument to \"-%s\"", option->opt_text);
- return 1;
- }
-
switch (code)
{
default:
@@ -239,8 +232,6 @@ ffe_handle_option (size_t scode, const char *arg, int value)
case OPT_ffixed_form:
ffe_set_is_free_form (!value);
- if (value)
- return -1;
break;
case OPT_fpedantic:
@@ -442,6 +433,7 @@ ffe_handle_option (size_t scode, const char *arg, int value)
ffe_set_case_match (FFE_caseNONE);
ffe_set_case_source (FFE_caseLOWER);
ffe_set_case_symbol (FFE_caseNONE);
+ break;
case OPT_fcase_preserve:
ffe_set_case_intrin (FFE_caseNONE);
@@ -564,21 +556,18 @@ ffe_handle_option (size_t scode, const char *arg, int value)
case OPT_ffixed_line_length_:
if (strcmp (arg, "none") == 0)
- {
- ffe_set_fixed_line_length (0);
- return -1;
- }
+ ffe_set_fixed_line_length (0);
else if (ffe_is_digit_string_ (arg))
- {
- ffe_set_fixed_line_length (atol (arg));
- return -1;
- }
- return 0;
+ ffe_set_fixed_line_length (atol (arg));
+ else
+ return 0;
+ break;
case OPT_Wcomment:
case OPT_Wcomments:
case OPT_Wimport:
case OPT_Wtrigraphs:
+ case OPT_fpreprocessed:
/* These are for cpp. */
break;
diff --git a/gcc/final.c b/gcc/final.c
index dae455d2990..b7a04f5d510 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -81,6 +81,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "dwarf2out.h"
#endif
+#ifdef DBX_DEBUGGING_INFO
+#include "dbxout.h"
+#endif
+
/* If we aren't using cc0, CC_STATUS_INIT shouldn't exist. So define a
null default for it to save conditionalization later. */
#ifndef CC_STATUS_INIT
@@ -3419,17 +3423,8 @@ asm_fprintf (FILE *file, const char *p, ...)
'o' cases, but we do not check for those cases. It
means that the value is a HOST_WIDE_INT, which may be
either `long' or `long long'. */
-
-#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
-#else
-#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
- *q++ = 'l';
-#else
- *q++ = 'l';
- *q++ = 'l';
-#endif
-#endif
-
+ memcpy (q, HOST_WIDE_INT_PRINT, strlen (HOST_WIDE_INT_PRINT));
+ q += strlen (HOST_WIDE_INT_PRINT);
*q++ = *p++;
*q = 0;
fprintf (file, buf, va_arg (argptr, HOST_WIDE_INT));
@@ -3856,3 +3851,85 @@ leaf_renumber_regs_insn (in_rtx)
}
}
#endif
+
+
+/* When -gused is used, emit debug info for only used symbols. But in
+ addition to the standard intercepted debug_hooks there are some direct
+ calls into this file, i.e., dbxout_symbol, dbxout_parms, and dbxout_reg_params.
+ Those routines may also be called from a higher level intercepted routine. So
+ to prevent recording data for an inner call to one of these for an intercept,
+ we maintain a intercept nesting counter (debug_nesting). We only save the
+ intercepted arguments if the nesting is 1. */
+int debug_nesting = 0;
+
+static tree *symbol_queue;
+int symbol_queue_index = 0;
+static int symbol_queue_size = 0;
+
+/* Generate the symbols for any queued up type symbols we encountered
+ while generating the type info for some originally used symbol.
+ This might generate additional entries in the queue. Only when
+ the nesting depth goes to 0 is this routine called. */
+
+void
+debug_flush_symbol_queue ()
+{
+ int i;
+
+ /* Make sure that additionally queued items are not flushed
+ prematurely. */
+
+ ++debug_nesting;
+
+ for (i = 0; i < symbol_queue_index; ++i)
+ {
+ /* If we pushed queued symbols then such symbols are must be
+ output no matter what anyone else says. Specifically,
+ we need to make sure dbxout_symbol() thinks the symbol was
+ used and also we need to override TYPE_DECL_SUPPRESS_DEBUG
+ which may be set for outside reasons. */
+ int saved_tree_used = TREE_USED (symbol_queue[i]);
+ int saved_suppress_debug = TYPE_DECL_SUPPRESS_DEBUG (symbol_queue[i]);
+ TREE_USED (symbol_queue[i]) = 1;
+ TYPE_DECL_SUPPRESS_DEBUG (symbol_queue[i]) = 0;
+
+#ifdef DBX_DEBUGGING_INFO
+ dbxout_symbol (symbol_queue[i], 0);
+#endif
+
+ TREE_USED (symbol_queue[i]) = saved_tree_used;
+ TYPE_DECL_SUPPRESS_DEBUG (symbol_queue[i]) = saved_suppress_debug;
+ }
+
+ symbol_queue_index = 0;
+ --debug_nesting;
+}
+
+/* Queue a type symbol needed as part of the definition of a decl
+ symbol. These symbols are generated when debug_flush_symbol_queue()
+ is called. */
+
+void
+debug_queue_symbol (tree decl)
+{
+ if (symbol_queue_index >= symbol_queue_size)
+ {
+ symbol_queue_size += 10;
+ symbol_queue = (tree *) xrealloc (symbol_queue,
+ symbol_queue_size * sizeof (tree));
+ }
+
+ symbol_queue[symbol_queue_index++] = decl;
+}
+
+/* Free symbol queue */
+void
+debug_free_queue ()
+{
+ if (symbol_queue)
+ {
+ free (symbol_queue);
+ symbol_queue = NULL;
+ symbol_queue_size = 0;
+ }
+}
diff --git a/gcc/fixinc/gnu-regex.c b/gcc/fixinc/gnu-regex.c
index 790f87e4c44..3863a993a06 100644
--- a/gcc/fixinc/gnu-regex.c
+++ b/gcc/fixinc/gnu-regex.c
@@ -78,10 +78,6 @@
# define gettext_noop(String) String
#endif
-# if !defined(volatile) && !defined(HAVE_VOLATILE)
-# define volatile
-# endif
-
/* If we are not linking with Emacs proper,
we can't use the relocating allocator
even if config.h says that we can. */
diff --git a/gcc/flags.h b/gcc/flags.h
index 511312420f4..410967ba931 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -1,5 +1,6 @@
/* Compilation switch flag definitions for GCC.
- Copyright (C) 1987, 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002
+ Copyright (C) 1987, 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
+ 2003
Free Software Foundation, Inc.
This file is part of GCC.
@@ -22,9 +23,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_FLAGS_H
#define GCC_FLAGS_H
-/* Name of the input .c file being compiled. */
-extern const char *main_input_filename;
-
enum debug_info_type
{
NO_DEBUG, /* Write no debug info. */
@@ -59,6 +57,9 @@ extern enum debug_info_level debug_info_level;
debugging information. */
extern int use_gnu_debug_info_extensions;
+/* Nonzero means emit debugging information only for symbols which are used. */
+extern int flag_debug_only_used_symbols;
+
/* Nonzero means do optimizations. -opt. */
extern int optimize;
@@ -79,16 +80,20 @@ extern int mem_report;
/* Don't print warning messages. -w. */
-extern int inhibit_warnings;
+extern bool inhibit_warnings;
/* Don't suppress warnings from system headers. -Wsystem-headers. */
-extern int warn_system_headers;
+extern bool warn_system_headers;
/* Do print extra warnings (such as for uninitialized variables).
-W/-Wextra. */
-extern int extra_warnings;
+extern bool extra_warnings;
+
+/* If -Werror. */
+
+extern bool warnings_are_errors;
/* Nonzero to warn about unused variables, functions et.al. Use
set_Wunused() to update the -Wunused-* flags that correspond to the
@@ -96,49 +101,41 @@ extern int extra_warnings;
extern void set_Wunused PARAMS ((int setting));
-extern int warn_unused_function;
-extern int warn_unused_label;
-extern int warn_unused_parameter;
-extern int warn_unused_variable;
-extern int warn_unused_value;
+extern bool warn_unused_function;
+extern bool warn_unused_label;
+extern bool warn_unused_parameter;
+extern bool warn_unused_variable;
+extern bool warn_unused_value;
/* Nonzero to warn about code which is never reached. */
-extern int warn_notreached;
+extern bool warn_notreached;
/* Nonzero means warn if inline function is too large. */
-extern int warn_inline;
+extern bool warn_inline;
/* Nonzero to warn about variables used before they are initialized. */
extern int warn_uninitialized;
-/* Zero if unknown pragmas are ignored
- One if the compiler should warn about an unknown pragma not in
- a system include file.
- Greater than one if the compiler should warn for all unknown
- pragmas. */
-
-extern int warn_unknown_pragmas;
-
/* Nonzero means warn about all declarations which shadow others. */
-extern int warn_shadow;
+extern bool warn_shadow;
/* Warn if a switch on an enum, that does not have a default case,
fails to have a case for every enum value. */
-extern int warn_switch;
+extern bool warn_switch;
/* Warn if a switch does not have a default case. */
-extern int warn_switch_default;
+extern bool warn_switch_default;
/* Warn if a switch on an enum fails to have a case for every enum
value (regardless of the presence or otherwise of a default case). */
-extern int warn_switch_enum;
+extern bool warn_switch_enum;
/* Nonzero means warn about function definitions that default the return type
or that use a null return and have a return-type other than void. */
@@ -147,47 +144,47 @@ extern int warn_return_type;
/* Warn about functions which might be candidates for attribute noreturn. */
-extern int warn_missing_noreturn;
+extern bool warn_missing_noreturn;
/* Nonzero means warn about pointer casts that increase the required
alignment of the target type (and might therefore lead to a crash
due to a misaligned access). */
-extern int warn_cast_align;
+extern bool warn_cast_align;
/* Nonzero means warn about any objects definitions whose size is larger
than N bytes. Also want about function definitions whose returned
values are larger than N bytes. The value N is in `larger_than_size'. */
-extern int warn_larger_than;
+extern bool warn_larger_than;
extern HOST_WIDE_INT larger_than_size;
/* Warn if a function returns an aggregate,
since there are often incompatible calling conventions for doing this. */
-extern int warn_aggregate_return;
+extern bool warn_aggregate_return;
/* Warn if packed attribute on struct is unnecessary and inefficient. */
-extern int warn_packed;
+extern bool warn_packed;
/* Warn when gcc pads a structure to an alignment boundary. */
-extern int warn_padded;
+extern bool warn_padded;
/* Warn when an optimization pass is disabled. */
-extern int warn_disabled_optimization;
+extern bool warn_disabled_optimization;
/* Nonzero means warn about uses of __attribute__((deprecated))
declarations. */
-extern int warn_deprecated_decl;
+extern bool warn_deprecated_decl;
/* Nonzero means warn about constructs which might not be strict
aliasing safe. */
-extern int warn_strict_aliasing;
+extern bool warn_strict_aliasing;
/* Nonzero if generating code to do profiling. */
@@ -197,6 +194,10 @@ extern int profile_flag;
extern int profile_arc_flag;
+/* Nonzero if value profile should be measured. */
+
+extern int flag_profile_values;
+
/* Nonzero if generating info for gcov to calculate line test coverage. */
extern int flag_test_coverage;
@@ -652,6 +653,16 @@ extern int flag_gcse_lm;
extern int flag_gcse_sm;
+/* Perform branch target register optimization before prologue / epilogue
+ threading. */
+
+extern int flag_branch_target_load_optimize;
+
+/* Perform branch target register optimization after prologue / epilogue
+ threading and jump2. */
+
+extern int flag_branch_target_load_optimize2;
+
/* Nonzero means we should do dwarf2 duplicate elimination. */
diff --git a/gcc/flow.c b/gcc/flow.c
index e234b1d5e8f..e51d477c94f 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -1,6 +1,6 @@
/* Data flow analysis for GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -333,7 +333,6 @@ static void mark_used_reg PARAMS ((struct propagate_block_info *,
rtx, rtx, rtx));
static void mark_used_regs PARAMS ((struct propagate_block_info *,
rtx, rtx, rtx));
-void dump_flow_info PARAMS ((FILE *));
void debug_flow_info PARAMS ((void));
static void add_to_mem_set_list PARAMS ((struct propagate_block_info *,
rtx));
@@ -986,7 +985,7 @@ mark_regs_live_at_end (set)
/* If exiting needs the right stack value, consider the stack pointer
live at the end of the function. */
- if ((HAVE_epilogue && reload_completed)
+ if ((HAVE_epilogue && epilogue_completed)
|| ! EXIT_IGNORE_STACK
|| (! FRAME_POINTER_REQUIRED
&& ! current_function_calls_alloca
@@ -1026,7 +1025,7 @@ mark_regs_live_at_end (set)
if (global_regs[i] || EPILOGUE_USES (i))
SET_REGNO_REG_SET (set, i);
- if (HAVE_epilogue && reload_completed)
+ if (HAVE_epilogue && epilogue_completed)
{
/* Mark all call-saved registers that we actually used. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
@@ -1047,7 +1046,7 @@ mark_regs_live_at_end (set)
}
#endif
#ifdef EH_RETURN_STACKADJ_RTX
- if ((! HAVE_epilogue || ! reload_completed)
+ if ((! HAVE_epilogue || ! epilogue_completed)
&& current_function_calls_eh_return)
{
rtx tmp = EH_RETURN_STACKADJ_RTX;
@@ -1056,7 +1055,7 @@ mark_regs_live_at_end (set)
}
#endif
#ifdef EH_RETURN_HANDLER_RTX
- if ((! HAVE_epilogue || ! reload_completed)
+ if ((! HAVE_epilogue || ! epilogue_completed)
&& current_function_calls_eh_return)
{
rtx tmp = EH_RETURN_HANDLER_RTX;
@@ -1771,8 +1770,10 @@ propagate_one_insn (pbi, insn)
if (GET_CODE (insn) == CALL_INSN)
{
- int i;
+ regset live_at_end;
+ bool sibcall_p;
rtx note, cond;
+ int i;
cond = NULL_RTX;
if (GET_CODE (PATTERN (insn)) == COND_EXEC)
@@ -1797,9 +1798,17 @@ propagate_one_insn (pbi, insn)
mark_set_1 (pbi, CLOBBER, XEXP (XEXP (note, 0), 0),
cond, insn, pbi->flags);
- /* Calls change all call-used and global registers. */
+ /* Calls change all call-used and global registers; sibcalls do not
+ clobber anything that must be preserved at end-of-function,
+ except for return values. */
+
+ sibcall_p = SIBLING_CALL_P (insn);
+ live_at_end = EXIT_BLOCK_PTR->global_live_at_start;
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
+ if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)
+ && ! (sibcall_p
+ && REGNO_REG_SET_P (live_at_end, i)
+ && !FUNCTION_VALUE_REGNO_P (i)))
{
/* We do not want REG_UNUSED notes for these registers. */
mark_set_1 (pbi, CLOBBER, regno_reg_rtx[i], cond, insn,
@@ -3843,7 +3852,8 @@ mark_used_regs (pbi, x, cond, insn)
case SUBREG:
#ifdef CANNOT_CHANGE_MODE_CLASS
- if (GET_CODE (SUBREG_REG (x)) == REG
+ if ((flags & PROP_REG_INFO)
+ && GET_CODE (SUBREG_REG (x)) == REG
&& REGNO (SUBREG_REG (x)) >= FIRST_PSEUDO_REGISTER)
bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (x))
* MAX_MACHINE_MODE
@@ -3892,7 +3902,8 @@ mark_used_regs (pbi, x, cond, insn)
|| GET_CODE (testreg) == SUBREG)
{
#ifdef CANNOT_CHANGE_MODE_CLASS
- if (GET_CODE (testreg) == SUBREG
+ if ((flags & PROP_REG_INFO)
+ && GET_CODE (testreg) == SUBREG
&& GET_CODE (SUBREG_REG (testreg)) == REG
&& REGNO (SUBREG_REG (testreg)) >= FIRST_PSEUDO_REGISTER)
bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (testreg))
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index bdc84de96f2..b160a4ea0eb 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1444,7 +1444,7 @@ size_int_type_wide (number, type)
HOST_WIDE_INT number;
tree type;
{
- PTR *slot;
+ void **slot;
if (size_htab == 0)
{
@@ -1466,7 +1466,7 @@ size_int_type_wide (number, type)
{
tree t = new_const;
- *slot = (PTR) new_const;
+ *slot = new_const;
new_const = make_node (INTEGER_CST);
return t;
}
@@ -1968,8 +1968,8 @@ operand_equal_p (arg0, arg1, only_const)
TREE_OPERAND (arg1, 0), 0));
case 'r':
- /* If either of the pointer (or reference) expressions we are dereferencing
- contain a side effect, these cannot be equal. */
+ /* If either of the pointer (or reference) expressions we are
+ dereferencing contain a side effect, these cannot be equal. */
if (TREE_SIDE_EFFECTS (arg0)
|| TREE_SIDE_EFFECTS (arg1))
return 0;
@@ -2010,10 +2010,52 @@ operand_equal_p (arg0, arg1, only_const)
case RTL_EXPR:
return rtx_equal_p (RTL_EXPR_RTL (arg0), RTL_EXPR_RTL (arg1));
+ case CALL_EXPR:
+ /* If the CALL_EXPRs call different functions, then they
+ clearly can not be equal. */
+ if (! operand_equal_p (TREE_OPERAND (arg0, 0),
+ TREE_OPERAND (arg1, 0), 0))
+ return 0;
+
+ /* Only consider const functions equivalent. */
+ if (TREE_CODE (TREE_OPERAND (arg0, 0)) == ADDR_EXPR)
+ {
+ tree fndecl = TREE_OPERAND (TREE_OPERAND (arg0, 0), 0);
+ if (! (flags_from_decl_or_type (fndecl) & ECF_CONST))
+ return 0;
+ }
+ else
+ return 0;
+
+ /* Now see if all the arguments are the same. operand_equal_p
+ does not handle TREE_LIST, so we walk the operands here
+ feeding them to operand_equal_p. */
+ arg0 = TREE_OPERAND (arg0, 1);
+ arg1 = TREE_OPERAND (arg1, 1);
+ while (arg0 && arg1)
+ {
+ if (! operand_equal_p (TREE_VALUE (arg0), TREE_VALUE (arg1), 0))
+ return 0;
+
+ arg0 = TREE_CHAIN (arg0);
+ arg1 = TREE_CHAIN (arg1);
+ }
+
+ /* If we get here and both argument lists are exhausted
+ then the CALL_EXPRs are equal. */
+ return ! (arg0 || arg1);
+
default:
return 0;
}
+ case 'd':
+ /* Consider __builtin_sqrt equal to sqrt. */
+ return TREE_CODE (arg0) == FUNCTION_DECL
+ && DECL_BUILT_IN (arg0) && DECL_BUILT_IN (arg1)
+ && DECL_BUILT_IN_CLASS (arg0) == DECL_BUILT_IN_CLASS (arg1)
+ && DECL_FUNCTION_CODE (arg0) == DECL_FUNCTION_CODE (arg1);
+
default:
return 0;
}
@@ -2700,7 +2742,8 @@ decode_field_reference (exp, pbitsize, pbitpos, pmode, punsignedp,
if (! INTEGRAL_TYPE_P (TREE_TYPE (exp)))
return 0;
- STRIP_NOPS (exp);
+ /* Signedness matters here. */
+ STRIP_SIGN_NOPS (exp);
if (TREE_CODE (exp) == BIT_AND_EXPR)
{
@@ -8180,7 +8223,7 @@ tree_expr_nonnegative_p (t)
}
}
- /* ... fall through ... */
+ /* ... fall through ... */
default:
if (truth_value_p (TREE_CODE (t)))
diff --git a/gcc/function.c b/gcc/function.c
index 84cfd6ede27..b2caea9959c 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1,4 +1,4 @@
-/* Expands front end tree to back end RTL for GNU C-Compiler
+/* Expands front end tree to back end RTL for GCC.
Copyright (C) 1987, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
@@ -300,7 +300,7 @@ static void do_clobber_return_reg PARAMS ((rtx, void *));
static void do_use_return_reg PARAMS ((rtx, void *));
static void instantiate_virtual_regs_lossage PARAMS ((rtx));
static tree split_complex_args (tree);
-static void set_insn_locators (rtx, int);
+static void set_insn_locators (rtx, int) ATTRIBUTE_UNUSED;
/* Pointer to chain of `struct function' for containing functions. */
static GTY(()) struct function *outer_function_chain;
@@ -3384,7 +3384,7 @@ insns_for_mem_walk (r, data)
if (ifmwi->pass == 0 && *r && GET_CODE (*r) == ADDRESSOF
&& GET_CODE (XEXP (*r, 0)) == REG)
{
- PTR *e;
+ void **e;
tmp.key = XEXP (*r, 0);
e = htab_find_slot (ifmwi->ht, &tmp, INSERT);
if (*e == NULL)
@@ -6549,7 +6549,7 @@ init_function_start (subr)
/* Make sure first insn is a note even if we don't want linenums.
This makes sure the first insn will never be deleted.
Also, final expects a note to appear there. */
- emit_note (NULL, NOTE_INSN_DELETED);
+ emit_note (NOTE_INSN_DELETED);
/* Set flags used by final.c. */
if (aggregate_value_p (DECL_RESULT (subr)))
@@ -6791,10 +6791,10 @@ expand_function_start (subr, parms_have_cleanups)
The move is supposed to make sdb output more accurate. */
/* Indicate the beginning of the function body,
as opposed to parm setup. */
- emit_note (NULL, NOTE_INSN_FUNCTION_BEG);
+ emit_note (NOTE_INSN_FUNCTION_BEG);
if (GET_CODE (get_last_insn ()) != NOTE)
- emit_note (NULL, NOTE_INSN_DELETED);
+ emit_note (NOTE_INSN_DELETED);
parm_birth_insn = get_last_insn ();
context_display = 0;
@@ -6868,7 +6868,7 @@ expand_function_start (subr, parms_have_cleanups)
/* After the display initializations is where the tail-recursion label
should go, if we end up needing one. Ensure we have a NOTE here
since some things (like trampolines) get placed before this. */
- tail_recursion_reentry = emit_note (NULL, NOTE_INSN_DELETED);
+ tail_recursion_reentry = emit_note (NOTE_INSN_DELETED);
/* Evaluate now the sizes of any types declared among the arguments. */
expand_pending_sizes (nreverse (get_pending_sizes ()));
@@ -6963,17 +6963,10 @@ use_return_register ()
static GTY(()) rtx initial_trampoline;
-/* Generate RTL for the end of the current function.
- FILENAME and LINE are the current position in the source file.
-
- It is up to language-specific callers to do cleanups for parameters--
- or else, supply 1 for END_BINDINGS and we will call expand_end_bindings. */
+/* Generate RTL for the end of the current function. */
void
-expand_function_end (filename, line, end_bindings)
- const char *filename;
- int line;
- int end_bindings;
+expand_function_end ()
{
tree link;
rtx clobber_after;
@@ -7087,7 +7080,7 @@ expand_function_end (filename, line, end_bindings)
/* Mark the end of the function body.
If control reaches this insn, the function can drop through
without returning a value. */
- emit_note (NULL, NOTE_INSN_FUNCTION_END);
+ emit_note (NOTE_INSN_FUNCTION_END);
/* Must mark the last line number note in the function, so that the test
coverage code can avoid counting the last line twice. This just tells
@@ -7095,11 +7088,12 @@ expand_function_end (filename, line, end_bindings)
already exists a copy of this note somewhere above. This line number
note is still needed for debugging though, so we can't delete it. */
if (flag_test_coverage)
- emit_note (NULL, NOTE_INSN_REPEATED_LINE_NUMBER);
+ emit_note (NOTE_INSN_REPEATED_LINE_NUMBER);
/* Output a linenumber for the end of the function.
SDB depends on this. */
- emit_line_note_force (filename, line);
+
+ emit_line_note_force (input_filename, input_line);
/* Before the return label (if any), clobber the return
registers so that they are not propagated live to the rest of
@@ -7119,10 +7113,6 @@ expand_function_end (filename, line, end_bindings)
if (return_label)
emit_label (return_label);
- /* C++ uses this. */
- if (end_bindings)
- expand_end_bindings (0, 0, 0);
-
if (current_function_instrument_entry_exit)
{
rtx fun = DECL_RTL (current_function_decl);
@@ -7764,7 +7754,7 @@ thread_prologue_and_epilogue_insns (f)
/* Retain a map of the prologue insns. */
record_insns (seq, &prologue);
- prologue_end = emit_note (NULL, NOTE_INSN_PROLOGUE_END);
+ prologue_end = emit_note (NOTE_INSN_PROLOGUE_END);
seq = get_insns ();
end_sequence ();
@@ -7900,7 +7890,7 @@ thread_prologue_and_epilogue_insns (f)
goto epilogue_done;
start_sequence ();
- epilogue_end = emit_note (NULL, NOTE_INSN_EPILOGUE_BEG);
+ epilogue_end = emit_note (NOTE_INSN_EPILOGUE_BEG);
seq = gen_epilogue ();
diff --git a/gcc/function.h b/gcc/function.h
index f9db14c3cbc..24bebc1982e 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -83,10 +83,9 @@ struct emit_status GTY(())
Reset to 1 for each function compiled. */
int x_cur_insn_uid;
- /* Line number and source file of the last line-number NOTE emitted.
+ /* Location the last line-number NOTE emitted.
This is used to avoid generating duplicates. */
- int x_last_linenum;
- const char *x_last_filename;
+ location_t x_last_location;
/* The length of the regno_pointer_align, regno_decl, and x_regno_reg_rtx
vectors. Since these vectors are needed during the expansion phase when
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 04ac6c7bde9..df3205151bc 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -212,6 +212,14 @@ static const char *target_system_root = 0;
static int target_system_root_changed;
+/* Nonzero means append this string to target_system_root. */
+
+static const char *target_sysroot_suffix = 0;
+
+/* Nonzero means append this string to target_system_root for headers. */
+
+static const char *target_sysroot_hdrs_suffix = 0;
+
/* Nonzero means write "temp" files in source directory
and use the source file's name in them, and don't delete them. */
@@ -703,6 +711,14 @@ proper position among the other output files. */
# define STARTFILE_PREFIX_SPEC ""
#endif
+#ifndef SYSROOT_SUFFIX_SPEC
+# define SYSROOT_SUFFIX_SPEC ""
+#endif
+
+#ifndef SYSROOT_HEADERS_SUFFIX_SPEC
+# define SYSROOT_HEADERS_SUFFIX_SPEC ""
+#endif
+
static const char *asm_debug;
static const char *cpp_spec = CPP_SPEC;
static const char *cc1_spec = CC1_SPEC;
@@ -720,6 +736,8 @@ static const char *linker_name_spec = LINKER_NAME;
static const char *link_command_spec = LINK_COMMAND_SPEC;
static const char *link_libgcc_spec = LINK_LIBGCC_SPEC;
static const char *startfile_prefix_spec = STARTFILE_PREFIX_SPEC;
+static const char *sysroot_suffix_spec = SYSROOT_SUFFIX_SPEC;
+static const char *sysroot_hdrs_suffix_spec = SYSROOT_HEADERS_SUFFIX_SPEC;
/* Standard options to cpp, cc1, and as, to reduce duplication in specs.
There should be no need to override these in target dependent files,
@@ -1499,6 +1517,8 @@ static struct spec_list static_specs[] =
INIT_STATIC_SPEC ("md_startfile_prefix", &md_startfile_prefix),
INIT_STATIC_SPEC ("md_startfile_prefix_1", &md_startfile_prefix_1),
INIT_STATIC_SPEC ("startfile_prefix_spec", &startfile_prefix_spec),
+ INIT_STATIC_SPEC ("sysroot_suffix_spec", &sysroot_suffix_spec),
+ INIT_STATIC_SPEC ("sysroot_hdrs_suffix_spec", &sysroot_hdrs_suffix_spec),
};
#ifdef EXTRA_SPECS /* additional specs needed */
@@ -1759,7 +1779,7 @@ set_spec (name, spec)
/* Free the old spec. */
if (old_spec && sl->alloc_p)
- free ((PTR) old_spec);
+ free ((void *) old_spec);
sl->alloc_p = 1;
}
@@ -2058,7 +2078,7 @@ read_specs (filename, main_p)
set_spec (p2, *(sl->ptr_spec));
if (sl->alloc_p)
- free ((PTR) *(sl->ptr_spec));
+ free ((void *) *(sl->ptr_spec));
*(sl->ptr_spec) = "";
sl->alloc_p = 0;
@@ -2611,7 +2631,10 @@ add_sysrooted_prefix (pprefix, prefix, component, priority,
if (target_system_root)
{
+ if (target_sysroot_suffix)
+ prefix = concat (target_sysroot_suffix, prefix, NULL);
prefix = concat (target_system_root, prefix, NULL);
+
/* We have to override this because GCC's notion of sysroot
moves along with GCC. */
component = "GCC";
@@ -2784,7 +2807,7 @@ execute ()
pfatal_pexecute (errmsg_fmt, errmsg_arg);
if (string != commands[i].prog)
- free ((PTR) string);
+ free ((void *) string);
}
execution_count++;
@@ -4824,12 +4847,15 @@ do_spec_1 (spec, inswitch, soft_matched_part)
do_spec_1 (" ", 0, NULL);
}
- if (target_system_root_changed)
+ if (target_system_root_changed ||
+ (target_system_root && target_sysroot_hdrs_suffix))
{
do_spec_1 ("-isysroot", 1, NULL);
/* Make this a separate argument. */
do_spec_1 (" ", 0, NULL);
do_spec_1 (target_system_root, 1, NULL);
+ if (target_sysroot_hdrs_suffix)
+ do_spec_1 (target_sysroot_hdrs_suffix, 1, NULL);
do_spec_1 (" ", 0, NULL);
}
@@ -5040,8 +5066,13 @@ do_spec_1 (spec, inswitch, soft_matched_part)
/* We assume there is a directory
separator at the end of this string. */
if (target_system_root)
- obstack_grow (&obstack, target_system_root,
- strlen (target_system_root));
+ {
+ obstack_grow (&obstack, target_system_root,
+ strlen (target_system_root));
+ if (target_sysroot_suffix)
+ obstack_grow (&obstack, target_sysroot_suffix,
+ strlen (target_sysroot_suffix));
+ }
break;
case 'S':
@@ -6124,6 +6155,26 @@ main (argc, argv)
}
}
+ /* Process sysroot_suffix_spec. */
+ if (*sysroot_suffix_spec != 0
+ && do_spec_2 (sysroot_suffix_spec) == 0)
+ {
+ if (argbuf_index > 1)
+ error ("spec failure: more than one arg to SYSROOT_SUFFIX_SPEC.");
+ else if (argbuf_index == 1)
+ target_sysroot_suffix = xstrdup (argbuf[argbuf_index -1]);
+ }
+
+ /* Process sysroot_hdrs_suffix_spec. */
+ if (*sysroot_hdrs_suffix_spec != 0
+ && do_spec_2 (sysroot_hdrs_suffix_spec) == 0)
+ {
+ if (argbuf_index > 1)
+ error ("spec failure: more than one arg to SYSROOT_HEADERS_SUFFIX_SPEC.");
+ else if (argbuf_index == 1)
+ target_sysroot_hdrs_suffix = xstrdup (argbuf[argbuf_index -1]);
+ }
+
/* Look for startfiles in the standard places. */
if (*startfile_prefix_spec != 0
&& do_spec_2 (startfile_prefix_spec) == 0
diff --git a/gcc/gccbug.in b/gcc/gccbug.in
index 4da84150b6c..05ea8efe9c9 100755
--- a/gcc/gccbug.in
+++ b/gcc/gccbug.in
@@ -1,6 +1,6 @@
#!/bin/sh
# Submit a problem report to a GNATS site.
-# Copyright (C) 1993, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1993, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
# Contributed by Brendan Kehoe (brendan@cygnus.com), based on a
# version written by Heinz G. Seidl (hgs@cygnus.com).
#
@@ -198,7 +198,7 @@ EOF
done
# spam does not need to be listed here
-CATEGORIES="ada bootstrap c++ c debug driver fortran inline-asm java libf2c libgcj libobjc libstdc++ middle-end objc optimization other preprocessor target web"
+CATEGORIES="ada bootstrap c++ c debug driver fortran inline-asm java libf2c libgcj libobjc libstdc++ middle-end objc optimization other pch preprocessor target web"
case "$FORMAT" in
lisp) echo "$CATEGORIES" | \
diff --git a/gcc/gcov-io.c b/gcc/gcov-io.c
index 112e77caa77..6f4f1b8b688 100644
--- a/gcc/gcov-io.c
+++ b/gcc/gcov-io.c
@@ -338,7 +338,7 @@ gcov_write_summary (gcov_unsigned_t tag, const struct gcov_summary *summary)
#endif /*!IN_GCOV */
/* Return a pointer to read BYTES bytes from the gcov file. Returns
- NULL on failure (read past EOF). */
+ NULL on failure (read past EOF). */
static const unsigned char *
gcov_read_bytes (unsigned bytes)
@@ -489,7 +489,7 @@ gcov_sync (gcov_position_t base, gcov_unsigned_t length)
#if IN_LIBGCOV
/* Move to the a set position in a gcov file. BASE is zero to move to
- the end, and nonzero to move to that position. */
+ the end, and nonzero to move to that position. */
GCOV_LINKAGE void
gcov_seek (gcov_position_t base)
diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h
index e512783e89d..769fd8a276f 100644
--- a/gcc/gcov-io.h
+++ b/gcc/gcov-io.h
@@ -223,7 +223,7 @@ typedef HOST_WIDEST_INT gcov_type;
#define gcov_read_counter __gcov_read_counter
#define gcov_read_summary __gcov_read_summary
-/* Poison these, so they don't accidentally slip in. */
+/* Poison these, so they don't accidentally slip in. */
#pragma GCC poison gcov_write_string gcov_write_tag gcov_write_length
#pragma GCC poison gcov_read_string gcov_sync gcov_time
@@ -268,16 +268,26 @@ typedef HOST_WIDEST_INT gcov_type;
/* Counters that are collected. */
#define GCOV_COUNTER_ARCS 0 /* Arc transitions. */
#define GCOV_COUNTERS_SUMMABLE 1 /* Counters which can be
- summaried. */
-#define GCOV_COUNTERS 1
-
-/* A list of human readable names of the counters */
-#define GCOV_COUNTER_NAMES {"arcs"}
-
-/* Names of merge functions for counters. */
-#define GCOV_MERGE_FUNCTIONS {"__gcov_merge_add"}
-
-/* Convert a counter index to a tag. */
+ summaried. */
+#define GCOV_COUNTER_V_INTERVAL 1 /* Histogram of value inside an interval. */
+#define GCOV_COUNTER_V_POW2 2 /* Histogram of exact power2 logarithm
+ of a value. */
+#define GCOV_COUNTER_V_SINGLE 3 /* The most common value of expression. */
+#define GCOV_COUNTER_V_DELTA 4 /* The most common difference between
+ consecutive values of expression. */
+#define GCOV_COUNTERS 5
+
+ /* A list of human readable names of the counters */
+#define GCOV_COUNTER_NAMES {"arcs", "interval", "pow2", "single", "delta"}
+
+ /* Names of merge functions for counters. */
+#define GCOV_MERGE_FUNCTIONS {"__gcov_merge_add", \
+ "__gcov_merge_add", \
+ "__gcov_merge_add", \
+ "__gcov_merge_single", \
+ "__gcov_merge_delta"}
+
+/* Convert a counter index to a tag. */
#define GCOV_TAG_FOR_COUNTER(COUNT) \
(GCOV_TAG_COUNTER_BASE + ((gcov_unsigned_t)(COUNT) << 17))
/* Convert a tag to a counter. */
@@ -316,9 +326,9 @@ struct gcov_ctr_summary
{
gcov_unsigned_t num; /* number of counters. */
gcov_unsigned_t runs; /* number of program runs */
- gcov_type sum_all; /* sum of all counters accumulated. */
+ gcov_type sum_all; /* sum of all counters accumulated. */
gcov_type run_max; /* maximum value on a single run. */
- gcov_type sum_max; /* sum of individual run max values. */
+ gcov_type sum_max; /* sum of individual run max values. */
};
/* Object & program summary record. */
@@ -380,6 +390,13 @@ extern void __gcov_flush (void);
/* The merge function that just sums the counters. */
extern void __gcov_merge_add (gcov_type *, unsigned);
+
+/* The merge function to choose the most often value. */
+extern void __gcov_merge_single (gcov_type *, unsigned);
+
+/* The merge function to choose the most often difference between consecutive
+ values. */
+extern void __gcov_merge_delta (gcov_type *, unsigned);
#endif /* IN_LIBGCOV */
#if IN_LIBGCOV >= 0
@@ -391,8 +408,8 @@ GCOV_LINKAGE struct gcov_var
{
FILE *file;
gcov_position_t start; /* Position of first byte of block */
- unsigned offset; /* Read/write position within the block. */
- unsigned length; /* Read limit in the block. */
+ unsigned offset; /* Read/write position within the block. */
+ unsigned length; /* Read limit in the block. */
unsigned overread; /* Number of bytes overread. */
int error; /* < 0 overflow, > 0 disk error. */
int mode; /* < 0 writing, > 0 reading */
@@ -417,7 +434,7 @@ GCOV_LINKAGE struct gcov_var
may use the gcov_write functions, gcov_seek & gcov_error. When a
file is to be rewritten you use the functions for reading, then
gcov_rewrite then the functions for writing. Your file may become
- corrupted if you break these invariants. */
+ corrupted if you break these invariants. */
GCOV_LINKAGE int gcov_open (const char */*name*/, int /*truncate*/);
GCOV_LINKAGE int gcov_close (void);
diff --git a/gcc/gcov.c b/gcc/gcov.c
index fd18c007356..60930da32eb 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -149,11 +149,11 @@ typedef struct block_info
struct
{
/* Single line graph cycle workspace. Used for all-blocks
- mode. */
+ mode. */
arc_t *arc;
unsigned ident;
} cycle; /* Used in all-blocks mode, after blocks are linked onto
- lines. */
+ lines. */
} u;
/* Temporary chain for solving graph, and for chaining blocks on one
@@ -218,9 +218,9 @@ typedef struct line_info
{
arc_t *branches; /* branches from blocks that end on this
line. Used for branch-counts when not
- all-blocks mode. */
+ all-blocks mode. */
block_t *blocks; /* blocks which start on this line. Used
- in all-blocks mode. */
+ in all-blocks mode. */
} u;
unsigned exists : 1;
} line_t;
@@ -1691,7 +1691,7 @@ accumulate_line_counts (src)
arc_t *cycle_arc = arc;
arc_t *probe_arc;
- /* Locate the smallest arc count of the loop. */
+ /* Locate the smallest arc count of the loop. */
for (dst = head; (probe_arc = dst->u.cycle.arc);
dst = probe_arc->src)
if (cycle_count > probe_arc->count)
@@ -1723,7 +1723,7 @@ accumulate_line_counts (src)
arc = head->u.cycle.arc;
if (arc)
{
- /* It was not the first vertex. Move onto next arc. */
+ /* It was not the first vertex. Move onto next arc. */
head->u.cycle.arc = NULL;
head = arc->src;
arc = arc->succ_next;
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 0dbe56a6326..0ef03201a80 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -7464,7 +7464,7 @@ store_killed_in_insn (x, x_regs, insn)
base of some of registers used in mem is stack pointer. */
for (reg = x_regs; reg; reg = XEXP (reg, 1))
{
- base = find_base_term (reg);
+ base = find_base_term (XEXP (reg, 0));
if (!base
|| (GET_CODE (base) == ADDRESS
&& GET_MODE (base) == Pmode
@@ -7831,7 +7831,6 @@ store_motion ()
print_rtl (gcse_file, get_insns ());
}
-
init_alias_analysis ();
/* Find all the available and anticipatable stores. */
diff --git a/gcc/gencheck.c b/gcc/gencheck.c
index aedd4965530..58009a8ea3c 100644
--- a/gcc/gencheck.c
+++ b/gcc/gencheck.c
@@ -24,7 +24,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "coretypes.h"
#include "tm.h"
-#define DEFTREECODE(SYM, NAME, TYPE, LEN) STRINGX(SYM),
+#define DEFTREECODE(SYM, NAME, TYPE, LEN) #SYM,
static const char *const tree_codes[] = {
#include "tree.def"
diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c
index 9dbb7342f08..46c3185f792 100644
--- a/gcc/gengenrtl.c
+++ b/gcc/gengenrtl.c
@@ -36,7 +36,7 @@ struct rtx_definition
const char *const enumname, *const name, *const format;
};
-#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { STRINGX(ENUM), NAME, FORMAT },
+#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { #ENUM, NAME, FORMAT },
static const struct rtx_definition defs[] =
{
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index 0e58dc0c717..4e61449861b 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -83,8 +83,7 @@ xasprintf (const char *format, ...)
/* The one and only TYPE_STRING. */
struct type string_type = {
- TYPE_STRING, NULL, NULL, GC_USED
- UNION_INIT_ZERO
+ TYPE_STRING, NULL, NULL, GC_USED, {0}
};
/* Lists of various things. */
@@ -1272,8 +1271,6 @@ get_output_file_name (const char *input_file)
/* Copy the output to its final destination,
but don't unnecessarily change modification times. */
-static void close_output_files (void);
-
static void
close_output_files (void)
{
diff --git a/gcc/genopinit.c b/gcc/genopinit.c
index bba458d5f08..47f441cf2f7 100644
--- a/gcc/genopinit.c
+++ b/gcc/genopinit.c
@@ -125,6 +125,8 @@ static const char * const optabs[] =
"cos_optab->handlers[$A].insn_code = CODE_FOR_$(cos$a2$)",
"exp_optab->handlers[$A].insn_code = CODE_FOR_$(exp$a2$)",
"log_optab->handlers[$A].insn_code = CODE_FOR_$(log$a2$)",
+ "tan_optab->handlers[$A].insn_code = CODE_FOR_$(tan$a2$)",
+ "atan_optab->handlers[$A].insn_code = CODE_FOR_$(atan$a2$)",
"strlen_optab->handlers[$A].insn_code = CODE_FOR_$(strlen$a$)",
"one_cmpl_optab->handlers[$A].insn_code = CODE_FOR_$(one_cmpl$a2$)",
"ffs_optab->handlers[$A].insn_code = CODE_FOR_$(ffs$a2$)",
diff --git a/gcc/genoutput.c b/gcc/genoutput.c
index 2f464cf2a62..044a64382d2 100644
--- a/gcc/genoutput.c
+++ b/gcc/genoutput.c
@@ -389,7 +389,7 @@ output_insn_data (void)
break;
case INSN_OUTPUT_FORMAT_MULTI:
case INSN_OUTPUT_FORMAT_FUNCTION:
- printf (" (const PTR) output_%d,\n", d->code_number);
+ printf (" (const void *) output_%d,\n", d->code_number);
break;
default:
abort ();
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index f6f733fe299..dcfa6d8425f 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -212,9 +212,7 @@ static const struct pred_table
{"indirect_operand", {SUBREG, MEM}},
{"comparison_operator", {EQ, NE, LE, LT, GE, GT, LEU, LTU, GEU, GTU,
UNORDERED, ORDERED, UNEQ, UNGE, UNGT, UNLE,
- UNLT, LTGT}},
- {"mode_independent_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
- LABEL_REF, SUBREG, REG, MEM, ADDRESSOF}}
+ UNLT, LTGT}}
};
#define NUM_KNOWN_PREDS ARRAY_SIZE (preds)
@@ -2479,7 +2477,7 @@ make_insn_sequence (rtx insn, enum routine_type type)
switch (type)
{
case RECOG:
- /* If this is an DEFINE_INSN and X is a PARALLEL, see if it ends
+ /* If this is a DEFINE_INSN and X is a PARALLEL, see if it ends
with a group of CLOBBERs of (hard) registers or MATCH_SCRATCHes.
If so, set up to recognize the pattern without these CLOBBERs. */
diff --git a/gcc/gensupport.c b/gcc/gensupport.c
index 979c3353320..32bbcf26028 100644
--- a/gcc/gensupport.c
+++ b/gcc/gensupport.c
@@ -930,8 +930,8 @@ init_md_reader (const char *filename)
hash_c_test, cmp_c_test, NULL);
for (i = 0; i < n_insn_conditions; i++)
- *(htab_find_slot (condition_table, (PTR) &insn_conditions[i], INSERT))
- = (PTR) &insn_conditions[i];
+ *(htab_find_slot (condition_table, &insn_conditions[i], INSERT))
+ = (void *) &insn_conditions[i];
obstack_init (rtl_obstack);
errors = 0;
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index 929ef8e41cc..f6fe8cdcd08 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -200,11 +200,7 @@ struct max_alignment {
char c;
union {
HOST_WIDEST_INT i;
-#ifdef HAVE_LONG_DOUBLE
long double d;
-#else
- double d;
-#endif
} u;
};
@@ -235,7 +231,7 @@ static size_t object_size_table[NUM_ORDERS];
static struct
{
- unsigned int mult;
+ size_t mult;
unsigned int shift;
}
inverse_table[NUM_ORDERS];
@@ -1223,19 +1219,8 @@ ggc_get_size (const void *p)
static void
compute_inverse (unsigned order)
{
- unsigned size, inv, e;
-
- /* There can be only one object per "page" in a bucket for sizes
- larger than half a machine page; it will always have offset zero. */
- if (OBJECT_SIZE (order) > G.pagesize/2)
- {
- if (OBJECTS_PER_PAGE (order) != 1)
- abort ();
-
- DIV_MULT (order) = 1;
- DIV_SHIFT (order) = 0;
- return;
- }
+ size_t size, inv;
+ unsigned int e;
size = OBJECT_SIZE (order);
e = 0;
diff --git a/gcc/ggc-simple.c b/gcc/ggc-simple.c
index 4bcc099760f..488df3a95ab 100644
--- a/gcc/ggc-simple.c
+++ b/gcc/ggc-simple.c
@@ -86,11 +86,7 @@ struct ggc_mem
/* Make sure the data is reasonably aligned. */
union {
HOST_WIDEST_INT i;
-#ifdef HAVE_LONG_DOUBLE
long double d;
-#else
- double d;
-#endif
} u;
};
diff --git a/gcc/global.c b/gcc/global.c
index d5636084ce7..1cc668004ef 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -289,7 +289,7 @@ static int n_regs_set;
static HARD_REG_SET eliminable_regset;
-static int allocno_compare PARAMS ((const PTR, const PTR));
+static int allocno_compare PARAMS ((const void *, const void *));
static void global_conflicts PARAMS ((void));
static void mirror_conflicts PARAMS ((void));
static void expand_preferences PARAMS ((void));
@@ -600,8 +600,8 @@ global_alloc (file)
static int
allocno_compare (v1p, v2p)
- const PTR v1p;
- const PTR v2p;
+ const void *v1p;
+ const void *v2p;
{
int v1 = *(const int *)v1p, v2 = *(const int *)v2p;
/* Note that the quotient will never be bigger than
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index ee5fb2b2212..1112f534ebc 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -480,7 +480,7 @@ static int actual_hazard PARAMS ((int, rtx, int, int));
static int potential_hazard PARAMS ((int, rtx, int));
static int priority PARAMS ((rtx));
-static int rank_for_schedule PARAMS ((const PTR, const PTR));
+static int rank_for_schedule PARAMS ((const void *, const void *));
static void swap_sort PARAMS ((rtx *, int));
static void queue_insn PARAMS ((rtx, int));
static int schedule_insn PARAMS ((rtx, struct ready_list *, int));
@@ -1007,8 +1007,8 @@ while (0)
static int
rank_for_schedule (x, y)
- const PTR x;
- const PTR y;
+ const void *x;
+ const void *y;
{
rtx tmp = *(const rtx *) y;
rtx tmp2 = *(const rtx *) x;
diff --git a/gcc/hashtable.c b/gcc/hashtable.c
index b3f6404ba33..86898f38850 100644
--- a/gcc/hashtable.c
+++ b/gcc/hashtable.c
@@ -127,7 +127,7 @@ ht_lookup (table, str, len, insert)
if (insert == HT_ALLOCED)
/* The string we search for was placed at the end of the
obstack. Release it. */
- obstack_free (&table->stack, (PTR) str);
+ obstack_free (&table->stack, (void *) str);
return node;
}
@@ -203,7 +203,7 @@ void
ht_forall (table, cb, v)
hash_table *table;
ht_cb cb;
- const PTR v;
+ const void *v;
{
hashnode *p, *limit;
diff --git a/gcc/hooks.c b/gcc/hooks.c
index 438af66f921..e183a11766e 100644
--- a/gcc/hooks.c
+++ b/gcc/hooks.c
@@ -41,6 +41,21 @@ hook_bool_void_false ()
return false;
}
+/* The same, but formally returning NO_REGS. */
+int
+hook_int_void_no_regs (void)
+{
+ return NO_REGS;
+}
+
+/* Generic hook that takes (bool) and returns false. */
+bool
+hook_bool_bool_false (bool a ATTRIBUTE_UNUSED)
+{
+ return false;
+}
+
+
/* Generic hook that takes (tree, int) and does nothing. */
void
hook_void_tree_int (a, b)
diff --git a/gcc/hooks.h b/gcc/hooks.h
index 15b742da178..044654acb38 100644
--- a/gcc/hooks.h
+++ b/gcc/hooks.h
@@ -23,6 +23,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define GCC_HOOKS_H
bool hook_bool_void_false PARAMS ((void));
+bool hook_bool_bool_false (bool);
bool hook_bool_tree_false PARAMS ((tree));
bool hook_bool_tree_hwi_hwi_tree_false
PARAMS ((tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
@@ -41,6 +42,7 @@ int hook_int_tree_tree_1 PARAMS ((tree, tree));
int hook_int_rtx_0 PARAMS ((rtx));
int hook_int_void_0 (void);
int hook_int_size_t_constcharptr_int_0 (size_t, const char *, int);
+int hook_int_void_no_regs (void);
bool default_can_output_mi_thunk_no_vcall
PARAMS ((tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
diff --git a/gcc/hwint.h b/gcc/hwint.h
index f866e168c8b..4fed004cbf6 100644
--- a/gcc/hwint.h
+++ b/gcc/hwint.h
@@ -64,12 +64,8 @@ extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1];
/* Various printf format strings for HOST_WIDE_INT. */
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
-# define HOST_WIDE_INT_PRINT_DEC "%ld"
-# define HOST_WIDE_INT_PRINT_DEC_C "%ldL"
-# define HOST_WIDE_INT_PRINT_DEC_SPACE "% *ld"
-# define HOST_WIDE_INT_PRINT_UNSIGNED "%lu"
-# define HOST_WIDE_INT_PRINT_UNSIGNED_SPACE "% *lu"
-# define HOST_WIDE_INT_PRINT_HEX "0x%lx"
+# define HOST_WIDE_INT_PRINT "l"
+# define HOST_WIDE_INT_PRINT_C "L"
/* 'long' might be 32 or 64 bits, and the number of leading zeroes
must be tweaked accordingly. */
# if HOST_BITS_PER_WIDE_INT == 64
@@ -78,15 +74,16 @@ extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1];
# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%08lx"
# endif
#else
-# define HOST_WIDE_INT_PRINT_DEC "%lld"
-# define HOST_WIDE_INT_PRINT_DEC_C "%lldLL"
-# define HOST_WIDE_INT_PRINT_DEC_SPACE "% *lld"
-# define HOST_WIDE_INT_PRINT_UNSIGNED "%llu"
-# define HOST_WIDE_INT_PRINT_UNSIGNED_SPACE "% *llu"
-# define HOST_WIDE_INT_PRINT_HEX "0x%llx"
+# define HOST_WIDE_INT_PRINT "ll"
+# define HOST_WIDE_INT_PRINT_C "LL"
/* We can assume that 'long long' is at least 64 bits. */
# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%llx%016llx"
-#endif
+#endif /* HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG */
+
+#define HOST_WIDE_INT_PRINT_DEC "%" HOST_WIDE_INT_PRINT "d"
+#define HOST_WIDE_INT_PRINT_DEC_C HOST_WIDE_INT_PRINT_DEC HOST_WIDE_INT_PRINT_C
+#define HOST_WIDE_INT_PRINT_UNSIGNED "%" HOST_WIDE_INT_PRINT "u"
+#define HOST_WIDE_INT_PRINT_HEX "0x%" HOST_WIDE_INT_PRINT "x"
/* Set HOST_WIDEST_INT. This is a 64-bit type unless the compiler
in use has no 64-bit type at all; in that case it's 32 bits. */
@@ -97,9 +94,7 @@ extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1];
# define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_WIDE_INT
# define HOST_WIDEST_INT_PRINT_DEC HOST_WIDE_INT_PRINT_DEC
# define HOST_WIDEST_INT_PRINT_DEC_C HOST_WIDE_INT_PRINT_DEC_C
-# define HOST_WIDEST_INT_PRINT_DEC_SPACE HOST_WIDE_INT_PRINT_DEC_SPACE
# define HOST_WIDEST_INT_PRINT_UNSIGNED HOST_WIDE_INT_PRINT_UNSIGNED
-# define HOST_WIDEST_INT_PRINT_UNSIGNED_SPACE HOST_WIDE_INT_PRINT_UNSIGNED_SPACE
# define HOST_WIDEST_INT_PRINT_HEX HOST_WIDE_INT_PRINT_HEX
# define HOST_WIDEST_INT_PRINT_DOUBLE_HEX HOST_WIDE_INT_PRINT_DOUBLE_HEX
#else
@@ -116,9 +111,7 @@ extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1];
# endif
# define HOST_WIDEST_INT_PRINT_DEC "%lld"
# define HOST_WIDEST_INT_PRINT_DEC_C "%lldLL"
-# define HOST_WIDEST_INT_PRINT_DEC_SPACE "% *lld"
# define HOST_WIDEST_INT_PRINT_UNSIGNED "%llu"
-# define HOST_WIDEST_INT_PRINT_UNSIGNED_SPACE "% *llu"
# define HOST_WIDEST_INT_PRINT_HEX "0x%llx"
# define HOST_WIDEST_INT_PRINT_DOUBLE_HEX "0x%llx%016llx"
#endif
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 84788f0bd3a..7ae08da5789 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -2160,7 +2160,7 @@ find_if_header (test_bb, pass)
/* Otherwise this must be a multiway branch of some sort. */
return NULL;
- memset ((PTR) &ce_info, '\0', sizeof (ce_info));
+ memset (&ce_info, '\0', sizeof (ce_info));
ce_info.test_bb = test_bb;
ce_info.then_bb = then_edge->dest;
ce_info.else_bb = else_edge->dest;
@@ -2566,7 +2566,7 @@ find_cond_trap (test_bb, then_edge, else_edge)
{
struct ce_if_block new_ce_info;
delete_insn (jump);
- memset ((PTR) &new_ce_info, '\0', sizeof (new_ce_info));
+ memset (&new_ce_info, '\0', sizeof (new_ce_info));
new_ce_info.test_bb = test_bb;
new_ce_info.then_bb = NULL;
new_ce_info.else_bb = NULL;
diff --git a/gcc/integrate.c b/gcc/integrate.c
index 4152fb27fa4..ab4af1823f1 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -88,15 +88,14 @@ static void set_block_origin_self PARAMS ((tree));
static void set_block_abstract_flags PARAMS ((tree, int));
static void process_reg_param PARAMS ((struct inline_remap *, rtx,
rtx));
-void set_decl_abstract_flags PARAMS ((tree, int));
static void mark_stores PARAMS ((rtx, rtx, void *));
static void save_parm_insns PARAMS ((rtx, rtx));
static void copy_insn_list PARAMS ((rtx, struct inline_remap *,
rtx));
static void copy_insn_notes PARAMS ((rtx, struct inline_remap *,
int));
-static int compare_blocks PARAMS ((const PTR, const PTR));
-static int find_block PARAMS ((const PTR, const PTR));
+static int compare_blocks PARAMS ((const void *, const void *));
+static int find_block PARAMS ((const void *, const void *));
/* Used by copy_rtx_and_substitute; this indicates whether the function is
called for the purpose of inlining or some other purpose (i.e. loop
@@ -614,8 +613,8 @@ process_reg_param (map, loc, copy)
static int
compare_blocks (v1, v2)
- const PTR v1;
- const PTR v2;
+ const void *v1;
+ const void *v2;
{
tree b1 = *((const tree *) v1);
tree b2 = *((const tree *) v2);
@@ -632,8 +631,8 @@ compare_blocks (v1, v2)
static int
find_block (v1, v2)
- const PTR v1;
- const PTR v2;
+ const void *v1;
+ const void *v2;
{
const union tree_node *b1 = (const union tree_node *) v1;
tree b2 = *((const tree *) v2);
@@ -898,7 +897,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
insn that can be used as an insertion point. */
map->insns_at_start = get_last_insn ();
if (map->insns_at_start == 0)
- map->insns_at_start = emit_note (NULL, NOTE_INSN_DELETED);
+ map->insns_at_start = emit_note (NOTE_INSN_DELETED);
map->regno_pointer_align = inl_f->emit->regno_pointer_align;
map->x_regno_reg_rtx = inl_f->emit->x_regno_reg_rtx;
@@ -925,8 +924,8 @@ expand_inline_function (fndecl, parms, target, ignore, type,
if (GET_CODE (parm_insns) == NOTE
&& NOTE_LINE_NUMBER (parm_insns) > 0)
{
- rtx note = emit_note (NOTE_SOURCE_FILE (parm_insns),
- NOTE_LINE_NUMBER (parm_insns));
+ rtx note = emit_line_note (NOTE_SOURCE_FILE (parm_insns),
+ NOTE_LINE_NUMBER (parm_insns));
if (note)
RTX_INTEGRATED_P (note) = 1;
}
@@ -1017,8 +1016,8 @@ expand_inline_function (fndecl, parms, target, ignore, type,
&& ! (GET_CODE (XEXP (loc, 0)) == REG
&& REGNO (XEXP (loc, 0)) > LAST_VIRTUAL_REGISTER))
{
- rtx note = emit_note (DECL_SOURCE_FILE (formal),
- DECL_SOURCE_LINE (formal));
+ rtx note = emit_line_note (DECL_SOURCE_FILE (formal),
+ DECL_SOURCE_LINE (formal));
if (note)
RTX_INTEGRATED_P (note) = 1;
@@ -1305,7 +1304,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
This line number note is still needed for debugging though, so we can't
delete it. */
if (flag_test_coverage)
- emit_note (0, NOTE_INSN_REPEATED_LINE_NUMBER);
+ emit_note (NOTE_INSN_REPEATED_LINE_NUMBER);
emit_line_note (input_filename, input_line);
@@ -1683,15 +1682,17 @@ copy_insn_list (insns, map, static_chain_value)
NOTE_INSN_DELETED notes aren't useful. */
- if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_END
+ if (NOTE_LINE_NUMBER (insn) > 0)
+ copy = emit_line_note (NOTE_SOURCE_FILE (insn),
+ NOTE_LINE_NUMBER (insn));
+ else if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_END
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_BEG
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED)
{
- copy = emit_note (NOTE_SOURCE_FILE (insn),
- NOTE_LINE_NUMBER (insn));
- if (copy
- && (NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_BEG
- || NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_END)
+ copy = emit_note (NOTE_LINE_NUMBER (insn));
+ NOTE_DATA (copy) = NOTE_DATA (insn);
+ if ((NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_BEG
+ || NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_END)
&& NOTE_BLOCK (insn))
{
tree *mapped_block_p;
@@ -1708,8 +1709,7 @@ copy_insn_list (insns, map, static_chain_value)
else
NOTE_BLOCK (copy) = *mapped_block_p;
}
- else if (copy
- && NOTE_LINE_NUMBER (copy) == NOTE_INSN_EXPECTED_VALUE)
+ else if (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EXPECTED_VALUE)
NOTE_EXPECTED_VALUE (copy)
= copy_rtx_and_substitute (NOTE_EXPECTED_VALUE (insn),
map, 0);
diff --git a/gcc/integrate.h b/gcc/integrate.h
index b4d622767c9..1c539e57d59 100644
--- a/gcc/integrate.h
+++ b/gcc/integrate.h
@@ -1,4 +1,4 @@
-/* Function integration definitions for GNU C-Compiler
+/* Function integration definitions for GCC
Copyright (C) 1990, 1995, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index e2c58664bd3..591b230a136 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,26 @@
+2003-06-26 Neil Booth <neil@daikokuya.co.uk>
+
+ * lang.c (java_handle_option): Don't check for missing arguments.
+
+2003-06-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ * class.c (push_class): Use a location_t to save place.
+ (emit_register_classes): Set input_location. Adjust
+ expand_function_end call.
+ * resource.c (write_resource_constructor): Likewise.
+ * decl.c (end_java_method): Adjust expand_function_end call.
+ * parse.y (source_end_java_method): Likewise.
+
+2003-06-17 Robert Abeles <rabeles@archaelogic.com>
+
+ * lang.c (java_handle_option): Likewise.
+
+2003-06-16 Neil Booth <neil@daikokuya.co.uk>
+
+ * lang.c (java_handle_option): Special-casing of optional
+ joined arguments no longer needed.
+ * lang.opt: Update switches that take optional argument.
+
2003-06-15 Neil Booth <neil@daikokuya.co.uk>
* lang.opt: Declare Java.
diff --git a/gcc/java/class.c b/gcc/java/class.c
index fe00f78f9a3..ed1ae4d7116 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -308,8 +308,7 @@ tree
push_class (tree class_type, tree class_name)
{
tree decl, signature;
- const char *save_input_filename = input_filename;
- int save_lineno = input_line;
+ location_t saved_loc = input_location;
tree source_name = identifier_subst (class_name, "", '.', '/', ".java");
CLASS_P (class_type) = 1;
input_filename = IDENTIFIER_POINTER (source_name);
@@ -319,8 +318,7 @@ push_class (tree class_type, tree class_name)
/* dbxout needs a DECL_SIZE if in gstabs mode */
DECL_SIZE (decl) = integer_zero_node;
- input_filename = save_input_filename;
- input_line = save_lineno;
+ input_location = saved_loc;
signature = identifier_subst (class_name, "L", '.', '/', ";");
IDENTIFIER_SIGNATURE_TYPE (signature) = build_pointer_type (class_type);
@@ -2000,6 +1998,7 @@ emit_register_classes (void)
tree init_type = build_function_type (void_type_node, end_params_node);
tree init_decl;
tree t;
+ location_t saved_loc = input_location;
init_decl = build_decl (FUNCTION_DECL, init_name, init_type);
SET_DECL_ASSEMBLER_NAME (init_decl, init_name);
@@ -2028,8 +2027,8 @@ emit_register_classes (void)
for ( t = registered_class; t; t = TREE_CHAIN (t))
emit_library_call (registerClass_libfunc, 0, VOIDmode, 1,
XEXP (DECL_RTL (t), 0), Pmode);
-
- expand_function_end (input_filename, 0, 0);
+ input_location = DECL_SOURCE_LOCATION (init_decl);
+ expand_function_end ();
poplevel (1, 0, 1);
rest_of_compilation (init_decl);
current_function_decl = NULL_TREE;
@@ -2037,6 +2036,7 @@ emit_register_classes (void)
if (targetm.have_ctors_dtors)
(* targetm.asm_out.constructor) (XEXP (DECL_RTL (init_decl), 0),
DEFAULT_INIT_PRIORITY);
+ input_location = saved_loc;
}
}
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 7d5507cd8ed..5354f8963dd 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -1810,7 +1810,7 @@ end_java_method (void)
BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl;
/* Generate rtl for function exit. */
- expand_function_end (input_filename, input_line, 0);
+ expand_function_end ();
/* Run the optimizers and output assembler code for this function. */
rest_of_compilation (fndecl);
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index ff20985fc50..b8fc498da3c 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -265,28 +265,12 @@ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
static int
java_handle_option (size_t scode, const char *arg, int value)
{
- const struct cl_option *option = &cl_options[scode];
enum opt_code code = (enum opt_code) scode;
/* Ignore file names. */
if (code == N_OPTS)
return 1;
- if (arg == NULL && (option->flags & (CL_JOINED | CL_SEPARATE)))
- {
- /* These can take an empty argument. */
- if (code == OPT_fassume_compiled_
- || code == OPT_fclasspath_
- || code == OPT_fCLASSPATH_
- || code == OPT_fbootclasspath_)
- arg = "";
- else
- {
- error ("missing argument to \"-%s\"", option->opt_text);
- return 1;
- }
- }
-
switch (code)
{
default:
@@ -385,7 +369,7 @@ java_handle_option (size_t scode, const char *arg, int value)
break;
case OPT_fdump_:
- if (!dump_switch_p (option->opt_text + strlen ("f")))
+ if (!dump_switch_p (arg))
return 0;
break;
diff --git a/gcc/java/lang.opt b/gcc/java/lang.opt
index e108fb72c2c..ed8d02ee151 100644
--- a/gcc/java/lang.opt
+++ b/gcc/java/lang.opt
@@ -65,7 +65,7 @@ Wredundant-modifiers
Java
fCLASSPATH=
-Java Joined RejectNegative
+Java JoinedOrMissing RejectNegative
fassert
Java
@@ -74,16 +74,16 @@ fassume-compiled
Java
fassume-compiled=
-Java Joined
+Java JoinedOrMissing
fbootclasspath=
-Java Joined RejectNegative
+Java JoinedOrMissing RejectNegative
fcheck-references
Java
fclasspath=
-Java Joined RejectNegative
+Java JoinedOrMissing RejectNegative
fcompile-resource=
Java Joined RejectNegative
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 854fd5f07bf..a156be1ccfd 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -7386,7 +7386,7 @@ source_end_java_method (void)
if (! flag_emit_class_files && ! flag_emit_xref)
{
input_line = DECL_FUNCTION_LAST_LINE (fndecl);
- expand_function_end (input_filename, input_line, 0);
+ expand_function_end ();
/* Run the optimizers and output assembler code for this function. */
rest_of_compilation (fndecl);
diff --git a/gcc/java/resource.c b/gcc/java/resource.c
index a1de225c608..b71a6709f5e 100644
--- a/gcc/java/resource.c
+++ b/gcc/java/resource.c
@@ -104,6 +104,7 @@ write_resource_constructor (void)
{
tree init_name, init_type, init_decl;
tree iter;
+ location_t saved_loc = input_location;
/* Only do work if required. */
if (resources == NULL_TREE)
@@ -139,7 +140,8 @@ write_resource_constructor (void)
Pmode);
}
- expand_function_end (input_filename, 0, 0);
+ input_location = DECL_SOURCE_LOCATION (init_decl);
+ expand_function_end ();
poplevel (1, 0, 1);
{
/* Force generation, even with -O3 or deeper. Gross hack.
@@ -152,6 +154,7 @@ write_resource_constructor (void)
current_function_decl = NULL_TREE;
(* targetm.asm_out.constructor) (XEXP (DECL_RTL (init_decl), 0),
DEFAULT_INIT_PRIORITY);
+ input_location = saved_loc;
}
/* Generate a byte array representing the contents of FILENAME. The
diff --git a/gcc/jump.c b/gcc/jump.c
index 40166b40e31..630524bb356 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -760,7 +760,7 @@ reversed_comparison_code_parts (code, arg0, arg1, insn)
return UNKNOWN;
}
-/* An wrapper around the previous function to take COMPARISON as rtx
+/* A wrapper around the previous function to take COMPARISON as rtx
expression. This simplifies many callers. */
enum rtx_code
reversed_comparison_code (comparison, insn)
@@ -1834,18 +1834,6 @@ delete_related_insns (insn)
return next;
}
-
-/* Advance from INSN till reaching something not deleted
- then return that. May return INSN itself. */
-
-rtx
-next_nondeleted_insn (insn)
- rtx insn;
-{
- while (INSN_DELETED_P (insn))
- insn = NEXT_INSN (insn);
- return insn;
-}
/* Delete a range of insns from FROM to TO, inclusive.
This is for the sake of peephole optimization, so assume
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index a7f0abcd39f..e6fa38ea8fc 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -107,6 +107,7 @@ void write_global_declarations PARAMS ((void));
#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME lhd_set_decl_assembler_name
#define LANG_HOOKS_CAN_USE_BIT_FIELDS_P lhd_can_use_bit_fields_p
#define LANG_HOOKS_HONOR_READONLY false
+#define LANG_HOOKS_NO_BODY_BLOCKS false
#define LANG_HOOKS_PRINT_STATISTICS lhd_do_nothing
#define LANG_HOOKS_PRINT_XNODE lhd_print_tree_nothing
#define LANG_HOOKS_PRINT_DECL lhd_print_tree_nothing
@@ -221,6 +222,7 @@ int lhd_tree_dump_type_quals PARAMS ((tree));
#define LANG_HOOKS_GETDECLS getdecls
#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL lhd_warn_unused_global_decl
#define LANG_HOOKS_WRITE_GLOBALS write_global_declarations
+#define LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE NULL
#define LANG_HOOKS_DECL_OK_FOR_SIBCALL lhd_decl_ok_for_sibcall
#define LANG_HOOKS_DECLS { \
@@ -233,6 +235,7 @@ int lhd_tree_dump_type_quals PARAMS ((tree));
LANG_HOOKS_GETDECLS, \
LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, \
LANG_HOOKS_WRITE_GLOBALS, \
+ LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE, \
LANG_HOOKS_DECL_OK_FOR_SIBCALL, \
}
@@ -264,6 +267,7 @@ int lhd_tree_dump_type_quals PARAMS ((tree));
LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, \
LANG_HOOKS_CAN_USE_BIT_FIELDS_P, \
LANG_HOOKS_HONOR_READONLY, \
+ LANG_HOOKS_NO_BODY_BLOCKS, \
LANG_HOOKS_PRINT_STATISTICS, \
LANG_HOOKS_PRINT_XNODE, \
LANG_HOOKS_PRINT_DECL, \
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index 423bb5f421b..7dbe684e222 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -25,7 +25,6 @@ Boston, MA 02111-1307, USA. */
#include "tm.h"
#include "toplev.h"
#include "tree.h"
-#include "c-tree.h"
#include "tree-inline.h"
#include "rtl.h"
#include "insn-config.h"
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index cfb26de5994..a23db4293e1 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -181,6 +181,9 @@ struct lang_hooks_for_decls
of compilation */
void (*final_write_globals) PARAMS ((void));
+ /* Do necessary preparations before assemble_variable can proceed. */
+ void (*prepare_assemble_variable) PARAMS ((tree));
+
/* True if this decl may be called via a sibcall. */
bool (*ok_for_sibcall) PARAMS ((tree));
};
@@ -325,6 +328,11 @@ struct lang_hooks
/* Nonzero if TYPE_READONLY and TREE_READONLY should always be honored. */
bool honor_readonly;
+ /* Nonzero if this front end does not generate a dummy BLOCK between
+ the outermost scope of the function and the FUNCTION_DECL. See
+ is_body_block in stmt.c, and its callers. */
+ bool no_body_blocks;
+
/* The front end can add its own statistics to -fmem-report with
this hook. It should output to stderr. */
void (*print_statistics) PARAMS ((void));
diff --git a/gcc/libgcov.c b/gcc/libgcov.c
index ba54281e585..5396c395bf2 100644
--- a/gcc/libgcov.c
+++ b/gcc/libgcov.c
@@ -63,6 +63,16 @@ void __gcov_merge_add (gcov_type *counters __attribute__ ((unused)),
unsigned n_counters __attribute__ ((unused))) {}
#endif
+#ifdef L_gcov_merge_single
+void __gcov_merge_single (gcov_type *counters __attribute__ ((unused)),
+ unsigned n_counters __attribute__ ((unused))) {}
+#endif
+
+#ifdef L_gcov_merge_delta
+void __gcov_merge_delta (gcov_type *counters __attribute__ ((unused)),
+ unsigned n_counters __attribute__ ((unused))) {}
+#endif
+
#else
#include <string.h>
@@ -466,4 +476,83 @@ __gcov_merge_add (gcov_type *counters, unsigned n_counters)
}
#endif /* L_gcov_merge_add */
+#ifdef L_gcov_merge_single
+/* The profile merging function for choosing the most common value. It is given
+ an array COUNTERS of N_COUNTERS old counters and it reads the same number
+ of counters from the gcov file. The counters are split into 3-tuples
+ where the members of the tuple have meanings:
+ -- the stored candidate on the most common value of the measured entity
+ -- counter
+ -- total number of evaluations of the value */
+void
+__gcov_merge_single (gcov_type *counters, unsigned n_counters)
+{
+ unsigned i, n_measures;
+ gcov_type value, counter, all;
+
+ if (n_counters % 3)
+ abort ();
+
+ n_measures = n_counters / 3;
+ for (i = 0; i < n_measures; i++, counters += 3)
+ {
+ value = gcov_read_counter ();
+ counter = gcov_read_counter ();
+ all = gcov_read_counter ();
+
+ if (counters[0] == value)
+ counters[1] += counter;
+ else if (counter > counters[1])
+ {
+ counters[0] = value;
+ counters[1] = counter - counters[1];
+ }
+ else
+ counters[1] -= counter;
+ counters[2] += all;
+ }
+}
+#endif /* L_gcov_merge_single */
+
+#ifdef L_gcov_merge_delta
+/* The profile merging function for choosing the most common difference between
+ two consecutive evaluations of the value. It is given an array COUNTERS of
+ N_COUNTERS old counters and it reads the same number of counters from the
+ gcov file. The counters are split into 4-tuples where the members of the
+ tuple have meanings:
+ -- the last value of the measured entity
+ -- the stored candidate on the most common difference
+ -- counter
+ -- total number of evaluations of the value */
+void
+__gcov_merge_delta (gcov_type *counters, unsigned n_counters)
+{
+ unsigned i, n_measures;
+ gcov_type last, value, counter, all;
+
+ if (n_counters % 4)
+ abort ();
+
+ n_measures = n_counters / 4;
+ for (i = 0; i < n_measures; i++, counters += 4)
+ {
+ last = gcov_read_counter ();
+ value = gcov_read_counter ();
+ counter = gcov_read_counter ();
+ all = gcov_read_counter ();
+
+ if (counters[1] == value)
+ counters[2] += counter;
+ else if (counter > counters[2])
+ {
+ counters[1] = value;
+ counters[2] = counter - counters[2];
+ }
+ else
+ counters[2] -= counter;
+ counters[3] += all;
+ }
+}
+#endif /* L_gcov_merge_delta */
+
#endif /* inhibit_libc */
diff --git a/gcc/line-map.c b/gcc/line-map.c
index 442e314d030..05d34ea744e 100644
--- a/gcc/line-map.c
+++ b/gcc/line-map.c
@@ -27,14 +27,12 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "line-map.h"
#include "intl.h"
-static void trace_include
- PARAMS ((const struct line_maps *, const struct line_map *));
+static void trace_include (const struct line_maps *, const struct line_map *);
/* Initialize a line map set. */
void
-init_line_maps (set)
- struct line_maps *set;
+init_line_maps (struct line_maps *set)
{
set->maps = 0;
set->allocated = 0;
@@ -47,8 +45,7 @@ init_line_maps (set)
/* Free a line map set. */
void
-free_line_maps (set)
- struct line_maps *set;
+free_line_maps (struct line_maps *set)
{
if (set->maps)
{
@@ -73,13 +70,9 @@ free_line_maps (set)
function. */
const struct line_map *
-add_line_map (set, reason, sysp, from_line, to_file, to_line)
- struct line_maps *set;
- enum lc_reason reason;
- unsigned int sysp;
- unsigned int from_line;
- const char *to_file;
- unsigned int to_line;
+add_line_map (struct line_maps *set, enum lc_reason reason,
+ unsigned int sysp, unsigned int from_line,
+ const char *to_file, unsigned int to_line)
{
struct line_map *map;
@@ -161,9 +154,7 @@ add_line_map (set, reason, sysp, from_line, to_file, to_line)
the list is sorted and we can use a binary search. */
const struct line_map *
-lookup_line (set, line)
- struct line_maps *set;
- unsigned int line;
+lookup_line (struct line_maps *set, unsigned int line)
{
unsigned int md, mn = 0, mx = set->used;
@@ -187,9 +178,7 @@ lookup_line (set, line)
the most recently listed stack is the same as the current one. */
void
-print_containing_files (set, map)
- struct line_maps *set;
- const struct line_map *map;
+print_containing_files (struct line_maps *set, const struct line_map *map)
{
if (MAIN_FILE_P (map) || set->last_listed == map->included_from)
return;
@@ -225,9 +214,7 @@ print_containing_files (set, map)
/* Print an include trace, for e.g. the -H option of the preprocessor. */
static void
-trace_include (set, map)
- const struct line_maps *set;
- const struct line_map *map;
+trace_include (const struct line_maps *set, const struct line_map *map)
{
unsigned int i = set->depth;
diff --git a/gcc/line-map.h b/gcc/line-map.h
index 60201887f49..8309f080242 100644
--- a/gcc/line-map.h
+++ b/gcc/line-map.h
@@ -68,12 +68,10 @@ struct line_maps
};
/* Initialize a line map set. */
-extern void init_line_maps
- PARAMS ((struct line_maps *));
+extern void init_line_maps (struct line_maps *);
/* Free a line map set. */
-extern void free_line_maps
- PARAMS ((struct line_maps *));
+extern void free_line_maps (struct line_maps *);
/* Add a mapping of logical source line to physical source file and
line number. The text pointed to by TO_FILE must have a lifetime
@@ -85,19 +83,18 @@ extern void free_line_maps
function. A call to this function can relocate the previous set of
maps, so any stored line_map pointers should not be used. */
extern const struct line_map *add_line_map
- PARAMS ((struct line_maps *, enum lc_reason, unsigned int sysp,
- unsigned int from_line, const char *to_file, unsigned int to_line));
+ (struct line_maps *, enum lc_reason, unsigned int sysp,
+ unsigned int from_line, const char *to_file, unsigned int to_line);
/* Given a logical line, returns the map from which the corresponding
(source file, line) pair can be deduced. */
-extern const struct line_map *lookup_line
- PARAMS ((struct line_maps *, unsigned int));
+extern const struct line_map *lookup_line (struct line_maps *, unsigned int);
/* Print the file names and line numbers of the #include commands
which led to the map MAP, if any, to stderr. Nothing is output if
the most recently listed stack is the same as the current one. */
-extern void print_containing_files
- PARAMS ((struct line_maps *, const struct line_map *));
+extern void print_containing_files (struct line_maps *,
+ const struct line_map *);
/* Converts a map and logical line to source line. */
#define SOURCE_LINE(MAP, LINE) ((LINE) + (MAP)->to_line - (MAP)->from_line)
diff --git a/gcc/lists.c b/gcc/lists.c
index 57eda4b2f1f..1e4a57a160f 100644
--- a/gcc/lists.c
+++ b/gcc/lists.c
@@ -1,4 +1,4 @@
-/* List management for the GNU C-Compiler expander.
+/* List management for the GCC expander.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2003 Free Software Foundation, Inc.
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index 2e91ae1b8d0..8e06b8db7cc 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -283,9 +283,9 @@ static void update_equiv_regs PARAMS ((void));
static void no_equiv PARAMS ((rtx, rtx, void *));
static void block_alloc PARAMS ((int));
static int qty_sugg_compare PARAMS ((int, int));
-static int qty_sugg_compare_1 PARAMS ((const PTR, const PTR));
+static int qty_sugg_compare_1 PARAMS ((const void *, const void *));
static int qty_compare PARAMS ((int, int));
-static int qty_compare_1 PARAMS ((const PTR, const PTR));
+static int qty_compare_1 PARAMS ((const void *, const void *));
static int combine_regs PARAMS ((rtx, rtx, int, int, rtx, int));
static int reg_meets_class_p PARAMS ((int, enum reg_class));
static void update_qty_class PARAMS ((int, int));
@@ -1701,8 +1701,8 @@ qty_compare (q1, q2)
static int
qty_compare_1 (q1p, q2p)
- const PTR q1p;
- const PTR q2p;
+ const void *q1p;
+ const void *q2p;
{
int q1 = *(const int *) q1p, q2 = *(const int *) q2p;
int tem = QTY_CMP_PRI (q2) - QTY_CMP_PRI (q1);
@@ -1741,8 +1741,8 @@ qty_sugg_compare (q1, q2)
static int
qty_sugg_compare_1 (q1p, q2p)
- const PTR q1p;
- const PTR q2p;
+ const void *q1p;
+ const void *q2p;
{
int q1 = *(const int *) q1p, q2 = *(const int *) q2p;
int tem = QTY_CMP_SUGG (q1) - QTY_CMP_SUGG (q2);
diff --git a/gcc/loop.c b/gcc/loop.c
index cc094547738..ae7edab06d5 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -314,7 +314,7 @@ static int consec_sets_giv PARAMS ((const struct loop *, int, rtx,
static int check_dbra_loop PARAMS ((struct loop *, int));
static rtx express_from_1 PARAMS ((rtx, rtx, rtx));
static rtx combine_givs_p PARAMS ((struct induction *, struct induction *));
-static int cmp_combine_givs_stats PARAMS ((const PTR, const PTR));
+static int cmp_combine_givs_stats PARAMS ((const void *, const void *));
static void combine_givs PARAMS ((struct loop_regs *, struct iv_class *));
static int product_cheap_p PARAMS ((rtx, rtx));
static int maybe_eliminate_biv PARAMS ((const struct loop *, struct iv_class *,
@@ -7645,8 +7645,8 @@ struct combine_givs_stats
static int
cmp_combine_givs_stats (xp, yp)
- const PTR xp;
- const PTR yp;
+ const void *xp;
+ const void *yp;
{
const struct combine_givs_stats * const x =
(const struct combine_givs_stats *) xp;
diff --git a/gcc/loop.h b/gcc/loop.h
index 12a0b619313..b17696516ff 100644
--- a/gcc/loop.h
+++ b/gcc/loop.h
@@ -1,4 +1,4 @@
-/* Loop optimization definitions for GNU C-Compiler
+/* Loop optimization definitions for GCC
Copyright (C) 1991, 1995, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
diff --git a/gcc/machmode.def b/gcc/machmode.def
index 6cb912c4536..8555a6ee58d 100644
--- a/gcc/machmode.def
+++ b/gcc/machmode.def
@@ -162,7 +162,7 @@ DEF_MACHMODE (CCmode, "CC", MODE_CC, BITS_PER_UNIT*4, 4, 4, VOIDmode, VOIDmode)
#ifdef EXTRA_MODES_FILE
#define CC(N) \
- DEF_MACHMODE (CONCAT2 (N,mode), STRINGX (N), \
+ DEF_MACHMODE (N##mode, #N, \
MODE_CC, BITS_PER_UNIT*4, 4, 4, VOIDmode, VOIDmode)
#include EXTRA_MODES_FILE
#undef CC
diff --git a/gcc/machmode.h b/gcc/machmode.h
index 46247d57343..b286acb0b8f 100644
--- a/gcc/machmode.h
+++ b/gcc/machmode.h
@@ -1,4 +1,4 @@
-/* Machine mode definitions for GNU C-Compiler; included by rtl.h and tree.h.
+/* Machine mode definitions for GCC; included by rtl.h and tree.h.
Copyright (C) 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
diff --git a/gcc/mips-tdump.c b/gcc/mips-tdump.c
index 44486b4e500..2296a8a748c 100644
--- a/gcc/mips-tdump.c
+++ b/gcc/mips-tdump.c
@@ -234,7 +234,7 @@ ulong *rfile_desc; /* relative file tables */
PDR *proc_desc; /* procedure tables */
/* Forward reference for functions. */
-static PTR read_seek PARAMS ((PTR, size_t, off_t, const char *));
+static void *read_seek PARAMS ((void *, size_t, off_t, const char *));
static void read_tfile PARAMS ((void));
static void print_global_hdr PARAMS ((struct filehdr *));
static void print_sym_hdr PARAMS ((HDRR *));
@@ -271,9 +271,9 @@ static const struct option options[] =
/* Read some bytes at a specified location, and return a pointer. */
-static PTR
+static void *
read_seek (ptr, size, offset, context)
- PTR ptr; /* pointer to buffer or NULL */
+ void *ptr; /* pointer to buffer or NULL */
size_t size; /* # bytes to read */
off_t offset; /* offset to read at */
const char *context; /* context for error message */
@@ -1349,12 +1349,12 @@ read_tfile ()
short magic;
off_t sym_hdr_offset = 0;
- (void) read_seek ((PTR) &magic, sizeof (magic), (off_t) 0, "Magic number");
+ (void) read_seek (&magic, sizeof (magic), (off_t) 0, "Magic number");
if (!tfile)
{
/* Print out the global header, since this is not a T-file. */
- (void) read_seek ((PTR) &global_hdr, sizeof (global_hdr), (off_t) 0,
+ (void) read_seek (&global_hdr, sizeof (global_hdr), (off_t) 0,
"Global file header");
print_global_hdr (&global_hdr);
@@ -1368,7 +1368,7 @@ read_tfile ()
sym_hdr_offset = global_hdr.f_symptr;
}
- (void) read_seek ((PTR) &sym_hdr,
+ (void) read_seek (&sym_hdr,
sizeof (sym_hdr),
sym_hdr_offset,
"Symbolic header");
diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c
index c7b7840fa67..920e15d1a61 100644
--- a/gcc/mips-tfile.c
+++ b/gcc/mips-tfile.c
@@ -4060,7 +4060,7 @@ write_varray (vp, offset, str)
if (debug)
{
fputs ("\twarray\tvp = ", stderr);
- fprintf (stderr, HOST_PTR_PRINTF, (PTR) vp);
+ fprintf (stderr, HOST_PTR_PRINTF, (void *) vp);
fprintf (stderr, ", offset = %7lu, size = %7lu, %s\n",
(unsigned long) offset, vp->num_allocated * vp->object_size, str);
}
@@ -4075,7 +4075,7 @@ write_varray (vp, offset, str)
? vp->objects_last_page * vp->object_size
: vp->objects_per_page * vp->object_size;
- sys_write = fwrite ((PTR) ptr->datum, 1, num_write, object_stream);
+ sys_write = fwrite (ptr->datum, 1, num_write, object_stream);
if (sys_write <= 0)
pfatal_with_name (object_name);
@@ -4102,12 +4102,12 @@ write_object ()
if (debug)
{
fputs ("\n\twrite\tvp = ", stderr);
- fprintf (stderr, HOST_PTR_PRINTF, (PTR) &symbolic_header);
+ fprintf (stderr, HOST_PTR_PRINTF, (void *) &symbolic_header);
fprintf (stderr, ", offset = %7u, size = %7lu, %s\n",
0, (unsigned long) sizeof (symbolic_header), "symbolic header");
}
- sys_write = fwrite ((PTR) &symbolic_header,
+ sys_write = fwrite (&symbolic_header,
1,
sizeof (symbolic_header),
object_stream);
@@ -4135,13 +4135,13 @@ write_object ()
if (debug)
{
fputs ("\twrite\tvp = ", stderr);
- fprintf (stderr, HOST_PTR_PRINTF, (PTR) &orig_linenum);
+ fprintf (stderr, HOST_PTR_PRINTF, (void *) &orig_linenum);
fprintf (stderr, ", offset = %7lu, size = %7lu, %s\n",
(long) symbolic_header.cbLineOffset,
(long) symbolic_header.cbLine, "Line numbers");
}
- sys_write = fwrite ((PTR) orig_linenum,
+ sys_write = fwrite (orig_linenum,
1,
symbolic_header.cbLine,
object_stream);
@@ -4170,13 +4170,13 @@ write_object ()
if (debug)
{
fputs ("\twrite\tvp = ", stderr);
- fprintf (stderr, HOST_PTR_PRINTF, (PTR) &orig_opt_syms);
+ fprintf (stderr, HOST_PTR_PRINTF, (void *) &orig_opt_syms);
fprintf (stderr, ", offset = %7lu, size = %7lu, %s\n",
(long) symbolic_header.cbOptOffset,
num_write, "Optimizer symbols");
}
- sys_write = fwrite ((PTR) orig_opt_syms,
+ sys_write = fwrite (orig_opt_syms,
1,
num_write,
object_stream);
@@ -4262,7 +4262,7 @@ write_object ()
if (debug)
{
fputs ("\twrite\tvp = ", stderr);
- fprintf (stderr, HOST_PTR_PRINTF, (PTR) &file_ptr->fdr);
+ fprintf (stderr, HOST_PTR_PRINTF, (void *) &file_ptr->fdr);
fprintf (stderr, ", offset = %7lu, size = %7lu, %s\n",
file_offset, (unsigned long) sizeof (FDR),
"File header");
@@ -4298,7 +4298,7 @@ write_object ()
if (debug)
{
fputs ("\twrite\tvp = ", stderr);
- fprintf (stderr, HOST_PTR_PRINTF, (PTR) &orig_rfds);
+ fprintf (stderr, HOST_PTR_PRINTF, (void *) &orig_rfds);
fprintf (stderr, ", offset = %7lu, size = %7lu, %s\n",
(long) symbolic_header.cbRfdOffset,
num_write, "Relative file descriptors");
@@ -4378,7 +4378,7 @@ read_seek (size, offset, str)
pfatal_with_name (obj_in_name);
}
- sys_read = fread ((PTR) ptr, 1, size, obj_in_stream);
+ sys_read = fread (ptr, 1, size, obj_in_stream);
if (sys_read <= 0)
pfatal_with_name (obj_in_name);
@@ -4421,7 +4421,7 @@ copy_object ()
|| fseek (obj_in_stream, 0L, SEEK_SET) != 0)
pfatal_with_name (obj_in_name);
- sys_read = fread ((PTR) &orig_file_header,
+ sys_read = fread (&orig_file_header,
1,
sizeof (struct filehdr),
obj_in_stream);
@@ -4448,7 +4448,7 @@ copy_object ()
if (fseek (obj_in_stream, (long) orig_file_header.f_symptr, SEEK_SET) != 0)
pfatal_with_name (input_name);
- sys_read = fread ((PTR) &orig_sym_hdr,
+ sys_read = fread (&orig_sym_hdr,
1,
sizeof (orig_sym_hdr),
obj_in_stream);
@@ -4746,7 +4746,7 @@ copy_object ()
num_write
= (remaining <= (int) sizeof (buffer))
? remaining : (int) sizeof (buffer);
- sys_read = fread ((PTR) buffer, 1, num_write, obj_in_stream);
+ sys_read = fread (buffer, 1, num_write, obj_in_stream);
if (sys_read <= 0)
pfatal_with_name (obj_in_name);
@@ -5104,7 +5104,7 @@ allocate_cluster (npages)
{
fprintf (stderr, "\talloc\tnpages = %lu, value = ",
(unsigned long) npages);
- fprintf (stderr, HOST_PTR_PRINTF, (PTR) ptr);
+ fprintf (stderr, HOST_PTR_PRINTF, (void *) ptr);
fputs ("\n", stderr);
}
@@ -5175,7 +5175,7 @@ free_multiple_pages (page_ptr, npages)
the free pages is done right after an allocate. */
#else /* MALLOC_CHECK */
- free ((char *) page_ptr);
+ free (page_ptr);
#endif /* MALLOC_CHECK */
}
@@ -5255,7 +5255,7 @@ free_scope (ptr)
alloc_counts[ (int) alloc_type_scope ].free_list.f_scope = ptr;
#else
- free ((PTR) ptr);
+ free (ptr);
#endif
}
@@ -5412,7 +5412,7 @@ free_tag (ptr)
alloc_counts[ (int) alloc_type_tag ].free_list.f_tag = ptr;
#else
- free ((PTR) ptr);
+ free (ptr);
#endif
}
@@ -5470,7 +5470,7 @@ free_forward (ptr)
alloc_counts[ (int) alloc_type_forward ].free_list.f_forward = ptr;
#else
- free ((PTR) ptr);
+ free (ptr);
#endif
}
@@ -5528,7 +5528,7 @@ free_thead (ptr)
alloc_counts[ (int) alloc_type_thead ].free_list.f_thead = ptr;
#else
- free ((PTR) ptr);
+ free (ptr);
#endif
}
diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
index 64d118f1a99..70d9a23d92d 100644
--- a/gcc/mkconfig.sh
+++ b/gcc/mkconfig.sh
@@ -33,6 +33,14 @@ fi
output=$1
rm -f ${output}T
+# This converts a file name into header guard macro format.
+hg_sed_expr='y,abcdefghijklmnopqrstuvwxyz./,ABCDEFGHIJKLMNOPQRSTUVWXYZ__,'
+header_guard=GCC_`echo ${output} | sed -e ${hg_sed_expr}`
+
+# Add multiple inclusion protection guard, part one.
+echo "#ifndef ${header_guard}" >> ${output}T
+echo "#define ${header_guard}" >> ${output}T
+
# Define TARGET_CPU_DEFAULT if the system wants one.
# This substitutes for lots of *.h files.
if [ "$TARGET_CPU_DEFAULT" != "" ]; then
@@ -85,6 +93,9 @@ EOF
;;
esac
+# Add multiple inclusion protection guard, part two.
+echo "#endif /* ${header_guard} */" >> ${output}T
+
# Avoid changing the actual file if possible.
if [ -f $output ] && cmp ${output}T $output >/dev/null 2>&1; then
echo $output is unchanged >&2
diff --git a/gcc/mkdeps.c b/gcc/mkdeps.c
index 0c573cd4d82..8b1b2e9161e 100644
--- a/gcc/mkdeps.c
+++ b/gcc/mkdeps.c
@@ -137,14 +137,14 @@ deps_free (d)
if (d->targetv)
{
for (i = 0; i < d->ntargets; i++)
- free ((PTR) d->targetv[i]);
+ free ((void *) d->targetv[i]);
free (d->targetv);
}
if (d->depv)
{
for (i = 0; i < d->ndeps; i++)
- free ((PTR) d->depv[i]);
+ free ((void *) d->depv[i]);
free (d->depv);
}
diff --git a/gcc/mkdeps.h b/gcc/mkdeps.h
index 2be8f81a99c..6054a56f137 100644
--- a/gcc/mkdeps.h
+++ b/gcc/mkdeps.h
@@ -39,7 +39,7 @@ extern void deps_free PARAMS ((struct deps *));
extern void deps_add_target PARAMS ((struct deps *, const char *, int));
/* Sets the default target if none has been given already. An empty
- string as the default target in interpreted as stdin. */
+ string as the default target is interpreted as stdin. */
extern void deps_add_default_target PARAMS ((struct deps *, const char *));
/* Add a dependency (appears on the right side of the colon) to the
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 3a654e6ed13..d52e62ee75f 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -1697,24 +1697,21 @@ build_module_descriptor ()
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_LONG]);
field_decl = get_identifier ("version");
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
field_decl_chain = field_decl;
/* long size; */
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_LONG]);
field_decl = get_identifier ("size");
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* char *name; */
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_CHAR]);
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("name"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* struct objc_symtab *symtab; */
@@ -1722,8 +1719,7 @@ build_module_descriptor ()
decl_specs = get_identifier (UTAG_SYMTAB);
decl_specs = build_tree_list (NULL_TREE, xref_tag (RECORD_TYPE, decl_specs));
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("symtab"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
finish_struct (objc_module_template, field_decl_chain, NULL_TREE);
@@ -2565,8 +2561,7 @@ build_protocol_template ()
decl_specs = build_tree_list (NULL_TREE, xref_tag (RECORD_TYPE,
get_identifier (UTAG_CLASS)));
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("isa"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
field_decl_chain = field_decl;
/* char *protocol_name; */
@@ -2574,8 +2569,7 @@ build_protocol_template ()
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_CHAR]);
field_decl
= build1 (INDIRECT_REF, NULL_TREE, get_identifier ("protocol_name"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* struct objc_protocol **protocol_list; */
@@ -2584,8 +2578,7 @@ build_protocol_template ()
field_decl
= build1 (INDIRECT_REF, NULL_TREE, get_identifier ("protocol_list"));
field_decl = build1 (INDIRECT_REF, NULL_TREE, field_decl);
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* struct objc_method_list *instance_methods; */
@@ -2596,8 +2589,7 @@ build_protocol_template ()
get_identifier (UTAG_METHOD_PROTOTYPE_LIST)));
field_decl
= build1 (INDIRECT_REF, NULL_TREE, get_identifier ("instance_methods"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* struct objc_method_list *class_methods; */
@@ -2608,8 +2600,7 @@ build_protocol_template ()
get_identifier (UTAG_METHOD_PROTOTYPE_LIST)));
field_decl
= build1 (INDIRECT_REF, NULL_TREE, get_identifier ("class_methods"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
return finish_struct (template, field_decl_chain, NULL_TREE);
@@ -2672,8 +2663,7 @@ build_method_prototype_list_template (list_type, size)
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_INT]);
field_decl = get_identifier ("method_count");
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
field_decl_chain = field_decl;
/* struct objc_method method_list[]; */
@@ -2681,8 +2671,7 @@ build_method_prototype_list_template (list_type, size)
decl_specs = build_tree_list (NULL_TREE, list_type);
field_decl = build_nt (ARRAY_REF, get_identifier ("method_list"),
build_int_2 (size, 0));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
finish_struct (objc_ivar_list_record, field_decl_chain, NULL_TREE);
@@ -2703,15 +2692,13 @@ build_method_prototype_template ()
decl_specs = tree_cons (NULL_TREE, xref_tag (RECORD_TYPE,
get_identifier (TAG_SELECTOR)), NULL_TREE);
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("_cmd"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
field_decl_chain = field_decl;
decl_specs = tree_cons (NULL_TREE, ridpointers[(int) RID_CHAR], NULL_TREE);
field_decl
= build1 (INDIRECT_REF, NULL_TREE, get_identifier ("method_types"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
finish_struct (proto_record, field_decl_chain, NULL_TREE);
@@ -3250,16 +3237,14 @@ build_category_template ()
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_CHAR]);
field_decl
= build1 (INDIRECT_REF, NULL_TREE, get_identifier ("category_name"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
field_decl_chain = field_decl;
/* char *class_name; */
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_CHAR]);
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("class_name"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* struct objc_method_list *instance_methods; */
@@ -3269,8 +3254,7 @@ build_category_template ()
get_identifier (UTAG_METHOD_LIST)));
field_decl
= build1 (INDIRECT_REF, NULL_TREE, get_identifier ("instance_methods"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* struct objc_method_list *class_methods; */
@@ -3280,8 +3264,7 @@ build_category_template ()
get_identifier (UTAG_METHOD_LIST)));
field_decl
= build1 (INDIRECT_REF, NULL_TREE, get_identifier ("class_methods"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* struct objc_protocol **protocol_list; */
@@ -3292,8 +3275,7 @@ build_category_template ()
field_decl
= build1 (INDIRECT_REF, NULL_TREE, get_identifier ("protocol_list"));
field_decl = build1 (INDIRECT_REF, NULL_TREE, field_decl);
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
finish_struct (objc_category_template, field_decl_chain, NULL_TREE);
@@ -3317,16 +3299,14 @@ build_selector_template ()
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_VOID]);
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("sel_id"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
field_decl_chain = field_decl;
/* char *sel_type; */
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_CHAR]);
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("sel_type"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
finish_struct (objc_selector_template, field_decl_chain, NULL_TREE);
@@ -3364,8 +3344,7 @@ build_class_template ()
decl_specs = build_tree_list (NULL_TREE, objc_class_template);
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("isa"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
field_decl_chain = field_decl;
/* struct objc_class *super_class; */
@@ -3373,40 +3352,35 @@ build_class_template ()
decl_specs = build_tree_list (NULL_TREE, objc_class_template);
field_decl
= build1 (INDIRECT_REF, NULL_TREE, get_identifier ("super_class"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* char *name; */
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_CHAR]);
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("name"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* long version; */
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_LONG]);
field_decl = get_identifier ("version");
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* long info; */
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_LONG]);
field_decl = get_identifier ("info");
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* long instance_size; */
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_LONG]);
field_decl = get_identifier ("instance_size");
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* struct objc_ivar_list *ivars; */
@@ -3415,8 +3389,7 @@ build_class_template ()
xref_tag (RECORD_TYPE,
get_identifier (UTAG_IVAR_LIST)));
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("ivars"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* struct objc_method_list *methods; */
@@ -3425,8 +3398,7 @@ build_class_template ()
xref_tag (RECORD_TYPE,
get_identifier (UTAG_METHOD_LIST)));
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("methods"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
if (flag_next_runtime)
@@ -3437,8 +3409,7 @@ build_class_template ()
xref_tag (RECORD_TYPE,
get_identifier ("objc_cache")));
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("cache"));
- field_decl = grokfield (input_filename, input_line, field_decl,
- decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
}
else
@@ -3449,8 +3420,7 @@ build_class_template ()
xref_tag (RECORD_TYPE,
get_identifier ("sarray")));
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("dtable"));
- field_decl = grokfield (input_filename, input_line, field_decl,
- decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* struct objc_class *subclass_list; */
@@ -3458,8 +3428,7 @@ build_class_template ()
decl_specs = build_tree_list (NULL_TREE, objc_class_template);
field_decl
= build1 (INDIRECT_REF, NULL_TREE, get_identifier ("subclass_list"));
- field_decl = grokfield (input_filename, input_line, field_decl,
- decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* struct objc_class *sibling_class; */
@@ -3467,8 +3436,7 @@ build_class_template ()
decl_specs = build_tree_list (NULL_TREE, objc_class_template);
field_decl
= build1 (INDIRECT_REF, NULL_TREE, get_identifier ("sibling_class"));
- field_decl = grokfield (input_filename, input_line, field_decl,
- decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
}
@@ -3481,24 +3449,21 @@ build_class_template ()
= build1 (INDIRECT_REF, NULL_TREE, get_identifier ("protocol_list"));
field_decl
= build1 (INDIRECT_REF, NULL_TREE, field_decl);
- field_decl = grokfield (input_filename, input_line, field_decl,
- decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* void *sel_id; */
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_VOID]);
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("sel_id"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* void *gc_object_type; */
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_VOID]);
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("gc_object_type"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
finish_struct (objc_class_template, field_decl_chain, NULL_TREE);
@@ -3619,8 +3584,7 @@ build_super_template ()
decl_specs = build_tree_list (NULL_TREE, objc_object_reference);
field_decl = get_identifier ("self");
field_decl = build1 (INDIRECT_REF, NULL_TREE, field_decl);
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
field_decl_chain = field_decl;
/* struct objc_class *class; */
@@ -3629,8 +3593,7 @@ build_super_template ()
decl_specs = build_tree_list (NULL_TREE, xref_tag (RECORD_TYPE, decl_specs));
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("class"));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
finish_struct (record, field_decl_chain, NULL_TREE);
@@ -3663,8 +3626,7 @@ build_ivar_template ()
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_CHAR]);
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("ivar_name"));
- field_decl = grokfield (input_filename, input_line, field_decl,
- decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
field_decl_chain = field_decl;
/* char *ivar_type; */
@@ -3672,8 +3634,7 @@ build_ivar_template ()
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_CHAR]);
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("ivar_type"));
- field_decl = grokfield (input_filename, input_line, field_decl,
- decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* int ivar_offset; */
@@ -3681,8 +3642,7 @@ build_ivar_template ()
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_INT]);
field_decl = get_identifier ("ivar_offset");
- field_decl = grokfield (input_filename, input_line, field_decl,
- decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
finish_struct (objc_ivar_record, field_decl_chain, NULL_TREE);
@@ -3710,8 +3670,7 @@ build_ivar_list_template (list_type, size)
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_INT]);
field_decl = get_identifier ("ivar_count");
- field_decl = grokfield (input_filename, input_line, field_decl,
- decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
field_decl_chain = field_decl;
/* struct objc_ivar ivar_list[]; */
@@ -3720,8 +3679,7 @@ build_ivar_list_template (list_type, size)
field_decl = build_nt (ARRAY_REF, get_identifier ("ivar_list"),
build_int_2 (size, 0));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
finish_struct (objc_ivar_list_record, field_decl_chain, NULL_TREE);
@@ -3754,8 +3712,7 @@ build_method_list_template (list_type, size)
get_identifier (UTAG_METHOD_PROTOTYPE_LIST)));
field_decl
= build1 (INDIRECT_REF, NULL_TREE, get_identifier ("method_next"));
- field_decl = grokfield (input_filename, input_line, field_decl,
- decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
field_decl_chain = field_decl;
/* int method_count; */
@@ -3763,8 +3720,7 @@ build_method_list_template (list_type, size)
decl_specs = build_tree_list (NULL_TREE, ridpointers[(int) RID_INT]);
field_decl = get_identifier ("method_count");
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* struct objc_method method_list[]; */
@@ -3773,8 +3729,7 @@ build_method_list_template (list_type, size)
field_decl = build_nt (ARRAY_REF, get_identifier ("method_list"),
build_int_2 (size, 0));
- field_decl = grokfield (input_filename, input_line,
- field_decl, decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
finish_struct (objc_ivar_list_record, field_decl_chain, NULL_TREE);
@@ -3978,23 +3933,20 @@ build_method_template ()
NULL_TREE);
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("_cmd"));
- field_decl = grokfield (input_filename, input_line, field_decl,
- decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
field_decl_chain = field_decl;
decl_specs = tree_cons (NULL_TREE, ridpointers[(int) RID_CHAR], NULL_TREE);
field_decl = build1 (INDIRECT_REF, NULL_TREE,
get_identifier ("method_types"));
- field_decl = grokfield (input_filename, input_line, field_decl,
- decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
/* void *_imp; */
decl_specs = tree_cons (NULL_TREE, ridpointers[(int) RID_VOID], NULL_TREE);
field_decl = build1 (INDIRECT_REF, NULL_TREE, get_identifier ("_imp"));
- field_decl = grokfield (input_filename, input_line, field_decl,
- decl_specs, NULL_TREE);
+ field_decl = grokfield (field_decl, decl_specs, NULL_TREE);
chainon (field_decl_chain, field_decl);
finish_struct (_SLT_record, field_decl_chain, NULL_TREE);
@@ -5823,8 +5775,7 @@ add_instance_variable (class, public, declarator, declspecs, width)
else
CLASS_RAW_IVARS (class) = raw_decl;
- field_decl = grokfield (input_filename, input_line,
- declarator, declspecs, width);
+ field_decl = grokfield (declarator, declspecs, width);
/* Overload the public attribute, it is not used for FIELD_DECLs. */
switch (public)
diff --git a/gcc/objc/objc-lang.c b/gcc/objc/objc-lang.c
index 2002840f5fa..7d76b6be7b2 100644
--- a/gcc/objc/objc-lang.c
+++ b/gcc/objc/objc-lang.c
@@ -65,6 +65,8 @@ static int objc_init_options PARAMS ((void));
#define LANG_HOOKS_UNSAFE_FOR_REEVAL c_common_unsafe_for_reeval
#undef LANG_HOOKS_STATICP
#define LANG_HOOKS_STATICP c_staticp
+#undef LANG_HOOKS_NO_BODY_BLOCKS
+#define LANG_HOOKS_NO_BODY_BLOCKS true
#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL c_dup_lang_specific_decl
#undef LANG_HOOKS_PRINT_IDENTIFIER
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 06299e8ffda..7f1a5a34fd0 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -3449,6 +3449,11 @@ emit_libcall_block (insns, target, result, equiv)
add_insn (insn);
}
+
+ /* Some ports use a loop to copy large arguments onto the stack.
+ Don't move anything outside such a loop. */
+ if (GET_CODE (insn) == CODE_LABEL)
+ break;
}
prev = get_last_insn ();
@@ -5552,6 +5557,8 @@ init_optabs ()
cos_optab = init_optab (UNKNOWN);
exp_optab = init_optab (UNKNOWN);
log_optab = init_optab (UNKNOWN);
+ tan_optab = init_optab (UNKNOWN);
+ atan_optab = init_optab (UNKNOWN);
strlen_optab = init_optab (UNKNOWN);
cbranch_optab = init_optab (UNKNOWN);
cmov_optab = init_optab (UNKNOWN);
diff --git a/gcc/optabs.h b/gcc/optabs.h
index 22e2422ccd1..0c04a9d1b49 100644
--- a/gcc/optabs.h
+++ b/gcc/optabs.h
@@ -149,6 +149,10 @@ enum optab_index
OTI_trunc,
OTI_round,
OTI_nearbyint,
+ /* Tangent */
+ OTI_tan,
+ /* Inverse tangent */
+ OTI_atan,
/* Compare insn; two operands. */
OTI_cmp,
@@ -232,6 +236,8 @@ extern GTY(()) optab optab_table[OTI_MAX];
#define trunc_optab (optab_table[OTI_trunc])
#define round_optab (optab_table[OTI_round])
#define nearbyint_optab (optab_table[OTI_nearbyint])
+#define tan_optab (optab_table[OTI_tan])
+#define atan_optab (optab_table[OTI_atan])
#define cmp_optab (optab_table[OTI_cmp])
#define ucmp_optab (optab_table[OTI_ucmp])
diff --git a/gcc/opts.c b/gcc/opts.c
index 204cc0d0db3..b1238beb291 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -24,11 +24,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
+#include "rtl.h"
+#include "ggc.h"
+#include "output.h"
#include "langhooks.h"
#include "opts.h"
#include "options.h"
#include "flags.h"
#include "toplev.h"
+#include "params.h"
+#include "diagnostic.h"
/* Value of the -G xx switch, and whether it was passed or not. */
unsigned HOST_WIDE_INT g_switch_value;
@@ -40,105 +45,251 @@ bool exit_after_options;
/* If -version. */
bool version_flag;
+/* Print various extra warnings. -W/-Wextra. */
+bool extra_warnings;
+
+/* Don't print warning messages. -w. */
+bool inhibit_warnings;
+
+/* Treat warnings as errors. -Werror. */
+bool warnings_are_errors;
+
+/* Warn if a function returns an aggregate, since there are often
+ incompatible calling conventions for doing this. */
+bool warn_aggregate_return;
+
+/* Nonzero means warn about pointer casts that increase the required
+ alignment of the target type (and might therefore lead to a crash
+ due to a misaligned access). */
+bool warn_cast_align;
+
+/* Nonzero means warn about uses of __attribute__((deprecated))
+ declarations. */
+bool warn_deprecated_decl = true;
+
+/* Warn when an optimization pass is disabled. */
+bool warn_disabled_optimization;
+
+/* Nonzero means warn if inline function is too large. */
+bool warn_inline;
+
+/* True to warn about any objects definitions whose size is larger
+ than N bytes. Also want about function definitions whose returned
+ values are larger than N bytes, where N is `larger_than_size'. */
+bool warn_larger_than;
+HOST_WIDE_INT larger_than_size;
+
+/* Warn about functions which might be candidates for attribute noreturn. */
+bool warn_missing_noreturn;
+
+/* True to warn about code which is never reached. */
+bool warn_notreached;
+
+/* Warn if packed attribute on struct is unnecessary and inefficient. */
+bool warn_packed;
+
+/* Warn when gcc pads a structure to an alignment boundary. */
+bool warn_padded;
+
+/* True means warn about all declarations which shadow others. */
+bool warn_shadow;
+
+/* Nonzero means warn about constructs which might not be
+ strict-aliasing safe. */
+bool warn_strict_aliasing;
+
+/* True to warn if a switch on an enum, that does not have a default
+ case, fails to have a case for every enum value. */
+bool warn_switch;
+
+/* Warn if a switch does not have a default case. */
+bool warn_switch_default;
+
+/* Warn if a switch on an enum fails to have a case for every enum
+ value (regardless of the presence or otherwise of a default case). */
+bool warn_switch_enum;
+
+/* Don't suppress warnings from system headers. -Wsystem-headers. */
+bool warn_system_headers;
+
+/* True to warn about variables used before they are initialized. */
+int warn_uninitialized;
+
+/* True to warn about unused variables, functions et.al. */
+bool warn_unused_function;
+bool warn_unused_label;
+bool warn_unused_parameter;
+bool warn_unused_variable;
+bool warn_unused_value;
+
+/* Hack for cooperation between set_Wunused and set_Wextra. */
+static bool maybe_warn_unused_parameter;
+
static size_t find_opt (const char *, int);
static int common_handle_option (size_t scode, const char *arg, int value);
+static void handle_param (const char *);
+static void set_Wextra (int);
+static unsigned int handle_option (char **argv, unsigned int lang_mask);
+static char *write_langs (unsigned int lang_mask);
+static void complain_wrong_lang (const char *, const struct cl_option *,
+ unsigned int lang_mask);
/* Perform a binary search to find which option the command-line INPUT
- matches. Returns its index in the option array, and N_OPTS on
- failure.
-
- Complications arise since some options can be suffixed with an
- argument, and multiple complete matches can occur, e.g. -pedantic
- and -pedantic-errors. Also, some options are only accepted by some
- languages. If a switch matches for a different language and
- doesn't match any alternatives for the true front end, the index of
- the matched switch is returned anyway. The caller should check for
- this case. */
+ matches. Returns its index in the option array, and N_OPTS
+ (cl_options_count) on failure.
+
+ This routine is quite subtle. A normal binary search is not good
+ enough because some options can be suffixed with an argument, and
+ multiple sub-matches can occur, e.g. input of "-pedantic" matching
+ the initial substring of "-pedantic-errors".
+
+ A more complicated example is -gstabs. It should match "-g" with
+ an argument of "stabs". Suppose, however, that the number and list
+ of switches are such that the binary search tests "-gen-decls"
+ before having tested "-g". This doesn't match, and as "-gen-decls"
+ is less than "-gstabs", it will become the lower bound of the
+ binary search range, and "-g" will never be seen. To resolve this
+ issue, opts.sh makes "-gen-decls" point, via the back_chain member,
+ to "-g" so that failed searches that end between "-gen-decls" and
+ the lexicographically subsequent switch know to go back and see if
+ "-g" causes a match (which it does in this example).
+
+ This search is done in such a way that the longest match for the
+ front end in question wins. If there is no match for the current
+ front end, the longest match for a different front end is returned
+ (or N_OPTS if none) and the caller emits an error message. */
static size_t
find_opt (const char *input, int lang_mask)
{
- size_t md, mn, mx;
- size_t opt_len;
- size_t result = cl_options_count;
+ size_t mn, mx, md, opt_len;
+ size_t match_wrong_lang;
int comp;
mn = 0;
mx = cl_options_count;
- while (mx > mn)
+ /* Find mn such this lexicographical inequality holds:
+ cl_options[mn] <= input < cl_options[mn + 1]. */
+ while (mx - mn > 1)
{
md = (mn + mx) / 2;
-
opt_len = cl_options[md].opt_len;
comp = strncmp (input, cl_options[md].opt_text, opt_len);
if (comp < 0)
mx = md;
- else if (comp > 0)
- mn = md + 1;
else
- {
- /* The switch matches. It it an exact match? */
- if (input[opt_len] == '\0')
- return md;
- else
- {
- mn = md + 1;
+ mn = md;
+ }
- /* If the switch takes no arguments this is not a proper
- match, so we continue the search (e.g. input="stdc++"
- match was "stdc"). */
- if (!(cl_options[md].flags & CL_JOINED))
- continue;
+ /* This is the switch that is the best match but for a different
+ front end, or cl_options_count if there is no match at all. */
+ match_wrong_lang = cl_options_count;
- /* Is this switch valid for this front end? */
- if (!(cl_options[md].flags & lang_mask))
- {
- /* If subsequently we don't find a better match,
- return this and let the caller report it as a bad
- match. */
- result = md;
- continue;
- }
-
- /* Two scenarios remain: we have the switch's argument,
- or we match a longer option. This can happen with
- -iwithprefix and -withprefixbefore. The longest
- possible option match succeeds.
+ /* Backtrace the chain of possible matches, returning the longest
+ one, if any, that fits best. With current GCC switches, this
+ loop executes at most twice. */
+ do
+ {
+ const struct cl_option *opt = &cl_options[mn];
- Scan forwards, and return an exact match. Otherwise
- return the longest valid option-accepting match (mx).
- This loops at most twice with current options. */
- mx = md;
- for (md = md + 1; md < cl_options_count; md++)
- {
- opt_len = cl_options[md].opt_len;
- if (strncmp (input, cl_options[md].opt_text, opt_len))
- break;
- if (input[opt_len] == '\0')
- return md;
- if (cl_options[md].flags & lang_mask
- && cl_options[md].flags & CL_JOINED)
- mx = md;
- }
+ /* Is this switch a prefix of the input? */
+ if (!strncmp (input, opt->opt_text, opt->opt_len))
+ {
+ /* If language is OK, and the match is exact or the switch
+ takes a joined argument, return it. */
+ if ((opt->flags & lang_mask)
+ && (input[opt->opt_len] == '\0' || (opt->flags & CL_JOINED)))
+ return mn;
- return mx;
- }
+ /* If we haven't remembered a prior match, remember this
+ one. Any prior match is necessarily better. */
+ if (match_wrong_lang == cl_options_count)
+ match_wrong_lang = mn;
}
+
+ /* Try the next possibility. This is cl_options_count if there
+ are no more. */
+ mn = opt->back_chain;
}
+ while (mn != cl_options_count);
+
+ /* Return the best wrong match, or cl_options_count if none. */
+ return match_wrong_lang;
+}
+
+/* If ARG is a non-negative integer made up solely of digits, return its
+ value, otherwise return -1. */
+static int
+integral_argument (const char *arg)
+{
+ const char *p = arg;
+
+ while (*p && ISDIGIT (*p))
+ p++;
+
+ if (*p == '\0')
+ return atoi (arg);
+
+ return -1;
+}
+
+/* Return a malloced slash-separated list of languages in MASK. */
+static char *
+write_langs (unsigned int mask)
+{
+ unsigned int n = 0, len = 0;
+ const char *lang_name;
+ char *result;
+
+ for (n = 0; (lang_name = lang_names[n]) != 0; n++)
+ if (mask & (1U << n))
+ len += strlen (lang_name) + 1;
+
+ result = xmalloc (len);
+ len = 0;
+ for (n = 0; (lang_name = lang_names[n]) != 0; n++)
+ if (mask & (1U << n))
+ {
+ if (len)
+ result[len++] = '/';
+ strcpy (result + len, lang_name);
+ len += strlen (lang_name);
+ }
+
+ result[len] = 0;
return result;
}
-/* Handle the switch beginning at ARGV, with ARGC remaining. */
-int
-handle_option (int argc ATTRIBUTE_UNUSED, char **argv, int lang_mask)
+/* Complain that switch OPT_INDEX does not apply to this front end. */
+static void
+complain_wrong_lang (const char *text, const struct cl_option *option,
+ unsigned int lang_mask)
+{
+ char *ok_langs, *bad_lang;
+
+ ok_langs = write_langs (option->flags);
+ bad_lang = write_langs (lang_mask);
+
+ /* Eventually this should become a hard error IMO. */
+ warning ("command line option \"%s\" is valid for %s but not for %s",
+ text, ok_langs, bad_lang);
+
+ free (ok_langs);
+ free (bad_lang);
+}
+
+/* Handle the switch beginning at ARGV for the language indicated by
+ LANG_MASK. Returns the number of switches consumed. */
+static unsigned int
+handle_option (char **argv, unsigned int lang_mask)
{
size_t opt_index;
const char *opt, *arg = 0;
char *dup = 0;
- bool on = true;
- int result = 0, temp;
+ int value = 1;
+ unsigned int result = 0;
const struct cl_option *option;
opt = argv[0];
@@ -149,7 +300,7 @@ handle_option (int argc ATTRIBUTE_UNUSED, char **argv, int lang_mask)
opt_index = cl_options_count;
arg = opt;
main_input_filename = opt;
- result = (*lang_hooks.handle_option) (opt_index, arg, on);
+ result = (*lang_hooks.handle_option) (opt_index, arg, value);
}
else
{
@@ -164,7 +315,7 @@ handle_option (int argc ATTRIBUTE_UNUSED, char **argv, int lang_mask)
dup[1] = opt[1];
memcpy (dup + 2, opt + 5, len - 2 + 1);
opt = dup;
- on = false;
+ value = 0;
}
opt_index = find_opt (opt + 1, lang_mask | CL_COMMON);
@@ -173,51 +324,75 @@ handle_option (int argc ATTRIBUTE_UNUSED, char **argv, int lang_mask)
option = &cl_options[opt_index];
- /* Reject negative form of switches that don't take negatives. */
- if (!on && (option->flags & CL_REJECT_NEGATIVE))
+ /* Reject negative form of switches that don't take negatives as
+ unrecognized. */
+ if (!value && (option->flags & CL_REJECT_NEGATIVE))
goto done;
/* We've recognized this switch. */
result = 1;
/* Sort out any argument the switch takes. */
- if (option->flags & (CL_JOINED | CL_SEPARATE))
+ if (option->flags & CL_JOINED)
{
- if (option->flags & CL_JOINED)
- {
- /* Have arg point to the original switch. This is because
- some code, such as disable_builtin_function, expects its
- argument to be persistent until the program exits. */
- arg = argv[0] + cl_options[opt_index].opt_len + 1;
- if (!on)
- arg += strlen ("no-");
- }
+ /* Have arg point to the original switch. This is because
+ some code, such as disable_builtin_function, expects its
+ argument to be persistent until the program exits. */
+ arg = argv[0] + cl_options[opt_index].opt_len + 1;
+ if (!value)
+ arg += strlen ("no-");
- /* If we don't have an argument, and CL_SEPARATE, try the next
- argument in the vector. */
- if (!arg || (*arg == '\0' && option->flags & CL_SEPARATE))
+ if (*arg == '\0' && !(option->flags & CL_MISSING_OK))
{
- arg = argv[1];
- result = 2;
+ if (option->flags & CL_SEPARATE)
+ {
+ arg = argv[1];
+ result = 2;
+ }
+ else
+ /* Missing argument. */
+ arg = NULL;
}
+ }
+ else if (option->flags & CL_SEPARATE)
+ {
+ arg = argv[1];
+ result = 2;
+ }
- /* Canonicalize missing arguments as NULL for the handler. */
- if (*arg == '\0')
- arg = NULL;
+ /* Now we've swallowed any potential argument, complain if this
+ is a switch for a different front end. */
+ if (!(option->flags & (lang_mask | CL_COMMON)))
+ {
+ complain_wrong_lang (argv[0], option, lang_mask);
+ goto done;
}
- if (option->flags & lang_mask)
+ if (arg == NULL && (option->flags & (CL_JOINED | CL_SEPARATE)))
{
- temp = (*lang_hooks.handle_option) (opt_index, arg, on);
- if (temp <= 0)
- result = temp;
+ error ("missing argument to \"-%s\"", argv[0]);
+ goto done;
}
- if (result > 0 && (option->flags & CL_COMMON))
+ /* If the switch takes an integer, convert it. */
+ if (arg && (option->flags & CL_UINTEGER))
{
- if (common_handle_option (opt_index, arg, on) == 0)
- result = 0;
+ value = integral_argument (arg);
+ if (value == -1)
+ {
+ error ("argument to \"-%s\" should be a non-negative integer",
+ option->opt_text);
+ goto done;
+ }
}
+
+ if (option->flags & lang_mask)
+ if ((*lang_hooks.handle_option) (opt_index, arg, value) == 0)
+ result = 0;
+
+ if (result && (option->flags & CL_COMMON))
+ if (common_handle_option (opt_index, arg, value) == 0)
+ result = 0;
}
done:
@@ -226,6 +401,26 @@ handle_option (int argc ATTRIBUTE_UNUSED, char **argv, int lang_mask)
return result;
}
+/* Decode and handle the vector of command line options. LANG_MASK
+ contains has a single bit set representing the current
+ language. */
+void
+handle_options (unsigned int argc, char **argv, unsigned int lang_mask)
+{
+ unsigned int n, i;
+
+ for (i = 1; i < argc; i += n)
+ {
+ n = handle_option (argv + i, lang_mask);
+
+ if (!n)
+ {
+ n = 1;
+ error ("unrecognized command line option \"%s\"", argv[i]);
+ }
+ }
+}
+
/* Handle target- and language-independent options. Return zero to
generate an "unknown option" message. */
static int
@@ -251,6 +446,10 @@ common_handle_option (size_t scode, const char *arg,
exit_after_options = true;
break;
+ case OPT__param:
+ handle_param (arg);
+ break;
+
case OPT__target_help:
display_target_options ();
exit_after_options = true;
@@ -262,12 +461,121 @@ common_handle_option (size_t scode, const char *arg,
break;
case OPT_G:
- g_switch_value = read_integral_parameter (arg, 0, -1);
- if (g_switch_value == (unsigned HOST_WIDE_INT) -1)
- return 0;
+ g_switch_value = value;
g_switch_set = true;
break;
+ case OPT_O:
+ case OPT_Os:
+ /* Currently handled in a prescan. */
+ break;
+
+ case OPT_W:
+ /* For backward compatibility, -W is the same as -Wextra. */
+ set_Wextra (value);
+ break;
+
+ case OPT_Waggregate_return:
+ warn_aggregate_return = value;
+ break;
+
+ case OPT_Wcast_align:
+ warn_cast_align = value;
+ break;
+
+ case OPT_Wdeprecated_declarations:
+ warn_deprecated_decl = value;
+ break;
+
+ case OPT_Wdisabled_optimization:
+ warn_disabled_optimization = value;
+ break;
+
+ case OPT_Werror:
+ warnings_are_errors = value;
+ break;
+
+ case OPT_Wextra:
+ set_Wextra (value);
+ break;
+
+ case OPT_Winline:
+ warn_inline = value;
+ break;
+
+ case OPT_Wlarger_than_:
+ larger_than_size = value;
+ warn_larger_than = value != -1;
+ break;
+
+ case OPT_Wmissing_noreturn:
+ warn_missing_noreturn = value;
+ break;
+
+ case OPT_Wpacked:
+ warn_packed = value;
+ break;
+
+ case OPT_Wpadded:
+ warn_padded = value;
+ break;
+
+ case OPT_Wshadow:
+ warn_shadow = value;
+ break;
+
+ case OPT_Wstrict_aliasing:
+ warn_strict_aliasing = value;
+ break;
+
+ case OPT_Wswitch:
+ warn_switch = value;
+ break;
+
+ case OPT_Wswitch_default:
+ warn_switch_default = value;
+ break;
+
+ case OPT_Wswitch_enum:
+ warn_switch_enum = value;
+ break;
+
+ case OPT_Wsystem_headers:
+ warn_system_headers = value;
+ break;
+
+ case OPT_Wuninitialized:
+ warn_uninitialized = value;
+ break;
+
+ case OPT_Wunreachable_code:
+ warn_notreached = value;
+ break;
+
+ case OPT_Wunused:
+ set_Wunused (value);
+ break;
+
+ case OPT_Wunused_function:
+ warn_unused_function = value;
+ break;
+
+ case OPT_Wunused_label:
+ warn_unused_label = value;
+ break;
+
+ case OPT_Wunused_parameter:
+ warn_unused_parameter = value;
+ break;
+
+ case OPT_Wunused_value:
+ warn_unused_value = value;
+ break;
+
+ case OPT_Wunused_variable:
+ warn_unused_variable = value;
+ break;
+
case OPT_aux_info:
case OPT_aux_info_:
aux_info_file_name = arg;
@@ -295,6 +603,584 @@ common_handle_option (size_t scode, const char *arg,
dump_base_name = arg;
break;
+ case OPT_fPIC:
+ flag_pic = value + value;
+ break;
+
+ case OPT_fPIE:
+ flag_pie = value + value;
+ break;
+
+ case OPT_falign_functions:
+ case OPT_falign_functions_:
+ align_functions = value;
+ break;
+
+ case OPT_falign_jumps:
+ case OPT_falign_jumps_:
+ align_jumps = value;
+ break;
+
+ case OPT_falign_labels:
+ case OPT_falign_labels_:
+ align_labels = value;
+ break;
+
+ case OPT_falign_loops:
+ case OPT_falign_loops_:
+ align_loops = value;
+ break;
+
+ case OPT_fargument_alias:
+ flag_argument_noalias = !value;
+ break;
+
+ case OPT_fargument_noalias:
+ flag_argument_noalias = value;
+ break;
+
+ case OPT_fargument_noalias_global:
+ flag_argument_noalias = value + value;
+ break;
+
+ case OPT_fasynchronous_unwind_tables:
+ flag_asynchronous_unwind_tables = value;
+ break;
+
+ case OPT_fbounds_check:
+ flag_bounds_check = value;
+ break;
+
+ case OPT_fbranch_count_reg:
+ flag_branch_on_count_reg = value;
+ break;
+
+ case OPT_fbranch_probabilities:
+ flag_branch_probabilities = value;
+ break;
+
+ case OPT_fbranch_target_load_optimize:
+ flag_branch_target_load_optimize = value;
+ break;
+
+ case OPT_fbranch_target_load_optimize2:
+ flag_branch_target_load_optimize2 = value;
+ break;
+
+ case OPT_fcall_used_:
+ fix_register (arg, 0, 1);
+ break;
+
+ case OPT_fcall_saved_:
+ fix_register (arg, 0, 0);
+ break;
+
+ case OPT_fcaller_saves:
+ flag_caller_saves = value;
+ break;
+
+ case OPT_fcommon:
+ flag_no_common = !value;
+ break;
+
+ case OPT_fcprop_registers:
+ flag_cprop_registers = value;
+ break;
+
+ case OPT_fcrossjumping:
+ flag_crossjumping = value;
+ break;
+
+ case OPT_fcse_follow_jumps:
+ flag_cse_follow_jumps = value;
+ break;
+
+ case OPT_fcse_skip_blocks:
+ flag_cse_skip_blocks = value;
+ break;
+
+ case OPT_fdata_sections:
+ flag_data_sections = value;
+ break;
+
+ case OPT_fdefer_pop:
+ flag_defer_pop = value;
+ break;
+
+ case OPT_fdelayed_branch:
+ flag_delayed_branch = value;
+ break;
+
+ case OPT_fdelete_null_pointer_checks:
+ flag_delete_null_pointer_checks = value;
+ break;
+
+ case OPT_fdiagnostics_show_location_:
+ if (!strcmp (arg, "once"))
+ diagnostic_prefixing_rule (global_dc) = DIAGNOSTICS_SHOW_PREFIX_ONCE;
+ else if (!strcmp (arg, "every-line"))
+ diagnostic_prefixing_rule (global_dc)
+ = DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE;
+ else
+ return 0;
+ break;
+
+ case OPT_fdump_unnumbered:
+ flag_dump_unnumbered = value;
+ break;
+
+ case OPT_feliminate_dwarf2_dups:
+ flag_eliminate_dwarf2_dups = value;
+ break;
+
+ case OPT_feliminate_unused_debug_types:
+ flag_eliminate_unused_debug_types = value;
+ break;
+
+ case OPT_feliminate_unused_debug_symbols:
+ flag_debug_only_used_symbols = value;
+ break;
+
+ case OPT_fexceptions:
+ flag_exceptions = value;
+ break;
+
+ case OPT_fexpensive_optimizations:
+ flag_expensive_optimizations = value;
+ break;
+
+ case OPT_ffast_math:
+ set_fast_math_flags (value);
+ break;
+
+ case OPT_ffinite_math_only:
+ flag_finite_math_only = value;
+ break;
+
+ case OPT_ffixed_:
+ fix_register (arg, 1, 1);
+ break;
+
+ case OPT_ffunction_cse:
+ flag_no_function_cse = !value;
+ break;
+
+ case OPT_ffloat_store:
+ flag_float_store = value;
+ break;
+
+ case OPT_fforce_addr:
+ flag_force_addr = value;
+ break;
+
+ case OPT_fforce_mem:
+ flag_force_mem = value;
+ break;
+
+ case OPT_ffunction_sections:
+ flag_function_sections = value;
+ break;
+
+ case OPT_fgcse:
+ flag_gcse = value;
+ break;
+
+ case OPT_fgcse_lm:
+ flag_gcse_lm = value;
+ break;
+
+ case OPT_fgcse_sm:
+ flag_gcse_sm = value;
+ break;
+
+ case OPT_fgnu_linker:
+ flag_gnu_linker = value;
+ break;
+
+ case OPT_fguess_branch_probability:
+ flag_guess_branch_prob = value;
+ break;
+
+ case OPT_fident:
+ flag_no_ident = !value;
+ break;
+
+ case OPT_fif_conversion:
+ flag_if_conversion = value;
+ break;
+
+ case OPT_fif_conversion2:
+ flag_if_conversion2 = value;
+ break;
+
+ case OPT_finhibit_size_directive:
+ flag_inhibit_size_directive = value;
+ break;
+
+ case OPT_finline:
+ flag_no_inline = !value;
+ break;
+
+ case OPT_finline_functions:
+ flag_inline_functions = value;
+ break;
+
+ case OPT_finline_limit_:
+ case OPT_finline_limit_eq:
+ set_param_value ("max-inline-insns", value);
+ set_param_value ("max-inline-insns-single", value / 2);
+ set_param_value ("max-inline-insns-auto", value / 2);
+ set_param_value ("max-inline-insns-rtl", value);
+ if (value / 4 < MIN_INLINE_INSNS)
+ {
+ if (value / 4 > 10)
+ set_param_value ("min-inline-insns", value / 4);
+ else
+ set_param_value ("min-inline-insns", 10);
+ }
+ break;
+
+ case OPT_finstrument_functions:
+ flag_instrument_function_entry_exit = value;
+ break;
+
+ case OPT_fkeep_inline_functions:
+ flag_keep_inline_functions =value;
+ break;
+
+ case OPT_fkeep_static_consts:
+ flag_keep_static_consts = value;
+ break;
+
+ case OPT_fleading_underscore:
+ flag_leading_underscore = value;
+ break;
+
+ case OPT_floop_optimize:
+ flag_loop_optimize = value;
+ break;
+
+ case OPT_fmath_errno:
+ flag_errno_math = value;
+ break;
+
+ case OPT_fmem_report:
+ mem_report = value;
+ break;
+
+ case OPT_fmerge_all_constants:
+ flag_merge_constants = value + value;
+ break;
+
+ case OPT_fmerge_constants:
+ flag_merge_constants = value;
+ break;
+
+ case OPT_fmessage_length_:
+ output_set_maximum_length (&global_dc->buffer, value);
+ break;
+
+ case OPT_fmove_all_movables:
+ flag_move_all_movables = value;
+ break;
+
+ case OPT_fnew_ra:
+ flag_new_regalloc = value;
+ break;
+
+ case OPT_fnon_call_exceptions:
+ flag_non_call_exceptions = value;
+ break;
+
+ case OPT_fold_unroll_all_loops:
+ flag_old_unroll_all_loops = value;
+ break;
+
+ case OPT_fold_unroll_loops:
+ flag_old_unroll_loops = value;
+ break;
+
+ case OPT_fomit_frame_pointer:
+ flag_omit_frame_pointer = value;
+ break;
+
+ case OPT_foptimize_register_move:
+ flag_regmove = value;
+ break;
+
+ case OPT_foptimize_sibling_calls:
+ flag_optimize_sibling_calls = value;
+ break;
+
+ case OPT_fpack_struct:
+ flag_pack_struct = value;
+ break;
+
+ case OPT_fpeel_loops:
+ flag_peel_loops = value;
+ break;
+
+ case OPT_fpcc_struct_return:
+ flag_pcc_struct_return = value;
+ break;
+
+ case OPT_fpeephole:
+ flag_no_peephole = !value;
+ break;
+
+ case OPT_fpeephole2:
+ flag_peephole2 = value;
+ break;
+
+ case OPT_fpic:
+ flag_pic = value;
+ break;
+
+ case OPT_fpie:
+ flag_pie = value;
+ break;
+
+ case OPT_fprefetch_loop_arrays:
+ flag_prefetch_loop_arrays = value;
+ break;
+
+ case OPT_fprofile:
+ profile_flag = value;
+ break;
+
+ case OPT_fprofile_arcs:
+ profile_arc_flag = value;
+ break;
+
+ case OPT_frandom_seed:
+ /* The real switch is -fno-random-seed. */
+ if (value)
+ return 0;
+ flag_random_seed = NULL;
+ break;
+
+ case OPT_frandom_seed_:
+ flag_random_seed = arg;
+ break;
+
+ case OPT_freduce_all_givs:
+ flag_reduce_all_givs = value;
+ break;
+
+ case OPT_freg_struct_return:
+ flag_pcc_struct_return = !value;
+ break;
+
+ case OPT_fregmove:
+ flag_regmove = value;
+ break;
+
+ case OPT_frename_registers:
+ flag_rename_registers = value;
+ break;
+
+ case OPT_freorder_blocks:
+ flag_reorder_blocks = value;
+ break;
+
+ case OPT_freorder_functions:
+ flag_reorder_functions = value;
+ break;
+
+ case OPT_frerun_cse_after_loop:
+ flag_rerun_cse_after_loop = value;
+ break;
+
+ case OPT_frerun_loop_opt:
+ flag_rerun_loop_opt = value;
+ break;
+
+ case OPT_fsched_interblock:
+ flag_schedule_interblock= value;
+ break;
+
+ case OPT_fsched_spec:
+ flag_schedule_speculative = value;
+ break;
+
+ case OPT_fsched_spec_load:
+ flag_schedule_speculative_load = value;
+ break;
+
+ case OPT_fsched_spec_load_dangerous:
+ flag_schedule_speculative_load_dangerous = value;
+ break;
+
+ case OPT_fsched_verbose_:
+#ifdef INSN_SCHEDULING
+ fix_sched_param ("verbose", arg);
+ break;
+#else
+ return 0;
+#endif
+
+ case OPT_fsched2_use_superblocks:
+ flag_sched2_use_superblocks = value;
+ break;
+
+ case OPT_fsched2_use_traces:
+ flag_sched2_use_traces = value;
+ break;
+
+ case OPT_fschedule_insns:
+ flag_schedule_insns = value;
+ break;
+
+ case OPT_fschedule_insns2:
+ flag_schedule_insns_after_reload = value;
+ break;
+
+ case OPT_fshared_data:
+ flag_shared_data = value;
+ break;
+
+ case OPT_fsignaling_nans:
+ flag_signaling_nans = value;
+ break;
+
+ case OPT_fsingle_precision_constant:
+ flag_single_precision_constant = value;
+ break;
+
+ case OPT_fssa:
+ flag_ssa = value;
+ break;
+
+ case OPT_fssa_ccp:
+ flag_ssa_ccp = value;
+ break;
+
+ case OPT_fssa_dce:
+ flag_ssa_dce = value;
+ break;
+
+ case OPT_fstack_check:
+ flag_stack_check = value;
+ break;
+
+ case OPT_fstack_limit:
+ /* The real switch is -fno-stack-limit. */
+ if (value)
+ return 0;
+ stack_limit_rtx = NULL_RTX;
+ break;
+
+ case OPT_fstack_limit_register_:
+ {
+ int reg = decode_reg_name (arg);
+ if (reg < 0)
+ error ("unrecognized register name \"%s\"", arg);
+ else
+ stack_limit_rtx = gen_rtx_REG (Pmode, reg);
+ }
+ break;
+
+ case OPT_fstack_limit_symbol_:
+ stack_limit_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (arg));
+ break;
+
+ case OPT_fstrength_reduce:
+ flag_strength_reduce = value;
+ break;
+
+ case OPT_fstrict_aliasing:
+ flag_strict_aliasing = value;
+ break;
+
+ case OPT_fsyntax_only:
+ flag_syntax_only = value;
+ break;
+
+ case OPT_ftest_coverage:
+ flag_test_coverage = value;
+ break;
+
+ case OPT_fthread_jumps:
+ flag_thread_jumps = value;
+ break;
+
+ case OPT_ftime_report:
+ time_report = value;
+ break;
+
+ case OPT_ftls_model_:
+ if (!strcmp (arg, "global-dynamic"))
+ flag_tls_default = TLS_MODEL_GLOBAL_DYNAMIC;
+ else if (!strcmp (arg, "local-dynamic"))
+ flag_tls_default = TLS_MODEL_LOCAL_DYNAMIC;
+ else if (!strcmp (arg, "initial-exec"))
+ flag_tls_default = TLS_MODEL_INITIAL_EXEC;
+ else if (!strcmp (arg, "local-exec"))
+ flag_tls_default = TLS_MODEL_LOCAL_EXEC;
+ else
+ warning ("unknown tls-model \"%s\"", arg);
+ break;
+
+ case OPT_ftracer:
+ flag_tracer = value;
+ break;
+
+ case OPT_ftrapping_math:
+ flag_trapping_math = value;
+ break;
+
+ case OPT_ftrapv:
+ flag_trapv = value;
+ break;
+
+ case OPT_funit_at_a_time:
+ flag_unit_at_a_time = value;
+ break;
+
+ case OPT_funroll_all_loops:
+ flag_unroll_all_loops = value;
+ break;
+
+ case OPT_funroll_loops:
+ flag_unroll_loops = value;
+ break;
+
+ case OPT_funsafe_math_optimizations:
+ flag_unsafe_math_optimizations = value;
+ break;
+
+ case OPT_funswitch_loops:
+ flag_unswitch_loops = value;
+ break;
+
+ case OPT_funwind_tables:
+ flag_unwind_tables = value;
+ break;
+
+ case OPT_fverbose_asm:
+ flag_verbose_asm = value;
+ break;
+
+ case OPT_fwrapv:
+ flag_wrapv = value;
+ break;
+
+ case OPT_fwritable_strings:
+ flag_writable_strings = value;
+ break;
+
+ case OPT_fzero_initialized_in_bss:
+ flag_zero_initialized_in_bss = value;
+ break;
+
+ case OPT_g:
+ decode_g_option (arg);
+ break;
+
+ case OPT_m:
+ set_target_switch (arg);
+ break;
+
case OPT_o:
asm_file_name = arg;
break;
@@ -320,9 +1206,92 @@ common_handle_option (size_t scode, const char *arg,
break;
case OPT_w:
- inhibit_warnings = 1;
+ inhibit_warnings = true;
break;
}
return 1;
}
+
+/* Handle --param NAME=VALUE. */
+static void
+handle_param (const char *carg)
+{
+ char *equal, *arg;
+ int value;
+
+ arg = xstrdup (carg);
+ equal = strchr (arg, '=');
+ if (!equal)
+ error ("%s: --param arguments should be of the form NAME=VALUE", arg);
+ else
+ {
+ value = integral_argument (equal + 1);
+ if (value == -1)
+ error ("invalid --param value `%s'", equal + 1);
+ else
+ {
+ *equal = '\0';
+ set_param_value (arg, value);
+ }
+ }
+
+ free (arg);
+}
+
+/* Handle -W and -Wextra. */
+static void
+set_Wextra (int setting)
+{
+ extra_warnings = setting;
+ warn_unused_value = setting;
+ warn_unused_parameter = (setting && maybe_warn_unused_parameter);
+
+ /* We save the value of warn_uninitialized, since if they put
+ -Wuninitialized on the command line, we need to generate a
+ warning about not using it without also specifying -O. */
+ if (setting == 0)
+ warn_uninitialized = 0;
+ else if (warn_uninitialized != 1)
+ warn_uninitialized = 2;
+}
+
+/* Initialize unused warning flags. */
+void
+set_Wunused (int setting)
+{
+ warn_unused_function = setting;
+ warn_unused_label = setting;
+ /* Unused function parameter warnings are reported when either
+ ``-Wextra -Wunused'' or ``-Wunused-parameter'' is specified.
+ Thus, if -Wextra has already been seen, set warn_unused_parameter;
+ otherwise set maybe_warn_extra_parameter, which will be picked up
+ by set_Wextra. */
+ maybe_warn_unused_parameter = setting;
+ warn_unused_parameter = (setting && extra_warnings);
+ warn_unused_variable = setting;
+ warn_unused_value = setting;
+}
+
+/* The following routines are useful in setting all the flags that
+ -ffast-math and -fno-fast-math imply. */
+void
+set_fast_math_flags (int set)
+{
+ flag_trapping_math = !set;
+ flag_unsafe_math_optimizations = set;
+ flag_finite_math_only = set;
+ flag_errno_math = !set;
+ if (set)
+ flag_signaling_nans = 0;
+}
+
+/* Return true iff flags are set as if -ffast-math. */
+bool
+fast_math_flags_set_p (void)
+{
+ return (!flag_trapping_math
+ && flag_unsafe_math_optimizations
+ && flag_finite_math_only
+ && !flag_errno_math);
+}
diff --git a/gcc/opts.h b/gcc/opts.h
index 31c6e8e7f31..4ee3ffe37e8 100644
--- a/gcc/opts.h
+++ b/gcc/opts.h
@@ -21,21 +21,26 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_OPTS_H
#define GCC_OPTS_H
-extern int handle_option (int argc, char **argv, int lang_mask);
+extern void handle_options (unsigned int argc, char **argv,
+ unsigned int lang_mask);
struct cl_option
{
const char *opt_text;
+ unsigned short back_chain;
unsigned char opt_len;
unsigned int flags;
};
extern const struct cl_option cl_options[];
extern const unsigned int cl_options_count;
+extern const char *const lang_names[];
#define CL_JOINED (1 << 24) /* If takes joined argument. */
#define CL_SEPARATE (1 << 25) /* If takes a separate argument. */
#define CL_REJECT_NEGATIVE (1 << 26) /* Reject no- form. */
-#define CL_COMMON (1 << 27) /* Language-independent. */
+#define CL_MISSING_OK (1 << 27) /* Missing argument OK (joined). */
+#define CL_UINTEGER (1 << 28) /* Argument is an integer >=0. */
+#define CL_COMMON (1 << 29) /* Language-independent. */
#endif
diff --git a/gcc/opts.sh b/gcc/opts.sh
index bbca27265c7..2770f080ba0 100644
--- a/gcc/opts.sh
+++ b/gcc/opts.sh
@@ -33,15 +33,11 @@ SORT=sort # Could be /bin/sort or /usr/bin/sort
C_FILE=$1; shift
H_FILE=$1; shift
-# Must unset, so that RS="" works in gawk 3.0-3.1.1 (possibly earlier too)
-# Appears to be a gawk bug, RS="" is not an extension
-unset POSIXLY_CORRECT
-
${AWK} '
- BEGIN{ RS=""; FS="\n" }
# Ignore comments and blank lines
/^[ \t]*(;|$)/ { next }
- /^[^ \t]/ { gsub ("\n", "\034", $0); print }
+ # Note that RS="" falls foul of gawk 3.1.2 bugs
+ /^[^ \t]/ { getline tmp; print $0 "\034" tmp}
' "$@" | ${SORT} | ${AWK} '
function switch_flags (flags, result)
{
@@ -89,36 +85,65 @@ ${AWK} '
h_file = "'${H_FILE}'"
comma = ","
+ print "/* This file is auto-generated by opts.sh. */\n" > c_file
+ print "#include \"" h_file "\"" >> c_file
+ print "#include \"opts.h\"\n" >> c_file
+ print "const char * const lang_names[] =\n{" >> c_file
+
print "/* This file is auto-generated by opts.sh. */\n" > h_file
for (i = 0; i < n_langs; i++) {
macros[i] = "CL_" langs[i]
gsub( "[^A-Za-z0-9_]", "X", macros[i] )
s = substr(" ", length (macros[i]))
print "#define " macros[i] s " (1 << " i ")" >> h_file
+ print " \"" langs[i] "\"," >> c_file
}
- print "\nenum opt_code\n{" >> h_file
- print "/* This file is auto-generated by opts.sh. */\n" > c_file
- print "#include \"" h_file "\"" >> c_file
- print "#include \"opts.h\"\n" >> c_file
+ print " 0\n};\n" >> c_file
print "const unsigned int cl_options_count = N_OPTS;\n" >> c_file
print "const struct cl_option cl_options[] =\n{" >> c_file
+ print "\nenum opt_code\n{" >> h_file
+
+ for (i = 0; i < n_opts; i++)
+ back_chain[i] = "N_OPTS";
+
for (i = 0; i < n_opts; i++) {
+ # Combine the flags of identical switches. Switches
+ # appear many times if they are handled by many front
+ # ends, for example.
while( i + 1 != n_opts && opts[i] == opts[i + 1] ) {
flags[i + 1] = flags[i] " " flags[i + 1];
i++;
}
+ len = length (opts[i]);
enum = "OPT_" opts[i]
- gsub( "[^A-Za-z0-9]", "_", enum)
+ if (opts[i] == "finline-limit=")
+ enum = enum "eq"
+ gsub ("[^A-Za-z0-9]", "_", enum)
+
+ # If this switch takes joined arguments, back-chain all
+ # subsequent switches to it for which it is a prefix. If
+ # a later switch S is a longer prefix of a switch T, T
+ # will be back-chained to S in a later iteration of this
+ # for() loop, which is what we want.
+ if (flags[i] ~ "Joined") {
+ for (j = i + 1; j < n_opts; j++) {
+ if (substr (opts[j], 1, len) != opts[i])
+ break;
+ back_chain[j] = enum;
+ }
+ }
+
s = substr(" ", length (opts[i]))
if (i + 1 == n_opts)
comma = ""
printf(" %s,%s/* -%s */\n", enum, s, opts[i]) >> h_file
- printf(" { \"%s\", %u, %s }%s\n", opts[i], \
- length(opts[i]), switch_flags(flags[i]), comma) >> c_file
+ printf(" { \"%s\", (unsigned short) %s, %u,\n\t%s }%s\n",
+ opts[i], back_chain[i], len, switch_flags(flags[i]),
+ comma) >> c_file
}
print " N_OPTS\n};" >> h_file
diff --git a/gcc/output.h b/gcc/output.h
index 2bfc64d3a6b..aaaeaa2fe08 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -519,6 +519,7 @@ extern bool default_binds_local_p PARAMS ((tree));
extern bool default_binds_local_p_1 PARAMS ((tree, int));
extern void default_globalize_label PARAMS ((FILE *, const char *));
extern void default_internal_label PARAMS ((FILE *, const char *, unsigned long));
+extern void default_file_start PARAMS ((void));
extern void file_end_indicate_exec_stack PARAMS ((void));
extern bool default_valid_pointer_mode PARAMS ((enum machine_mode));
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index 165db771e35..071cec1c57a 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -1,4 +1,4 @@
-/* Print RTL for GNU C Compiler.
+/* Print RTL for GCC.
Copyright (C) 1987, 1988, 1992, 1997, 1998, 1999, 2000, 2002, 2003
Free Software Foundation, Inc.
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index 6ce305ea872..a826c1c024f 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -1,4 +1,4 @@
-/* Prints out tree in human readable form - GNU C-compiler
+/* Prints out tree in human readable form - GCC
Copyright (C) 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003 Free Software Foundation, Inc.
diff --git a/gcc/profile.c b/gcc/profile.c
index 310277f61fd..2140a0fed30 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -60,6 +60,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "function.h"
#include "toplev.h"
#include "coverage.h"
+#include "value-prof.h"
+#include "tree.h"
/* Additional information about the edges we need. */
struct edge_info {
@@ -84,7 +86,7 @@ struct bb_info {
#define EDGE_INFO(e) ((struct edge_info *) (e)->aux)
#define BB_INFO(b) ((struct bb_info *) (b)->aux)
-/* Counter summary from the last set of coverage counts read. */
+/* Counter summary from the last set of coverage counts read. */
const struct gcov_ctr_summary *profile_info;
@@ -105,7 +107,12 @@ static int total_num_branches;
/* Forward declarations. */
static void find_spanning_tree PARAMS ((struct edge_list *));
static rtx gen_edge_profiler PARAMS ((int));
+static rtx gen_interval_profiler (struct histogram_value *, unsigned, unsigned);
+static rtx gen_pow2_profiler (struct histogram_value *, unsigned, unsigned);
+static rtx gen_one_value_profiler (struct histogram_value *, unsigned, unsigned);
+static rtx gen_const_delta_profiler (struct histogram_value *, unsigned, unsigned);
static unsigned instrument_edges PARAMS ((struct edge_list *));
+static void instrument_values (unsigned, struct histogram_value *);
static void compute_branch_probabilities PARAMS ((void));
static gcov_type * get_exec_counts PARAMS ((void));
static basic_block find_group PARAMS ((basic_block));
@@ -157,10 +164,73 @@ instrument_edges (el)
fprintf (rtl_dump_file, "%d edges instrumented\n", num_instr_edges);
return num_instr_edges;
}
+
+/* Add code to measure histograms list of VALUES of length N_VALUES. */
+static void
+instrument_values (unsigned n_values, struct histogram_value *values)
+{
+ rtx sequence;
+ unsigned i, t;
+ edge e;
+
+ /* Emit code to generate the histograms before the insns. */
+
+ for (i = 0; i < n_values; i++)
+ {
+ e = split_block (BLOCK_FOR_INSN (values[i].insn),
+ PREV_INSN (values[i].insn));
+ switch (values[i].type)
+ {
+ case HIST_TYPE_INTERVAL:
+ t = GCOV_COUNTER_V_INTERVAL;
+ break;
+
+ case HIST_TYPE_POW2:
+ t = GCOV_COUNTER_V_POW2;
+ break;
+
+ case HIST_TYPE_SINGLE_VALUE:
+ t = GCOV_COUNTER_V_SINGLE;
+ break;
+
+ case HIST_TYPE_CONST_DELTA:
+ t = GCOV_COUNTER_V_DELTA;
+ break;
+
+ default:
+ abort ();
+ }
+ if (!coverage_counter_alloc (t, values[i].n_counters))
+ continue;
+
+ switch (values[i].type)
+ {
+ case HIST_TYPE_INTERVAL:
+ sequence = gen_interval_profiler (values + i, t, 0);
+ break;
+
+ case HIST_TYPE_POW2:
+ sequence = gen_pow2_profiler (values + i, t, 0);
+ break;
+
+ case HIST_TYPE_SINGLE_VALUE:
+ sequence = gen_one_value_profiler (values + i, t, 0);
+ break;
+
+ case HIST_TYPE_CONST_DELTA:
+ sequence = gen_const_delta_profiler (values + i, t, 0);
+ break;
+
+ default:
+ abort ();
+ }
+
+ safe_insert_insn_on_edge (sequence, e);
+ }
+}
-/* Computes hybrid profile for all matching entries in da_file.
- Sets max_counter_in_program as a side effect. */
+/* Computes hybrid profile for all matching entries in da_file. */
static gcov_type *
get_exec_counts ()
@@ -553,6 +623,8 @@ branch_prob ()
unsigned num_edges, ignored_edges;
unsigned num_instrumented;
struct edge_list *el;
+ unsigned n_values = 0;
+ struct histogram_value *values = NULL;
total_num_times_called++;
@@ -731,7 +803,7 @@ branch_prob ()
}
}
- /* Line numbers. */
+ /* Line numbers. */
if (coverage_begin_output ())
{
char const *prev_file_name = NULL;
@@ -804,6 +876,13 @@ branch_prob ()
EXIT_BLOCK_PTR->index = EXIT_BLOCK;
#undef BB_TO_GCOV_INDEX
+ if (flag_profile_values)
+ {
+ life_analysis (get_insns (), NULL, PROP_DEATH_NOTES);
+ find_values_to_profile (&n_values, &values);
+ allocate_reg_info (max_reg_num (), FALSE, FALSE);
+ }
+
if (flag_branch_probabilities)
compute_branch_probabilities ();
@@ -816,11 +895,16 @@ branch_prob ()
if (n_instrumented != num_instrumented)
abort ();
+ if (flag_profile_values)
+ instrument_values (n_values, values);
+
/* Commit changes done by instrumentation. */
commit_edge_insertions_watch_calls ();
allocate_reg_info (max_reg_num (), FALSE, FALSE);
}
+ if (flag_profile_values)
+ count_or_remove_death_notes (NULL, 1);
remove_fake_edges ();
free_aux_for_edges ();
/* Re-merge split basic blocks and the mess introduced by
@@ -1029,3 +1113,301 @@ gen_edge_profiler (edgeno)
end_sequence ();
return sequence;
}
+
+/* Output instructions as RTL to increment the interval histogram counter.
+ VALUE is the expression whose value is profiled. TAG is the tag of the
+ section for counters, BASE is offset of the counter position. */
+
+static rtx
+gen_interval_profiler (struct histogram_value *value,
+ unsigned tag, unsigned base)
+{
+ unsigned gcov_size = tree_low_cst (TYPE_SIZE (GCOV_TYPE_NODE), 1);
+ enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0);
+ rtx mem_ref, tmp, tmp1, mr, val;
+ rtx sequence;
+ rtx more_label = gen_label_rtx ();
+ rtx less_label = gen_label_rtx ();
+ rtx end_of_code_label = gen_label_rtx ();
+ int per_counter = gcov_size / BITS_PER_UNIT;
+
+ start_sequence ();
+
+ if (value->seq)
+ emit_insn (value->seq);
+
+ mr = gen_reg_rtx (Pmode);
+
+ tmp = coverage_counter_ref (tag, base);
+ tmp = force_reg (Pmode, XEXP (tmp, 0));
+
+ val = expand_simple_binop (value->mode, MINUS,
+ copy_rtx (value->value),
+ GEN_INT (value->hdata.intvl.int_start),
+ NULL_RTX, 0, OPTAB_WIDEN);
+
+ if (value->hdata.intvl.may_be_more)
+ do_compare_rtx_and_jump (copy_rtx (val), GEN_INT (value->hdata.intvl.steps),
+ GE, 0, value->mode, NULL_RTX, NULL_RTX, more_label);
+ if (value->hdata.intvl.may_be_less)
+ do_compare_rtx_and_jump (copy_rtx (val), const0_rtx, LT, 0, value->mode,
+ NULL_RTX, NULL_RTX, less_label);
+
+ /* We are in range. */
+ tmp1 = expand_simple_binop (value->mode, MULT,
+ copy_rtx (val), GEN_INT (per_counter),
+ NULL_RTX, 0, OPTAB_WIDEN);
+ tmp1 = expand_simple_binop (Pmode, PLUS, copy_rtx (tmp), tmp1, mr,
+ 0, OPTAB_WIDEN);
+ if (tmp1 != mr)
+ emit_move_insn (copy_rtx (mr), tmp1);
+
+ if (value->hdata.intvl.may_be_more
+ || value->hdata.intvl.may_be_less)
+ {
+ emit_jump_insn (gen_jump (end_of_code_label));
+ emit_barrier ();
+ }
+
+ /* Above the interval. */
+ if (value->hdata.intvl.may_be_more)
+ {
+ emit_label (more_label);
+ tmp1 = expand_simple_binop (Pmode, PLUS, copy_rtx (tmp),
+ GEN_INT (per_counter * value->hdata.intvl.steps),
+ mr, 0, OPTAB_WIDEN);
+ if (tmp1 != mr)
+ emit_move_insn (copy_rtx (mr), tmp1);
+ if (value->hdata.intvl.may_be_less)
+ {
+ emit_jump_insn (gen_jump (end_of_code_label));
+ emit_barrier ();
+ }
+ }
+
+ /* Below the interval. */
+ if (value->hdata.intvl.may_be_less)
+ {
+ emit_label (less_label);
+ tmp1 = expand_simple_binop (Pmode, PLUS, copy_rtx (tmp),
+ GEN_INT (per_counter * (value->hdata.intvl.steps
+ + (value->hdata.intvl.may_be_more ? 1 : 0))),
+ mr, 0, OPTAB_WIDEN);
+ if (tmp1 != mr)
+ emit_move_insn (copy_rtx (mr), tmp1);
+ }
+
+ if (value->hdata.intvl.may_be_more
+ || value->hdata.intvl.may_be_less)
+ emit_label (end_of_code_label);
+
+ mem_ref = validize_mem (gen_rtx_MEM (mode, mr));
+
+ tmp = expand_simple_binop (mode, PLUS, copy_rtx (mem_ref), const1_rtx,
+ mem_ref, 0, OPTAB_WIDEN);
+
+ if (tmp != mem_ref)
+ emit_move_insn (copy_rtx (mem_ref), tmp);
+
+ sequence = get_insns ();
+ end_sequence ();
+ rebuild_jump_labels (sequence);
+ return sequence;
+}
+
+/* Output instructions as RTL to increment the power of two histogram counter.
+ VALUE is the expression whose value is profiled. TAG is the tag of the
+ section for counters, BASE is offset of the counter position. */
+
+static rtx
+gen_pow2_profiler (struct histogram_value *value,
+ unsigned tag, unsigned base)
+{
+ unsigned gcov_size = tree_low_cst (TYPE_SIZE (GCOV_TYPE_NODE), 1);
+ enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0);
+ rtx mem_ref, tmp, mr, uval;
+ rtx sequence;
+ rtx end_of_code_label = gen_label_rtx ();
+ rtx loop_label = gen_label_rtx ();
+ int per_counter = gcov_size / BITS_PER_UNIT;
+
+ start_sequence ();
+
+ if (value->seq)
+ emit_insn (value->seq);
+
+ mr = gen_reg_rtx (Pmode);
+ tmp = coverage_counter_ref (tag, base);
+ tmp = force_reg (Pmode, XEXP (tmp, 0));
+ emit_move_insn (mr, tmp);
+
+ uval = gen_reg_rtx (value->mode);
+ emit_move_insn (uval, copy_rtx (value->value));
+
+ /* Check for non-power of 2. */
+ if (value->hdata.pow2.may_be_other)
+ {
+ do_compare_rtx_and_jump (copy_rtx (uval), const0_rtx, LE, 0, value->mode,
+ NULL_RTX, NULL_RTX, end_of_code_label);
+ tmp = expand_simple_binop (value->mode, PLUS, copy_rtx (uval),
+ constm1_rtx, NULL_RTX, 0, OPTAB_WIDEN);
+ tmp = expand_simple_binop (value->mode, AND, copy_rtx (uval), tmp,
+ NULL_RTX, 0, OPTAB_WIDEN);
+ do_compare_rtx_and_jump (tmp, const0_rtx, NE, 0, value->mode, NULL_RTX,
+ NULL_RTX, end_of_code_label);
+ }
+
+ /* Count log_2(value). */
+ emit_label (loop_label);
+
+ tmp = expand_simple_binop (Pmode, PLUS, copy_rtx (mr), GEN_INT (per_counter), mr, 0, OPTAB_WIDEN);
+ if (tmp != mr)
+ emit_move_insn (copy_rtx (mr), tmp);
+
+ tmp = expand_simple_binop (value->mode, ASHIFTRT, copy_rtx (uval), const1_rtx,
+ uval, 0, OPTAB_WIDEN);
+ if (tmp != uval)
+ emit_move_insn (copy_rtx (uval), tmp);
+
+ do_compare_rtx_and_jump (copy_rtx (uval), const0_rtx, NE, 0, value->mode,
+ NULL_RTX, NULL_RTX, loop_label);
+
+ /* Increase the counter. */
+ emit_label (end_of_code_label);
+
+ mem_ref = validize_mem (gen_rtx_MEM (mode, mr));
+
+ tmp = expand_simple_binop (mode, PLUS, copy_rtx (mem_ref), const1_rtx,
+ mem_ref, 0, OPTAB_WIDEN);
+
+ if (tmp != mem_ref)
+ emit_move_insn (copy_rtx (mem_ref), tmp);
+
+ sequence = get_insns ();
+ end_sequence ();
+ rebuild_jump_labels (sequence);
+ return sequence;
+}
+
+/* Output instructions as RTL for code to find the most common value.
+ VALUE is the expression whose value is profiled. TAG is the tag of the
+ section for counters, BASE is offset of the counter position. */
+
+static rtx
+gen_one_value_profiler (struct histogram_value *value,
+ unsigned tag, unsigned base)
+{
+ unsigned gcov_size = tree_low_cst (TYPE_SIZE (GCOV_TYPE_NODE), 1);
+ enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0);
+ rtx stored_value_ref, counter_ref, all_ref, stored_value, counter, all;
+ rtx tmp, uval;
+ rtx sequence;
+ rtx same_label = gen_label_rtx ();
+ rtx zero_label = gen_label_rtx ();
+ rtx end_of_code_label = gen_label_rtx ();
+
+ start_sequence ();
+
+ if (value->seq)
+ emit_insn (value->seq);
+
+ stored_value_ref = coverage_counter_ref (tag, base);
+ counter_ref = coverage_counter_ref (tag, base + 1);
+ all_ref = coverage_counter_ref (tag, base + 2);
+ stored_value = validize_mem (stored_value_ref);
+ counter = validize_mem (counter_ref);
+ all = validize_mem (all_ref);
+
+ uval = gen_reg_rtx (mode);
+ convert_move (uval, copy_rtx (value->value), 0);
+
+ /* Check if the stored value matches. */
+ do_compare_rtx_and_jump (copy_rtx (uval), copy_rtx (stored_value), EQ,
+ 0, mode, NULL_RTX, NULL_RTX, same_label);
+
+ /* Does not match; check whether the counter is zero. */
+ do_compare_rtx_and_jump (copy_rtx (counter), const0_rtx, EQ, 0, mode,
+ NULL_RTX, NULL_RTX, zero_label);
+
+ /* The counter is not zero yet. */
+ tmp = expand_simple_binop (mode, PLUS, copy_rtx (counter), constm1_rtx,
+ counter, 0, OPTAB_WIDEN);
+
+ if (tmp != counter)
+ emit_move_insn (copy_rtx (counter), tmp);
+
+ emit_jump_insn (gen_jump (end_of_code_label));
+ emit_barrier ();
+
+ emit_label (zero_label);
+ /* Set new value. */
+ emit_move_insn (copy_rtx (stored_value), copy_rtx (uval));
+
+ emit_label (same_label);
+ /* Increase the counter. */
+ tmp = expand_simple_binop (mode, PLUS, copy_rtx (counter), const1_rtx,
+ counter, 0, OPTAB_WIDEN);
+
+ if (tmp != counter)
+ emit_move_insn (copy_rtx (counter), tmp);
+
+ emit_label (end_of_code_label);
+
+ /* Increase the counter of all executions; this seems redundant given
+ that ve have counts for edges in cfg, but it may happen that some
+ optimization will change the counts for the block (either because
+ it is unable to update them correctly, or because it will duplicate
+ the block or its part). */
+ tmp = expand_simple_binop (mode, PLUS, copy_rtx (all), const1_rtx,
+ all, 0, OPTAB_WIDEN);
+
+ if (tmp != all)
+ emit_move_insn (copy_rtx (all), tmp);
+ sequence = get_insns ();
+ end_sequence ();
+ rebuild_jump_labels (sequence);
+ return sequence;
+}
+
+/* Output instructions as RTL for code to find the most common value of
+ a difference between two evaluations of an expression.
+ VALUE is the expression whose value is profiled. TAG is the tag of the
+ section for counters, BASE is offset of the counter position. */
+
+static rtx
+gen_const_delta_profiler (struct histogram_value *value,
+ unsigned tag, unsigned base)
+{
+ struct histogram_value one_value_delta;
+ unsigned gcov_size = tree_low_cst (TYPE_SIZE (GCOV_TYPE_NODE), 1);
+ enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0);
+ rtx stored_value_ref, stored_value, tmp, uval;
+ rtx sequence;
+
+ start_sequence ();
+
+ if (value->seq)
+ emit_insn (value->seq);
+
+ stored_value_ref = coverage_counter_ref (tag, base);
+ stored_value = validize_mem (stored_value_ref);
+
+ uval = gen_reg_rtx (mode);
+ convert_move (uval, copy_rtx (value->value), 0);
+ tmp = expand_simple_binop (mode, MINUS,
+ copy_rtx (uval), copy_rtx (stored_value),
+ NULL_RTX, 0, OPTAB_WIDEN);
+
+ one_value_delta.value = tmp;
+ one_value_delta.mode = mode;
+ one_value_delta.seq = NULL_RTX;
+ one_value_delta.insn = value->insn;
+ one_value_delta.type = HIST_TYPE_SINGLE_VALUE;
+ emit_insn (gen_one_value_profiler (&one_value_delta, tag, base + 1));
+
+ emit_move_insn (copy_rtx (stored_value), uval);
+ sequence = get_insns ();
+ end_sequence ();
+ rebuild_jump_labels (sequence);
+ return sequence;
+}
diff --git a/gcc/protoize.c b/gcc/protoize.c
index a83add6db72..e89aa73efec 100644
--- a/gcc/protoize.c
+++ b/gcc/protoize.c
@@ -1,6 +1,6 @@
/* Protoize program - Original version by Ron Guilmette (rfg@segfault.us.com).
Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -84,8 +84,8 @@ static void notice PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
static char *savestring PARAMS ((const char *, unsigned int));
static char *dupnstr PARAMS ((const char *, size_t));
static const char *substr PARAMS ((const char *, const char * const));
-static int safe_read PARAMS ((int, PTR, int));
-static void safe_write PARAMS ((int, PTR, int, const char *));
+static int safe_read PARAMS ((int, void *, int));
+static void safe_write PARAMS ((int, void *, int, const char *));
static void save_pointers PARAMS ((void));
static void restore_pointers PARAMS ((void));
static int is_id_char PARAMS ((int));
@@ -227,9 +227,7 @@ struct string_list *exclude_list;
static const char * const other_var_style = "stdarg";
#else /* !defined (UNPROTOIZE) */
static const char * const other_var_style = "varargs";
-/* Note that this is a string containing the expansion of va_alist.
- But in `main' we discard all but the first token. */
-static const char *varargs_style_indicator = STRINGX (va_alist);
+static const char *varargs_style_indicator = "va_alist";
#endif /* !defined (UNPROTOIZE) */
/* The following two types are used to create hash tables. In this program,
@@ -590,7 +588,7 @@ outer:
static int
safe_read (desc, ptr, len)
int desc;
- PTR ptr;
+ void *ptr;
int len;
{
int left = len;
@@ -619,7 +617,7 @@ safe_read (desc, ptr, len)
static void
safe_write (desc, ptr, len, out_fname)
int desc;
- PTR ptr;
+ void *ptr;
int len;
const char *out_fname;
{
@@ -1020,7 +1018,7 @@ static void
free_def_dec (p)
def_dec_info *p;
{
- free ((NONCONST PTR) p->ansi_decl);
+ free ((NONCONST void *) p->ansi_decl);
#ifndef UNPROTOIZE
{
@@ -1030,7 +1028,7 @@ free_def_dec (p)
for (curr = p->f_list_chain; curr; curr = next)
{
next = curr->chain_next;
- free ((NONCONST PTR) curr);
+ free ((NONCONST void *) curr);
}
}
#endif /* !defined (UNPROTOIZE) */
diff --git a/gcc/ra-debug.c b/gcc/ra-debug.c
index 17d89b469ee..7d59bac42e3 100644
--- a/gcc/ra-debug.c
+++ b/gcc/ra-debug.c
@@ -985,21 +985,16 @@ dump_static_insn_cost (file, message, prefix)
if (!prefix)
prefix = "";
fprintf (file, "static insn cost %s\n", message ? message : "");
- fprintf (file, " %soverall:\tnum=%6d\tcost="
- HOST_WIDE_INT_PRINT_DEC_SPACE "\n",
- prefix, overall.count, 8, overall.cost);
- fprintf (file, " %sloads:\tnum=%6d\tcost="
- HOST_WIDE_INT_PRINT_DEC_SPACE "\n",
- prefix, load.count, 8, load.cost);
- fprintf (file, " %sstores:\tnum=%6d\tcost="
- HOST_WIDE_INT_PRINT_DEC_SPACE "\n",
- prefix, store.count, 8, store.cost);
- fprintf (file, " %sregcopy:\tnum=%6d\tcost="
- HOST_WIDE_INT_PRINT_DEC_SPACE "\n",
- prefix, regcopy.count, 8, regcopy.cost);
- fprintf (file, " %sselfcpy:\tnum=%6d\tcost="
- HOST_WIDE_INT_PRINT_DEC_SPACE "\n",
- prefix, selfcopy.count, 8, selfcopy.cost);
+ fprintf (file, " %soverall:\tnum=%6d\tcost=% 8" HOST_WIDE_INT_PRINT "d\n",
+ prefix, overall.count, overall.cost);
+ fprintf (file, " %sloads:\tnum=%6d\tcost=% 8" HOST_WIDE_INT_PRINT "d\n",
+ prefix, load.count, load.cost);
+ fprintf (file, " %sstores:\tnum=%6d\tcost=% 8" HOST_WIDE_INT_PRINT "d\n",
+ prefix, store.count, store.cost);
+ fprintf (file, " %sregcopy:\tnum=%6d\tcost=% 8" HOST_WIDE_INT_PRINT "d\n",
+ prefix, regcopy.count, regcopy.cost);
+ fprintf (file, " %sselfcpy:\tnum=%6d\tcost=% 8" HOST_WIDE_INT_PRINT "d\n",
+ prefix, selfcopy.count, selfcopy.cost);
}
/* Returns nonzero, if WEB1 and WEB2 have some possible
diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c
index 5b4a6c44b18..9d08da4c94c 100644
--- a/gcc/read-rtl.c
+++ b/gcc/read-rtl.c
@@ -1,4 +1,4 @@
-/* RTL reader for GNU C Compiler.
+/* RTL reader for GCC.
Copyright (C) 1987, 1988, 1991, 1994, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
@@ -298,11 +298,13 @@ read_braced_string (ob, infile)
{
int c;
int brace_depth = 1; /* caller-processed */
+ unsigned long starting_read_rtx_lineno = read_rtx_lineno;
obstack_1grow (ob, '{');
while (brace_depth)
{
c = getc (infile); /* Read the string */
+
if (c == '\n')
read_rtx_lineno++;
else if (c == '{')
@@ -314,6 +316,10 @@ read_braced_string (ob, infile)
read_escape (ob, infile);
continue;
}
+ else if (c == EOF)
+ fatal_with_file_and_line
+ (infile, "missing closing } for opening brace on line %lu",
+ starting_read_rtx_lineno);
obstack_1grow (ob, c);
}
@@ -653,7 +659,7 @@ again:
{
ungetc (c, infile);
list_counter++;
- obstack_ptr_grow (&vector_stack, (PTR) read_rtx (infile));
+ obstack_ptr_grow (&vector_stack, read_rtx (infile));
}
if (list_counter > 0)
{
diff --git a/gcc/real.c b/gcc/real.c
index 4e1dc227f12..b491d885a9f 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -3326,6 +3326,25 @@ const struct real_format ieee_extended_intel_128_format =
true
};
+/* The following caters to i386 systems that set the rounding precision
+ to 53 bits instead of 64, e.g. FreeBSD. */
+const struct real_format ieee_extended_intel_96_round_53_format =
+ {
+ encode_ieee_extended,
+ decode_ieee_extended,
+ 2,
+ 1,
+ 53,
+ 53,
+ -16381,
+ 16384,
+ 79,
+ true,
+ true,
+ true,
+ true,
+ true
+ };
/* IBM 128-bit extended precision format: a pair of IEEE double precision
numbers whose sum is equal to the extended precision value. The number
diff --git a/gcc/real.h b/gcc/real.h
index 15a5d93e444..71e3cc4b6b9 100644
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -234,6 +234,7 @@ extern const struct real_format ieee_double_format;
extern const struct real_format mips_double_format;
extern const struct real_format ieee_extended_motorola_format;
extern const struct real_format ieee_extended_intel_96_format;
+extern const struct real_format ieee_extended_intel_96_round_53_format;
extern const struct real_format ieee_extended_intel_128_format;
extern const struct real_format ibm_extended_format;
extern const struct real_format mips_extended_format;
@@ -368,7 +369,7 @@ extern bool real_sqrt PARAMS ((REAL_VALUE_TYPE *,
enum machine_mode,
const REAL_VALUE_TYPE *));
-/* Calculate R as X raised to the integer exponent N in mode MODE. */
+/* Calculate R as X raised to the integer exponent N in mode MODE. */
extern bool real_powi PARAMS ((REAL_VALUE_TYPE *,
enum machine_mode,
const REAL_VALUE_TYPE *,
diff --git a/gcc/recog.c b/gcc/recog.c
index 8ea1e8d58dc..c539a387734 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -88,6 +88,9 @@ int which_alternative;
int reload_completed;
+/* Nonzero after thread_prologue_and_epilogue_insns has run. */
+int epilogue_completed;
+
/* Initialize data used by the function `recog'.
This must be called once in the compilation of a function
before any insn recognition may be done in the function. */
@@ -724,34 +727,6 @@ next_insn_tests_no_inequality (insn)
|| GET_CODE (next) == CALL_INSN)
&& ! inequality_comparisons_p (PATTERN (next)));
}
-
-#if 0 /* This is useless since the insn that sets the cc's
- must be followed immediately by the use of them. */
-/* Return 1 if the CC value set up by INSN is not used. */
-
-int
-next_insns_test_no_inequality (insn)
- rtx insn;
-{
- rtx next = NEXT_INSN (insn);
-
- for (; next != 0; next = NEXT_INSN (next))
- {
- if (GET_CODE (next) == CODE_LABEL
- || GET_CODE (next) == BARRIER)
- return 1;
- if (GET_CODE (next) == NOTE)
- continue;
- if (inequality_comparisons_p (PATTERN (next)))
- return 0;
- if (sets_cc0_p (PATTERN (next)) == 1)
- return 1;
- if (! reg_mentioned_p (cc0_rtx, PATTERN (next)))
- return 1;
- }
- return 1;
-}
-#endif
#endif
/* This is used by find_single_use to locate an rtx that contains exactly one
@@ -2053,30 +2028,6 @@ mode_dependent_address_p (addr)
win: ATTRIBUTE_UNUSED_LABEL
return 1;
}
-
-/* Return 1 if OP is a general operand
- other than a memory ref with a mode dependent address. */
-
-int
-mode_independent_operand (op, mode)
- enum machine_mode mode;
- rtx op;
-{
- rtx addr;
-
- if (! general_operand (op, mode))
- return 0;
-
- if (GET_CODE (op) != MEM)
- return 1;
-
- addr = XEXP (op, 0);
- GO_IF_MODE_DEPENDENT_ADDRESS (addr, lose);
- return 1;
- /* Label `lose' might (not) be used via GO_IF_MODE_DEPENDENT_ADDRESS. */
- lose: ATTRIBUTE_UNUSED_LABEL
- return 0;
-}
/* Like extract_insn, but save insn extracted and don't extract again, when
called again for the same insn expecting that recog_data still contain the
diff --git a/gcc/recog.h b/gcc/recog.h
index 86af35f721f..76349b63bbb 100644
--- a/gcc/recog.h
+++ b/gcc/recog.h
@@ -112,7 +112,6 @@ extern int push_operand PARAMS ((rtx, enum machine_mode));
extern int pop_operand PARAMS ((rtx, enum machine_mode));
extern int memory_operand PARAMS ((rtx, enum machine_mode));
extern int indirect_operand PARAMS ((rtx, enum machine_mode));
-extern int mode_independent_operand PARAMS ((rtx, enum machine_mode));
extern int comparison_operator PARAMS ((rtx, enum machine_mode));
extern int offsettable_memref_p PARAMS ((rtx));
@@ -241,7 +240,7 @@ struct insn_operand_data
struct insn_data
{
const char *const name;
- const PTR output;
+ const void *output;
const insn_gen_fn genfun;
const struct insn_operand_data *const operand;
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 5b3a359d606..ac7b6c3ea24 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -2671,7 +2671,7 @@ compensate_edge (e, file)
start_sequence ();
/* ??? change_stack needs some point to emit insns after. */
- after = emit_note (NULL, NOTE_INSN_DELETED);
+ after = emit_note (NOTE_INSN_DELETED);
tmpstack = regstack;
change_stack (after, &tmpstack, target_stack, EMIT_BEFORE);
diff --git a/gcc/regclass.c b/gcc/regclass.c
index 01c08f3a078..e587f71a40c 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -45,10 +45,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ggc.h"
#include "timevar.h"
-#ifndef REGISTER_MOVE_COST
-#define REGISTER_MOVE_COST(m, x, y) 2
-#endif
-
static void init_reg_sets_1 PARAMS ((void));
static void init_reg_modes PARAMS ((void));
static void init_reg_autoinc PARAMS ((void));
diff --git a/gcc/regs.h b/gcc/regs.h
index 2e838e32939..5a953850219 100644
--- a/gcc/regs.h
+++ b/gcc/regs.h
@@ -1,6 +1,6 @@
/* Define per-register tables for data flow info and register allocation.
Copyright (C) 1987, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -158,10 +158,6 @@ extern short *reg_renumber;
extern char regs_ever_live[FIRST_PSEUDO_REGISTER];
-/* Vector indexed by hardware reg giving its name. */
-
-extern const char * reg_names[FIRST_PSEUDO_REGISTER];
-
/* For each hard register, the widest mode object that it can contain.
This will be a MODE_INT mode if the register can hold integers. Otherwise
it will be a MODE_FLOAT or a MODE_CC mode, whichever is valid for the
diff --git a/gcc/reload.c b/gcc/reload.c
index 7ab823db605..9b1b148d860 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -105,10 +105,6 @@ a register with any other reload. */
#include "function.h"
#include "toplev.h"
-#ifndef REGISTER_MOVE_COST
-#define REGISTER_MOVE_COST(m, x, y) 2
-#endif
-
#ifndef REGNO_MODE_OK_FOR_BASE_P
#define REGNO_MODE_OK_FOR_BASE_P(REGNO, MODE) REGNO_OK_FOR_BASE_P (REGNO)
#endif
@@ -840,6 +836,56 @@ reload_inner_reg_of_subreg (x, mode, output)
!= (int) HARD_REGNO_NREGS (REGNO (inner), GET_MODE (inner))));
}
+/* Return nonzero if IN can be reloaded into REGNO with mode MODE without
+ requiring an extra reload register. The caller has already found that
+ IN contains some reference to REGNO, so check that we can produce the
+ new value in a single step. E.g. if we have
+ (set (reg r13) (plus (reg r13) (const int 1))), and there is an
+ instruction that adds one to a register, this should succeed.
+ However, if we have something like
+ (set (reg r13) (plus (reg r13) (const int 999))), and the constant 999
+ needs to be loaded into a register first, we need a separate reload
+ register.
+ Such PLUS reloads are generated by find_reload_address_part.
+ The out-of-range PLUS expressions are usually introduced in the instruction
+ patterns by register elimination and substituting pseudos without a home
+ by their function-invariant equivalences. */
+static int
+can_reload_into (rtx in, int regno, enum machine_mode mode)
+{
+ rtx dst, test_insn;
+ int r = 0;
+ struct recog_data save_recog_data;
+
+ /* For matching constraints, we often get notional input reloads where
+ we want to use the original register as the reload register. I.e.
+ technically this is a non-optional input-output reload, but IN is
+ already a valid register, and has been chosen as the reload register.
+ Speed this up, since it trivially works. */
+ if (GET_CODE (in) == REG)
+ return 1;
+
+ /* To test MEMs properly, we'd have to take into account all the reloads
+ that are already scheduled, which can become quite complicated.
+ And since we've already handled address reloads for this MEM, it
+ should always succeed anyway. */
+ if (GET_CODE (in) == MEM)
+ return 1;
+
+ /* If we can make a simple SET insn that does the job, everything should
+ be fine. */
+ dst = gen_rtx_REG (mode, regno);
+ test_insn = make_insn_raw (gen_rtx_SET (VOIDmode, dst, in));
+ save_recog_data = recog_data;
+ if (recog_memoized (test_insn) >= 0)
+ {
+ extract_insn (test_insn);
+ r = constrain_operands (1);
+ }
+ recog_data = save_recog_data;
+ return r;
+}
+
/* Record one reload that needs to be performed.
IN is an rtx saying where the data are to be found before this instruction.
OUT says where they must be stored after the instruction.
@@ -1532,7 +1578,11 @@ push_reload (in, out, inloc, outloc, class,
regno + offs))
break;
- if (offs == nregs)
+ if (offs == nregs
+ && (! (refers_to_regno_for_reload_p
+ (regno, (regno + HARD_REGNO_NREGS (regno, inmode)),
+ in, (rtx *)0))
+ || can_reload_into (in, regno, inmode)))
{
rld[i].reg_rtx = gen_rtx_REG (rel_mode, regno);
break;
diff --git a/gcc/reload.h b/gcc/reload.h
index 7fc4f49da40..b163339d9b4 100644
--- a/gcc/reload.h
+++ b/gcc/reload.h
@@ -338,9 +338,10 @@ extern int push_reload PARAMS ((rtx, rtx, rtx *, rtx *, enum reg_class,
enum machine_mode, enum machine_mode,
int, int, int, enum reload_type));
-/* Functions in reload1.c: */
-
+/* Functions in postreload.c: */
extern void reload_cse_regs PARAMS ((rtx));
+
+/* Functions in reload1.c: */
extern int reloads_conflict PARAMS ((int, int));
/* Initialize the reload pass once per compilation. */
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 12f6689eaf1..e1c470e12c7 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -39,7 +39,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "reload.h"
#include "recog.h"
#include "output.h"
-#include "cselib.h"
#include "real.h"
#include "toplev.h"
#include "except.h"
@@ -79,10 +78,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
fixing up each insn, and generating the new insns to copy values
into the reload registers. */
-#ifndef REGISTER_MOVE_COST
-#define REGISTER_MOVE_COST(m, x, y) 2
-#endif
-
#ifndef LOCAL_REGNO
#define LOCAL_REGNO(REGNO) 0
#endif
@@ -402,7 +397,7 @@ static void count_pseudo PARAMS ((int));
static void order_regs_for_reload PARAMS ((struct insn_chain *));
static void reload_as_needed PARAMS ((int));
static void forget_old_reloads_1 PARAMS ((rtx, rtx, void *));
-static int reload_reg_class_lower PARAMS ((const PTR, const PTR));
+static int reload_reg_class_lower PARAMS ((const void *, const void *));
static void mark_reload_reg_in_use PARAMS ((unsigned int, int,
enum reload_type,
enum machine_mode));
@@ -440,23 +435,10 @@ static void delete_output_reload PARAMS ((rtx, int, int));
static void delete_address_reloads PARAMS ((rtx, rtx));
static void delete_address_reloads_1 PARAMS ((rtx, rtx, rtx));
static rtx inc_for_reload PARAMS ((rtx, rtx, rtx, int));
-static void reload_cse_regs_1 PARAMS ((rtx));
-static int reload_cse_noop_set_p PARAMS ((rtx));
-static int reload_cse_simplify_set PARAMS ((rtx, rtx));
-static int reload_cse_simplify_operands PARAMS ((rtx, rtx));
-static void reload_combine PARAMS ((void));
-static void reload_combine_note_use PARAMS ((rtx *, rtx));
-static void reload_combine_note_store PARAMS ((rtx, rtx, void *));
-static void reload_cse_move2add PARAMS ((rtx));
-static void move2add_note_store PARAMS ((rtx, rtx, void *));
#ifdef AUTO_INC_DEC
static void add_auto_inc_notes PARAMS ((rtx, rtx));
#endif
static void copy_eh_notes PARAMS ((rtx, rtx));
-static void failed_reload PARAMS ((rtx, int));
-static int set_reload_reg PARAMS ((int, int));
-static void reload_cse_simplify PARAMS ((rtx, rtx));
-void fixup_abnormal_edges PARAMS ((void));
extern void dump_needs PARAMS ((struct insn_chain *));
/* Initialize the reload pass once per compilation. */
@@ -683,7 +665,7 @@ reload (first, global)
/* Make sure that the last insn in the chain
is not something that needs reloading. */
- emit_note (NULL, NOTE_INSN_DELETED);
+ emit_note (NOTE_INSN_DELETED);
/* Enable find_equiv_reg to distinguish insns made by reload. */
reload_first_uid = get_max_uid ();
@@ -1551,8 +1533,8 @@ calculate_needs_all_insns (global)
static int
reload_reg_class_lower (r1p, r2p)
- const PTR r1p;
- const PTR r2p;
+ const void *r1p;
+ const void *r2p;
{
int r1 = *(const short *) r1p, r2 = *(const short *) r2p;
int t;
@@ -8038,1467 +8020,6 @@ inc_for_reload (reloadreg, in, value, inc_amount)
return store;
}
-
-/* See whether a single set SET is a noop. */
-static int
-reload_cse_noop_set_p (set)
- rtx set;
-{
- if (cselib_reg_set_mode (SET_DEST (set)) != GET_MODE (SET_DEST (set)))
- return 0;
-
- return rtx_equal_for_cselib_p (SET_DEST (set), SET_SRC (set));
-}
-
-/* Try to simplify INSN. */
-static void
-reload_cse_simplify (insn, testreg)
- rtx insn;
- rtx testreg;
-{
- rtx body = PATTERN (insn);
-
- if (GET_CODE (body) == SET)
- {
- int count = 0;
-
- /* Simplify even if we may think it is a no-op.
- We may think a memory load of a value smaller than WORD_SIZE
- is redundant because we haven't taken into account possible
- implicit extension. reload_cse_simplify_set() will bring
- this out, so it's safer to simplify before we delete. */
- count += reload_cse_simplify_set (body, insn);
-
- if (!count && reload_cse_noop_set_p (body))
- {
- rtx value = SET_DEST (body);
- if (REG_P (value)
- && ! REG_FUNCTION_VALUE_P (value))
- value = 0;
- delete_insn_and_edges (insn);
- return;
- }
-
- if (count > 0)
- apply_change_group ();
- else
- reload_cse_simplify_operands (insn, testreg);
- }
- else if (GET_CODE (body) == PARALLEL)
- {
- int i;
- int count = 0;
- rtx value = NULL_RTX;
-
- /* If every action in a PARALLEL is a noop, we can delete
- the entire PARALLEL. */
- for (i = XVECLEN (body, 0) - 1; i >= 0; --i)
- {
- rtx part = XVECEXP (body, 0, i);
- if (GET_CODE (part) == SET)
- {
- if (! reload_cse_noop_set_p (part))
- break;
- if (REG_P (SET_DEST (part))
- && REG_FUNCTION_VALUE_P (SET_DEST (part)))
- {
- if (value)
- break;
- value = SET_DEST (part);
- }
- }
- else if (GET_CODE (part) != CLOBBER)
- break;
- }
-
- if (i < 0)
- {
- delete_insn_and_edges (insn);
- /* We're done with this insn. */
- return;
- }
-
- /* It's not a no-op, but we can try to simplify it. */
- for (i = XVECLEN (body, 0) - 1; i >= 0; --i)
- if (GET_CODE (XVECEXP (body, 0, i)) == SET)
- count += reload_cse_simplify_set (XVECEXP (body, 0, i), insn);
-
- if (count > 0)
- apply_change_group ();
- else
- reload_cse_simplify_operands (insn, testreg);
- }
-}
-
-/* Do a very simple CSE pass over the hard registers.
-
- This function detects no-op moves where we happened to assign two
- different pseudo-registers to the same hard register, and then
- copied one to the other. Reload will generate a useless
- instruction copying a register to itself.
-
- This function also detects cases where we load a value from memory
- into two different registers, and (if memory is more expensive than
- registers) changes it to simply copy the first register into the
- second register.
-
- Another optimization is performed that scans the operands of each
- instruction to see whether the value is already available in a
- hard register. It then replaces the operand with the hard register
- if possible, much like an optional reload would. */
-
-static void
-reload_cse_regs_1 (first)
- rtx first;
-{
- rtx insn;
- rtx testreg = gen_rtx_REG (VOIDmode, -1);
-
- cselib_init ();
- init_alias_analysis ();
-
- for (insn = first; insn; insn = NEXT_INSN (insn))
- {
- if (INSN_P (insn))
- reload_cse_simplify (insn, testreg);
-
- cselib_process_insn (insn);
- }
-
- /* Clean up. */
- end_alias_analysis ();
- cselib_finish ();
-}
-
-/* Call cse / combine like post-reload optimization phases.
- FIRST is the first instruction. */
-void
-reload_cse_regs (first)
- rtx first;
-{
- reload_cse_regs_1 (first);
- reload_combine ();
- reload_cse_move2add (first);
- if (flag_expensive_optimizations)
- reload_cse_regs_1 (first);
-}
-
-/* Try to simplify a single SET instruction. SET is the set pattern.
- INSN is the instruction it came from.
- This function only handles one case: if we set a register to a value
- which is not a register, we try to find that value in some other register
- and change the set into a register copy. */
-
-static int
-reload_cse_simplify_set (set, insn)
- rtx set;
- rtx insn;
-{
- int did_change = 0;
- int dreg;
- rtx src;
- enum reg_class dclass;
- int old_cost;
- cselib_val *val;
- struct elt_loc_list *l;
-#ifdef LOAD_EXTEND_OP
- enum rtx_code extend_op = NIL;
-#endif
-
- dreg = true_regnum (SET_DEST (set));
- if (dreg < 0)
- return 0;
-
- src = SET_SRC (set);
- if (side_effects_p (src) || true_regnum (src) >= 0)
- return 0;
-
- dclass = REGNO_REG_CLASS (dreg);
-
-#ifdef LOAD_EXTEND_OP
- /* When replacing a memory with a register, we need to honor assumptions
- that combine made wrt the contents of sign bits. We'll do this by
- generating an extend instruction instead of a reg->reg copy. Thus
- the destination must be a register that we can widen. */
- if (GET_CODE (src) == MEM
- && GET_MODE_BITSIZE (GET_MODE (src)) < BITS_PER_WORD
- && (extend_op = LOAD_EXTEND_OP (GET_MODE (src))) != NIL
- && GET_CODE (SET_DEST (set)) != REG)
- return 0;
-#endif
-
- /* If memory loads are cheaper than register copies, don't change them. */
- if (GET_CODE (src) == MEM)
- old_cost = MEMORY_MOVE_COST (GET_MODE (src), dclass, 1);
- else if (CONSTANT_P (src))
- old_cost = rtx_cost (src, SET);
- else if (GET_CODE (src) == REG)
- old_cost = REGISTER_MOVE_COST (GET_MODE (src),
- REGNO_REG_CLASS (REGNO (src)), dclass);
- else
- /* ??? */
- old_cost = rtx_cost (src, SET);
-
- val = cselib_lookup (src, GET_MODE (SET_DEST (set)), 0);
- if (! val)
- return 0;
- for (l = val->locs; l; l = l->next)
- {
- rtx this_rtx = l->loc;
- int this_cost;
-
- if (CONSTANT_P (this_rtx) && ! references_value_p (this_rtx, 0))
- {
-#ifdef LOAD_EXTEND_OP
- if (extend_op != NIL)
- {
- HOST_WIDE_INT this_val;
-
- /* ??? I'm lazy and don't wish to handle CONST_DOUBLE. Other
- constants, such as SYMBOL_REF, cannot be extended. */
- if (GET_CODE (this_rtx) != CONST_INT)
- continue;
-
- this_val = INTVAL (this_rtx);
- switch (extend_op)
- {
- case ZERO_EXTEND:
- this_val &= GET_MODE_MASK (GET_MODE (src));
- break;
- case SIGN_EXTEND:
- /* ??? In theory we're already extended. */
- if (this_val == trunc_int_for_mode (this_val, GET_MODE (src)))
- break;
- default:
- abort ();
- }
- this_rtx = GEN_INT (this_val);
- }
-#endif
- this_cost = rtx_cost (this_rtx, SET);
- }
- else if (GET_CODE (this_rtx) == REG)
- {
-#ifdef LOAD_EXTEND_OP
- if (extend_op != NIL)
- {
- this_rtx = gen_rtx_fmt_e (extend_op, word_mode, this_rtx);
- this_cost = rtx_cost (this_rtx, SET);
- }
- else
-#endif
- this_cost = REGISTER_MOVE_COST (GET_MODE (this_rtx),
- REGNO_REG_CLASS (REGNO (this_rtx)),
- dclass);
- }
- else
- continue;
-
- /* If equal costs, prefer registers over anything else. That
- tends to lead to smaller instructions on some machines. */
- if (this_cost < old_cost
- || (this_cost == old_cost
- && GET_CODE (this_rtx) == REG
- && GET_CODE (SET_SRC (set)) != REG))
- {
-#ifdef LOAD_EXTEND_OP
- if (GET_MODE_BITSIZE (GET_MODE (SET_DEST (set))) < BITS_PER_WORD
- && extend_op != NIL
-#ifdef CANNOT_CHANGE_MODE_CLASS
- && !CANNOT_CHANGE_MODE_CLASS (GET_MODE (SET_DEST (set)),
- word_mode,
- REGNO_REG_CLASS (REGNO (SET_DEST (set))))
-#endif
- )
- {
- rtx wide_dest = gen_rtx_REG (word_mode, REGNO (SET_DEST (set)));
- ORIGINAL_REGNO (wide_dest) = ORIGINAL_REGNO (SET_DEST (set));
- validate_change (insn, &SET_DEST (set), wide_dest, 1);
- }
-#endif
-
- validate_change (insn, &SET_SRC (set), copy_rtx (this_rtx), 1);
- old_cost = this_cost, did_change = 1;
- }
- }
-
- return did_change;
-}
-
-/* Try to replace operands in INSN with equivalent values that are already
- in registers. This can be viewed as optional reloading.
-
- For each non-register operand in the insn, see if any hard regs are
- known to be equivalent to that operand. Record the alternatives which
- can accept these hard registers. Among all alternatives, select the
- ones which are better or equal to the one currently matching, where
- "better" is in terms of '?' and '!' constraints. Among the remaining
- alternatives, select the one which replaces most operands with
- hard registers. */
-
-static int
-reload_cse_simplify_operands (insn, testreg)
- rtx insn;
- rtx testreg;
-{
- int i, j;
-
- /* For each operand, all registers that are equivalent to it. */
- HARD_REG_SET equiv_regs[MAX_RECOG_OPERANDS];
-
- const char *constraints[MAX_RECOG_OPERANDS];
-
- /* Vector recording how bad an alternative is. */
- int *alternative_reject;
- /* Vector recording how many registers can be introduced by choosing
- this alternative. */
- int *alternative_nregs;
- /* Array of vectors recording, for each operand and each alternative,
- which hard register to substitute, or -1 if the operand should be
- left as it is. */
- int *op_alt_regno[MAX_RECOG_OPERANDS];
- /* Array of alternatives, sorted in order of decreasing desirability. */
- int *alternative_order;
-
- extract_insn (insn);
-
- if (recog_data.n_alternatives == 0 || recog_data.n_operands == 0)
- return 0;
-
- /* Figure out which alternative currently matches. */
- if (! constrain_operands (1))
- fatal_insn_not_found (insn);
-
- alternative_reject = (int *) alloca (recog_data.n_alternatives * sizeof (int));
- alternative_nregs = (int *) alloca (recog_data.n_alternatives * sizeof (int));
- alternative_order = (int *) alloca (recog_data.n_alternatives * sizeof (int));
- memset ((char *) alternative_reject, 0, recog_data.n_alternatives * sizeof (int));
- memset ((char *) alternative_nregs, 0, recog_data.n_alternatives * sizeof (int));
-
- /* For each operand, find out which regs are equivalent. */
- for (i = 0; i < recog_data.n_operands; i++)
- {
- cselib_val *v;
- struct elt_loc_list *l;
-
- CLEAR_HARD_REG_SET (equiv_regs[i]);
-
- /* cselib blows up on CODE_LABELs. Trying to fix that doesn't seem
- right, so avoid the problem here. Likewise if we have a constant
- and the insn pattern doesn't tell us the mode we need. */
- if (GET_CODE (recog_data.operand[i]) == CODE_LABEL
- || (CONSTANT_P (recog_data.operand[i])
- && recog_data.operand_mode[i] == VOIDmode))
- continue;
-
- v = cselib_lookup (recog_data.operand[i], recog_data.operand_mode[i], 0);
- if (! v)
- continue;
-
- for (l = v->locs; l; l = l->next)
- if (GET_CODE (l->loc) == REG)
- SET_HARD_REG_BIT (equiv_regs[i], REGNO (l->loc));
- }
-
- for (i = 0; i < recog_data.n_operands; i++)
- {
- enum machine_mode mode;
- int regno;
- const char *p;
-
- op_alt_regno[i] = (int *) alloca (recog_data.n_alternatives * sizeof (int));
- for (j = 0; j < recog_data.n_alternatives; j++)
- op_alt_regno[i][j] = -1;
-
- p = constraints[i] = recog_data.constraints[i];
- mode = recog_data.operand_mode[i];
-
- /* Add the reject values for each alternative given by the constraints
- for this operand. */
- j = 0;
- while (*p != '\0')
- {
- char c = *p++;
- if (c == ',')
- j++;
- else if (c == '?')
- alternative_reject[j] += 3;
- else if (c == '!')
- alternative_reject[j] += 300;
- }
-
- /* We won't change operands which are already registers. We
- also don't want to modify output operands. */
- regno = true_regnum (recog_data.operand[i]);
- if (regno >= 0
- || constraints[i][0] == '='
- || constraints[i][0] == '+')
- continue;
-
- for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
- {
- int class = (int) NO_REGS;
-
- if (! TEST_HARD_REG_BIT (equiv_regs[i], regno))
- continue;
-
- REGNO (testreg) = regno;
- PUT_MODE (testreg, mode);
-
- /* We found a register equal to this operand. Now look for all
- alternatives that can accept this register and have not been
- assigned a register they can use yet. */
- j = 0;
- p = constraints[i];
- for (;;)
- {
- char c = *p;
-
- switch (c)
- {
- case '=': case '+': case '?':
- 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':
- case 'I': case 'J': case 'K': case 'L':
- case 'M': case 'N': case 'O': case 'P':
- case 'p': case 'X':
- /* These don't say anything we care about. */
- break;
-
- case 'g': case 'r':
- class = reg_class_subunion[(int) class][(int) GENERAL_REGS];
- break;
-
- default:
- class
- = (reg_class_subunion
- [(int) class]
- [(int) REG_CLASS_FROM_CONSTRAINT ((unsigned char) c, p)]);
- break;
-
- case ',': case '\0':
- /* See if REGNO fits this alternative, and set it up as the
- replacement register if we don't have one for this
- alternative yet and the operand being replaced is not
- a cheap CONST_INT. */
- if (op_alt_regno[i][j] == -1
- && reg_fits_class_p (testreg, class, 0, mode)
- && (GET_CODE (recog_data.operand[i]) != CONST_INT
- || (rtx_cost (recog_data.operand[i], SET)
- > rtx_cost (testreg, SET))))
- {
- alternative_nregs[j]++;
- op_alt_regno[i][j] = regno;
- }
- j++;
- break;
- }
- p += CONSTRAINT_LEN (c, p);
-
- if (c == '\0')
- break;
- }
- }
- }
-
- /* Record all alternatives which are better or equal to the currently
- matching one in the alternative_order array. */
- for (i = j = 0; i < recog_data.n_alternatives; i++)
- if (alternative_reject[i] <= alternative_reject[which_alternative])
- alternative_order[j++] = i;
- recog_data.n_alternatives = j;
-
- /* Sort it. Given a small number of alternatives, a dumb algorithm
- won't hurt too much. */
- for (i = 0; i < recog_data.n_alternatives - 1; i++)
- {
- int best = i;
- int best_reject = alternative_reject[alternative_order[i]];
- int best_nregs = alternative_nregs[alternative_order[i]];
- int tmp;
-
- for (j = i + 1; j < recog_data.n_alternatives; j++)
- {
- int this_reject = alternative_reject[alternative_order[j]];
- int this_nregs = alternative_nregs[alternative_order[j]];
-
- if (this_reject < best_reject
- || (this_reject == best_reject && this_nregs < best_nregs))
- {
- best = j;
- best_reject = this_reject;
- best_nregs = this_nregs;
- }
- }
-
- tmp = alternative_order[best];
- alternative_order[best] = alternative_order[i];
- alternative_order[i] = tmp;
- }
-
- /* Substitute the operands as determined by op_alt_regno for the best
- alternative. */
- j = alternative_order[0];
-
- for (i = 0; i < recog_data.n_operands; i++)
- {
- enum machine_mode mode = recog_data.operand_mode[i];
- if (op_alt_regno[i][j] == -1)
- continue;
-
- validate_change (insn, recog_data.operand_loc[i],
- gen_rtx_REG (mode, op_alt_regno[i][j]), 1);
- }
-
- for (i = recog_data.n_dups - 1; i >= 0; i--)
- {
- int op = recog_data.dup_num[i];
- enum machine_mode mode = recog_data.operand_mode[op];
-
- if (op_alt_regno[op][j] == -1)
- continue;
-
- validate_change (insn, recog_data.dup_loc[i],
- gen_rtx_REG (mode, op_alt_regno[op][j]), 1);
- }
-
- return apply_change_group ();
-}
-
-/* If reload couldn't use reg+reg+offset addressing, try to use reg+reg
- addressing now.
- This code might also be useful when reload gave up on reg+reg addressing
- because of clashes between the return register and INDEX_REG_CLASS. */
-
-/* The maximum number of uses of a register we can keep track of to
- replace them with reg+reg addressing. */
-#define RELOAD_COMBINE_MAX_USES 6
-
-/* INSN is the insn where a register has ben used, and USEP points to the
- location of the register within the rtl. */
-struct reg_use { rtx insn, *usep; };
-
-/* If the register is used in some unknown fashion, USE_INDEX is negative.
- If it is dead, USE_INDEX is RELOAD_COMBINE_MAX_USES, and STORE_RUID
- indicates where it becomes live again.
- Otherwise, USE_INDEX is the index of the last encountered use of the
- register (which is first among these we have seen since we scan backwards),
- OFFSET contains the constant offset that is added to the register in
- all encountered uses, and USE_RUID indicates the first encountered, i.e.
- last, of these uses.
- STORE_RUID is always meaningful if we only want to use a value in a
- register in a different place: it denotes the next insn in the insn
- stream (i.e. the last encountered) that sets or clobbers the register. */
-static struct
- {
- struct reg_use reg_use[RELOAD_COMBINE_MAX_USES];
- int use_index;
- rtx offset;
- int store_ruid;
- int use_ruid;
- } reg_state[FIRST_PSEUDO_REGISTER];
-
-/* Reverse linear uid. This is increased in reload_combine while scanning
- the instructions from last to first. It is used to set last_label_ruid
- and the store_ruid / use_ruid fields in reg_state. */
-static int reload_combine_ruid;
-
-#define LABEL_LIVE(LABEL) \
- (label_live[CODE_LABEL_NUMBER (LABEL) - min_labelno])
-
-static void
-reload_combine ()
-{
- rtx insn, set;
- int first_index_reg = -1;
- int last_index_reg = 0;
- int i;
- basic_block bb;
- unsigned int r;
- int last_label_ruid;
- int min_labelno, n_labels;
- HARD_REG_SET ever_live_at_start, *label_live;
-
- /* If reg+reg can be used in offsetable memory addresses, the main chunk of
- reload has already used it where appropriate, so there is no use in
- trying to generate it now. */
- if (double_reg_address_ok && INDEX_REG_CLASS != NO_REGS)
- return;
-
- /* To avoid wasting too much time later searching for an index register,
- determine the minimum and maximum index register numbers. */
- for (r = 0; r < FIRST_PSEUDO_REGISTER; r++)
- if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS], r))
- {
- if (first_index_reg == -1)
- first_index_reg = r;
-
- last_index_reg = r;
- }
-
- /* If no index register is available, we can quit now. */
- if (first_index_reg == -1)
- return;
-
- /* Set up LABEL_LIVE and EVER_LIVE_AT_START. The register lifetime
- information is a bit fuzzy immediately after reload, but it's
- still good enough to determine which registers are live at a jump
- destination. */
- min_labelno = get_first_label_num ();
- n_labels = max_label_num () - min_labelno;
- label_live = (HARD_REG_SET *) xmalloc (n_labels * sizeof (HARD_REG_SET));
- CLEAR_HARD_REG_SET (ever_live_at_start);
-
- FOR_EACH_BB_REVERSE (bb)
- {
- insn = bb->head;
- if (GET_CODE (insn) == CODE_LABEL)
- {
- HARD_REG_SET live;
-
- REG_SET_TO_HARD_REG_SET (live,
- bb->global_live_at_start);
- compute_use_by_pseudos (&live,
- bb->global_live_at_start);
- COPY_HARD_REG_SET (LABEL_LIVE (insn), live);
- IOR_HARD_REG_SET (ever_live_at_start, live);
- }
- }
-
- /* Initialize last_label_ruid, reload_combine_ruid and reg_state. */
- last_label_ruid = reload_combine_ruid = 0;
- for (r = 0; r < FIRST_PSEUDO_REGISTER; r++)
- {
- reg_state[r].store_ruid = reload_combine_ruid;
- if (fixed_regs[r])
- reg_state[r].use_index = -1;
- else
- reg_state[r].use_index = RELOAD_COMBINE_MAX_USES;
- }
-
- for (insn = get_last_insn (); insn; insn = PREV_INSN (insn))
- {
- rtx note;
-
- /* We cannot do our optimization across labels. Invalidating all the use
- information we have would be costly, so we just note where the label
- is and then later disable any optimization that would cross it. */
- if (GET_CODE (insn) == CODE_LABEL)
- last_label_ruid = reload_combine_ruid;
- else if (GET_CODE (insn) == BARRIER)
- for (r = 0; r < FIRST_PSEUDO_REGISTER; r++)
- if (! fixed_regs[r])
- reg_state[r].use_index = RELOAD_COMBINE_MAX_USES;
-
- if (! INSN_P (insn))
- continue;
-
- reload_combine_ruid++;
-
- /* Look for (set (REGX) (CONST_INT))
- (set (REGX) (PLUS (REGX) (REGY)))
- ...
- ... (MEM (REGX)) ...
- and convert it to
- (set (REGZ) (CONST_INT))
- ...
- ... (MEM (PLUS (REGZ) (REGY)))... .
-
- First, check that we have (set (REGX) (PLUS (REGX) (REGY)))
- and that we know all uses of REGX before it dies. */
- set = single_set (insn);
- if (set != NULL_RTX
- && GET_CODE (SET_DEST (set)) == REG
- && (HARD_REGNO_NREGS (REGNO (SET_DEST (set)),
- GET_MODE (SET_DEST (set)))
- == 1)
- && GET_CODE (SET_SRC (set)) == PLUS
- && GET_CODE (XEXP (SET_SRC (set), 1)) == REG
- && rtx_equal_p (XEXP (SET_SRC (set), 0), SET_DEST (set))
- && last_label_ruid < reg_state[REGNO (SET_DEST (set))].use_ruid)
- {
- rtx reg = SET_DEST (set);
- rtx plus = SET_SRC (set);
- rtx base = XEXP (plus, 1);
- rtx prev = prev_nonnote_insn (insn);
- rtx prev_set = prev ? single_set (prev) : NULL_RTX;
- unsigned int regno = REGNO (reg);
- rtx const_reg = NULL_RTX;
- rtx reg_sum = NULL_RTX;
-
- /* Now, we need an index register.
- We'll set index_reg to this index register, const_reg to the
- register that is to be loaded with the constant
- (denoted as REGZ in the substitution illustration above),
- and reg_sum to the register-register that we want to use to
- substitute uses of REG (typically in MEMs) with.
- First check REG and BASE for being index registers;
- we can use them even if they are not dead. */
- if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS], regno)
- || TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS],
- REGNO (base)))
- {
- const_reg = reg;
- reg_sum = plus;
- }
- else
- {
- /* Otherwise, look for a free index register. Since we have
- checked above that neiter REG nor BASE are index registers,
- if we find anything at all, it will be different from these
- two registers. */
- for (i = first_index_reg; i <= last_index_reg; i++)
- {
- if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS],
- i)
- && reg_state[i].use_index == RELOAD_COMBINE_MAX_USES
- && reg_state[i].store_ruid <= reg_state[regno].use_ruid
- && HARD_REGNO_NREGS (i, GET_MODE (reg)) == 1)
- {
- rtx index_reg = gen_rtx_REG (GET_MODE (reg), i);
-
- const_reg = index_reg;
- reg_sum = gen_rtx_PLUS (GET_MODE (reg), index_reg, base);
- break;
- }
- }
- }
-
- /* Check that PREV_SET is indeed (set (REGX) (CONST_INT)) and that
- (REGY), i.e. BASE, is not clobbered before the last use we'll
- create. */
- if (prev_set != 0
- && GET_CODE (SET_SRC (prev_set)) == CONST_INT
- && rtx_equal_p (SET_DEST (prev_set), reg)
- && reg_state[regno].use_index >= 0
- && (reg_state[REGNO (base)].store_ruid
- <= reg_state[regno].use_ruid)
- && reg_sum != 0)
- {
- int i;
-
- /* Change destination register and, if necessary, the
- constant value in PREV, the constant loading instruction. */
- validate_change (prev, &SET_DEST (prev_set), const_reg, 1);
- if (reg_state[regno].offset != const0_rtx)
- validate_change (prev,
- &SET_SRC (prev_set),
- GEN_INT (INTVAL (SET_SRC (prev_set))
- + INTVAL (reg_state[regno].offset)),
- 1);
-
- /* Now for every use of REG that we have recorded, replace REG
- with REG_SUM. */
- for (i = reg_state[regno].use_index;
- i < RELOAD_COMBINE_MAX_USES; i++)
- validate_change (reg_state[regno].reg_use[i].insn,
- reg_state[regno].reg_use[i].usep,
- /* Each change must have its own
- replacement. */
- copy_rtx (reg_sum), 1);
-
- if (apply_change_group ())
- {
- rtx *np;
-
- /* Delete the reg-reg addition. */
- delete_insn (insn);
-
- if (reg_state[regno].offset != const0_rtx)
- /* Previous REG_EQUIV / REG_EQUAL notes for PREV
- are now invalid. */
- for (np = &REG_NOTES (prev); *np;)
- {
- if (REG_NOTE_KIND (*np) == REG_EQUAL
- || REG_NOTE_KIND (*np) == REG_EQUIV)
- *np = XEXP (*np, 1);
- else
- np = &XEXP (*np, 1);
- }
-
- reg_state[regno].use_index = RELOAD_COMBINE_MAX_USES;
- reg_state[REGNO (const_reg)].store_ruid
- = reload_combine_ruid;
- continue;
- }
- }
- }
-
- note_stores (PATTERN (insn), reload_combine_note_store, NULL);
-
- if (GET_CODE (insn) == CALL_INSN)
- {
- rtx link;
-
- for (r = 0; r < FIRST_PSEUDO_REGISTER; r++)
- if (call_used_regs[r])
- {
- reg_state[r].use_index = RELOAD_COMBINE_MAX_USES;
- reg_state[r].store_ruid = reload_combine_ruid;
- }
-
- for (link = CALL_INSN_FUNCTION_USAGE (insn); link;
- link = XEXP (link, 1))
- {
- rtx usage_rtx = XEXP (XEXP (link, 0), 0);
- if (GET_CODE (usage_rtx) == REG)
- {
- unsigned int i;
- unsigned int start_reg = REGNO (usage_rtx);
- unsigned int num_regs =
- HARD_REGNO_NREGS (start_reg, GET_MODE (usage_rtx));
- unsigned int end_reg = start_reg + num_regs - 1;
- for (i = start_reg; i <= end_reg; i++)
- if (GET_CODE (XEXP (link, 0)) == CLOBBER)
- {
- reg_state[i].use_index = RELOAD_COMBINE_MAX_USES;
- reg_state[i].store_ruid = reload_combine_ruid;
- }
- else
- reg_state[i].use_index = -1;
- }
- }
-
- }
- else if (GET_CODE (insn) == JUMP_INSN
- && GET_CODE (PATTERN (insn)) != RETURN)
- {
- /* Non-spill registers might be used at the call destination in
- some unknown fashion, so we have to mark the unknown use. */
- HARD_REG_SET *live;
-
- if ((condjump_p (insn) || condjump_in_parallel_p (insn))
- && JUMP_LABEL (insn))
- live = &LABEL_LIVE (JUMP_LABEL (insn));
- else
- live = &ever_live_at_start;
-
- for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; --i)
- if (TEST_HARD_REG_BIT (*live, i))
- reg_state[i].use_index = -1;
- }
-
- reload_combine_note_use (&PATTERN (insn), insn);
- for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
- {
- if (REG_NOTE_KIND (note) == REG_INC
- && GET_CODE (XEXP (note, 0)) == REG)
- {
- int regno = REGNO (XEXP (note, 0));
-
- reg_state[regno].store_ruid = reload_combine_ruid;
- reg_state[regno].use_index = -1;
- }
- }
- }
-
- free (label_live);
-}
-
-/* Check if DST is a register or a subreg of a register; if it is,
- update reg_state[regno].store_ruid and reg_state[regno].use_index
- accordingly. Called via note_stores from reload_combine. */
-
-static void
-reload_combine_note_store (dst, set, data)
- rtx dst, set;
- void *data ATTRIBUTE_UNUSED;
-{
- int regno = 0;
- int i;
- enum machine_mode mode = GET_MODE (dst);
-
- if (GET_CODE (dst) == SUBREG)
- {
- regno = subreg_regno_offset (REGNO (SUBREG_REG (dst)),
- GET_MODE (SUBREG_REG (dst)),
- SUBREG_BYTE (dst),
- GET_MODE (dst));
- dst = SUBREG_REG (dst);
- }
- if (GET_CODE (dst) != REG)
- return;
- regno += REGNO (dst);
-
- /* note_stores might have stripped a STRICT_LOW_PART, so we have to be
- careful with registers / register parts that are not full words.
-
- Similarly for ZERO_EXTRACT and SIGN_EXTRACT. */
- if (GET_CODE (set) != SET
- || GET_CODE (SET_DEST (set)) == ZERO_EXTRACT
- || GET_CODE (SET_DEST (set)) == SIGN_EXTRACT
- || GET_CODE (SET_DEST (set)) == STRICT_LOW_PART)
- {
- for (i = HARD_REGNO_NREGS (regno, mode) - 1 + regno; i >= regno; i--)
- {
- reg_state[i].use_index = -1;
- reg_state[i].store_ruid = reload_combine_ruid;
- }
- }
- else
- {
- for (i = HARD_REGNO_NREGS (regno, mode) - 1 + regno; i >= regno; i--)
- {
- reg_state[i].store_ruid = reload_combine_ruid;
- reg_state[i].use_index = RELOAD_COMBINE_MAX_USES;
- }
- }
-}
-
-/* XP points to a piece of rtl that has to be checked for any uses of
- registers.
- *XP is the pattern of INSN, or a part of it.
- Called from reload_combine, and recursively by itself. */
-static void
-reload_combine_note_use (xp, insn)
- rtx *xp, insn;
-{
- rtx x = *xp;
- enum rtx_code code = x->code;
- const char *fmt;
- int i, j;
- rtx offset = const0_rtx; /* For the REG case below. */
-
- switch (code)
- {
- case SET:
- if (GET_CODE (SET_DEST (x)) == REG)
- {
- reload_combine_note_use (&SET_SRC (x), insn);
- return;
- }
- break;
-
- case USE:
- /* If this is the USE of a return value, we can't change it. */
- if (GET_CODE (XEXP (x, 0)) == REG && REG_FUNCTION_VALUE_P (XEXP (x, 0)))
- {
- /* Mark the return register as used in an unknown fashion. */
- rtx reg = XEXP (x, 0);
- int regno = REGNO (reg);
- int nregs = HARD_REGNO_NREGS (regno, GET_MODE (reg));
-
- while (--nregs >= 0)
- reg_state[regno + nregs].use_index = -1;
- return;
- }
- break;
-
- case CLOBBER:
- if (GET_CODE (SET_DEST (x)) == REG)
- {
- /* No spurious CLOBBERs of pseudo registers may remain. */
- if (REGNO (SET_DEST (x)) >= FIRST_PSEUDO_REGISTER)
- abort ();
- return;
- }
- break;
-
- case PLUS:
- /* We are interested in (plus (reg) (const_int)) . */
- if (GET_CODE (XEXP (x, 0)) != REG
- || GET_CODE (XEXP (x, 1)) != CONST_INT)
- break;
- offset = XEXP (x, 1);
- x = XEXP (x, 0);
- /* Fall through. */
- case REG:
- {
- int regno = REGNO (x);
- int use_index;
- int nregs;
-
- /* No spurious USEs of pseudo registers may remain. */
- if (regno >= FIRST_PSEUDO_REGISTER)
- abort ();
-
- nregs = HARD_REGNO_NREGS (regno, GET_MODE (x));
-
- /* We can't substitute into multi-hard-reg uses. */
- if (nregs > 1)
- {
- while (--nregs >= 0)
- reg_state[regno + nregs].use_index = -1;
- return;
- }
-
- /* If this register is already used in some unknown fashion, we
- can't do anything.
- If we decrement the index from zero to -1, we can't store more
- uses, so this register becomes used in an unknown fashion. */
- use_index = --reg_state[regno].use_index;
- if (use_index < 0)
- return;
-
- if (use_index != RELOAD_COMBINE_MAX_USES - 1)
- {
- /* We have found another use for a register that is already
- used later. Check if the offsets match; if not, mark the
- register as used in an unknown fashion. */
- if (! rtx_equal_p (offset, reg_state[regno].offset))
- {
- reg_state[regno].use_index = -1;
- return;
- }
- }
- else
- {
- /* This is the first use of this register we have seen since we
- marked it as dead. */
- reg_state[regno].offset = offset;
- reg_state[regno].use_ruid = reload_combine_ruid;
- }
- reg_state[regno].reg_use[use_index].insn = insn;
- reg_state[regno].reg_use[use_index].usep = xp;
- return;
- }
-
- default:
- break;
- }
-
- /* Recursively process the components of X. */
- fmt = GET_RTX_FORMAT (code);
- for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
- {
- if (fmt[i] == 'e')
- reload_combine_note_use (&XEXP (x, i), insn);
- else if (fmt[i] == 'E')
- {
- for (j = XVECLEN (x, i) - 1; j >= 0; j--)
- reload_combine_note_use (&XVECEXP (x, i, j), insn);
- }
- }
-}
-
-/* See if we can reduce the cost of a constant by replacing a move
- with an add. We track situations in which a register is set to a
- constant or to a register plus a constant. */
-/* We cannot do our optimization across labels. Invalidating all the
- information about register contents we have would be costly, so we
- use move2add_last_label_luid to note where the label is and then
- later disable any optimization that would cross it.
- reg_offset[n] / reg_base_reg[n] / reg_mode[n] are only valid if
- reg_set_luid[n] is greater than move2add_last_label_luid. */
-static int reg_set_luid[FIRST_PSEUDO_REGISTER];
-
-/* If reg_base_reg[n] is negative, register n has been set to
- reg_offset[n] in mode reg_mode[n] .
- If reg_base_reg[n] is non-negative, register n has been set to the
- sum of reg_offset[n] and the value of register reg_base_reg[n]
- before reg_set_luid[n], calculated in mode reg_mode[n] . */
-static HOST_WIDE_INT reg_offset[FIRST_PSEUDO_REGISTER];
-static int reg_base_reg[FIRST_PSEUDO_REGISTER];
-static enum machine_mode reg_mode[FIRST_PSEUDO_REGISTER];
-
-/* move2add_luid is linearly increased while scanning the instructions
- from first to last. It is used to set reg_set_luid in
- reload_cse_move2add and move2add_note_store. */
-static int move2add_luid;
-
-/* move2add_last_label_luid is set whenever a label is found. Labels
- invalidate all previously collected reg_offset data. */
-static int move2add_last_label_luid;
-
-/* ??? We don't know how zero / sign extension is handled, hence we
- can't go from a narrower to a wider mode. */
-#define MODES_OK_FOR_MOVE2ADD(OUTMODE, INMODE) \
- (GET_MODE_SIZE (OUTMODE) == GET_MODE_SIZE (INMODE) \
- || (GET_MODE_SIZE (OUTMODE) <= GET_MODE_SIZE (INMODE) \
- && TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (OUTMODE), \
- GET_MODE_BITSIZE (INMODE))))
-
-static void
-reload_cse_move2add (first)
- rtx first;
-{
- int i;
- rtx insn;
-
- for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--)
- reg_set_luid[i] = 0;
-
- move2add_last_label_luid = 0;
- move2add_luid = 2;
- for (insn = first; insn; insn = NEXT_INSN (insn), move2add_luid++)
- {
- rtx pat, note;
-
- if (GET_CODE (insn) == CODE_LABEL)
- {
- move2add_last_label_luid = move2add_luid;
- /* We're going to increment move2add_luid twice after a
- label, so that we can use move2add_last_label_luid + 1 as
- the luid for constants. */
- move2add_luid++;
- continue;
- }
- if (! INSN_P (insn))
- continue;
- pat = PATTERN (insn);
- /* For simplicity, we only perform this optimization on
- straightforward SETs. */
- if (GET_CODE (pat) == SET
- && GET_CODE (SET_DEST (pat)) == REG)
- {
- rtx reg = SET_DEST (pat);
- int regno = REGNO (reg);
- rtx src = SET_SRC (pat);
-
- /* Check if we have valid information on the contents of this
- register in the mode of REG. */
- if (reg_set_luid[regno] > move2add_last_label_luid
- && MODES_OK_FOR_MOVE2ADD (GET_MODE (reg), reg_mode[regno]))
- {
- /* Try to transform (set (REGX) (CONST_INT A))
- ...
- (set (REGX) (CONST_INT B))
- to
- (set (REGX) (CONST_INT A))
- ...
- (set (REGX) (plus (REGX) (CONST_INT B-A)))
- or
- (set (REGX) (CONST_INT A))
- ...
- (set (STRICT_LOW_PART (REGX)) (CONST_INT B))
- */
-
- if (GET_CODE (src) == CONST_INT && reg_base_reg[regno] < 0)
- {
- rtx new_src =
- GEN_INT (trunc_int_for_mode (INTVAL (src)
- - reg_offset[regno],
- GET_MODE (reg)));
- /* (set (reg) (plus (reg) (const_int 0))) is not canonical;
- use (set (reg) (reg)) instead.
- We don't delete this insn, nor do we convert it into a
- note, to avoid losing register notes or the return
- value flag. jump2 already knows how to get rid of
- no-op moves. */
- if (new_src == const0_rtx)
- {
- /* If the constants are different, this is a
- truncation, that, if turned into (set (reg)
- (reg)), would be discarded. Maybe we should
- try a truncMN pattern? */
- if (INTVAL (src) == reg_offset [regno])
- validate_change (insn, &SET_SRC (pat), reg, 0);
- }
- else if (rtx_cost (new_src, PLUS) < rtx_cost (src, SET)
- && have_add2_insn (reg, new_src))
- {
- rtx newpat = gen_add2_insn (reg, new_src);
- if (INSN_P (newpat) && NEXT_INSN (newpat) == NULL_RTX)
- newpat = PATTERN (newpat);
- /* If it was the first insn of a sequence or
- some other emitted insn, validate_change will
- reject it. */
- validate_change (insn, &PATTERN (insn),
- newpat, 0);
- }
- else
- {
- enum machine_mode narrow_mode;
- for (narrow_mode = GET_CLASS_NARROWEST_MODE (MODE_INT);
- narrow_mode != GET_MODE (reg);
- narrow_mode = GET_MODE_WIDER_MODE (narrow_mode))
- {
- if (have_insn_for (STRICT_LOW_PART, narrow_mode)
- && ((reg_offset[regno]
- & ~GET_MODE_MASK (narrow_mode))
- == (INTVAL (src)
- & ~GET_MODE_MASK (narrow_mode))))
- {
- rtx narrow_reg = gen_rtx_REG (narrow_mode,
- REGNO (reg));
- rtx narrow_src =
- GEN_INT (trunc_int_for_mode (INTVAL (src),
- narrow_mode));
- rtx new_set =
- gen_rtx_SET (VOIDmode,
- gen_rtx_STRICT_LOW_PART (VOIDmode,
- narrow_reg),
- narrow_src);
- if (validate_change (insn, &PATTERN (insn),
- new_set, 0))
- break;
- }
- }
- }
- reg_set_luid[regno] = move2add_luid;
- reg_mode[regno] = GET_MODE (reg);
- reg_offset[regno] = INTVAL (src);
- continue;
- }
-
- /* Try to transform (set (REGX) (REGY))
- (set (REGX) (PLUS (REGX) (CONST_INT A)))
- ...
- (set (REGX) (REGY))
- (set (REGX) (PLUS (REGX) (CONST_INT B)))
- to
- (set (REGX) (REGY))
- (set (REGX) (PLUS (REGX) (CONST_INT A)))
- ...
- (set (REGX) (plus (REGX) (CONST_INT B-A))) */
- else if (GET_CODE (src) == REG
- && reg_set_luid[regno] == reg_set_luid[REGNO (src)]
- && reg_base_reg[regno] == reg_base_reg[REGNO (src)]
- && MODES_OK_FOR_MOVE2ADD (GET_MODE (reg),
- reg_mode[REGNO (src)]))
- {
- rtx next = next_nonnote_insn (insn);
- rtx set = NULL_RTX;
- if (next)
- set = single_set (next);
- if (set
- && SET_DEST (set) == reg
- && GET_CODE (SET_SRC (set)) == PLUS
- && XEXP (SET_SRC (set), 0) == reg
- && GET_CODE (XEXP (SET_SRC (set), 1)) == CONST_INT)
- {
- rtx src3 = XEXP (SET_SRC (set), 1);
- HOST_WIDE_INT added_offset = INTVAL (src3);
- HOST_WIDE_INT base_offset = reg_offset[REGNO (src)];
- HOST_WIDE_INT regno_offset = reg_offset[regno];
- rtx new_src =
- GEN_INT (trunc_int_for_mode (added_offset
- + base_offset
- - regno_offset,
- GET_MODE (reg)));
- int success = 0;
-
- if (new_src == const0_rtx)
- /* See above why we create (set (reg) (reg)) here. */
- success
- = validate_change (next, &SET_SRC (set), reg, 0);
- else if ((rtx_cost (new_src, PLUS)
- < COSTS_N_INSNS (1) + rtx_cost (src3, SET))
- && have_add2_insn (reg, new_src))
- {
- rtx newpat = gen_add2_insn (reg, new_src);
- if (INSN_P (newpat)
- && NEXT_INSN (newpat) == NULL_RTX)
- newpat = PATTERN (newpat);
- success
- = validate_change (next, &PATTERN (next),
- newpat, 0);
- }
- if (success)
- delete_insn (insn);
- insn = next;
- reg_mode[regno] = GET_MODE (reg);
- reg_offset[regno] =
- trunc_int_for_mode (added_offset + base_offset,
- GET_MODE (reg));
- continue;
- }
- }
- }
- }
-
- for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
- {
- if (REG_NOTE_KIND (note) == REG_INC
- && GET_CODE (XEXP (note, 0)) == REG)
- {
- /* Reset the information about this register. */
- int regno = REGNO (XEXP (note, 0));
- if (regno < FIRST_PSEUDO_REGISTER)
- reg_set_luid[regno] = 0;
- }
- }
- note_stores (PATTERN (insn), move2add_note_store, NULL);
-
- /* If INSN is a conditional branch, we try to extract an
- implicit set out of it. */
- if (any_condjump_p (insn) && onlyjump_p (insn))
- {
- rtx cnd = fis_get_condition (insn);
-
- if (cnd != NULL_RTX
- && GET_CODE (cnd) == NE
- && GET_CODE (XEXP (cnd, 0)) == REG
- /* The following two checks, which are also in
- move2add_note_store, are intended to reduce the
- number of calls to gen_rtx_SET to avoid memory
- allocation if possible. */
- && SCALAR_INT_MODE_P (GET_MODE (XEXP (cnd, 0)))
- && HARD_REGNO_NREGS (REGNO (XEXP (cnd, 0)), GET_MODE (XEXP (cnd, 0))) == 1
- && GET_CODE (XEXP (cnd, 1)) == CONST_INT)
- {
- rtx implicit_set =
- gen_rtx_SET (VOIDmode, XEXP (cnd, 0), XEXP (cnd, 1));
- move2add_note_store (SET_DEST (implicit_set), implicit_set, 0);
- }
- }
-
- /* If this is a CALL_INSN, all call used registers are stored with
- unknown values. */
- if (GET_CODE (insn) == CALL_INSN)
- {
- for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--)
- {
- if (call_used_regs[i])
- /* Reset the information about this register. */
- reg_set_luid[i] = 0;
- }
- }
- }
-}
-
-/* SET is a SET or CLOBBER that sets DST.
- Update reg_set_luid, reg_offset and reg_base_reg accordingly.
- Called from reload_cse_move2add via note_stores. */
-
-static void
-move2add_note_store (dst, set, data)
- rtx dst, set;
- void *data ATTRIBUTE_UNUSED;
-{
- unsigned int regno = 0;
- unsigned int i;
- enum machine_mode mode = GET_MODE (dst);
-
- if (GET_CODE (dst) == SUBREG)
- {
- regno = subreg_regno_offset (REGNO (SUBREG_REG (dst)),
- GET_MODE (SUBREG_REG (dst)),
- SUBREG_BYTE (dst),
- GET_MODE (dst));
- dst = SUBREG_REG (dst);
- }
-
- /* Some targets do argument pushes without adding REG_INC notes. */
-
- if (GET_CODE (dst) == MEM)
- {
- dst = XEXP (dst, 0);
- if (GET_CODE (dst) == PRE_INC || GET_CODE (dst) == POST_INC
- || GET_CODE (dst) == PRE_DEC || GET_CODE (dst) == POST_DEC)
- reg_set_luid[REGNO (XEXP (dst, 0))] = 0;
- return;
- }
- if (GET_CODE (dst) != REG)
- return;
-
- regno += REGNO (dst);
-
- if (SCALAR_INT_MODE_P (mode)
- && HARD_REGNO_NREGS (regno, mode) == 1 && GET_CODE (set) == SET
- && GET_CODE (SET_DEST (set)) != ZERO_EXTRACT
- && GET_CODE (SET_DEST (set)) != SIGN_EXTRACT
- && GET_CODE (SET_DEST (set)) != STRICT_LOW_PART)
- {
- rtx src = SET_SRC (set);
- rtx base_reg;
- HOST_WIDE_INT offset;
- int base_regno;
- /* This may be different from mode, if SET_DEST (set) is a
- SUBREG. */
- enum machine_mode dst_mode = GET_MODE (dst);
-
- switch (GET_CODE (src))
- {
- case PLUS:
- if (GET_CODE (XEXP (src, 0)) == REG)
- {
- base_reg = XEXP (src, 0);
-
- if (GET_CODE (XEXP (src, 1)) == CONST_INT)
- offset = INTVAL (XEXP (src, 1));
- else if (GET_CODE (XEXP (src, 1)) == REG
- && (reg_set_luid[REGNO (XEXP (src, 1))]
- > move2add_last_label_luid)
- && (MODES_OK_FOR_MOVE2ADD
- (dst_mode, reg_mode[REGNO (XEXP (src, 1))])))
- {
- if (reg_base_reg[REGNO (XEXP (src, 1))] < 0)
- offset = reg_offset[REGNO (XEXP (src, 1))];
- /* Maybe the first register is known to be a
- constant. */
- else if (reg_set_luid[REGNO (base_reg)]
- > move2add_last_label_luid
- && (MODES_OK_FOR_MOVE2ADD
- (dst_mode, reg_mode[REGNO (XEXP (src, 1))]))
- && reg_base_reg[REGNO (base_reg)] < 0)
- {
- offset = reg_offset[REGNO (base_reg)];
- base_reg = XEXP (src, 1);
- }
- else
- goto invalidate;
- }
- else
- goto invalidate;
-
- break;
- }
-
- goto invalidate;
-
- case REG:
- base_reg = src;
- offset = 0;
- break;
-
- case CONST_INT:
- /* Start tracking the register as a constant. */
- reg_base_reg[regno] = -1;
- reg_offset[regno] = INTVAL (SET_SRC (set));
- /* We assign the same luid to all registers set to constants. */
- reg_set_luid[regno] = move2add_last_label_luid + 1;
- reg_mode[regno] = mode;
- return;
-
- default:
- invalidate:
- /* Invalidate the contents of the register. */
- reg_set_luid[regno] = 0;
- return;
- }
-
- base_regno = REGNO (base_reg);
- /* If information about the base register is not valid, set it
- up as a new base register, pretending its value is known
- starting from the current insn. */
- if (reg_set_luid[base_regno] <= move2add_last_label_luid)
- {
- reg_base_reg[base_regno] = base_regno;
- reg_offset[base_regno] = 0;
- reg_set_luid[base_regno] = move2add_luid;
- reg_mode[base_regno] = mode;
- }
- else if (! MODES_OK_FOR_MOVE2ADD (dst_mode,
- reg_mode[base_regno]))
- goto invalidate;
-
- reg_mode[regno] = mode;
-
- /* Copy base information from our base register. */
- reg_set_luid[regno] = reg_set_luid[base_regno];
- reg_base_reg[regno] = reg_base_reg[base_regno];
-
- /* Compute the sum of the offsets or constants. */
- reg_offset[regno] = trunc_int_for_mode (offset
- + reg_offset[base_regno],
- dst_mode);
- }
- else
- {
- unsigned int endregno = regno + HARD_REGNO_NREGS (regno, mode);
-
- for (i = regno; i < endregno; i++)
- /* Reset the information about this register. */
- reg_set_luid[i] = 0;
- }
-}
-
#ifdef AUTO_INC_DEC
static void
add_auto_inc_notes (insn, x)
diff --git a/gcc/rtl-error.c b/gcc/rtl-error.c
index d5efc762d87..5be5cd55849 100644
--- a/gcc/rtl-error.c
+++ b/gcc/rtl-error.c
@@ -1,4 +1,4 @@
-/* RTL specific diagnostic subroutines for the GNU C compiler
+/* RTL specific diagnostic subroutines for GCC
Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
diff --git a/gcc/rtl.h b/gcc/rtl.h
index b7d8745211f..52baa243875 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1,4 +1,4 @@
-/* Register Transfer Language (RTL) definitions for GNU C-Compiler
+/* Register Transfer Language (RTL) definitions for GCC
Copyright (C) 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
@@ -25,6 +25,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
struct function;
#include "machmode.h"
+#include "input.h"
#undef FFS /* Some systems predefine this symbol; don't let it interfere. */
#undef FLOAT /* Likewise. */
@@ -782,6 +783,8 @@ extern const char * const reg_note_name[];
between ints and pointers if we use a different macro for the block number.)
*/
+/* Opaque data. */
+#define NOTE_DATA(INSN) XCINT (INSN, 4, NOTE)
#define NOTE_SOURCE_FILE(INSN) XCSTR (INSN, 4, NOTE)
#define NOTE_BLOCK(INSN) XCTREE (INSN, 4, NOTE)
#define NOTE_EH_HANDLER(INSN) XCINT (INSN, 4, NOTE)
@@ -1511,6 +1514,7 @@ extern rtx assign_stack_temp PARAMS ((enum machine_mode,
extern rtx assign_stack_temp_for_type PARAMS ((enum machine_mode,
HOST_WIDE_INT, int, tree));
extern rtx assign_temp PARAMS ((tree, int, int, int));
+
/* In emit-rtl.c */
extern rtx emit_insn_before PARAMS ((rtx, rtx));
extern rtx emit_insn_before_setloc PARAMS ((rtx, rtx, int));
@@ -1537,7 +1541,7 @@ extern rtx emit_call_insn PARAMS ((rtx));
extern rtx emit_label PARAMS ((rtx));
extern rtx emit_barrier PARAMS ((void));
extern rtx emit_line_note PARAMS ((const char *, int));
-extern rtx emit_note PARAMS ((const char *, int));
+extern rtx emit_note PARAMS ((int));
extern rtx emit_line_note_force PARAMS ((const char *, int));
extern rtx make_insn_raw PARAMS ((rtx));
extern void add_function_usage_to PARAMS ((rtx, rtx));
@@ -1563,7 +1567,6 @@ extern const char * insn_file PARAMS ((rtx));
extern int prologue_locator, epilogue_locator;
/* In jump.c */
-extern rtx next_nondeleted_insn PARAMS ((rtx));
extern enum rtx_code reverse_condition PARAMS ((enum rtx_code));
extern enum rtx_code reverse_condition_maybe_unordered PARAMS ((enum rtx_code));
extern enum rtx_code swap_condition PARAMS ((enum rtx_code));
@@ -1961,6 +1964,9 @@ extern int flow2_completed;
extern int reload_completed;
+/* Nonzero after thread_prologue_and_epilogue_insns has run. */
+extern int epilogue_completed;
+
/* Set to 1 while reload_as_needed is operating.
Required by some machines to handle any generated moves differently. */
@@ -2119,6 +2125,7 @@ extern rtx libcall_other_reg PARAMS ((rtx, rtx));
#ifdef BUFSIZ
extern void loop_optimize PARAMS ((rtx, FILE *, int));
#endif
+extern void branch_target_load_optimize (rtx, bool);
extern void record_excess_regs PARAMS ((rtx, rtx, rtx *));
/* In function.c */
@@ -2222,11 +2229,6 @@ extern void dump_local_alloc PARAMS ((FILE *));
extern int local_alloc PARAMS ((void));
extern int function_invariant_p PARAMS ((rtx));
-/* In coverage.c */
-extern void coverage_init (const char *);
-extern void coverage_finish (void);
-extern void coverage_end_function (void);
-
/* In profile.c */
extern void init_branch_prob PARAMS ((void));
extern void branch_prob PARAMS ((void));
@@ -2237,36 +2239,6 @@ extern void end_branch_prob PARAMS ((void));
extern bool reg_to_stack PARAMS ((rtx, FILE *));
#endif
-/* In fold-const.c */
-extern int add_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- unsigned HOST_WIDE_INT *,
- HOST_WIDE_INT *));
-extern int neg_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- unsigned HOST_WIDE_INT *,
- HOST_WIDE_INT *));
-extern int mul_double PARAMS ((unsigned HOST_WIDE_INT,
- HOST_WIDE_INT,
- unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- unsigned HOST_WIDE_INT *,
- HOST_WIDE_INT *));
-extern void lshift_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- HOST_WIDE_INT, unsigned int,
- unsigned HOST_WIDE_INT *,
- HOST_WIDE_INT *, int));
-extern void rshift_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- HOST_WIDE_INT, unsigned int,
- unsigned HOST_WIDE_INT *,
- HOST_WIDE_INT *, int));
-extern void lrotate_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- HOST_WIDE_INT, unsigned int,
- unsigned HOST_WIDE_INT *,
- HOST_WIDE_INT *));
-extern void rrotate_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- HOST_WIDE_INT, unsigned int,
- unsigned HOST_WIDE_INT *,
- HOST_WIDE_INT *));
-
/* In calls.c */
enum libcall_type
{
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 2ce25956331..bfbcefda650 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -3435,7 +3435,7 @@ subreg_offset_representable_p (xregno, xmode, offset, ymode)
abort ();
#endif
- /* The XMODE value can be seen as an vector of NREGS_XMODE
+ /* The XMODE value can be seen as a vector of NREGS_XMODE
values. The subreg must represent an lowpart of given field.
Compute what field it is. */
offset -= subreg_lowpart_offset (ymode,
@@ -3838,7 +3838,7 @@ hoist_insn_to_edge (insn, e, val, new)
if (e->insns == NULL_RTX)
{
start_sequence ();
- emit_note (NULL, NOTE_INSN_DELETED);
+ emit_note (NOTE_INSN_DELETED);
}
else
push_to_sequence (e->insns);
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c
index ce60ca8a783..2c4ac155a92 100644
--- a/gcc/sbitmap.c
+++ b/gcc/sbitmap.c
@@ -68,14 +68,14 @@ sbitmap_resize (bmap, n_elms, def)
{
amt = (sizeof (struct simple_bitmap_def)
+ bytes - sizeof (SBITMAP_ELT_TYPE));
- bmap = (sbitmap) xrealloc ((PTR) bmap, amt);
+ bmap = (sbitmap) xrealloc (bmap, amt);
}
if (n_elms > bmap->n_bits)
{
if (def)
{
- memset ((PTR) (bmap->elms + bmap->size), -1, bytes - bmap->bytes);
+ memset (bmap->elms + bmap->size, -1, bytes - bmap->bytes);
/* Set the new bits if the original last element. */
last_bit = bmap->n_bits % SBITMAP_ELT_BITS;
@@ -90,7 +90,7 @@ sbitmap_resize (bmap, n_elms, def)
&= (SBITMAP_ELT_TYPE)-1 >> (SBITMAP_ELT_BITS - last_bit);
}
else
- memset ((PTR) (bmap->elms + bmap->size), 0, bytes - bmap->bytes);
+ memset (bmap->elms + bmap->size, 0, bytes - bmap->bytes);
}
else if (n_elms < bmap->n_bits)
{
@@ -173,7 +173,7 @@ void
sbitmap_zero (bmap)
sbitmap bmap;
{
- memset ((PTR) bmap->elms, 0, bmap->bytes);
+ memset (bmap->elms, 0, bmap->bytes);
}
/* Set all elements in a bitmap to ones. */
@@ -184,7 +184,7 @@ sbitmap_ones (bmap)
{
unsigned int last_bit;
- memset ((PTR) bmap->elms, -1, bmap->bytes);
+ memset (bmap->elms, -1, bmap->bytes);
last_bit = bmap->n_bits % SBITMAP_ELT_BITS;
if (last_bit)
diff --git a/gcc/scan.h b/gcc/scan.h
index 49ca823af3b..7062cdaf90e 100644
--- a/gcc/scan.h
+++ b/gcc/scan.h
@@ -33,14 +33,6 @@ typedef struct sstring
#define MAKE_SSTRING_SPACE(STR, COUNT) \
if ((STR)->limit - (STR)->ptr < (COUNT)) make_sstring_space (STR, COUNT);
-#ifndef _PARAMS
-#if defined(ANSI_PROTOTYPES) || defined(__cplusplus)
-#define _PARAMS(args) args
-#else
-#define _PARAMS(args) ()
-#endif
-#endif
-
struct partial_proto;
struct fn_decl
{
@@ -52,26 +44,26 @@ struct fn_decl
struct cpp_token;
-extern void sstring_append _PARAMS((sstring *, sstring *));
-extern void make_sstring_space _PARAMS((sstring *, int));
-extern int skip_spaces _PARAMS((FILE *, int));
-extern int scan_ident _PARAMS((FILE *, sstring *, int));
-extern int scan_string _PARAMS((FILE *, sstring *, int));
-extern int read_upto _PARAMS((FILE *, sstring *, int));
-extern unsigned long hash _PARAMS((const char *));
-extern void recognized_function _PARAMS((const struct cpp_token *,
- unsigned int, int, int));
-extern void recognized_extern _PARAMS((const struct cpp_token *));
-extern unsigned int hashstr _PARAMS((const char *, unsigned int));
+extern void sstring_append (sstring *, sstring *);
+extern void make_sstring_space (sstring *, int);
+extern int skip_spaces (FILE *, int);
+extern int scan_ident (FILE *, sstring *, int);
+extern int scan_string (FILE *, sstring *, int);
+extern int read_upto (FILE *, sstring *, int);
+extern unsigned long hash (const char *);
+extern void recognized_function (const struct cpp_token *,
+ unsigned int, int, int);
+extern void recognized_extern (const struct cpp_token *);
+extern unsigned int hashstr (const char *, unsigned int);
-extern int scan_decls _PARAMS((struct cpp_reader *, int, char **));
+extern int scan_decls (struct cpp_reader *, int, char **);
/* get_token is a simple C lexer. */
#define IDENTIFIER_TOKEN 300
#define CHAR_TOKEN 301
#define STRING_TOKEN 302
#define INT_TOKEN 303
-extern int get_token _PARAMS ((FILE *, sstring *));
+extern int get_token (FILE *, sstring *);
/* Current file and line numer, taking #-directives into account */
extern int source_lineno;
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index 5b1062bbc14..186766d05b1 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -489,7 +489,7 @@ sched_analyze_1 (deps, x, insn)
them as writes to get proper dependencies for following
instructions. We must handle them as reads to get proper
dependencies from this to previous instructions.
- Thus we need to call sched_analyze_2. */
+ Thus we need to call sched_analyze_2. */
sched_analyze_2 (deps, XEXP (dest, 0), insn);
}
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index 0af958c7924..54dcc799f40 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -51,6 +51,14 @@ AT&T C compiler. From the example below I would conclude the following:
static GTY(()) tree anonymous_types;
+/* Counter for sdbout_source_line. */
+
+static GTY(()) int sdbout_source_line_counter;
+
+/* Counter to generate unique "names" for nameless struct members. */
+
+static GTY(()) int unnamed_struct_number;
+
#ifdef SDB_DEBUGGING_INFO
#include "rtl.h"
@@ -88,9 +96,6 @@ static GTY(()) tree anonymous_types;
int sdb_begin_function_line = -1;
-/* Counter to generate unique "names" for nameless struct members. */
-
-static int unnamed_struct_number = 0;
extern FILE *asm_out_file;
@@ -1527,6 +1532,9 @@ sdbout_end_block (unsigned int line, unsigned int n ATTRIBUTE_UNUSED)
PUT_SDB_BLOCK_END (line - sdb_begin_function_line);
}
+/* Output a line number symbol entry for source file FILENAME and line
+ number LINE. */
+
static void
sdbout_source_line (line, filename)
unsigned int line;
@@ -1536,7 +1544,8 @@ sdbout_source_line (line, filename)
if ((int) line > sdb_begin_function_line)
{
#ifdef ASM_OUTPUT_SOURCE_LINE
- ASM_OUTPUT_SOURCE_LINE (asm_out_file, line);
+ sdbout_source_line_counter += 1;
+ ASM_OUTPUT_SOURCE_LINE (asm_out_file, line, sdbout_source_line_counter);
#else
fprintf (asm_out_file, "\t.ln\t%d\n",
((sdb_begin_function_line > -1)
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 9738566e09e..132b3aba375 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -2657,6 +2657,10 @@ simplify_subreg (outermode, op, innermode, byte)
unsigned i = BYTES_BIG_ENDIAN ? offset : offset + n_elts - 1;
unsigned step = BYTES_BIG_ENDIAN ? 1 : -1;
int shift = BITS_PER_UNIT * elt_size;
+ unsigned HOST_WIDE_INT unit_mask;
+
+ unit_mask = (unsigned HOST_WIDE_INT) -1
+ >> (sizeof (HOST_WIDE_INT) * BITS_PER_UNIT - shift);
for (; n_elts--; i += step)
{
@@ -2675,7 +2679,7 @@ simplify_subreg (outermode, op, innermode, byte)
if (high >> (HOST_BITS_PER_WIDE_INT - shift))
return NULL_RTX;
high = high << shift | sum >> (HOST_BITS_PER_WIDE_INT - shift);
- sum = (sum << shift) + INTVAL (elt);
+ sum = (sum << shift) + (INTVAL (elt) & unit_mask);
}
if (GET_MODE_BITSIZE (outermode) <= HOST_BITS_PER_WIDE_INT)
return GEN_INT (trunc_int_for_mode (sum, outermode));
@@ -2721,7 +2725,7 @@ simplify_subreg (outermode, op, innermode, byte)
/* This might fail, e.g. if taking a subreg from a SYMBOL_REF. */
/* ??? It would be nice if we could actually make such subregs
on targets that allow such relocations. */
- if (byte >= GET_MODE_UNIT_SIZE (innermode))
+ if (byte >= GET_MODE_SIZE (innermode))
elt = CONST0_RTX (submode);
else
elt = simplify_subreg (submode, op, innermode, byte);
diff --git a/gcc/sreal.c b/gcc/sreal.c
index 0468a9631b0..f69cbb1f862 100644
--- a/gcc/sreal.c
+++ b/gcc/sreal.c
@@ -56,7 +56,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tm.h"
#include "sreal.h"
-void dump_sreal PARAMS ((FILE *, sreal *));
static inline void copy PARAMS ((sreal *, sreal *));
static inline void shift_right PARAMS ((sreal *, int));
static void normalize PARAMS ((sreal *));
diff --git a/gcc/ssa-dce.c b/gcc/ssa-dce.c
index 6ccc222cea6..43354ff50b6 100644
--- a/gcc/ssa-dce.c
+++ b/gcc/ssa-dce.c
@@ -83,7 +83,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* A map from blocks to the edges on which they are control dependent. */
typedef struct {
- /* An dynamically allocated array. The Nth element corresponds to
+ /* A dynamically allocated array. The Nth element corresponds to
the block with index N + 2. The Ith bit in the bitmap is set if
that block is dependent on the Ith edge. */
bitmap *data;
@@ -211,7 +211,7 @@ control_dependent_block_to_edge_map_free (c)
int i;
for (i = 0; i < c->length; ++i)
BITMAP_XFREE (c->data[i]);
- free ((PTR) c);
+ free (c);
}
/* Record all blocks' control dependences on all edges in the edge
@@ -566,7 +566,7 @@ ssa_eliminate_dead_code ()
/* Propagate through the operands. */
for_each_rtx (&current_instruction,
&propagate_necessity_through_operand,
- (PTR) &unprocessed_instructions);
+ &unprocessed_instructions);
/* PHI nodes are somewhat special in that each PHI alternative
has data and control dependencies. The data dependencies
@@ -738,6 +738,6 @@ ssa_eliminate_dead_code ()
if (VARRAY_ACTIVE_SIZE (unprocessed_instructions) != 0)
abort ();
control_dependent_block_to_edge_map_free (cdbte);
- free ((PTR) pdom);
+ free (pdom);
free_edge_list (el);
}
diff --git a/gcc/ssa.c b/gcc/ssa.c
index 0a640ef5372..5b15b132d12 100644
--- a/gcc/ssa.c
+++ b/gcc/ssa.c
@@ -1,5 +1,6 @@
/* Static Single Assignment conversion routines for the GNU compiler.
- Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -212,8 +213,6 @@ static int record_canonical_element_1
PARAMS ((void **srfp, void *data));
static int check_hard_regs_in_partition
PARAMS ((partition reg_partition));
-static int rename_equivalent_regs_in_insn
- PARAMS ((rtx *ptr, void *data));
/* These are used in the register coalescing algorithm. */
static int coalesce_if_unconflicting
diff --git a/gcc/ssa.h b/gcc/ssa.h
index 115f77d74d8..f7593d003a9 100644
--- a/gcc/ssa.h
+++ b/gcc/ssa.h
@@ -1,4 +1,4 @@
-/* Static Single Assignment (SSA) definitions for GNU C-Compiler
+/* Static Single Assignment (SSA) definitions for GCC
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
Written by Jeffrey D. Oldham <oldham@codesourcery.com>.
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 1bf70f8d6a7..39e41ff6dc5 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1,4 +1,4 @@
-/* Expands front end tree to back end RTL for GNU C-Compiler
+/* Expands front end tree to back end RTL for GCC
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
@@ -918,11 +918,11 @@ expand_fixup (tree_label, rtl_label, last_insn)
}
start_sequence ();
- start = emit_note (NULL, NOTE_INSN_BLOCK_BEG);
+ start = emit_note (NOTE_INSN_BLOCK_BEG);
if (cfun->x_whole_function_mode_p)
NOTE_BLOCK (start) = block;
- fixup->before_jump = emit_note (NULL, NOTE_INSN_DELETED);
- end = emit_note (NULL, NOTE_INSN_BLOCK_END);
+ fixup->before_jump = emit_note (NOTE_INSN_DELETED);
+ end = emit_note (NOTE_INSN_BLOCK_END);
if (cfun->x_whole_function_mode_p)
NOTE_BLOCK (end) = block;
fixup->context = block;
@@ -2562,7 +2562,7 @@ expand_start_loop (exit_flag)
do_pending_stack_adjust ();
emit_queue ();
- emit_note (NULL, NOTE_INSN_LOOP_BEG);
+ emit_note (NOTE_INSN_LOOP_BEG);
emit_label (thisloop->data.loop.start_label);
return thisloop;
@@ -2594,7 +2594,7 @@ expand_start_null_loop ()
thisloop->next = loop_stack;
thisloop->all = nesting_stack;
thisloop->depth = ++nesting_depth;
- thisloop->data.loop.start_label = emit_note (NULL, NOTE_INSN_DELETED);
+ thisloop->data.loop.start_label = emit_note (NOTE_INSN_DELETED);
thisloop->data.loop.end_label = gen_label_rtx ();
thisloop->data.loop.continue_label = thisloop->data.loop.end_label;
thisloop->exit_label = thisloop->data.loop.end_label;
@@ -2613,7 +2613,7 @@ void
expand_loop_continue_here ()
{
do_pending_stack_adjust ();
- emit_note (NULL, NOTE_INSN_LOOP_CONT);
+ emit_note (NOTE_INSN_LOOP_CONT);
emit_label (loop_stack->data.loop.continue_label);
}
@@ -2765,7 +2765,7 @@ expand_end_loop ()
}
emit_jump (start_label);
- emit_note (NULL, NOTE_INSN_LOOP_END);
+ emit_note (NOTE_INSN_LOOP_END);
emit_label (loop_stack->data.loop.end_label);
POPSTACK (loop_stack);
@@ -2800,7 +2800,7 @@ expand_continue_loop (whichloop)
if (flag_guess_branch_prob)
{
- note = emit_note (NULL, NOTE_INSN_PREDICTION);
+ note = emit_note (NOTE_INSN_PREDICTION);
NOTE_PREDICTION (note) = NOTE_PREDICT (PRED_CONTINUE, IS_TAKEN);
}
clear_last_expr ();
@@ -2883,7 +2883,7 @@ expand_exit_loop_top_cond (whichloop, cond)
if (! expand_exit_loop_if_false (whichloop, cond))
return 0;
- emit_note (NULL, NOTE_INSN_LOOP_END_TOP_COND);
+ emit_note (NOTE_INSN_LOOP_END_TOP_COND);
return 1;
}
@@ -3000,7 +3000,7 @@ expand_value_return (val)
/* Emit information for branch prediction. */
rtx note;
- note = emit_note (NULL, NOTE_INSN_PREDICTION);
+ note = emit_note (NOTE_INSN_PREDICTION);
NOTE_PREDICTION (note) = NOTE_PREDICT (pred, NOT_TAKEN);
@@ -3420,11 +3420,11 @@ expand_start_bindings_and_block (flags, block)
/* Create a note to mark the beginning of the block. */
if (block_flag)
{
- note = emit_note (NULL, NOTE_INSN_BLOCK_BEG);
+ note = emit_note (NOTE_INSN_BLOCK_BEG);
NOTE_BLOCK (note) = block;
}
else
- note = emit_note (NULL, NOTE_INSN_DELETED);
+ note = emit_note (NOTE_INSN_DELETED);
/* Make an entry on block_stack for the block we are entering. */
@@ -3445,7 +3445,7 @@ expand_start_bindings_and_block (flags, block)
fix this is to just insert another instruction here, so that the
instructions inserted after the last unconditional cleanup are
never the last instruction. */
- emit_note (NULL, NOTE_INSN_DELETED);
+ emit_note (NOTE_INSN_DELETED);
if (block_stack
&& !(block_stack->data.block.cleanups == NULL_TREE
@@ -3511,6 +3511,9 @@ int
is_body_block (stmt)
tree stmt;
{
+ if (lang_hooks.no_body_blocks)
+ return 0;
+
if (TREE_CODE (stmt) == BLOCK)
{
tree parent = BLOCK_SUPERCONTEXT (stmt);
@@ -3844,7 +3847,7 @@ expand_end_bindings (vars, mark_ends, dont_jump_in)
if (mark_ends)
{
- rtx note = emit_note (NULL, NOTE_INSN_BLOCK_END);
+ rtx note = emit_note (NOTE_INSN_BLOCK_END);
NOTE_BLOCK (note) = NOTE_BLOCK (thisblock->data.block.first_insn);
}
else
@@ -4186,7 +4189,7 @@ expand_decl_cleanup (decl, cleanup)
fix this is to just insert another instruction here, so that the
instructions inserted after the last unconditional cleanup are
never the last instruction. */
- emit_note (NULL, NOTE_INSN_DELETED);
+ emit_note (NOTE_INSN_DELETED);
}
}
return 1;
@@ -4443,7 +4446,7 @@ expand_start_case (exit_flag, expr, type, printname)
/* Make sure case_stmt.start points to something that won't
need any transformation before expand_end_case. */
if (GET_CODE (get_last_insn ()) != NOTE)
- emit_note (NULL, NOTE_INSN_DELETED);
+ emit_note (NOTE_INSN_DELETED);
thiscase->data.case_stmt.start = get_last_insn ();
@@ -5753,7 +5756,7 @@ do_jump_if_equal (op1, op2, label, unsignedp)
{
if (GET_CODE (op1) == CONST_INT && GET_CODE (op2) == CONST_INT)
{
- if (INTVAL (op1) == INTVAL (op2))
+ if (op1 == op2)
emit_jump (label);
}
else
diff --git a/gcc/stringpool.c b/gcc/stringpool.c
index afb9bdb0972..7a5d51ac03f 100644
--- a/gcc/stringpool.c
+++ b/gcc/stringpool.c
@@ -50,7 +50,7 @@ struct ht *ident_hash;
static struct obstack string_stack;
static hashnode alloc_node PARAMS ((hash_table *));
-static int mark_ident PARAMS ((struct cpp_reader *, hashnode, const PTR));
+static int mark_ident PARAMS ((struct cpp_reader *, hashnode, const void *));
static int ht_copy_and_clear PARAMS ((struct cpp_reader *, hashnode, const void *));
/* Initialize the string pool. */
@@ -158,7 +158,7 @@ static int
mark_ident (pfile, h, v)
struct cpp_reader *pfile ATTRIBUTE_UNUSED;
hashnode h;
- const PTR v ATTRIBUTE_UNUSED;
+ const void *v ATTRIBUTE_UNUSED;
{
gt_ggc_m_9tree_node (HT_IDENT_TO_GCC_IDENT (h));
return 1;
diff --git a/gcc/system.h b/gcc/system.h
index febe4453e38..cafaea68b43 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -23,12 +23,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_SYSTEM_H
#define GCC_SYSTEM_H
-/* We must include stdarg.h/varargs.h before stdio.h. */
-#ifdef ANSI_PROTOTYPES
+/* We must include stdarg.h before stdio.h. */
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#ifndef va_copy
# ifdef __va_copy
@@ -77,14 +73,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
# undef fputs
# define fputs(String, Stream) fputs_unlocked (String, Stream)
# if defined (HAVE_DECL_FPUTS_UNLOCKED) && !HAVE_DECL_FPUTS_UNLOCKED
-extern int fputs_unlocked PARAMS ((const char *, FILE *));
+extern int fputs_unlocked (const char *, FILE *);
# endif
# endif
# ifdef HAVE_FWRITE_UNLOCKED
# undef fwrite
# define fwrite(Ptr, Size, N, Stream) fwrite_unlocked (Ptr, Size, N, Stream)
# if defined (HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED
-extern int fwrite_unlocked PARAMS ((const PTR, size_t, size_t, FILE *));
+extern int fwrite_unlocked (const void *, size_t, size_t, FILE *);
# endif
# endif
# ifdef HAVE_FPRINTF_UNLOCKED
@@ -93,7 +89,7 @@ extern int fwrite_unlocked PARAMS ((const PTR, size_t, size_t, FILE *));
we have varargs macros. */
# define fprintf fprintf_unlocked
# if defined (HAVE_DECL_FPRINTF_UNLOCKED) && !HAVE_DECL_FPRINTF_UNLOCKED
-extern int fprintf_unlocked PARAMS ((FILE *, const char *, ...));
+extern int fprintf_unlocked (FILE *, const char *, ...);
# endif
# endif
@@ -283,39 +279,39 @@ extern int errno;
is running so be careful to test "defined (HAVE_DECL_*)". */
#if defined (HAVE_DECL_ATOF) && !HAVE_DECL_ATOF
-extern double atof PARAMS ((const char *));
+extern double atof (const char *);
#endif
#if defined (HAVE_DECL_ATOL) && !HAVE_DECL_ATOL
-extern long atol PARAMS ((const char *));
+extern long atol (const char *);
#endif
#if defined (HAVE_DECL_FREE) && !HAVE_DECL_FREE
-extern void free PARAMS ((PTR));
+extern void free (void *);
#endif
#if defined (HAVE_DECL_GETCWD) && !HAVE_DECL_GETCWD
-extern char *getcwd PARAMS ((char *, size_t));
+extern char *getcwd (char *, size_t);
#endif
#if defined (HAVE_DECL_GETENV) && !HAVE_DECL_GETENV
-extern char *getenv PARAMS ((const char *));
+extern char *getenv (const char *);
#endif
#if defined (HAVE_DECL_GETOPT) && !HAVE_DECL_GETOPT
-extern int getopt PARAMS ((int, char * const *, const char *));
+extern int getopt (int, char * const *, const char *);
#endif
#if defined (HAVE_DECL_GETWD) && !HAVE_DECL_GETWD
-extern char *getwd PARAMS ((char *));
+extern char *getwd (char *);
#endif
#if defined (HAVE_DECL_SBRK) && !HAVE_DECL_SBRK
-extern PTR sbrk PARAMS ((int));
+extern void *sbrk (int);
#endif
#if defined (HAVE_DECL_STRSTR) && !HAVE_DECL_STRSTR
-extern char *strstr PARAMS ((const char *, const char *));
+extern char *strstr (const char *, const char *);
#endif
#ifdef HAVE_MALLOC_H
@@ -323,15 +319,15 @@ extern char *strstr PARAMS ((const char *, const char *));
#endif
#if defined (HAVE_DECL_MALLOC) && !HAVE_DECL_MALLOC
-extern PTR malloc PARAMS ((size_t));
+extern void *malloc (size_t);
#endif
#if defined (HAVE_DECL_CALLOC) && !HAVE_DECL_CALLOC
-extern PTR calloc PARAMS ((size_t, size_t));
+extern void *calloc (size_t, size_t);
#endif
#if defined (HAVE_DECL_REALLOC) && !HAVE_DECL_REALLOC
-extern PTR realloc PARAMS ((PTR, size_t));
+extern void *realloc (void *, size_t);
#endif
/* If the system doesn't provide strsignal, we get it defined in
@@ -339,17 +335,15 @@ extern PTR realloc PARAMS ((PTR, size_t));
#if !defined (HAVE_STRSIGNAL) \
|| (defined (HAVE_DECL_STRSIGNAL) && !HAVE_DECL_STRSIGNAL)
# ifndef strsignal
-extern const char *strsignal PARAMS ((int));
+extern const char *strsignal (int);
# endif
#endif
#ifdef HAVE_GETRLIMIT
# if defined (HAVE_DECL_GETRLIMIT) && !HAVE_DECL_GETRLIMIT
# ifndef getrlimit
-# ifdef ANSI_PROTOTYPES
struct rlimit;
-# endif
-extern int getrlimit PARAMS ((int, struct rlimit *));
+extern int getrlimit (int, struct rlimit *);
# endif
# endif
#endif
@@ -357,22 +351,14 @@ extern int getrlimit PARAMS ((int, struct rlimit *));
#ifdef HAVE_SETRLIMIT
# if defined (HAVE_DECL_SETRLIMIT) && !HAVE_DECL_SETRLIMIT
# ifndef setrlimit
-# ifdef ANSI_PROTOTYPES
struct rlimit;
-# endif
-extern int setrlimit PARAMS ((int, const struct rlimit *));
+extern int setrlimit (int, const struct rlimit *);
# 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
-
#if defined (HAVE_DECL_ABORT) && !HAVE_DECL_ABORT
-extern void abort PARAMS ((void));
+extern void abort (void);
#endif
/* 1 if we have C99 designated initializers. */
@@ -499,7 +485,6 @@ extern void abort PARAMS ((void));
/* Get libiberty declarations. */
#include "libiberty.h"
-#include "symcat.h"
/* Provide a default for the HOST_BIT_BUCKET.
This suffices for POSIX-like hosts. */
@@ -524,16 +509,6 @@ extern void abort PARAMS ((void));
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER)
#endif
-/* Traditional C cannot initialize union members of structs. Provide
- a macro which expands appropriately to handle it. This only works
- if you intend to initialize the union member to zero since it relies
- on default initialization to zero in the traditional C case. */
-#ifdef __STDC__
-#define UNION_INIT_ZERO , {0}
-#else
-#define UNION_INIT_ZERO
-#endif
-
/* Various error reporting routines want to use __FUNCTION__. */
#if (GCC_VERSION < 2007)
#ifndef __FUNCTION__
@@ -623,7 +598,7 @@ typedef char _Bool;
WCHAR_UNSIGNED UNIQUE_SECTION SELECT_SECTION SELECT_RTX_SECTION \
ENCODE_SECTION_INFO STRIP_NAME_ENCODING ASM_GLOBALIZE_LABEL \
ASM_OUTPUT_MI_THUNK CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS \
- ADDRESS_COST MACHINE_DEPENDENT_REORG ASM_FILE_END
+ ADDRESS_COST MACHINE_DEPENDENT_REORG ASM_FILE_START ASM_FILE_END
/* Other obsolete target macros, or macros that used to be in target
headers and were not used, and may be obsolete or may never have
@@ -652,6 +627,17 @@ typedef char _Bool;
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \
LANG_HOOKS_MARK_TREE
+/* Libiberty macros that are no longer used in GCC. */
+#undef ANSI_PROTOTYPES
+#undef PTR_CONST
+#undef LONG_DOUBLE
+#undef VPARAMS
+#undef VA_OPEN
+#undef VA_FIXEDARG
+#undef VA_CLOSE
+#undef VA_START
+ #pragma GCC poison ANSI_PROTOTYPES PTR_CONST LONG_DOUBLE VPARAMS VA_OPEN \
+ VA_FIXEDARG VA_CLOSE VA_START
#endif /* IN_GCC */
/* Note: not all uses of the `index' token (e.g. variable names and
diff --git a/gcc/target-def.h b/gcc/target-def.h
index 02374d08201..31970222cf1 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -150,10 +150,22 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TARGET_ASM_EH_FRAME_SECTION default_eh_frame_section
#endif
+#ifndef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START default_file_start
+#endif
+
#ifndef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END hook_void_void
#endif
+#ifndef TARGET_ASM_FILE_START_APP_OFF
+#define TARGET_ASM_FILE_START_APP_OFF false
+#endif
+
+#ifndef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE false
+#endif
+
#define TARGET_ASM_ALIGNED_INT_OP \
{TARGET_ASM_ALIGNED_HI_OP, \
TARGET_ASM_ALIGNED_SI_OP, \
@@ -189,6 +201,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_ASM_DESTRUCTOR, \
TARGET_ASM_OUTPUT_MI_THUNK, \
TARGET_ASM_CAN_OUTPUT_MI_THUNK, \
+ TARGET_ASM_FILE_START, \
TARGET_ASM_FILE_END}
/* Scheduler hooks. All of these default to null pointers, which
@@ -269,6 +282,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* In hook.c. */
#define TARGET_CANNOT_MODIFY_JUMPS_P hook_bool_void_false
+#define TARGET_BRANCH_TARGET_REGISTER_CLASS hook_int_void_no_regs
+#define TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED hook_bool_bool_false
#define TARGET_CANNOT_FORCE_CONST_MEM hook_bool_rtx_false
#define TARGET_CANNOT_COPY_INSN_P NULL
#define TARGET_DELEGITIMIZE_ADDRESS hook_rtx_rtx_identity
@@ -307,6 +322,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_EXPAND_BUILTIN, \
TARGET_SECTION_TYPE_FLAGS, \
TARGET_CANNOT_MODIFY_JUMPS_P, \
+ TARGET_BRANCH_TARGET_REGISTER_CLASS, \
+ TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED, \
TARGET_CANNOT_FORCE_CONST_MEM, \
TARGET_CANNOT_COPY_INSN_P, \
TARGET_DELEGITIMIZE_ADDRESS, \
@@ -325,7 +342,9 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_HAVE_CTORS_DTORS, \
TARGET_HAVE_TLS, \
TARGET_HAVE_SRODATA_SECTION, \
- TARGET_TERMINATE_DW2_EH_FRAME_INFO \
+ TARGET_TERMINATE_DW2_EH_FRAME_INFO, \
+ TARGET_ASM_FILE_START_APP_OFF, \
+ TARGET_ASM_FILE_START_FILE_DIRECTIVE, \
}
#include "hooks.h"
diff --git a/gcc/target.h b/gcc/target.h
index ad07f86d958..f693868eb57 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -143,7 +143,12 @@ struct gcc_target
HOST_WIDE_INT vcall_offset,
tree function_decl));
- /* Output any boilerplate text needed at the end of a translation unit. */
+ /* Output any boilerplate text needed at the beginning of a
+ translation unit. */
+ void (*file_start) PARAMS ((void));
+
+ /* Output any boilerplate text needed at the end of a
+ translation unit. */
void (*file_end) PARAMS ((void));
} asm_out;
@@ -291,6 +296,16 @@ struct gcc_target
not, at the current point in the compilation. */
bool (* cannot_modify_jumps_p) PARAMS ((void));
+ /* Return a register class for which branch target register
+ optimizations should be applied. */
+ int (* branch_target_register_class) PARAMS ((void));
+
+ /* Return true if branch target register optimizations should include
+ callee-saved registers that are not already live during the current
+ function. AFTER_PE_GEN is true if prologues and epilogues have
+ already been generated. */
+ bool (* branch_target_register_callee_saved) PARAMS ((bool after_pe_gen));
+
/* True if the constant X cannot be placed in the constant pool. */
bool (* cannot_force_const_mem) PARAMS ((rtx));
@@ -365,6 +380,14 @@ struct gcc_target
/* True if EH frame info sections should be zero-terminated. */
bool terminate_dw2_eh_frame_info;
+
+ /* True if #NO_APP should be emitted at the beginning of
+ assembly output. */
+ bool file_start_app_off;
+
+ /* True if output_file_directive should be called for main_input_filename
+ at the beginning of assembly output. */
+ bool file_start_file_directive;
};
extern struct gcc_target targetm;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4371663f1a5..190e0ef2076 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,215 @@
+2003-06-26 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11332
+ * g++.dg/expr/static_cast2.C: New test.
+
+2003-06-26 Roger Sayle <roger@eyesopen.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/execute/string-opt-16.c: Remove test for disabled
+ sprintf(dst,"%s",src) optimization.
+ * gcc.c-torture/execute/20030626-1.c: New test case.
+ * gcc.c-torture/execute/20030626-2.c: New test case.
+
+2003-06-26 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * gcc.c-torture/execute/multi-ix.c: New test.
+
+ * gcc.c-torture/execute/simd-4.c (main):
+ Added missing semicolon at end of union.
+
+2003-06-26 Giovanni Bajo <giovannibajo@libero.it>
+
+ PR c++/8266
+ * g++.dg/template/explicit-instantiation3.C: New test.
+
+2003-06-26 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/20030626-1.c: Use signed char.
+
+2003-06-26 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/20030626-1.c: New test.
+
+2003-06-26 Neil Booth <neil@daikokuya.co.uk>
+
+ * const-str-2.m: Update.
+
+2003-06-25 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10990
+ * g++.dg/rtti/dyncast1.C: New test.
+ * g++.dg/abi/mangle4.C: Correct base-specifier access.
+ * g++.dg/lookup/scoped1.C: Remove XFAIL.
+ * g++.old-deja/g++.martin/pmf1.C: Correct base-specifier access.
+
+ PR c++/10931
+ * g++.dg/expr/static_cast1.C: New test.
+
+2003-06-25 Josef Zlomek <zlomekj@suse.cz>
+
+ * gcc.dg/20030625-1.c: New test.
+
+2003-06-24 Roger Sayle <roger@eyesopen.com>
+
+ * gcc.c-torture/compile/20030624-1.c: New test case.
+
+2003-06-24 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/execute/string-opt-17.c: New test.
+
+2003-06-24 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/5754
+ * g++.dg/parse/crash6.C: New test.
+
+2003-06-23 Roger Sayle <roger@eyesopen.com>
+
+ * gcc.dg/builtins-24.c: New test case.
+
+2003-06-23 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.dg/opt/operator1.C: New test.
+
+2003-06-22 Roger Sayle <roger@eyesopen.com>
+
+ * gcc.c-torture/execute/string-opt-16.c: New test case.
+
+2003-06-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * g++.old-deja/g++.benjamin/16077.C: Add -Wconversion option.
+ * g++.old-deja/g++.other/conv7.C: Likewise
+ * g++.old-deja/g++.other/overcnv2.C: Likewise.
+ * g++.old-deja/g++.other/overload14.C: Likewise.
+
+2003-06-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * g++.old-deja/g++.jason/conversion5.C: Adjust option.
+ * g++.old-deja/g++.bugs/900215_01.C: Likewise.
+
+2003-06-20 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10888
+ * g++.dg/warn/Winline-3.C: New test.
+
+2003-06-20 Mark Mitchell <mark@codesourcery.com>
+
+ * lib/target-supports.exp (check_alias_available): Make the test
+ program acceptable to the Solaris assembler.
+
+ PR c++/10749
+ * g++.dg/template/memclass2.C: New test.
+
+2003-06-20 Mark Mitchell <mark@codesourcery.com>
+ Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * lib/gcc-dg.exp (dg-xfail-if): Do not process conditional xfail
+ data for non-matching targets.
+ * gcc.c-torture/compile/simd-5.c: Fix typo in conditional xfail.
+
+2003-06-20 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10845
+ * g++.dg/template/member3.C: New test.
+
+2003-06-19 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10939
+ * g++.dg/template/func1.C: New test.
+
+ PR c++/9649
+ * g++.dg/template/static4.C: New test.
+ * g++.old-deja/g++.other/anon7.C: Remove spurious error messages.
+
+ PR c++/11041
+ * g++.dg/init/ref7.C: New test.
+
+2003-06-19 Matt Austern <austern@apple.com>
+
+ PR c++/11228
+ * g++.dg/anew1.C: New test.
+ * g++.dg/anew2.C: New test.
+ * g++.dg/anew3.C: New test.
+ * g++.dg/anew4.C: New test.
+
+2003-06-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * gcc.c-torture/compile/simd-5.c: Don't XFAIL on H8.
+
+2003-06-19 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * gcc.c-torture/execute/simd-4.c (main): Make expected value
+ endian-dependent.
+
+2003-06-17 Benjamin Kosnik <bkoz@redhat.com>
+
+ * lib/g++.exp (g++_include_flags): Tweak path to testsuite_flags.
+ Remove cruft.
+
+2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * gcc.c-torture/compile/20020604-1.c: Use dg-xfail-if for h8300.
+ * gcc.c-torture/compile/961203-1.c: Likewise.
+ * gcc.c-torture/compile/980506-1.c: Likewise.
+
+2003-06-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10712
+ * g++.dg/lookup/using7.C: New test.
+
+2003-06-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/11105
+ * g++.dg/abi/conv1.C: Remove it.
+ * g++.dg/template/conv7.C: New test.
+ * g++.dg/template/conv8.C: Likewise.
+ * g++.old-deja/g++.ext/pretty2.C: Do not test __FUNCTION__ for a
+ conversion operator.
+
+2003-06-17 Janis Johnson <janis187@us.ibm.com>
+
+ * gcc.dg/compat/compat-common.h (DEBUG_INIT): New.
+ * gcc.dg/compat/scalar-by-value-1_x.c: Use it.
+ * gcc.dg/compat/scalar-by-value-2_x.c: Ditto.
+ * gcc.dg/compat/scalar-by-value-3_x.c: Ditto.
+ * gcc.dg/compat/scalar-by-value-4_x.c: Ditto.
+ * gcc.dg/compat/scalar-return-1_x.c: Ditto.
+ * gcc.dg/compat/scalar-return-2_x.c: Ditto.
+ * gcc.dg/compat/scalar-return-3_x.c: Ditto.
+ * gcc.dg/compat/scalar-return-4_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-10_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-11_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-12_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-13_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-14_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-15_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-16_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-17_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-18_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-2_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-3_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-4_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-5_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-6_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-7_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-8_x.c: Ditto.
+ * gcc.dg/compat/struct-by-value-9_x.c: Ditto.
+ * gcc.dg/compat/struct-return-10_x.c: Ditto.
+ * gcc.dg/compat/struct-return-2_x.c: Ditto.
+ * gcc.dg/compat/struct-return-3_x.c: Ditto.
+
+2003-06-16 Mark Mitchell <mark@codesourcery.com>
+
+ * lib/gcc-dg.exp (dg-xfail-if): Fix thinko.
+ * gcc.c-torture/compile/simd-5.c: Remove spurious PowerPC-64 XFAIL
+ indications.
+
+2003-06-16 Roger Sayle <roger@eyesopen.com>
+
+ * gcc.dg/i386-387-5.c: New test case.
+ * gcc.dg/i386-387-6.c: New test case.
+ * gcc.dg/builtins-23.c: New test case.
+
2003-06-15 Roger Sayle <roger@eyesopen.com>
* gcc.dg/builtins-22.c: New test case.
diff --git a/gcc/testsuite/g++.dg/abi/conv1.C b/gcc/testsuite/g++.dg/abi/conv1.C
deleted file mode 100644
index fdedea20b13..00000000000
--- a/gcc/testsuite/g++.dg/abi/conv1.C
+++ /dev/null
@@ -1,13 +0,0 @@
-// { dg-options "-fabi-version=1" }
-
-template<class T1>
-struct A {
- typedef typename T1::X X;
- operator X() const;
-};
-
-template <class T0, class T1 >
-struct B {
- typedef typename T1::X X;
- operator X() const; // { dg-error "" }
-};
diff --git a/gcc/testsuite/g++.dg/abi/mangle4.C b/gcc/testsuite/g++.dg/abi/mangle4.C
index e0981273b2e..ec65654e8e2 100644
--- a/gcc/testsuite/g++.dg/abi/mangle4.C
+++ b/gcc/testsuite/g++.dg/abi/mangle4.C
@@ -2,7 +2,7 @@
// { dg-do compile }
class A {};
-class B : A {};
+class B : public A {};
template<const A* a> class C {};
template<const B* b> class D {};
diff --git a/gcc/testsuite/g++.dg/lookup/scoped1.C b/gcc/testsuite/g++.dg/lookup/scoped1.C
index fc6c4b3c269..f1d3f403ea2 100644
--- a/gcc/testsuite/g++.dg/lookup/scoped1.C
+++ b/gcc/testsuite/g++.dg/lookup/scoped1.C
@@ -17,6 +17,6 @@ struct C: public B
::A::i1 = 1;
::A::i2 = 1; // { dg-error "(access)|(context)" "" }
::A::f1 ();
- ::A::f2 (); // { dg-error "access" "" { xfail *-*-* } }
+ ::A::f2 (); // { dg-error "" }
}
};
diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/16077.C b/gcc/testsuite/g++.old-deja/g++.benjamin/16077.C
index edffef2ae07..9f854b5e189 100644
--- a/gcc/testsuite/g++.old-deja/g++.benjamin/16077.C
+++ b/gcc/testsuite/g++.old-deja/g++.benjamin/16077.C
@@ -1,6 +1,7 @@
// { dg-do assemble }
// 981203 bkoz
// g++/16077
+// { dg-options "-Wconversion" }
class nicaragua;
struct colombia {
diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900215_01.C b/gcc/testsuite/g++.old-deja/g++.bugs/900215_01.C
index 768105791aa..c79a7035f99 100644
--- a/gcc/testsuite/g++.old-deja/g++.bugs/900215_01.C
+++ b/gcc/testsuite/g++.old-deja/g++.bugs/900215_01.C
@@ -20,6 +20,8 @@
// 8/3/2000 (nathan): The std allows you to define such an op, but
// it will never be called. [class.conv.fct]. Make it an unconditional warning.
+// { dg-options "-Wconversion" }
+
struct struct0 {
operator void (); // { dg-warning "" } operator void
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/pretty2.C b/gcc/testsuite/g++.old-deja/g++.ext/pretty2.C
index 834ffa51bea..c309dc8d62d 100644
--- a/gcc/testsuite/g++.old-deja/g++.ext/pretty2.C
+++ b/gcc/testsuite/g++.old-deja/g++.ext/pretty2.C
@@ -1,5 +1,5 @@
// { dg-do run }
-// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 21 Nov 1999 <nathan@acm.org>
// make sure __FUNCTION__ and __PRETTY_FUNCTION__ work in member functions
@@ -68,8 +68,6 @@ X::operator int ()
printf ("__FUNCTION__ %s\n", function);
printf ("__PRETTY_FUNCTION__ %s\n", pretty);
- if (strcmp (function, "operator i"))
- bad = true;
if (strcmp (pretty, "X::operator int()"))
bad = true;
return 0;
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/conversion5.C b/gcc/testsuite/g++.old-deja/g++.jason/conversion5.C
index e409fae54af..0031084db00 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/conversion5.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/conversion5.C
@@ -1,4 +1,5 @@
// { dg-do assemble }
+// { dg-options "-Wconversion" }
struct A { };
struct B: public A {
A a;
diff --git a/gcc/testsuite/g++.old-deja/g++.law/memoized1.C b/gcc/testsuite/g++.old-deja/g++.law/memoized1.C
deleted file mode 100644
index eea60ebc256..00000000000
--- a/gcc/testsuite/g++.old-deja/g++.law/memoized1.C
+++ /dev/null
@@ -1,28 +0,0 @@
-// { dg-do assemble }
-// { dg-options "-fsave-memoized" }
-// GROUPS passed memoized
-class CArray
-{
-public:
- CArray();
-};
-class CBTree : public CArray
-{
-};
-class CData
-{
-public:
- virtual ~CData();
-};
-class CStr : public CData
-{
- inline int Read();
- inline int Write() const;
-};
-class CResource : private CBTree
-{
- struct SResourceNode
- {
- CStr xKey;
- };
-};
diff --git a/gcc/testsuite/g++.old-deja/g++.martin/pmf1.C b/gcc/testsuite/g++.old-deja/g++.martin/pmf1.C
index 2b5aa648914..108754b28df 100644
--- a/gcc/testsuite/g++.old-deja/g++.martin/pmf1.C
+++ b/gcc/testsuite/g++.old-deja/g++.martin/pmf1.C
@@ -5,7 +5,7 @@
struct B{};
-struct D:B{
+struct D: public B{
virtual void foo();
};
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/memoize1.C b/gcc/testsuite/g++.old-deja/g++.mike/memoize1.C
deleted file mode 100644
index af06f221f12..00000000000
--- a/gcc/testsuite/g++.old-deja/g++.mike/memoize1.C
+++ /dev/null
@@ -1,4 +0,0 @@
-// { dg-do assemble }
-// { dg-options "-fsave-memoized" }
-
-#include <iostream>
diff --git a/gcc/testsuite/g++.old-deja/g++.other/anon7.C b/gcc/testsuite/g++.old-deja/g++.other/anon7.C
index 3131c6b34ba..ebc378005cd 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/anon7.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/anon7.C
@@ -11,7 +11,7 @@ struct B {
int b; // { dg-error "" } conflicts with previous declaration
union {
int b; // { dg-error "" } duplicate member
- }; // { dg-error "" } declaration of
+ };
};
struct C {
@@ -20,5 +20,5 @@ struct C {
};
union {
int c; // { dg-error "" } duplicate member
- }; // { dg-error "" } declaration of
+ };
};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/conv7.C b/gcc/testsuite/g++.old-deja/g++.other/conv7.C
index 71ec2042548..7042e147ca5 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/conv7.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/conv7.C
@@ -1,4 +1,5 @@
// { dg-do assemble }
+// { dg-options "-Wconversion" }
//
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 5 May 2001 <nathan@codesourcery.com>
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C b/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C
index ab877d10993..ef9c1f7823b 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C
@@ -1,4 +1,5 @@
// { dg-do assemble }
+// { dg-options "-Wconversion" }
// Test that we resolve this case as mandated by the standard, but also
// warn about it. We choose op char* not because it is a member of B --
// the standard says that all conversion ops are treated as coming from
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload14.C b/gcc/testsuite/g++.old-deja/g++.other/overload14.C
index 28d5f47e42a..2a50b1bf510 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/overload14.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload14.C
@@ -1,4 +1,5 @@
// { dg-do run }
+// { dg-options "-Wconversion" }
extern "C" void abort();
struct A {
diff --git a/gcc/testsuite/gcc.c-torture/compile/20020604-1.c b/gcc/testsuite/gcc.c-torture/compile/20020604-1.c
index fca4a535893..488a1b403d3 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20020604-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20020604-1.c
@@ -1,5 +1,6 @@
/* The array is too big. */
-/* { dg-do assemble { xfail h8300-*-* m6811-*-* m6812-*-* } } */
+/* { dg-xfail-if "The array too big" { "h8300-*-*" } { "-mno-h" } { "" } } */
+/* { dg-do assemble { xfail m6811-*-* m6812-*-* } } */
/* PR c/6957
This testcase ICEd at -O2 on IA-32, because
diff --git a/gcc/testsuite/gcc.c-torture/compile/961203-1.c b/gcc/testsuite/gcc.c-torture/compile/961203-1.c
index 12aba52e7e0..1d879292e51 100644
--- a/gcc/testsuite/gcc.c-torture/compile/961203-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/961203-1.c
@@ -1,6 +1,7 @@
/* The structure is too large for the xstormy16 - won't fit in 16
bits. */
-/* { dg-do assemble { xfail xstormy16-*-* h8300-*-* m6811-*-* m6812-*-* } } */
+/* { dg-xfail-if "The array too big" { "h8300-*-*" } { "-mno-h" } { "" } } */
+/* { dg-do assemble { xfail xstormy16-*-* m6811-*-* m6812-*-* } } */
struct s {
char a[0x32100000];
diff --git a/gcc/testsuite/gcc.c-torture/compile/980506-1.c b/gcc/testsuite/gcc.c-torture/compile/980506-1.c
index 834137244f9..fd3496af309 100644
--- a/gcc/testsuite/gcc.c-torture/compile/980506-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/980506-1.c
@@ -1,5 +1,6 @@
/* The arrays are too large for the xstormy16 - won't fit in 16 bits. */
-/* { dg-do assemble { xfail xstormy16-*-* h8300-*-* m6811-*-* m6812-*-* } } */
+/* { dg-xfail-if "The array too big" { "h8300-*-*" } { "-mno-h" } { "" } } */
+/* { dg-do assemble { xfail xstormy16-*-* m6811-*-* m6812-*-* } } */
unsigned char TIFFFax2DMode[20][256];
unsigned char TIFFFax2DNextState[20][256];
diff --git a/gcc/testsuite/gcc.c-torture/compile/simd-5.c b/gcc/testsuite/gcc.c-torture/compile/simd-5.c
index 35b511879c3..d82b504a505 100644
--- a/gcc/testsuite/gcc.c-torture/compile/simd-5.c
+++ b/gcc/testsuite/gcc.c-torture/compile/simd-5.c
@@ -1,10 +1,7 @@
-/* h8300 does not have long long */
-/* PowerPC-64 doesn't handle this; see PR target/9680 */
-/* { dg-do assemble { xfail h8300-*-* powerpc64-*-* } } */
/* On SPARC64/SPARC-V9 it fails, except with -m32. */
/* { dg-xfail-if "PR target/9200" { "sparc64-*-*" "sparcv9-*-*" } { "*" } { "-m32" } } */
/* On regular SPARC it doesn't fail, except with -m64. */
-/* { dg-xfail-if "PR target/9200" { "sparc*-*-*" } { "-m64" } { "" } } */
+/* { dg-xfail-if "PR target/9200" { "sparc-*-*" } { "-m64" } { "" } } */
#define vector64 __attribute__((vector_size(8)))
diff --git a/gcc/testsuite/gcc.dg/compat/compat-common.h b/gcc/testsuite/gcc.dg/compat/compat-common.h
index 46eaf42b9a8..95c1af4b194 100644
--- a/gcc/testsuite/gcc.dg/compat/compat-common.h
+++ b/gcc/testsuite/gcc.dg/compat/compat-common.h
@@ -6,12 +6,14 @@
#ifdef DBG
#include <stdio.h>
+#define DEBUG_INIT setbuf (stdout, NULL);
#define DEBUG_FPUTS(x) fputs (x, stdout)
#define DEBUG_DOT putc ('.', stdout)
#define DEBUG_NL putc ('\n', stdout)
#define DEBUG_FAIL putc ('F', stdout); fails++
#define DEBUG_CHECK { DEBUG_FAIL; } else { DEBUG_DOT; }
#else
+#define DEBUG_INIT
#define DEBUG_FPUTS(x)
#define DEBUG_DOT
#define DEBUG_NL
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-by-value-1_x.c b/gcc/testsuite/gcc.dg/compat/scalar-by-value-1_x.c
index 51b5abd3d77..f17ed8b2e55 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-by-value-1_x.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-by-value-1_x.c
@@ -158,6 +158,8 @@ T(ld, long double, 92.0)
void
scalar_by_value_1_x ()
{
+DEBUG_INIT
+
#define T(NAME) testit##NAME ();
T(ui)
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-by-value-2_x.c b/gcc/testsuite/gcc.dg/compat/scalar-by-value-2_x.c
index fae665f2ca1..9e29b3ebb96 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-by-value-2_x.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-by-value-2_x.c
@@ -80,6 +80,8 @@ T(f, float, 90.0)
void
scalar_by_value_2_x ()
{
+DEBUG_INIT
+
#define T(NAME) testit##NAME ();
T(c)
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_x.c b/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_x.c
index 523210f8221..f5eea8d3668 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_x.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_x.c
@@ -155,6 +155,8 @@ T(cld, _Complex long double, (8.0,9.0))
void
scalar_by_value_3_x ()
{
+DEBUG_INIT
+
#define T(NAME) testit##NAME ();
T(ci)
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_x.c b/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_x.c
index 3b4c427c2ac..79ac7118df1 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_x.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_x.c
@@ -77,6 +77,8 @@ T(cf, _Complex float, (6.0,7.0))
void
scalar_by_value_4_x ()
{
+DEBUG_INIT
+
#define T(NAME) testit##NAME ();
T(cc)
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-return-1_x.c b/gcc/testsuite/gcc.dg/compat/scalar-return-1_x.c
index 7e8f975f758..3e56487afbc 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-return-1_x.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-return-1_x.c
@@ -98,6 +98,8 @@ T(ld, long double, 92.0)
void
scalar_return_1_x ()
{
+DEBUG_INIT
+
#define T(NAME) testit##NAME ();
T(ui)
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-return-2_x.c b/gcc/testsuite/gcc.dg/compat/scalar-return-2_x.c
index 2e68d59b7ea..888e3f43d6a 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-return-2_x.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-return-2_x.c
@@ -66,6 +66,8 @@ T(f, float, 90.0)
void
scalar_return_2_x ()
{
+DEBUG_INIT
+
#define T(NAME) testit##NAME ();
T(c)
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-return-3_x.c b/gcc/testsuite/gcc.dg/compat/scalar-return-3_x.c
index 5cf84faa04b..957cde7ff08 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-return-3_x.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-return-3_x.c
@@ -95,6 +95,8 @@ T(cld, _Complex long double, (3.0,4.0))
void
scalar_return_3_x ()
{
+DEBUG_INIT
+
#define T(NAME) testit##NAME ();
T(ci)
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-return-4_x.c b/gcc/testsuite/gcc.dg/compat/scalar-return-4_x.c
index cb413e62d4c..fb7fd4b9ba3 100644
--- a/gcc/testsuite/gcc.dg/compat/scalar-return-4_x.c
+++ b/gcc/testsuite/gcc.dg/compat/scalar-return-4_x.c
@@ -45,6 +45,8 @@ T(cf, _Complex float, (1.0,2.0))
void
scalar_return_4_x ()
{
+DEBUG_INIT
+
#define T(NAME) testit##NAME ();
T(cc)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-10_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-10_x.c
index 7468dc72a9d..861ee4917c8 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-10_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-10_x.c
@@ -158,6 +158,8 @@ TEST(Sldf)
void
struct_by_value_10_x ()
{
+DEBUG_INIT
+
#define T(TYPE) testit##TYPE ();
T(Sfd)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-11_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-11_x.c
index 237f6716403..5ea5a8eded3 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-11_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-11_x.c
@@ -29,6 +29,8 @@ TEST(Scc16, _Complex char)
void
struct_by_value_11_x ()
{
+DEBUG_INIT
+
#define T(TYPE, MTYPE) testit##TYPE ();
T(Scc1, _Complex char)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-12_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-12_x.c
index 2ba6fc6c0b6..dd7586406d5 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-12_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-12_x.c
@@ -29,6 +29,8 @@ TEST(Scs16, _Complex short)
void
struct_by_value_12_x ()
{
+DEBUG_INIT
+
#define T(TYPE, MTYPE) testit##TYPE ();
T(Scs1, _Complex short)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-13_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-13_x.c
index bf7af3a3603..2b8da398ef0 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-13_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-13_x.c
@@ -29,6 +29,8 @@ TEST(Sci16, _Complex int)
void
struct_by_value_13_x ()
{
+DEBUG_INIT
+
#define T(TYPE, MTYPE) testit##TYPE ();
T(Sci1, _Complex int)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-14_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-14_x.c
index 765144c5376..19ac834d223 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-14_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-14_x.c
@@ -29,6 +29,8 @@ TEST(Scl16, _Complex long)
void
struct_by_value_14_x ()
{
+DEBUG_INIT
+
#define T(TYPE, MTYPE) testit##TYPE ();
T(Scl1, _Complex long)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-15_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-15_x.c
index 732582e76b5..f424342dbc8 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-15_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-15_x.c
@@ -29,6 +29,8 @@ TEST(Scll16, _Complex long long)
void
struct_by_value_15_x ()
{
+DEBUG_INIT
+
#define T(TYPE, MTYPE) testit##TYPE ();
T(Scll1, _Complex long long)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c
index ef701767eb8..2485a90c55a 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c
@@ -29,6 +29,8 @@ TEST(Scf16, _Complex float)
void
struct_by_value_16_x ()
{
+DEBUG_INIT
+
#define T(TYPE, MTYPE) testit##TYPE ();
T(Scf1, _Complex float)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c
index 624cc34df60..349e23f2238 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c
@@ -29,6 +29,8 @@ TEST(Scd16, _Complex double)
void
struct_by_value_17_x ()
{
+DEBUG_INIT
+
#define T(TYPE, MTYPE) testit##TYPE ();
T(Scd1, _Complex double)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c
index ec02c568de9..dea586cb64c 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c
@@ -29,6 +29,8 @@ TEST(Scld16, _Complex long double)
void
struct_by_value_18_x ()
{
+DEBUG_INIT
+
#define T(TYPE, MTYPE) testit##TYPE ();
T(Scld1, _Complex long double)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-2_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-2_x.c
index ce455bf5bc2..06aec702ef1 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-2_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-2_x.c
@@ -159,6 +159,8 @@ T(15, ui, unsigned int)
void
struct_by_value_2_x ()
{
+DEBUG_INIT
+
#define T(N, NAME, TYPE) testit##NAME##N ();
T(0, uc, unsigned char)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-3_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-3_x.c
index 4490f485634..c54e47b7393 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-3_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-3_x.c
@@ -161,6 +161,8 @@ T(Sics)
void
struct_by_value_3_x ()
{
+DEBUG_INIT
+
#define T(TYPE) testit##TYPE ();
T(Sc)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-4_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-4_x.c
index 4b24cd56a85..d53396e1f12 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-4_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-4_x.c
@@ -183,6 +183,8 @@ T(15, Si)
void
struct_by_value_4_x ()
{
+DEBUG_INIT
+
#define T(N, TYPE) testit##TYPE##N ();
T(0, Sc)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-5_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-5_x.c
index 6db7771bc3a..46ca6c04caa 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-5_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-5_x.c
@@ -29,6 +29,8 @@ TEST(Sf16, float)
void
struct_by_value_5_x ()
{
+DEBUG_INIT
+
#define T(TYPE, MTYPE) testit##TYPE ();
T(Sf1, float)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-6_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-6_x.c
index cef1523b3ff..4ce1f7c18cf 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-6_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-6_x.c
@@ -29,6 +29,8 @@ TEST(Sd16, double)
void
struct_by_value_6_x ()
{
+DEBUG_INIT
+
#define T(TYPE, MTYPE) testit##TYPE ();
T(Sd1, double)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-7_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-7_x.c
index 30d945082f7..f4459f57e02 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-7_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-7_x.c
@@ -29,6 +29,8 @@ TEST(Sld16, long double)
void
struct_by_value_7_x ()
{
+DEBUG_INIT
+
#define T(TYPE, MTYPE) testit##TYPE ();
T(Sld1, long double)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-8_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-8_x.c
index 6c983c58cb9..cdde06b05eb 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-8_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-8_x.c
@@ -167,6 +167,8 @@ T(15, Sis)
void
struct_by_value_8_x ()
{
+DEBUG_INIT
+
#define T(N, TYPE) testit##TYPE##N ();
T(0, Ssc)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-9_x.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-9_x.c
index 3cd7ca74f04..9f2f9c0b504 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-by-value-9_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-9_x.c
@@ -170,6 +170,8 @@ T(15, Scis)
void
struct_by_value_9_x ()
{
+DEBUG_INIT
+
#define T(N, TYPE) testit##TYPE##N ();
T(0, Scsi)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-return-10_x.c b/gcc/testsuite/gcc.dg/compat/struct-return-10_x.c
index f3e375bb446..bb2644a11ed 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-return-10_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-return-10_x.c
@@ -93,6 +93,8 @@ T(Sldf);
void
struct_return_10_x ()
{
+DEBUG_INIT
+
#define T(TYPE) testit##TYPE ();
T(Sfd);
diff --git a/gcc/testsuite/gcc.dg/compat/struct-return-2_x.c b/gcc/testsuite/gcc.dg/compat/struct-return-2_x.c
index ff83e95f064..a0658a5b857 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-return-2_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-return-2_x.c
@@ -156,6 +156,8 @@ T(15, ui, unsigned int)
void
struct_return_2_x ()
{
+DEBUG_INIT
+
#define T(N, NAME, TYPE) testit##NAME##N ();
T(0, uc, unsigned char)
diff --git a/gcc/testsuite/gcc.dg/compat/struct-return-3_x.c b/gcc/testsuite/gcc.dg/compat/struct-return-3_x.c
index 62e9a94f5ab..d4e81d76729 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-return-3_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-return-3_x.c
@@ -106,6 +106,8 @@ T(Sics)
void
struct_return_3_x ()
{
+DEBUG_INIT
+
#define T(TYPE) testit##TYPE ();
T(Sc)
diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp
index 821c3d7c758..81ac484ae29 100644
--- a/gcc/testsuite/lib/g++.exp
+++ b/gcc/testsuite/lib/g++.exp
@@ -80,22 +80,11 @@ proc g++_include_flags { paths } {
return "${flags}"
}
- set dir [lookfor_file ${srcdir} libg++]
- if { ${dir} != "" } {
- append flags "-I${dir} -I${dir}/src "
- }
-
set gccpath ${paths}
- if { ${HAVE_LIBSTDCXX_V3} } {
- set odir_v3 [lookfor_file ${gccpath} libstdc++-v3]
- if { ${odir_v3} != "" } {
- append flags [exec sh ${odir_v3}/testsuite_flags --build-includes]
- }
- } else {
- set odir_v2 [lookfor_file ${gccpath} libstdc++]
- set sdir_v2 [lookfor_file ${srcdir} libstdc++]
- append flags "-I${sdir_v2} -I${sdir_v2}/stl "
+ set odir [lookfor_file ${gccpath} libstdc++-v3]
+ if { ${odir} != "" } {
+ append flags [exec sh ${odir}/scripts/testsuite_flags --build-includes]
}
return "$flags"
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index 69cf6fb2379..827062352f8 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -315,7 +315,12 @@ proc dg-require-dll { args } {
# Like check_conditional_xfail, but callable from a dg test.
proc dg-xfail-if { args } {
- eval check_conditional_xfail $args
+ set args [lreplace $args 0 0]
+ set selector "target [join [lindex $args 1]]"
+ if { [dg-process-target $selector] == "S" } {
+ global compiler_conditional_xfail_data
+ set compiler_conditional_xfail_data $args
+ }
}
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index db3700a0aff..38d416ccb77 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -81,7 +81,10 @@ proc check_alias_available { } {
} else {
verbose "check_alias_available compiling testfile" 2
set f [open "tmp.c" "w"]
- puts $f "void f() __attribute__((alias(\"g\")));"
+ # Compile a small test program. The definition of "g" is
+ # necessary to keep the Solaris assembler from complaining
+ # about the program.
+ puts $f "void g() {} void f() __attribute__((alias(\"g\")));"
close $f
set lines [gcc_target_compile "tmp.c" "tmp.o" object ""]
file delete "tmp.c"
diff --git a/gcc/testsuite/objc.dg/const-str-2.m b/gcc/testsuite/objc.dg/const-str-2.m
index 779d40aff4e..c406665c576 100644
--- a/gcc/testsuite/objc.dg/const-str-2.m
+++ b/gcc/testsuite/objc.dg/const-str-2.m
@@ -2,6 +2,6 @@
/* { dg-do compile } */
/* { dg-options "-fconstant-string-class=" } */
-{ dg-error "no class name specified" "" { target *-*-* } 0 }
+{ dg-error "no class name specified|missing argument" "" { target *-*-* } 0 }
void foo () {}
diff --git a/gcc/timevar.c b/gcc/timevar.c
index 534001bfe10..d793029add9 100644
--- a/gcc/timevar.c
+++ b/gcc/timevar.c
@@ -1,5 +1,5 @@
/* Timing variables for measuring compiler performance.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2003 Free Software Foundation, Inc.
Contributed by Alex Samuel <samuel@codesourcery.com>
This file is part of GCC.
@@ -513,17 +513,6 @@ timevar_print (fp)
|| defined (HAVE_WALL_TIME) */
}
-/* Returns time (user + system) used so far by the compiler process,
- in microseconds. */
-
-long
-get_run_time ()
-{
- struct timevar_time_def total_elapsed;
- timevar_get (TV_TOTAL, &total_elapsed);
- return total_elapsed.user + total_elapsed.sys;
-}
-
/* Prints a message to stderr stating that time elapsed in STR is
TOTAL (given in microseconds). */
diff --git a/gcc/timevar.h b/gcc/timevar.h
index abcbb95dee0..5de57ed6e9d 100644
--- a/gcc/timevar.h
+++ b/gcc/timevar.h
@@ -1,5 +1,5 @@
/* Timing variables for measuring compiler performance.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2003 Free Software Foundation, Inc.
Contributed by Alex Samuel <samuel@codesourcery.com>
This file is part of GCC.
@@ -88,7 +88,6 @@ extern void timevar_get PARAMS ((timevar_id_t, struct timevar_time_def *));
extern void timevar_print PARAMS ((FILE *));
/* Provided for backward compatibility. */
-extern long get_run_time PARAMS ((void));
extern void print_time PARAMS ((const char *, long));
#endif /* ! GCC_TIMEVAR_H */
diff --git a/gcc/tlink.c b/gcc/tlink.c
index 6da909c7baa..98acd086e23 100644
--- a/gcc/tlink.c
+++ b/gcc/tlink.c
@@ -120,7 +120,7 @@ symbol_hash_lookup (string, create)
const char *string;
int create;
{
- PTR *e;
+ void **e;
e = htab_find_slot_with_hash (symbol_table, string,
(*htab_hash_string) (string),
create ? INSERT : NO_INSERT);
@@ -143,7 +143,7 @@ static struct file_hash_entry *
file_hash_lookup (string)
const char *string;
{
- PTR *e;
+ void **e;
e = htab_find_slot_with_hash (file_table, string,
(*htab_hash_string) (string),
INSERT);
@@ -165,7 +165,7 @@ demangled_hash_lookup (string, create)
const char *string;
int create;
{
- PTR *e;
+ void **e;
e = htab_find_slot_with_hash (demangled_table, string,
(*htab_hash_string) (string),
create ? INSERT : NO_INSERT);
diff --git a/gcc/toplev.c b/gcc/toplev.c
index dc939250f18..3c856768b3c 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1,4 +1,4 @@
-/* Top level of GNU C compiler
+/* Top level of GCC compilers (cc1, cc1plus, etc.)
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
@@ -77,6 +77,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "hosthooks.h"
#include "cgraph.h"
#include "opts.h"
+#include "coverage.h"
#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
#include "dwarf2out.h"
@@ -112,19 +113,10 @@ static int lang_dependent_init (const char *);
static void init_asm_output (const char *);
static void finalize (void);
-static void set_target_switch (const char *);
-
static void crash_signal (int) ATTRIBUTE_NORETURN;
static void setup_core_dumping (void);
static void compile_file (void);
-void decode_d_option (const char *);
-static int decode_f_option (const char *);
-static int decode_W_option (const char *);
-static int decode_g_option (const char *);
-static unsigned int independent_decode_option (int, char **);
-static void set_Wextra (int);
-
static int print_single_switch (FILE *, int, int, const char *,
const char *, const char *,
const char *, const char *);
@@ -151,8 +143,8 @@ static void rest_of_handle_if_after_combine (tree, rtx);
static void rest_of_handle_tracer (tree, rtx);
static void rest_of_handle_combine (tree, rtx);
static void rest_of_handle_regmove (tree, rtx);
-static void rest_of_handle_sched (tree, rtx);
#ifdef INSN_SCHEDULING
+static void rest_of_handle_sched (tree, rtx);
static void rest_of_handle_sched2 (tree, rtx);
#endif
static bool rest_of_handle_new_regalloc (tree, rtx, int *);
@@ -290,6 +282,7 @@ enum dump_file_index
DFI_rnreg,
DFI_bbro,
DFI_ce3,
+ DFI_branch_target_load,
DFI_sched2,
DFI_stack,
DFI_mach,
@@ -302,8 +295,8 @@ enum dump_file_index
Remaining -d letters:
- " o q "
- " H JK OPQ TUV YZ"
+ " m q "
+ " JK O Q UV YZ"
*/
static struct dump_file_info dump_file[DFI_MAX] =
@@ -341,6 +334,7 @@ static struct dump_file_info dump_file[DFI_MAX] =
{ "rnreg", 'n', 1, 0, 0 },
{ "bbro", 'B', 1, 0, 0 },
{ "ce3", 'E', 1, 0, 0 },
+ { "btl", 'd', 1, 0, 0 }, /* Yes, duplicate enable switch. */
{ "sched2", 'R', 1, 0, 0 },
{ "stack", 'k', 1, 0, 0 },
{ "mach", 'M', 1, 0, 0 },
@@ -408,6 +402,9 @@ int flag_eliminate_dwarf2_dups = 0;
int flag_eliminate_unused_debug_types = 1;
+/* Nonzero means emit debugging information only for symbols which are used. */
+int flag_debug_only_used_symbols = 0;
+
/* Nonzero if generating code to do profiling. */
int profile_flag = 0;
@@ -416,6 +413,10 @@ int profile_flag = 0;
int profile_arc_flag = 0;
+/* Nonzero if value histograms should be measured. */
+
+int flag_profile_values = 0;
+
/* Nonzero if generating info for gcov to calculate line test coverage. */
int flag_test_coverage = 0;
@@ -453,7 +454,7 @@ int quiet_flag = 0;
/* Print times taken by the various passes. -ftime-report. */
-static int time_report = 0;
+int time_report = 0;
/* Print memory still in use at end of compilation (which may have little
to do with peak memory consumption). -fmem-report. */
@@ -640,7 +641,7 @@ int flag_finite_math_only = 0;
int flag_trapping_math = 1;
/* Nonzero means disable transformations observable by signaling NaNs.
- This option implies that any operation on a IEEE signaling NaN can
+ This option implies that any operation on an IEEE signaling NaN can
generate a (user-visible) trap. */
int flag_signaling_nans = 0;
@@ -657,24 +658,24 @@ int flag_syntax_only = 0;
/* Nonzero means perform loop optimizer. */
-static int flag_loop_optimize;
+int flag_loop_optimize;
/* Nonzero means perform crossjumping. */
-static int flag_crossjumping;
+int flag_crossjumping;
/* Nonzero means perform if conversion. */
-static int flag_if_conversion;
+int flag_if_conversion;
/* Nonzero means perform if conversion after reload. */
-static int flag_if_conversion2;
+int flag_if_conversion2;
/* Nonzero means to use global dataflow analysis to eliminate
useless null pointer tests. */
-static int flag_delete_null_pointer_checks;
+int flag_delete_null_pointer_checks;
/* Nonzero means perform global CSE. */
@@ -692,10 +693,20 @@ int flag_gcse_lm = 1;
int flag_gcse_sm = 1;
+/* Perform target register optimization before prologue / epilogue
+ threading. */
+
+int flag_branch_target_load_optimize = 0;
+
+/* Perform target register optimization after prologue / epilogue
+ threading and jump2. */
+
+int flag_branch_target_load_optimize2 = 0;
+
/* Nonzero means to rerun cse after loop optimization. This increases
compilation time about 20% and picks up a few more common expressions. */
-static int flag_rerun_cse_after_loop;
+int flag_rerun_cse_after_loop;
/* Nonzero means to run loop optimizations twice. */
@@ -1033,6 +1044,9 @@ static const param_info lang_independent_params[] = {
{ NULL, 0, NULL }
};
+/* Used for the f_options array temporarily. */
+static int flag_dummy;
+
/* Table of language-independent -f options.
STRING is the option name. VARIABLE is the address of the variable.
ON_VALUE is the value to store in VARIABLE
@@ -1041,231 +1055,239 @@ static const param_info lang_independent_params[] = {
static const lang_independent_options f_options[] =
{
- {"eliminate-dwarf2-dups", &flag_eliminate_dwarf2_dups, 1,
+ {"eliminate-dwarf2-dups", &flag_dummy, 1,
N_("Perform DWARF2 duplicate elimination") },
- {"eliminate-unused-debug-types", &flag_eliminate_unused_debug_types, 1,
+ {"eliminate-unused-debug-types", &flag_dummy, 1,
N_("Perform unused type elimination in debug info") },
- {"float-store", &flag_float_store, 1,
+ {"eliminate-unused-debug-symbols", &flag_dummy, 1,
+ N_("Perform unused type elimination in debug info") },
+ {"float-store", &flag_dummy, 1,
N_("Do not store floats in registers") },
- {"defer-pop", &flag_defer_pop, 1,
+ {"defer-pop", &flag_dummy, 1,
N_("Defer popping functions args from stack until later") },
- {"omit-frame-pointer", &flag_omit_frame_pointer, 1,
+ {"omit-frame-pointer", &flag_dummy, 1,
N_("When possible do not generate stack frames") },
- {"optimize-sibling-calls", &flag_optimize_sibling_calls, 1,
+ {"optimize-sibling-calls", &flag_dummy, 1,
N_("Optimize sibling and tail recursive calls") },
- {"tracer", &flag_tracer, 1,
+ {"tracer", &flag_dummy, 1,
N_("Perform superblock formation via tail duplication") },
- {"unit-at-a-time", &flag_unit_at_a_time, 1,
+ {"unit-at-a-time", &flag_dummy, 1,
N_("Compile whole compilation unit at a time") },
- {"cse-follow-jumps", &flag_cse_follow_jumps, 1,
+ {"cse-follow-jumps", &flag_dummy, 1,
N_("When running CSE, follow jumps to their targets") },
- {"cse-skip-blocks", &flag_cse_skip_blocks, 1,
+ {"cse-skip-blocks", &flag_dummy, 1,
N_("When running CSE, follow conditional jumps") },
- {"expensive-optimizations", &flag_expensive_optimizations, 1,
+ {"expensive-optimizations", &flag_dummy, 1,
N_("Perform a number of minor, expensive optimizations") },
- {"thread-jumps", &flag_thread_jumps, 1,
+ {"thread-jumps", &flag_dummy, 1,
N_("Perform jump threading optimizations") },
- {"strength-reduce", &flag_strength_reduce, 1,
+ {"strength-reduce", &flag_dummy, 1,
N_("Perform strength reduction optimizations") },
- {"unroll-loops", &flag_unroll_loops, 1,
+ {"unroll-loops", &flag_dummy, 1,
N_("Perform loop unrolling when iteration count is known") },
- {"unroll-all-loops", &flag_unroll_all_loops, 1,
+ {"unroll-all-loops", &flag_dummy, 1,
N_("Perform loop unrolling for all loops") },
- {"old-unroll-loops", &flag_old_unroll_loops, 1,
+ {"old-unroll-loops", &flag_dummy, 1,
N_("Perform loop unrolling when iteration count is known") },
- {"old-unroll-all-loops", &flag_old_unroll_all_loops, 1,
+ {"old-unroll-all-loops", &flag_dummy, 1,
N_("Perform loop unrolling for all loops") },
- {"peel-loops", &flag_peel_loops, 1,
+ {"peel-loops", &flag_dummy, 1,
N_("Perform loop peeling") },
- {"unswitch-loops", &flag_unswitch_loops, 1,
+ {"unswitch-loops", &flag_dummy, 1,
N_("Perform loop unswitching") },
- {"prefetch-loop-arrays", &flag_prefetch_loop_arrays, 1,
+ {"prefetch-loop-arrays", &flag_dummy, 1,
N_("Generate prefetch instructions, if available, for arrays in loops") },
- {"move-all-movables", &flag_move_all_movables, 1,
+ {"move-all-movables", &flag_dummy, 1,
N_("Force all loop invariant computations out of loops") },
- {"reduce-all-givs", &flag_reduce_all_givs, 1,
+ {"reduce-all-givs", &flag_dummy, 1,
N_("Strength reduce all loop general induction variables") },
- {"writable-strings", &flag_writable_strings, 1,
+ {"writable-strings", &flag_dummy, 1,
N_("Store strings in writable data section") },
- {"peephole", &flag_no_peephole, 0,
+ {"peephole", &flag_dummy, 0,
N_("Enable machine specific peephole optimizations") },
- {"force-mem", &flag_force_mem, 1,
+ {"force-mem", &flag_dummy, 1,
N_("Copy memory operands into registers before using") },
- {"force-addr", &flag_force_addr, 1,
+ {"force-addr", &flag_dummy, 1,
N_("Copy memory address constants into regs before using") },
- {"function-cse", &flag_no_function_cse, 0,
+ {"function-cse", &flag_dummy, 0,
N_("Allow function addresses to be held in registers") },
- {"inline-functions", &flag_inline_functions, 1,
+ {"inline-functions", &flag_dummy, 1,
N_("Integrate simple functions into their callers") },
- {"keep-inline-functions", &flag_keep_inline_functions, 1,
+ {"keep-inline-functions", &flag_dummy, 1,
N_("Generate code for funcs even if they are fully inlined") },
- {"inline", &flag_no_inline, 0,
+ {"inline", &flag_dummy, 0,
N_("Pay attention to the 'inline' keyword") },
- {"keep-static-consts", &flag_keep_static_consts, 1,
+ {"keep-static-consts", &flag_dummy, 1,
N_("Emit static const variables even if they are not used") },
- {"syntax-only", &flag_syntax_only, 1,
+ {"syntax-only", &flag_dummy, 1,
N_("Check for syntax errors, then stop") },
- {"shared-data", &flag_shared_data, 1,
+ {"shared-data", &flag_dummy, 1,
N_("Mark data as shared rather than private") },
- {"caller-saves", &flag_caller_saves, 1,
+ {"caller-saves", &flag_dummy, 1,
N_("Enable saving registers around function calls") },
- {"pcc-struct-return", &flag_pcc_struct_return, 1,
+ {"pcc-struct-return", &flag_dummy, 1,
N_("Return 'short' aggregates in memory, not registers") },
- {"reg-struct-return", &flag_pcc_struct_return, 0,
+ {"reg-struct-return", &flag_dummy, 0,
N_("Return 'short' aggregates in registers") },
- {"delayed-branch", &flag_delayed_branch, 1,
+ {"delayed-branch", &flag_dummy, 1,
N_("Attempt to fill delay slots of branch instructions") },
- {"gcse", &flag_gcse, 1,
+ {"gcse", &flag_dummy, 1,
N_("Perform the global common subexpression elimination") },
- {"gcse-lm", &flag_gcse_lm, 1,
+ {"gcse-lm", &flag_dummy, 1,
N_("Perform enhanced load motion during global subexpression elimination") },
- {"gcse-sm", &flag_gcse_sm, 1,
+ {"gcse-sm", &flag_dummy, 1,
N_("Perform store motion after global subexpression elimination") },
- {"loop-optimize", &flag_loop_optimize, 1,
+ {"branch-target-load-optimize", &flag_dummy, 1,
+ N_("Perform branch target load optimization before prologue / epilogue threading") },
+ {"branch-target-load-optimize2", &flag_dummy, 1,
+ N_("Perform branch target load optimization after prologue / epilogue threading") },
+ {"loop-optimize", &flag_dummy, 1,
N_("Perform the loop optimizations") },
- {"crossjumping", &flag_crossjumping, 1,
+ {"crossjumping", &flag_dummy, 1,
N_("Perform cross-jumping optimization") },
- {"if-conversion", &flag_if_conversion, 1,
+ {"if-conversion", &flag_dummy, 1,
N_("Perform conversion of conditional jumps to branchless equivalents") },
- {"if-conversion2", &flag_if_conversion2, 1,
+ {"if-conversion2", &flag_dummy, 1,
N_("Perform conversion of conditional jumps to conditional execution") },
- {"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1,
+ {"rerun-cse-after-loop", &flag_dummy, 1,
N_("Run CSE pass after loop optimizations") },
- {"rerun-loop-opt", &flag_rerun_loop_opt, 1,
+ {"rerun-loop-opt", &flag_dummy, 1,
N_("Run the loop optimizer twice") },
- {"delete-null-pointer-checks", &flag_delete_null_pointer_checks, 1,
+ {"delete-null-pointer-checks", &flag_dummy, 1,
N_("Delete useless null pointer checks") },
- {"schedule-insns", &flag_schedule_insns, 1,
+ {"schedule-insns", &flag_dummy, 1,
N_("Reschedule instructions before register allocation") },
- {"schedule-insns2", &flag_schedule_insns_after_reload, 1,
+ {"schedule-insns2", &flag_dummy, 1,
N_("Reschedule instructions after register allocation") },
- {"sched-interblock",&flag_schedule_interblock, 1,
+ {"sched-interblock",&flag_dummy, 1,
N_("Enable scheduling across basic blocks") },
- {"sched-spec",&flag_schedule_speculative, 1,
+ {"sched-spec",&flag_dummy, 1,
N_("Allow speculative motion of non-loads") },
- {"sched-spec-load",&flag_schedule_speculative_load, 1,
+ {"sched-spec-load",&flag_dummy, 1,
N_("Allow speculative motion of some loads") },
- {"sched-spec-load-dangerous",&flag_schedule_speculative_load_dangerous, 1,
+ {"sched-spec-load-dangerous",&flag_dummy, 1,
N_("Allow speculative motion of more loads") },
- {"sched2-use-superblocks", &flag_sched2_use_superblocks, 1,
+ {"sched2-use-superblocks", &flag_dummy, 1,
N_("If scheduling post reload, do superblock scheduling") },
- {"sched2-use-traces", &flag_sched2_use_traces, 1,
+ {"sched2-use-traces", &flag_dummy, 1,
N_("If scheduling post reload, do trace scheduling") },
- {"branch-count-reg",&flag_branch_on_count_reg, 1,
+ {"branch-count-reg",&flag_dummy, 1,
N_("Replace add,compare,branch with branch on count reg") },
- {"pic", &flag_pic, 1,
+ {"pic", &flag_dummy, 1,
N_("Generate position independent code, if possible") },
- {"PIC", &flag_pic, 2, ""},
- {"pie", &flag_pie, 1,
+ {"PIC", &flag_dummy, 2, ""},
+ {"pie", &flag_dummy, 1,
N_("Generate position independent code for executables, if possible") },
- {"PIE", &flag_pie, 2, ""},
- {"exceptions", &flag_exceptions, 1,
+ {"PIE", &flag_dummy, 2, ""},
+ {"exceptions", &flag_dummy, 1,
N_("Enable exception handling") },
- {"unwind-tables", &flag_unwind_tables, 1,
+ {"unwind-tables", &flag_dummy, 1,
N_("Just generate unwind tables for exception handling") },
- {"asynchronous-unwind-tables", &flag_asynchronous_unwind_tables, 1,
+ {"asynchronous-unwind-tables", &flag_dummy, 1,
N_("Generate unwind tables exact at each instruction boundary") },
- {"non-call-exceptions", &flag_non_call_exceptions, 1,
+ {"non-call-exceptions", &flag_dummy, 1,
N_("Support synchronous non-call exceptions") },
- {"profile-arcs", &profile_arc_flag, 1,
+ {"profile-arcs", &flag_dummy, 1,
N_("Insert arc based program profiling code") },
- {"test-coverage", &flag_test_coverage, 1,
+ {"test-coverage", &flag_dummy, 1,
N_("Create data files needed by gcov") },
- {"branch-probabilities", &flag_branch_probabilities, 1,
+ {"branch-probabilities", &flag_dummy, 1,
N_("Use profiling information for branch probabilities") },
- {"profile", &profile_flag, 1,
+ {"profile-values", &flag_profile_values, 1,
+ N_("Insert code to profile values of expressions") },
+ {"profile", &flag_dummy, 1,
N_("Enable basic program profiling code") },
- {"reorder-blocks", &flag_reorder_blocks, 1,
+ {"reorder-blocks", &flag_dummy, 1,
N_("Reorder basic blocks to improve code placement") },
- {"reorder-functions", &flag_reorder_functions, 1,
+ {"reorder-functions", &flag_dummy, 1,
N_("Reorder functions to improve code placement") },
- {"rename-registers", &flag_rename_registers, 1,
+ {"rename-registers", &flag_dummy, 1,
N_("Do the register renaming optimization pass") },
- {"cprop-registers", &flag_cprop_registers, 1,
+ {"cprop-registers", &flag_dummy, 1,
N_("Do the register copy-propagation optimization pass") },
- {"common", &flag_no_common, 0,
+ {"common", &flag_dummy, 0,
N_("Do not put uninitialized globals in the common section") },
- {"inhibit-size-directive", &flag_inhibit_size_directive, 1,
+ {"inhibit-size-directive", &flag_dummy, 1,
N_("Do not generate .size directives") },
- {"function-sections", &flag_function_sections, 1,
+ {"function-sections", &flag_dummy, 1,
N_("place each function into its own section") },
- {"data-sections", &flag_data_sections, 1,
+ {"data-sections", &flag_dummy, 1,
N_("place data items into their own section") },
- {"verbose-asm", &flag_verbose_asm, 1,
+ {"verbose-asm", &flag_dummy, 1,
N_("Add extra commentary to assembler output") },
- {"gnu-linker", &flag_gnu_linker, 1,
+ {"gnu-linker", &flag_dummy, 1,
N_("Output GNU ld formatted global initializers") },
- {"regmove", &flag_regmove, 1,
+ {"regmove", &flag_dummy, 1,
N_("Enables a register move optimization") },
- {"optimize-register-move", &flag_regmove, 1,
+ {"optimize-register-move", &flag_dummy, 1,
N_("Do the full regmove optimization pass") },
- {"pack-struct", &flag_pack_struct, 1,
+ {"pack-struct", &flag_dummy, 1,
N_("Pack structure members together without holes") },
- {"stack-check", &flag_stack_check, 1,
+ {"stack-check", &flag_dummy, 1,
N_("Insert stack checking code into the program") },
- {"argument-alias", &flag_argument_noalias, 0,
+ {"argument-alias", &flag_dummy, 0,
N_("Specify that arguments may alias each other & globals") },
- {"argument-noalias", &flag_argument_noalias, 1,
+ {"argument-noalias", &flag_dummy, 1,
N_("Assume arguments may alias globals but not each other") },
- {"argument-noalias-global", &flag_argument_noalias, 2,
+ {"argument-noalias-global", &flag_dummy, 2,
N_("Assume arguments do not alias each other or globals") },
- {"strict-aliasing", &flag_strict_aliasing, 1,
+ {"strict-aliasing", &flag_dummy, 1,
N_("Assume strict aliasing rules apply") },
- {"align-loops", &align_loops, 0,
+ {"align-loops", &flag_dummy, 0,
N_("Align the start of loops") },
- {"align-jumps", &align_jumps, 0,
+ {"align-jumps", &flag_dummy, 0,
N_("Align labels which are only reached by jumping") },
- {"align-labels", &align_labels, 0,
+ {"align-labels", &flag_dummy, 0,
N_("Align all labels") },
- {"align-functions", &align_functions, 0,
+ {"align-functions", &flag_dummy, 0,
N_("Align the start of functions") },
- {"merge-constants", &flag_merge_constants, 1,
+ {"merge-constants", &flag_dummy, 1,
N_("Attempt to merge identical constants across compilation units") },
- {"merge-all-constants", &flag_merge_constants, 2,
+ {"merge-all-constants", &flag_dummy, 2,
N_("Attempt to merge identical constants and constant variables") },
- {"dump-unnumbered", &flag_dump_unnumbered, 1,
+ {"dump-unnumbered", &flag_dummy, 1,
N_("Suppress output of instruction numbers and line number notes in debugging dumps") },
- {"instrument-functions", &flag_instrument_function_entry_exit, 1,
+ {"instrument-functions", &flag_dummy, 1,
N_("Instrument function entry/exit with profiling calls") },
- {"zero-initialized-in-bss", &flag_zero_initialized_in_bss, 1,
+ {"zero-initialized-in-bss", &flag_dummy, 1,
N_("Put zero initialized data in the bss section") },
- {"ssa", &flag_ssa, 1,
+ {"ssa", &flag_dummy, 1,
N_("Enable SSA optimizations") },
- {"ssa-ccp", &flag_ssa_ccp, 1,
+ {"ssa-ccp", &flag_dummy, 1,
N_("Enable SSA conditional constant propagation") },
- {"ssa-dce", &flag_ssa_dce, 1,
+ {"ssa-dce", &flag_dummy, 1,
N_("Enable aggressive SSA dead code elimination") },
- {"leading-underscore", &flag_leading_underscore, 1,
+ {"leading-underscore", &flag_dummy, 1,
N_("External symbols have a leading underscore") },
- {"ident", &flag_no_ident, 0,
+ {"ident", &flag_dummy, 0,
N_("Process #ident directives") },
- { "peephole2", &flag_peephole2, 1,
+ { "peephole2", &flag_dummy, 1,
N_("Enables an rtl peephole pass run before sched2") },
- {"finite-math-only", &flag_finite_math_only, 1,
+ {"finite-math-only", &flag_dummy, 1,
N_("Assume no NaNs or +-Infs are generated") },
- { "guess-branch-probability", &flag_guess_branch_prob, 1,
+ { "guess-branch-probability", &flag_dummy, 1,
N_("Enables guessing of branch probabilities") },
- {"math-errno", &flag_errno_math, 1,
+ {"math-errno", &flag_dummy, 1,
N_("Set errno after built-in math functions") },
- {"trapping-math", &flag_trapping_math, 1,
+ {"trapping-math", &flag_dummy, 1,
N_("Floating-point operations can trap") },
- {"unsafe-math-optimizations", &flag_unsafe_math_optimizations, 1,
+ {"unsafe-math-optimizations", &flag_dummy, 1,
N_("Allow math optimizations that may violate IEEE or ANSI standards") },
- {"signaling-nans", &flag_signaling_nans, 1,
+ {"signaling-nans", &flag_dummy, 1,
N_("Disable optimizations observable by IEEE signaling NaNs") },
- {"bounds-check", &flag_bounds_check, 1,
+ {"bounds-check", &flag_dummy, 1,
N_("Generate code to check bounds before indexing arrays") },
- {"single-precision-constant", &flag_single_precision_constant, 1,
+ {"single-precision-constant", &flag_dummy, 1,
N_("Convert floating point constant to single precision constant") },
- {"time-report", &time_report, 1,
+ {"time-report", &flag_dummy, 1,
N_("Report time taken by each compiler pass at end of run") },
- {"mem-report", &mem_report, 1,
+ {"mem-report", &flag_dummy, 1,
N_("Report on permanent memory allocation at end of run") },
- { "trapv", &flag_trapv, 1,
+ { "trapv", &flag_dummy, 1,
N_("Trap for signed overflow in addition / subtraction / multiplication") },
- { "wrapv", &flag_wrapv, 1,
+ { "wrapv", &flag_dummy, 1,
N_("Assume signed arithmetic overflow wraps around") },
- { "new-ra", &flag_new_regalloc, 1,
+ { "new-ra", &flag_dummy, 1,
N_("Use graph coloring register allocation.") },
};
@@ -1479,220 +1501,64 @@ target_options[] = TARGET_OPTIONS;
/* Options controlling warnings. */
-/* Don't print warning messages. -w. */
-
-int inhibit_warnings = 0;
-
-/* Don't suppress warnings from system headers. -Wsystem-headers. */
-
-int warn_system_headers = 0;
-
-/* Print various extra warnings. -W/-Wextra. */
-
-int extra_warnings = 0;
-
-/* Treat warnings as errors. -Werror. */
-
-int warnings_are_errors = 0;
-
-/* Nonzero to warn about unused variables, functions et.al. */
-
-int warn_unused_function;
-int warn_unused_label;
-int warn_unused_parameter;
-int warn_unused_variable;
-int warn_unused_value;
-
-/* Used for cooperation between set_Wunused and set_Wextra. */
-static int maybe_warn_unused_parameter;
-
-/* Nonzero to warn about code which is never reached. */
-
-int warn_notreached;
-
-/* Nonzero to warn about variables used before they are initialized. */
-
-int warn_uninitialized;
-
-/* Nonzero means warn about all declarations which shadow others. */
-
-int warn_shadow;
-
-/* Warn if a switch on an enum, that does not have a default case,
- fails to have a case for every enum value. */
-
-int warn_switch;
-
-/* Warn if a switch does not have a default case. */
-
-int warn_switch_default;
-
-/* Warn if a switch on an enum fails to have a case for every enum
- value (regardless of the presence or otherwise of a default case). */
-
-int warn_switch_enum;
-
/* Nonzero means warn about function definitions that default the return type
or that use a null return and have a return-type other than void. */
int warn_return_type;
-/* Nonzero means warn about pointer casts that increase the required
- alignment of the target type (and might therefore lead to a crash
- due to a misaligned access). */
-
-int warn_cast_align;
-
-/* Nonzero means warn about any objects definitions whose size is larger
- than N bytes. Also want about function definitions whose returned
- values are larger than N bytes. The value N is in `larger_than_size'. */
-
-int warn_larger_than;
-HOST_WIDE_INT larger_than_size;
-
-/* Nonzero means warn if inline function is too large. */
-
-int warn_inline;
-
-/* Warn if a function returns an aggregate,
- since there are often incompatible calling conventions for doing this. */
-
-int warn_aggregate_return;
-
-/* Warn if packed attribute on struct is unnecessary and inefficient. */
-
-int warn_packed;
-
-/* Warn when gcc pads a structure to an alignment boundary. */
-
-int warn_padded;
-
-/* Warn when an optimization pass is disabled. */
-
-int warn_disabled_optimization;
-
-/* Warn about functions which might be candidates for attribute noreturn. */
-
-int warn_missing_noreturn;
-
-/* Nonzero means warn about uses of __attribute__((deprecated))
- declarations. */
-
-int warn_deprecated_decl = 1;
-
-/* Nonzero means warn about constructs which might not be
- strict-aliasing safe. */
-
-int warn_strict_aliasing;
+/* Used for the -W options array temporarily. */
+static int warn_dummy;
/* Like f_options, but for -W. */
static const lang_independent_options W_options[] =
{
- {"unused-function", &warn_unused_function, 1,
+ {"unused-function", &warn_dummy, 1,
N_("Warn when a function is unused") },
- {"unused-label", &warn_unused_label, 1,
+ {"unused-label", &warn_dummy, 1,
N_("Warn when a label is unused") },
- {"unused-parameter", &warn_unused_parameter, 1,
+ {"unused-parameter", &warn_dummy, 1,
N_("Warn when a function parameter is unused") },
- {"unused-variable", &warn_unused_variable, 1,
+ {"unused-variable", &warn_dummy, 1,
N_("Warn when a variable is unused") },
- {"unused-value", &warn_unused_value, 1,
+ {"unused-value", &warn_dummy, 1,
N_("Warn when an expression value is unused") },
- {"system-headers", &warn_system_headers, 1,
+ {"system-headers", &warn_dummy, 1,
N_("Do not suppress warnings from system headers") },
- {"error", &warnings_are_errors, 1,
+ {"error", &warn_dummy, 1,
N_("Treat all warnings as errors") },
- {"shadow", &warn_shadow, 1,
+ {"shadow", &warn_dummy, 1,
N_("Warn when one local variable shadows another") },
- {"switch", &warn_switch, 1,
+ {"switch", &warn_dummy, 1,
N_("Warn about enumerated switches, with no default, missing a case") },
- {"switch-default", &warn_switch_default, 1,
+ {"switch-default", &warn_dummy, 1,
N_("Warn about enumerated switches missing a default case") },
- {"switch-enum", &warn_switch_enum, 1,
+ {"switch-enum", &warn_dummy, 1,
N_("Warn about all enumerated switches missing a specific case") },
- {"aggregate-return", &warn_aggregate_return, 1,
+ {"aggregate-return", &warn_dummy, 1,
N_("Warn about returning structures, unions or arrays") },
- {"cast-align", &warn_cast_align, 1,
+ {"cast-align", &warn_dummy, 1,
N_("Warn about pointer casts which increase alignment") },
- {"unreachable-code", &warn_notreached, 1,
+ {"unreachable-code", &warn_dummy, 1,
N_("Warn about code that will never be executed") },
- {"uninitialized", &warn_uninitialized, 1,
+ {"uninitialized", &warn_dummy, 1,
N_("Warn about uninitialized automatic variables") },
- {"inline", &warn_inline, 1,
+ {"inline", &warn_dummy, 1,
N_("Warn when an inlined function cannot be inlined") },
- {"packed", &warn_packed, 1,
+ {"packed", &warn_dummy, 1,
N_("Warn when the packed attribute has no effect on struct layout") },
- {"padded", &warn_padded, 1,
+ {"padded", &warn_dummy, 1,
N_("Warn when padding is required to align struct members") },
- {"disabled-optimization", &warn_disabled_optimization, 1,
+ {"disabled-optimization", &warn_dummy, 1,
N_("Warn when an optimization pass is disabled") },
- {"deprecated-declarations", &warn_deprecated_decl, 1,
+ {"deprecated-declarations", &warn_dummy, 1,
N_("Warn about uses of __attribute__((deprecated)) declarations") },
- {"missing-noreturn", &warn_missing_noreturn, 1,
+ {"missing-noreturn", &warn_dummy, 1,
N_("Warn about functions which might be candidates for attribute noreturn") },
- {"strict-aliasing", &warn_strict_aliasing, 1,
+ {"strict-aliasing", &warn_dummy, 1,
N_ ("Warn about code which might break the strict aliasing rules") }
};
-/* Initialize unused warning flags. */
-void
-set_Wunused (int setting)
-{
- warn_unused_function = setting;
- warn_unused_label = setting;
- /* Unused function parameter warnings are reported when either
- ``-Wextra -Wunused'' or ``-Wunused-parameter'' is specified.
- Thus, if -Wextra has already been seen, set warn_unused_parameter;
- otherwise set maybe_warn_extra_parameter, which will be picked up
- by set_Wextra. */
- maybe_warn_unused_parameter = setting;
- warn_unused_parameter = (setting && extra_warnings);
- warn_unused_variable = setting;
- warn_unused_value = setting;
-}
-
-/* Initialize more unused warning flags. */
-static void
-set_Wextra (int setting)
-{
- extra_warnings = setting;
- warn_unused_value = setting;
- warn_unused_parameter = (setting && maybe_warn_unused_parameter);
-
- /* We save the value of warn_uninitialized, since if they put
- -Wuninitialized on the command line, we need to generate a
- warning about not using it without also specifying -O. */
- if (setting == 0)
- warn_uninitialized = 0;
- else if (warn_uninitialized != 1)
- warn_uninitialized = 2;
-}
-
-/* The following routines are useful in setting all the flags that
- -ffast-math and -fno-fast-math imply. */
-
-void
-set_fast_math_flags (int set)
-{
- flag_trapping_math = !set;
- flag_unsafe_math_optimizations = set;
- flag_finite_math_only = set;
- flag_errno_math = !set;
- if (set)
- flag_signaling_nans = 0;
-}
-
-/* Return true iff flags are set as if -ffast-math. */
-bool
-fast_math_flags_set_p (void)
-{
- return (!flag_trapping_math
- && flag_unsafe_math_optimizations
- && flag_finite_math_only
- && !flag_errno_math);
-}
-
/* Output files for assembler code (real compiler output)
and debugging dumps. */
@@ -2042,7 +1908,14 @@ wrapup_global_declarations (tree *vec, int len)
{
bool needed = 1;
- if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
+ if (flag_unit_at_a_time
+ && cgraph_varpool_node (decl)->finalized)
+ needed = 0;
+ else if (flag_unit_at_a_time
+ && (TREE_USED (decl)
+ || TREE_USED (DECL_ASSEMBLER_NAME (decl))))
+ /* needed */;
+ else if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
/* needed */;
else if (DECL_COMDAT (decl))
needed = 0;
@@ -2214,6 +2087,8 @@ compile_file (void)
(*lang_hooks.decls.final_write_globals)();
+ cgraph_varpool_assemble_pending_decls ();
+
/* This must occur after the loop to output deferred functions.
Else the coverage initializer would not be emitted if all the
functions in this compilation unit were deferred. */
@@ -2314,7 +2189,13 @@ rest_of_decl_compilation (tree decl,
/* Don't output anything when a tentative file-scope definition
is seen. But at end of compilation, do output code for them. */
if (at_end || !DECL_DEFER_OUTPUT (decl))
- assemble_variable (decl, top_level, at_end, 0);
+ {
+ if (flag_unit_at_a_time && !cgraph_global_info_ready
+ && TREE_CODE (decl) != FUNCTION_DECL && top_level)
+ cgraph_varpool_finalize_decl (decl);
+ else
+ assemble_variable (decl, top_level, at_end, 0);
+ }
#ifdef ASM_FINISH_DECLARE_OBJECT
if (decl == last_assemble_variable_decl)
@@ -2671,12 +2552,12 @@ rest_of_handle_reorder_blocks (tree decl, rtx insns)
timevar_pop (TV_REORDER_BLOCKS);
}
+#ifdef INSN_SCHEDULING
/* Run instruction scheduler. */
static void
rest_of_handle_sched (tree decl, rtx insns)
{
timevar_push (TV_SCHED);
-#ifdef INSN_SCHEDULING
/* Print function header into sched dump now
because doing the sched analysis makes some of the dump. */
@@ -2691,13 +2572,11 @@ rest_of_handle_sched (tree decl, rtx insns)
close_dump_file (DFI_sched, print_rtl_with_bb, insns);
}
-#endif
timevar_pop (TV_SCHED);
ggc_collect ();
}
-#ifdef INSN_SCHEDULING
/* Run second scheduling pass after reload. */
static void
rest_of_handle_sched2 (tree decl, rtx insns)
@@ -3737,7 +3616,9 @@ rest_of_compilation (tree decl)
(see handling of reg_known_equiv in init_alias_analysis). */
recompute_reg_usage (insns, !optimize_size);
+#ifdef INSN_SCHEDULING
rest_of_handle_sched (decl, insns);
+#endif
/* Determine if the current function is a leaf before running reload
since this can impact optimizations done by the prologue and
@@ -3801,6 +3682,17 @@ rest_of_compilation (tree decl)
#endif
split_all_insns (0);
+ if (flag_branch_target_load_optimize)
+ {
+ open_dump_file (DFI_branch_target_load, decl);
+
+ branch_target_load_optimize (insns, false);
+
+ close_dump_file (DFI_branch_target_load, print_rtl_with_bb, insns);
+
+ ggc_collect ();
+ }
+
if (optimize)
cleanup_cfg (CLEANUP_EXPENSIVE);
@@ -3809,6 +3701,7 @@ rest_of_compilation (tree decl)
it and the rest of the code and also allows delayed branch
scheduling to operate in the epilogue. */
thread_prologue_and_epilogue_insns (insns);
+ epilogue_completed = 1;
if (optimize)
{
@@ -3865,6 +3758,24 @@ rest_of_compilation (tree decl)
timevar_pop (TV_IFCVT2);
}
+ if (flag_branch_target_load_optimize2)
+ {
+ /* Leave this a warning for now so that it is possible to experiment
+ with running this pass twice. In 3.6, we should either make this
+ an error, or use separate dump files. */
+ if (flag_branch_target_load_optimize)
+ warning ("branch target register load optimization is not intended "
+ "to be run twice");
+
+ open_dump_file (DFI_branch_target_load, decl);
+
+ branch_target_load_optimize (insns, true);
+
+ close_dump_file (DFI_branch_target_load, print_rtl_with_bb, insns);
+
+ ggc_collect ();
+ }
+
#ifdef INSN_SCHEDULING
if (optimize > 0 && flag_schedule_insns_after_reload)
rest_of_handle_sched2 (decl, insns);
@@ -3944,6 +3855,7 @@ rest_of_compilation (tree decl)
#endif
reload_completed = 0;
+ epilogue_completed = 0;
flow2_completed = 0;
no_new_pseudos = 0;
@@ -4260,194 +4172,6 @@ decode_d_option (const char *arg)
}
}
-/* Parse a -f... command line switch. ARG is the value after the -f.
- It is safe to access 'ARG - 2' to generate the full switch name.
- Return the number of strings consumed. */
-
-static int
-decode_f_option (const char *arg)
-{
- int j;
- const char *option_value = NULL;
-
- /* Search for the option in the table of binary f options. */
- for (j = ARRAY_SIZE (f_options); j--;)
- {
- if (!strcmp (arg, f_options[j].string))
- {
- *f_options[j].variable = f_options[j].on_value;
- return 1;
- }
-
- if (arg[0] == 'n' && arg[1] == 'o' && arg[2] == '-'
- && ! strcmp (arg + 3, f_options[j].string))
- {
- *f_options[j].variable = ! f_options[j].on_value;
- return 1;
- }
- }
-
- if (!strcmp (arg, "fast-math"))
- set_fast_math_flags (1);
- else if (!strcmp (arg, "no-fast-math"))
- set_fast_math_flags (0);
- else if ((option_value = skip_leading_substring (arg, "inline-limit-"))
- || (option_value = skip_leading_substring (arg, "inline-limit=")))
- {
- int val =
- read_integral_parameter (option_value, arg - 2,
- MAX_INLINE_INSNS);
- set_param_value ("max-inline-insns", val);
- set_param_value ("max-inline-insns-single", val/2);
- set_param_value ("max-inline-insns-auto", val/2);
- set_param_value ("max-inline-insns-rtl", val);
- if (val/4 < MIN_INLINE_INSNS)
- {
- if (val/4 > 10)
- set_param_value ("min-inline-insns", val/4);
- else
- set_param_value ("min-inline-insns", 10);
- }
- }
- else if ((option_value = skip_leading_substring (arg, "tls-model=")))
- {
- if (strcmp (option_value, "global-dynamic") == 0)
- flag_tls_default = TLS_MODEL_GLOBAL_DYNAMIC;
- else if (strcmp (option_value, "local-dynamic") == 0)
- flag_tls_default = TLS_MODEL_LOCAL_DYNAMIC;
- else if (strcmp (option_value, "initial-exec") == 0)
- flag_tls_default = TLS_MODEL_INITIAL_EXEC;
- else if (strcmp (option_value, "local-exec") == 0)
- flag_tls_default = TLS_MODEL_LOCAL_EXEC;
- else
- warning ("`%s': unknown tls-model option", arg - 2);
- }
-#ifdef INSN_SCHEDULING
- else if ((option_value = skip_leading_substring (arg, "sched-verbose=")))
- fix_sched_param ("verbose", option_value);
-#endif
- else if ((option_value = skip_leading_substring (arg, "fixed-")))
- fix_register (option_value, 1, 1);
- else if ((option_value = skip_leading_substring (arg, "call-used-")))
- fix_register (option_value, 0, 1);
- else if ((option_value = skip_leading_substring (arg, "call-saved-")))
- fix_register (option_value, 0, 0);
- else if ((option_value = skip_leading_substring (arg, "align-loops=")))
- align_loops = read_integral_parameter (option_value, arg - 2, align_loops);
- else if ((option_value = skip_leading_substring (arg, "align-functions=")))
- align_functions
- = read_integral_parameter (option_value, arg - 2, align_functions);
- else if ((option_value = skip_leading_substring (arg, "align-jumps=")))
- align_jumps = read_integral_parameter (option_value, arg - 2, align_jumps);
- else if ((option_value = skip_leading_substring (arg, "align-labels=")))
- align_labels
- = read_integral_parameter (option_value, arg - 2, align_labels);
- else if ((option_value
- = skip_leading_substring (arg, "stack-limit-register=")))
- {
- int reg = decode_reg_name (option_value);
- if (reg < 0)
- error ("unrecognized register name `%s'", option_value);
- else
- stack_limit_rtx = gen_rtx_REG (Pmode, reg);
- }
- else if ((option_value
- = skip_leading_substring (arg, "stack-limit-symbol=")))
- {
- const char *nm;
- nm = ggc_strdup (option_value);
- stack_limit_rtx = gen_rtx_SYMBOL_REF (Pmode, nm);
- }
- else if ((option_value
- = skip_leading_substring (arg, "message-length=")))
- output_set_maximum_length
- (&global_dc->buffer, read_integral_parameter
- (option_value, arg - 2, diagnostic_line_cutoff (global_dc)));
- else if ((option_value
- = skip_leading_substring (arg, "diagnostics-show-location=")))
- {
- if (!strcmp (option_value, "once"))
- diagnostic_prefixing_rule (global_dc) = DIAGNOSTICS_SHOW_PREFIX_ONCE;
- else if (!strcmp (option_value, "every-line"))
- diagnostic_prefixing_rule (global_dc)
- = DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE;
- else
- error ("unrecognized option `%s'", arg - 2);
- }
- else if (!strcmp (arg, "no-stack-limit"))
- stack_limit_rtx = NULL_RTX;
- else if ((option_value = skip_leading_substring (arg, "random-seed=")))
- flag_random_seed = option_value;
- else if (!strcmp (arg, "no-random-seed"))
- flag_random_seed = NULL;
- else if (!strcmp (arg, "preprocessed"))
- /* Recognize this switch but do nothing. This prevents warnings
- about an unrecognized switch if cpplib has not been linked in. */
- ;
- else
- return 0;
-
- return 1;
-}
-
-/* Parse a -W... command line switch. ARG is the value after the -W.
- It is safe to access 'ARG - 2' to generate the full switch name.
- Return the number of strings consumed. */
-
-static int
-decode_W_option (const char *arg)
-{
- const char *option_value = NULL;
- int j;
-
- /* Search for the option in the table of binary W options. */
-
- for (j = ARRAY_SIZE (W_options); j--;)
- {
- if (!strcmp (arg, W_options[j].string))
- {
- *W_options[j].variable = W_options[j].on_value;
- return 1;
- }
-
- if (arg[0] == 'n' && arg[1] == 'o' && arg[2] == '-'
- && ! strcmp (arg + 3, W_options[j].string))
- {
- *W_options[j].variable = ! W_options[j].on_value;
- return 1;
- }
- }
-
- if ((option_value = skip_leading_substring (arg, "id-clash-")))
- warning ("-Wid-clash-LEN is no longer supported");
- else if ((option_value = skip_leading_substring (arg, "larger-than-")))
- {
- larger_than_size = read_integral_parameter (option_value, arg - 2, -1);
-
- warn_larger_than = larger_than_size != -1;
- }
- else if (!strcmp (arg, "unused"))
- {
- set_Wunused (1);
- }
- else if (!strcmp (arg, "no-unused"))
- {
- set_Wunused (0);
- }
- else if (!strcmp (arg, "extra"))
- {
- set_Wextra (1);
- }
- else if (!strcmp (arg, "no-extra"))
- {
- set_Wextra (0);
- }
- else
- return 0;
-
- return 1;
-}
-
/* Indexed by enum debug_info_type. */
const char *const debug_type_names[] =
{
@@ -4458,7 +4182,7 @@ const char *const debug_type_names[] =
It is safe to access 'ARG - 2' to generate the full switch name.
Return the number of strings consumed. */
-static int
+void
decode_g_option (const char *arg)
{
static unsigned level = 0;
@@ -4569,93 +4293,13 @@ ignoring option `%s' due to invalid debug level specification",
}
if (! da->arg)
- return 0;
-
- return 1;
-}
-
-/* Decode the first argument in the argv as a language-independent option.
- Return the number of strings consumed. */
-
-static unsigned int
-independent_decode_option (int argc, char **argv)
-{
- char *arg = argv[0];
-
- if (arg[0] != '-' || arg[1] == 0)
- return 1;
-
- arg++;
-
- /* Handle '--param <name>=<value>'. */
- if (strcmp (arg, "-param") == 0)
- {
- char *equal;
-
- if (argc == 1)
- {
- error ("-param option missing argument");
- return 1;
- }
-
- /* Get the '<name>=<value>' parameter. */
- arg = argv[1];
- /* Look for the `='. */
- equal = strchr (arg, '=');
- if (!equal)
- error ("invalid --param option: %s", arg);
- else
- {
- int val;
-
- /* Zero out the `=' sign so that we get two separate strings. */
- *equal = '\0';
- /* Figure out what value is specified. */
- val = read_integral_parameter (equal + 1, NULL, INVALID_PARAM_VAL);
- if (val != INVALID_PARAM_VAL)
- set_param_value (arg, val);
- else
- error ("invalid parameter value `%s'", equal + 1);
- }
-
- return 2;
- }
-
- switch (*arg)
- {
- default:
- return 0;
-
- case 'O':
- /* Already been treated in main (). Do nothing. */
- break;
-
- case 'm':
- set_target_switch (arg + 1);
- break;
-
- case 'f':
- return decode_f_option (arg + 1);
-
- case 'g':
- return decode_g_option (arg + 1);
-
- case 'W':
- /* For backward compatibility, -W is the same as -Wextra. */
- if (arg[1] == 0)
- set_Wextra (1);
- else
- return decode_W_option (arg + 1);
- break;
- }
-
- return 1;
+ warning ("`-g%s': unknown or unsupported -g option", arg);
}
/* Decode -m switches. */
/* Decode the switch -mNAME. */
-static void
+void
set_target_switch (const char *name)
{
size_t j;
@@ -4877,9 +4521,7 @@ init_asm_output (const char *name)
if (!flag_syntax_only)
{
-#ifdef ASM_FILE_START
- ASM_FILE_START (asm_out_file);
-#endif
+ targetm.asm_out.file_start ();
#ifdef ASM_COMMENT_START
if (flag_verbose_asm)
@@ -4947,6 +4589,7 @@ general_init (char *argv0)
init_ggc ();
init_stringpool ();
init_ttree ();
+
}
/* Parse command line options and set default flag values, called
@@ -5104,70 +4747,7 @@ parse_options_and_default_flags (int argc, char **argv)
OPTIMIZATION_OPTIONS (optimize, optimize_size);
#endif
- /* Perform normal command line switch decoding. */
- for (i = 1; i < argc;)
- {
- int lang_processed;
- int indep_processed;
-
- /* Give the language a chance to decode the option for itself. */
- lang_processed = handle_option (argc - i, argv + i, lang_mask);
-
- if (lang_processed >= 0)
- /* Now see if the option also has a language independent meaning.
- Some options are both language specific and language independent,
- eg --help. */
- indep_processed = independent_decode_option (argc - i, argv + i);
- else
- {
- lang_processed = -lang_processed;
- indep_processed = 0;
- }
-
- if (lang_processed || indep_processed)
- i += MAX (lang_processed, indep_processed);
- else
- {
- const char *option = NULL;
- const char *lang = NULL;
- unsigned int j;
-
- /* It is possible that the command line switch is not valid for the
- current language, but it is valid for another language. In order
- to be compatible with previous versions of the compiler (which
- did not issue an error message in this case) we check for this
- possibility here. If we do find a match, then if extra_warnings
- is set we generate a warning message, otherwise we will just
- ignore the option. */
- for (j = 0; j < ARRAY_SIZE (documented_lang_options); j++)
- {
- option = documented_lang_options[j].option;
-
- if (option == NULL)
- lang = documented_lang_options[j].description;
- else if (! strncmp (argv[i], option, strlen (option)))
- break;
- }
-
- if (j != ARRAY_SIZE (documented_lang_options))
- {
- if (extra_warnings)
- {
- warning ("ignoring command line option '%s'", argv[i]);
- if (lang)
- warning
- ("(it is valid for %s but not the selected language)",
- lang);
- }
- }
- else if (argv[i][0] == '-' && argv[i][1] == 'g')
- warning ("`%s': unknown or unsupported -g option", &argv[i][2]);
- else
- error ("unrecognized option `%s'", argv[i]);
-
- i++;
- }
- }
+ handle_options (argc, argv, lang_mask);
if (flag_pie)
flag_pic = flag_pie;
diff --git a/gcc/toplev.h b/gcc/toplev.h
index 61bed8b3e85..323cde99fda 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -30,7 +30,6 @@ extern int toplev_main (int, char **);
extern int read_integral_parameter (const char *, const char *,
const int);
extern void strip_off_ending (char *, int);
-extern void print_time (const char *, long);
extern const char *trim_filename (const char *);
extern void internal_error (const char *, ...)
ATTRIBUTE_NORETURN;
@@ -105,9 +104,31 @@ extern bool version_flag;
extern int target_flags_explicit;
+/* See toplev.c. */
+extern int flag_loop_optimize;
+extern int flag_crossjumping;
+extern int flag_if_conversion;
+extern int flag_if_conversion2;
+extern int flag_delete_null_pointer_checks;
+extern int flag_keep_static_consts;
+extern int flag_peel_loops;
+extern int flag_rerun_cse_after_loop;
+extern int flag_thread_jumps;
+extern int flag_tracer;
+extern int flag_unroll_loops;
+extern int flag_unroll_all_loops;
+extern int flag_unswitch_loops;
+extern int flag_cprop_registers;
+extern int flag_ssa;
+extern int flag_ssa_ccp;
+extern int flag_ssa_dce;
+extern int time_report;
+extern int flag_new_regalloc;
+
extern void display_help (void);
extern void display_target_options (void);
extern void print_version (FILE *, const char *);
+extern void set_target_switch (const char *);
/* The hashtable, so that the C front ends can pass it to cpplib. */
extern struct ht *ident_hash;
@@ -120,6 +141,9 @@ extern void set_fast_math_flags (int);
/* Handle -d switch. */
extern void decode_d_option (const char *);
+/* Handle -g switch. */
+extern void decode_g_option (const char *);
+
/* Return true iff flags are set as if -ffast-math. */
extern bool fast_math_flags_set_p (void);
diff --git a/gcc/tracer.c b/gcc/tracer.c
index 701c16a9395..ec9b9bac5ae 100644
--- a/gcc/tracer.c
+++ b/gcc/tracer.c
@@ -56,7 +56,6 @@ static edge find_best_predecessor PARAMS ((basic_block));
static int find_trace PARAMS ((basic_block, basic_block *));
static void tail_duplicate PARAMS ((void));
static void layout_superblocks PARAMS ((void));
-static bool ignore_bb_p PARAMS ((basic_block));
/* Minimal outgoing edge probability considered for superblock formation. */
static int probability_cutoff;
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index b9854469ded..c6e92e65c1f 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -646,11 +646,11 @@ struct dump_file_info
TREE_DUMP_INDEX enumeration in tree.h */
static struct dump_file_info dump_files[TDI_end] =
{
- {".tu", "dump-translation-unit", 0, 0},
- {".class", "dump-class-hierarchy", 0, 0},
- {".original", "dump-tree-original", 0, 0},
- {".optimized", "dump-tree-optimized", 0, 0},
- {".inlined", "dump-tree-inlined", 0, 0},
+ {".tu", "translation-unit", 0, 0},
+ {".class", "class-hierarchy", 0, 0},
+ {".original", "tree-original", 0, 0},
+ {".optimized", "tree-optimized", 0, 0},
+ {".inlined", "tree-inlined", 0, 0},
};
/* Define a name->number mapping for a dump flag value. */
@@ -758,7 +758,7 @@ dump_switch_p (const char *arg)
flags |= option_ptr->value;
goto found;
}
- warning ("ignoring unknown option `%.*s' in `-f%s'",
+ warning ("ignoring unknown option `%.*s' in `-fdump-%s'",
length, ptr, dump_files[ix].swtch);
found:;
ptr = end_ptr;
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index dd50ca1d631..88bf4d9bc02 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1201,7 +1201,8 @@ expand_call_inline (tp, walk_subtrees, data)
|| !cgraph_global_info (fn)->inline_once)
&& !inlinable_function_p (fn, id, 0))
{
- if (warn_inline && DECL_INLINE (fn))
+ if (warn_inline && DECL_INLINE (fn) && !DID_INLINE_FUNC (fn)
+ && !DECL_IN_SYSTEM_HEADER (fn))
{
warning_with_decl (fn, "inlining failed in call to `%s'");
warning ("called from here");
diff --git a/gcc/tree.c b/gcc/tree.c
index ad4f51c973a..9b434d8c0fb 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -47,7 +47,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "langhooks.h"
/* obstack.[ch] explicitly declined to prototype this. */
-extern int _obstack_allocated_p PARAMS ((struct obstack *h, PTR obj));
+extern int _obstack_allocated_p PARAMS ((struct obstack *h, void *obj));
#ifdef GATHER_STATISTICS
/* Statistics-gathering stuff. */
@@ -293,7 +293,7 @@ make_node (code)
t = ggc_alloc_tree (length);
- memset ((PTR) t, 0, length);
+ memset (t, 0, length);
TREE_SET_CODE (t, code);
@@ -609,7 +609,7 @@ make_tree_vec (len)
t = ggc_alloc_tree (length);
- memset ((PTR) t, 0, length);
+ memset (t, 0, length);
TREE_SET_CODE (t, TREE_VEC);
TREE_VEC_LENGTH (t) = len;
@@ -2514,7 +2514,7 @@ build1 (code, type, node)
t = ggc_alloc_tree (length);
- memset ((PTR) t, 0, sizeof (struct tree_common));
+ memset (t, 0, sizeof (struct tree_common));
TREE_SET_CODE (t, code);
diff --git a/gcc/tree.def b/gcc/tree.def
index 5f6ee65eaad..b71d31d0454 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -1,5 +1,5 @@
/* This file contains the definitions and documentation for the
- tree codes used in the GNU C compiler.
+ tree codes used in GCC.
Copyright (C) 1987, 1988, 1993, 1995, 1997, 1998, 2000, 2001
Free Software Foundation, Inc.
diff --git a/gcc/tree.h b/gcc/tree.h
index aeee9d9107f..e43466b5d24 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -274,31 +274,31 @@ struct tree_common GTY(())
is accessed incorrectly. The macros abort with a fatal error. */
#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
-#define TREE_CHECK(t, code) __extension__ \
-({ const tree __t = (t); \
- if (TREE_CODE(__t) != (code)) \
- tree_check_failed (__t, code, __FILE__, __LINE__, __FUNCTION__); \
+#define TREE_CHECK(T, CODE) __extension__ \
+({ const tree __t = (T); \
+ if (TREE_CODE (__t) != (CODE)) \
+ tree_check_failed (__t, (CODE), __FILE__, __LINE__, __FUNCTION__); \
__t; })
-#define TREE_CLASS_CHECK(t, class) __extension__ \
-({ const tree __t = (t); \
- if (TREE_CODE_CLASS(TREE_CODE(__t)) != (class)) \
- tree_class_check_failed (__t, class, __FILE__, __LINE__, \
+
+#define TREE_CLASS_CHECK(T, CLASS) __extension__ \
+({ const tree __t = (T); \
+ if (TREE_CODE_CLASS (TREE_CODE(__t)) != (CLASS)) \
+ tree_class_check_failed (__t, (CLASS), __FILE__, __LINE__, \
__FUNCTION__); \
__t; })
/* These checks have to be special cased. */
-#define EXPR_CHECK(t) __extension__ \
-({ const tree __t = (t); \
- char const __c = TREE_CODE_CLASS(TREE_CODE(__t)); \
- if (__c != 'r' && __c != 's' && __c != '<' \
- && __c != '1' && __c != '2' && __c != 'e') \
+#define EXPR_CHECK(T) __extension__ \
+({ const tree __t = (T); \
+ char const __c = TREE_CODE_CLASS (TREE_CODE (__t)); \
+ if (!IS_EXPR_CODE_CLASS (__c) && __c != 'r' && __c != 's') \
tree_class_check_failed (__t, 'e', __FILE__, __LINE__, \
__FUNCTION__); \
__t; })
-#define TREE_VEC_ELT_CHECK(t, i) __extension__ \
-(*({const tree __t = t; \
- const int __i = (i); \
+#define TREE_VEC_ELT_CHECK(T, I) __extension__ \
+(*({const tree __t = (T); \
+ const int __i = (I); \
if (TREE_CODE (__t) != TREE_VEC) \
tree_check_failed (__t, TREE_VEC, \
__FILE__, __LINE__, __FUNCTION__); \
@@ -308,36 +308,32 @@ struct tree_common GTY(())
&__t->vec.a[__i]; }))
/* Special checks for TREE_OPERANDs. */
-#define TREE_OPERAND_CHECK(t, i) __extension__ \
-(*({const tree __t = EXPR_CHECK(t); \
- const int __i = (i); \
+#define TREE_OPERAND_CHECK(T, I) __extension__ \
+(*({const tree __t = EXPR_CHECK (T); \
+ const int __i = (I); \
if (__i < 0 || __i >= TREE_CODE_LENGTH (TREE_CODE (__t))) \
tree_operand_check_failed (__i, TREE_CODE (__t), \
__FILE__, __LINE__, __FUNCTION__); \
&__t->exp.operands[__i]; }))
-#define TREE_OPERAND_CHECK_CODE(t, code, i) __extension__ \
-(*({const tree __t = t; \
- const int __i = (i); \
- const enum tree_code __code = code; \
- if (TREE_CODE (__t) != __code) \
- tree_check_failed (__t, __code, \
- __FILE__, __LINE__, __FUNCTION__); \
- if (__i < 0 || __i >= TREE_CODE_LENGTH (__code)) \
- tree_operand_check_failed (__i, __code, \
+#define TREE_OPERAND_CHECK_CODE(T, CODE, I) __extension__ \
+(*({const tree __t = (T); \
+ const int __i = (I); \
+ if (TREE_CODE (__t) != CODE) \
+ tree_check_failed (__t, CODE, __FILE__, __LINE__, __FUNCTION__); \
+ if (__i < 0 || __i >= TREE_CODE_LENGTH (CODE)) \
+ tree_operand_check_failed (__i, (CODE), \
__FILE__, __LINE__, __FUNCTION__); \
&__t->exp.operands[__i]; }))
-#define TREE_RTL_OPERAND_CHECK(t, code, i) __extension__ \
+#define TREE_RTL_OPERAND_CHECK(T, CODE, I) __extension__ \
(*(rtx *) \
- ({const tree __t = t; \
- const int __i = (i); \
- const enum tree_code __code = code; \
- if (TREE_CODE (__t) != __code) \
- tree_check_failed (__t, __code, \
- __FILE__, __LINE__, __FUNCTION__); \
- if (__i < 0 || __i >= TREE_CODE_LENGTH (__code)) \
- tree_operand_check_failed (__i, __code, \
+ ({const tree __t = (T); \
+ const int __i = (I); \
+ if (TREE_CODE (__t) != (CODE)) \
+ tree_check_failed (__t, (CODE), __FILE__, __LINE__, __FUNCTION__); \
+ if (__i < 0 || __i >= TREE_CODE_LENGTH ((CODE))) \
+ tree_operand_check_failed (__i, (CODE), \
__FILE__, __LINE__, __FUNCTION__); \
&__t->exp.operands[__i]; }))
@@ -357,21 +353,22 @@ extern void tree_operand_check_failed PARAMS ((int, enum tree_code,
#else /* not ENABLE_TREE_CHECKING, or not gcc */
-#define TREE_CHECK(t, code) (t)
-#define TREE_CLASS_CHECK(t, code) (t)
-#define EXPR_CHECK(t) (t)
-#define TREE_VEC_ELT_CHECK(t, i) ((t)->vec.a[i])
-#define TREE_OPERAND_CHECK(t, i) ((t)->exp.operands[i])
-#define TREE_OPERAND_CHECK_CODE(t, code, i) ((t)->exp.operands[i])
-#define TREE_RTL_OPERAND_CHECK(t, code, i) (*(rtx *) &((t)->exp.operands[i]))
+#define TREE_CHECK(T, CODE) (T)
+#define TREE_CLASS_CHECK(T, CODE) (T)
+#define EXPR_CHECK(T) (T)
+#define TREE_VEC_ELT_CHECK(T, I) ((T)->vec.a[I])
+#define TREE_OPERAND_CHECK(T, I) ((T)->exp.operands[I])
+#define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I])
+#define TREE_RTL_OPERAND_CHECK(T, CODE, I) (*(rtx *) &((T)->exp.operands[I]))
#endif
#include "tree-check.h"
-#define TYPE_CHECK(tree) TREE_CLASS_CHECK (tree, 't')
-#define DECL_CHECK(tree) TREE_CLASS_CHECK (tree, 'd')
-#define CST_CHECK(tree) TREE_CLASS_CHECK (tree, 'c')
+#define TYPE_CHECK(T) TREE_CLASS_CHECK (T, 't')
+#define DECL_CHECK(T) TREE_CLASS_CHECK (T, 'd')
+#define CST_CHECK(T) TREE_CLASS_CHECK (T, 'c')
+#define STMT_CHECK(T) TREE_CLASS_CHECK (T, 's')
/* In all nodes that are expressions, this is the data type of the expression.
In POINTER_TYPE nodes, this is the type that the pointer points to.
@@ -2002,10 +1999,6 @@ enum ptrmemfunc_vbit_where_t
#define NULL_TREE (tree) NULL
-/* Approximate positive square root of a host double. This is for
- statistical reports, not code generation. */
-extern double approx_sqrt PARAMS ((double));
-
extern tree decl_assembler_name PARAMS ((tree));
/* Compute the number of bytes occupied by 'node'. This routine only
@@ -2644,6 +2637,10 @@ extern GTY(()) tree current_function_func_begin_label;
extern int all_types_permanent;
+/* Exit a binding level. This function is provided by each language
+ frontend. */
+extern tree poplevel (int, int, int);
+
/* Declare a predefined function. Return the declaration. This function is
provided by each language frontend. */
extern tree builtin_function PARAMS ((const char *, tree, int,
@@ -2780,7 +2777,6 @@ extern tree fold_builtin PARAMS ((tree));
extern enum built_in_function builtin_mathfn_code PARAMS ((tree));
extern tree build_function_call_expr PARAMS ((tree, tree));
extern tree mathfn_built_in PARAMS ((tree, enum built_in_function fn));
-extern tree strip_float_extensions PARAMS ((tree));
/* In convert.c */
extern tree strip_float_extensions PARAMS ((tree));
@@ -2810,7 +2806,7 @@ extern void type_hash_add PARAMS ((unsigned int, tree));
extern unsigned int type_hash_list PARAMS ((tree));
extern int simple_cst_list_equal PARAMS ((tree, tree));
extern void dump_tree_statistics PARAMS ((void));
-extern void expand_function_end PARAMS ((const char *, int, int));
+extern void expand_function_end PARAMS ((void));
extern void expand_function_start PARAMS ((tree, int));
extern void expand_pending_sizes PARAMS ((tree));
@@ -2911,6 +2907,8 @@ extern int supports_one_only PARAMS ((void));
extern void variable_section PARAMS ((tree, int));
enum tls_model decl_tls_model PARAMS ((tree));
enum symbol_visibility decl_visibility PARAMS ((tree));
+extern void resolve_unique_section PARAMS ((tree, int, int));
+extern void mark_referenced PARAMS ((tree));
/* In stmt.c */
extern void emit_nop PARAMS ((void));
diff --git a/gcc/treelang/ChangeLog b/gcc/treelang/ChangeLog
index e7499677807..cd821889855 100644
--- a/gcc/treelang/ChangeLog
+++ b/gcc/treelang/ChangeLog
@@ -1,3 +1,13 @@
+2003-06-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ * treetree.c (tree_code_create_function_wrapup): Adjust
+ expand_function_end call.
+
+2003-06-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ * treetree.c (build_stmt): Remove VPARAMS.
+ (pedwarn_c99): Likewise.
+
2003-06-15 Neil Booth <neil@daikokuya.co.uk>
* lang.opt: Declare Treelang. Update.
diff --git a/gcc/treelang/treetree.c b/gcc/treelang/treetree.c
index bbc0c3fa66d..57a4a48fbfd 100644
--- a/gcc/treelang/treetree.c
+++ b/gcc/treelang/treetree.c
@@ -452,7 +452,7 @@ tree_code_create_function_wrapup (location_t loc)
/* Emit rtl for end of function. */
- expand_function_end (loc.file, loc.line, 0);
+ expand_function_end ();
/* Pop the level. */
@@ -869,7 +869,7 @@ c_lex (tree *value ATTRIBUTE_UNUSED)
/* Should not be called for treelang. */
tree
-build_stmt VPARAMS ((enum tree_code code ATTRIBUTE_UNUSED, ...))
+build_stmt (enum tree_code code ATTRIBUTE_UNUSED, ...)
{
abort ();
}
@@ -893,7 +893,7 @@ build_return_stmt (tree expr ATTRIBUTE_UNUSED)
/* C warning, ignore. */
void
-pedwarn_c99 VPARAMS ((const char *msgid ATTRIBUTE_UNUSED, ...))
+pedwarn_c99 (const char *msgid ATTRIBUTE_UNUSED, ...)
{
return;
}
diff --git a/gcc/unroll.c b/gcc/unroll.c
index e7e03ab8de3..03decb773df 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -2263,14 +2263,20 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration,
the associated rtl. We do not want to share the structure in
this new block. */
- if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED_LABEL
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
- && ((NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT)
- || (last_iteration && unroll_type != UNROLL_COMPLETELY)))
- copy = emit_note (NOTE_SOURCE_FILE (insn),
+ if (NOTE_LINE_NUMBER (insn) > 0)
+ copy = emit_line_note (NOTE_SOURCE_FILE (insn),
NOTE_LINE_NUMBER (insn));
+ else if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED_LABEL
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
+ && ((NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT)
+ || (last_iteration
+ && unroll_type != UNROLL_COMPLETELY)))
+ {
+ copy = emit_note (NOTE_LINE_NUMBER (insn));
+ NOTE_DATA (copy) = NOTE_DATA (insn);
+ }
else
copy = 0;
break;
@@ -2315,12 +2321,18 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration,
instructions before the last insn in the loop, COPY_NOTES_FROM
can be a NOTE_INSN_LOOP_CONT note if there is no VTOP note,
as in a do .. while loop. */
- if (GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT)
- emit_note (NOTE_SOURCE_FILE (insn), NOTE_LINE_NUMBER (insn));
+ if (GET_CODE (insn) != NOTE)
+ /*NOP*/;
+ else if (NOTE_LINE_NUMBER (insn) > 0)
+ emit_line_note (NOTE_SOURCE_FILE (insn), NOTE_LINE_NUMBER (insn));
+ else if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT)
+ {
+ rtx copy = emit_note (NOTE_LINE_NUMBER (insn));
+ NOTE_DATA (copy) = NOTE_DATA (insn);
+ }
}
}
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 387659a9bb4..7519138b3f6 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -48,6 +48,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tm_p.h"
#include "debug.h"
#include "target.h"
+#include "cgraph.h"
#ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h" /* Needed for external data
@@ -166,8 +167,8 @@ static void output_constructor PARAMS ((tree, unsigned HOST_WIDE_INT,
unsigned int));
static void globalize_decl PARAMS ((tree));
static void maybe_assemble_visibility PARAMS ((tree));
-static int in_named_entry_eq PARAMS ((const PTR, const PTR));
-static hashval_t in_named_entry_hash PARAMS ((const PTR));
+static int in_named_entry_eq PARAMS ((const void *, const void *));
+static hashval_t in_named_entry_hash PARAMS ((const void *));
#ifdef ASM_OUTPUT_BSS
static void asm_output_bss PARAMS ((FILE *, tree, const char *,
unsigned HOST_WIDE_INT,
@@ -183,7 +184,6 @@ static void asm_output_aligned_bss
static bool asm_emit_uninitialised PARAMS ((tree, const char*,
unsigned HOST_WIDE_INT,
unsigned HOST_WIDE_INT));
-static void resolve_unique_section PARAMS ((tree, int, int));
static void mark_weak PARAMS ((tree));
enum in_section { no_section, in_text, in_data, in_named
@@ -310,8 +310,8 @@ in_data_section ()
static int
in_named_entry_eq (p1, p2)
- const PTR p1;
- const PTR p2;
+ const void *p1;
+ const void *p2;
{
const struct in_named_entry *old = p1;
const char *new = p2;
@@ -321,7 +321,7 @@ in_named_entry_eq (p1, p2)
static hashval_t
in_named_entry_hash (p)
- const PTR p;
+ const void *p;
{
const struct in_named_entry *old = p;
return htab_hash_string (old->name);
@@ -460,7 +460,7 @@ named_section (decl, name, reloc)
/* If required, set DECL_SECTION_NAME to a unique name. */
-static void
+void
resolve_unique_section (decl, reloc, flag_function_or_data_sections)
tree decl;
int reloc ATTRIBUTE_UNUSED;
@@ -1409,6 +1409,9 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
int reloc = 0;
rtx decl_rtl;
+ if (lang_hooks.decls.prepare_assemble_variable)
+ (*lang_hooks.decls.prepare_assemble_variable) (decl);
+
last_assemble_variable_decl = 0;
/* Normally no need to say anything here for external references,
@@ -1725,6 +1728,30 @@ assemble_label (name)
ASM_OUTPUT_LABEL (asm_out_file, name);
}
+/* Set the symbol_referenced flag for ID and notify callgraph code. */
+void
+mark_referenced (id)
+ tree id;
+{
+ if (!TREE_SYMBOL_REFERENCED (id))
+ {
+ struct cgraph_node *node;
+ struct cgraph_varpool_node *vnode;
+
+ if (!cgraph_global_info_ready)
+ {
+ node = cgraph_node_for_identifier (id);
+ if (node)
+ cgraph_mark_needed_node (node, 1);
+ }
+
+ vnode = cgraph_varpool_node_for_identifier (id);
+ if (vnode)
+ cgraph_varpool_mark_needed_node (vnode);
+ }
+ TREE_SYMBOL_REFERENCED (id) = 1;
+}
+
/* Output to FILE a reference to the assembler name of a C-level name NAME.
If NAME starts with a *, the rest of NAME is output verbatim.
Otherwise NAME is transformed in an implementation-defined way
@@ -1743,7 +1770,7 @@ assemble_name (file, name)
id = maybe_get_identifier (real_name);
if (id)
- TREE_SYMBOL_REFERENCED (id) = 1;
+ mark_referenced (id);
if (name[0] == '*')
fputs (&name[1], file);
@@ -5363,6 +5390,18 @@ default_internal_label (stream, prefix, labelno)
ASM_OUTPUT_LABEL (stream, buf);
}
+/* This is the default behavior at the beginning of a file. It's
+ controlled by two other target-hook toggles. */
+void
+default_file_start ()
+{
+ if (targetm.file_start_app_off && !flag_verbose_asm)
+ fputs (ASM_APP_OFF, asm_out_file);
+
+ if (targetm.file_start_file_directive)
+ output_file_directive (asm_out_file, main_input_filename);
+}
+
/* This is a generic routine suitable for use as TARGET_ASM_FILE_END
which emits a special section directive used to indicate whether or
not this object file needs an executable stack. This is primarily
diff --git a/gcc/varray.c b/gcc/varray.c
index 8eb6a623520..8e8d0290363 100644
--- a/gcc/varray.c
+++ b/gcc/varray.c
@@ -46,7 +46,7 @@ static const struct {
{ sizeof (unsigned long), 1 },
{ sizeof (HOST_WIDE_INT), 1 },
{ sizeof (unsigned HOST_WIDE_INT), 1 },
- { sizeof (PTR), 1 },
+ { sizeof (void *), 1 },
{ sizeof (char *), 1 },
{ sizeof (struct rtx_def *), 1 },
{ sizeof (struct rtvec_def *), 1 },
diff --git a/gcc/version.c b/gcc/version.c
index 38192be0038..b7d8275e3c4 100644
--- a/gcc/version.c
+++ b/gcc/version.c
@@ -6,7 +6,7 @@
please modify this string to indicate that, e.g. by putting your
organization's name in parentheses at the end of the string. */
-const char version_string[] = "3.4 20030615 (experimental)";
+const char version_string[] = "3.4 20030627 (experimental)";
/* This is the location of the online document giving instructions for
reporting bugs. If you distribute a modified version of GCC,
diff --git a/gcc/vmsdbgout.c b/gcc/vmsdbgout.c
index 7824698ffd2..e2d523ce042 100644
--- a/gcc/vmsdbgout.c
+++ b/gcc/vmsdbgout.c
@@ -1725,14 +1725,14 @@ vmsdbgout_abstract_function (decl)
VMS Debug debugging info. */
static void
-vmsdbgout_finish (input_filename)
- const char *input_filename ATTRIBUTE_UNUSED;
+vmsdbgout_finish (main_input_filename)
+ const char *main_input_filename ATTRIBUTE_UNUSED;
{
unsigned int i;
int totsize;
if (write_symbols == VMS_AND_DWARF2_DEBUG)
- (*dwarf2_debug_hooks.finish) (input_filename);
+ (*dwarf2_debug_hooks.finish) (main_input_filename);
if (debug_info_level == DINFO_LEVEL_NONE)
return;
diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c
index c34096bd382..faf8717e82b 100644
--- a/gcc/xcoffout.c
+++ b/gcc/xcoffout.c
@@ -78,7 +78,7 @@ const char *xcoff_lastfile;
((xcoff_inlining) ? (LINENO) : (LINENO) - xcoff_begin_function_line)
/* Output source line numbers via ".line" rather than ".stabd". */
-#define ASM_OUTPUT_SOURCE_LINE(FILE,LINENUM) \
+#define ASM_OUTPUT_SOURCE_LINE(FILE,LINENUM,COUNTER) \
do \
{ \
if (xcoff_begin_function_line >= 0) \
@@ -323,7 +323,7 @@ xcoffout_source_line (line, filename)
xcoffout_source_file (asm_out_file, filename, inline_p);
- ASM_OUTPUT_SOURCE_LINE (asm_out_file, line);
+ ASM_OUTPUT_SOURCE_LINE (asm_out_file, line, 0);
}
/* Output the symbols defined in block number DO_BLOCK.
@@ -461,7 +461,7 @@ xcoffout_begin_prologue (line, file)
xcoffout_block (DECL_INITIAL (current_function_decl), 0,
DECL_ARGUMENTS (current_function_decl));
- ASM_OUTPUT_SOURCE_LINE (asm_out_file, line);
+ ASM_OUTPUT_SOURCE_LINE (asm_out_file, line, 0);
}
/* Called at end of function (before epilogue).
diff --git a/gcc/xcoffout.h b/gcc/xcoffout.h
index dd630c93749..8e41770d43e 100644
--- a/gcc/xcoffout.h
+++ b/gcc/xcoffout.h
@@ -138,8 +138,8 @@ extern const char *xcoff_lastfile;
/* Write out main source file name using ".file" rather than ".stabs".
We don't actually do this here, because the assembler gets confused if there
- is more than one .file directive. ASM_FILE_START in config/rs6000/rs6000.h
- is already emitting a .file directory, so we don't output one here also.
+ is more than one .file directive. rs6000_xcoff_file_start is already
+ emitting a .file directory, so we don't output one here also.
Initialize xcoff_lastfile. */
#define DBX_OUTPUT_MAIN_SOURCE_FILENAME(FILE,FILENAME) \
xcoff_lastfile = (FILENAME)
diff --git a/include/ChangeLog b/include/ChangeLog
index c7c271b1ca9..a76344b3a96 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,18 @@
+2003-06-22 Zack Weinberg <zack@codesourcery.com>
+
+ * safe-ctype.h (HC_UNKNOWN, HC_ASCII, HC_EBCDIC): Rename to
+ HOST_CHARSET_UNKNOWN, HOST_CHARSET_ASCII, HOST_CHARSET_EBCDIC
+ respectively.
+
+2003-06-21 Zack Weinberg <zack@codesourcery.com>
+
+ * safe-ctype.h (HC_UNKNOWN, HC_ASCII, HC_EBCDIC, HOST_CHARSET):
+ New #defines.
+
+2003-06-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * ansidecl.h: Delete HAVE_LONG_DOUBLE GCC bootstrap support.
+
2003-05-15 Jim Blandy <jimb@redhat.com>
* libiberty.h (hex_value): Make the value an unsigned int, to
@@ -379,7 +394,7 @@
2000-09-04 Alex Samuel <samuel@codesourcery.com>
- * dyn-string.h: Adjust formatting.
+ * dyn-string.h: Adjust formatting.
(dyn_string_insert_char): New macro. New declaration.
2000-08-28 Jason Merrill <jason@redhat.com>
@@ -404,7 +419,7 @@
dyn_string_insert_cstr, dyn_string_append, dyn_string_append_cstr,
dyn_string_append_char, dyn_string_substring): Change return type
to int.
-
+
2000-06-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* demangle.h (demangling_styles): Remove trailing comma in enum.
@@ -417,12 +432,12 @@
* dyn-string.h: Move here from gcc/dyn-string.h. Add new functions.
* demangle.h (DMGL_GNU_NEW_ABI): New macro.
- (DMGL_STYLE_MASK): Or in DMGL_GNU_NEW_ABI.
+ (DMGL_STYLE_MASK): Or in DMGL_GNU_NEW_ABI.
(current_demangling_style): Add gnu_new_abi_demangling.
(GNU_NEW_ABI_DEMANGLING_STYLE_STRING): New macro.
(GNU_NEW_ABI_DEMANGLING): Likewise.
(cplus_demangle_new_abi): New declaration.
-
+
Tue May 30 16:53:34 2000 Andrew Cagney <cagney@b1.cygnus.com>
* floatformat.h (struct floatformat): Add field name.
@@ -454,9 +469,9 @@ Thu May 4 17:15:26 2000 Philippe De Muyter <phdm@macqel.be>
2000-04-28 Kenneth Block <block@zk3.dec.com>
Jason Merrill <jason@casey.cygnus.com>
- * demangle.h (libiberty_demanglers): new table for different styles.
- (cplus_demangle_set_style): New function for setting style.
- (cplus_demangle_name_to_style): New function to translate name.
+ * demangle.h (libiberty_demanglers): new table for different styles.
+ (cplus_demangle_set_style): New function for setting style.
+ (cplus_demangle_name_to_style): New function to translate name.
2000-04-24 Mark Mitchell <mark@codesourcery.com>
diff --git a/include/ansidecl.h b/include/ansidecl.h
index f8f2d737bf0..d2c87768ce2 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -312,15 +312,4 @@ So instead we use the macro below and test it against specific values. */
#define __extension__
#endif
-/* Bootstrap support: Adjust certain macros defined by Autoconf,
- which are only valid for the stage1 compiler. If we detect
- a modern version of GCC, we are probably in stage2 or beyond,
- so unconditionally reset the values. Note that const, inline,
- etc. have been dealt with above. */
-#if (GCC_VERSION >= 2007)
-# ifndef HAVE_LONG_DOUBLE
-# define HAVE_LONG_DOUBLE 1
-# endif
-#endif /* GCC >= 2.7 */
-
#endif /* ansidecl.h */
diff --git a/include/safe-ctype.h b/include/safe-ctype.h
index b2ad8490bd0..69a3f74cc6f 100644
--- a/include/safe-ctype.h
+++ b/include/safe-ctype.h
@@ -37,7 +37,24 @@ Boston, MA 02111-1307, USA. */
#ifdef isalpha
#error "safe-ctype.h and ctype.h may not be used simultaneously"
+#endif
+
+/* Determine host character set. */
+#define HOST_CHARSET_UNKNOWN 0
+#define HOST_CHARSET_ASCII 1
+#define HOST_CHARSET_EBCDIC 2
+
+#if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \
+ && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21
+# define HOST_CHARSET HOST_CHARSET_ASCII
#else
+# if '\n' == 0x15 && ' ' == 0x40 && '0' == 0xF0 \
+ && 'A' == 0xC1 && 'a' == 0x81 && '!' == 0x5A
+# define HOST_CHARSET HOST_CHARSET_EBCDIC
+# else
+# define HOST_CHARSET HOST_CHARSET_UNKNOWN
+# endif
+#endif
/* Categories. */
@@ -99,5 +116,4 @@ extern const unsigned char _sch_tolower[256];
#define TOUPPER(c) _sch_toupper[(c) & 0xff]
#define TOLOWER(c) _sch_tolower[(c) & 0xff]
-#endif /* no ctype.h */
#endif /* SAFE_CTYPE_H */
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 23f4556d9c2..e3b57b04642 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,7 @@
+2003-06-19 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * src/powerpc/ppc_closure.S: Include ffi.h.
+
2003-06-13 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* src/x86/sysv.S: Avoid gas-only .uleb128/.sleb128 directives.
diff --git a/libffi/src/powerpc/ppc_closure.S b/libffi/src/powerpc/ppc_closure.S
index 391f318d199..72c59e812e3 100644
--- a/libffi/src/powerpc/ppc_closure.S
+++ b/libffi/src/powerpc/ppc_closure.S
@@ -1,4 +1,5 @@
#define LIBFFI_ASM
+#include <ffi.h>
#include <powerpc/asm.h>
.file "ppc_closure.S"
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 75b66361296..99f2f0a695a 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,12 +1,38 @@
+2003-06-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ * testsuite/demangle-expected: Add more GNU V3 testcases.
+
+2003-06-22 Zack Weinberg <zack@codesourcery.com>
+
+ * safe-ctype.c: Use HOST_CHARSET_ASCII and HOST_CHARSET_EBCDIC,
+ not HC_ASCII and HC_EBCDIC.
+ Add documentation in form expected by gather-docs.
+ * hex.c: Use HOST_CHARSET, not hand-coded check of character set.
+ * Makefile.in, functions.texi: Regenerate.
+
+2003-06-21 Zack Weinberg <zack@codesourcery.com>
+
+ * safe-ctype.c: Separate out EOF==-1 check. Use HOST_CHARSET
+ for charset determination.
+
+2003-06-19 Dara Hazeghi <dhazeghi@yahoo.com>
+
+ * configure.in: Add check for malloc.h needed by
+ m68k for function free().
+ * configure: Regenerated.
+ * config.in: Add HAVE_MALLOC_H.
+ * hashtab.c: include malloc.h were available for
+ free().
+
2003-06-09 Albert Chin-A-Young <china@thewrittenword.com>
-
+
PR bootstrap/10974
* physmem.c: Update comment.
* configure.in: Modify test for _system_configuration for older
AIX systems.
* config.in, configure: Regenerated.
-
+
2003-06-05 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR other/10810
@@ -100,7 +126,7 @@
ANSI_PROTOTYPES.
* vsprintf.c: Include "ansidecl.h" earlier, rely on
ANSI_PROTOTYPES and possibly include <stdarg.h>.
-
+
* Makefile.in: Regenerate dependencies.
2003-04-15 DJ Delorie <dj@redhat.com>
@@ -198,7 +224,7 @@
2003-02-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
Richard Earnshaw <rearnsha@arm.com>
Geoffrey Keating <geoffk@apple.com>
-
+
* configure.in: Check for sys/sysctl.h and sysctl.
* physmem.c: Add support for *bsd and darwin.
* Makefile.in: Generate depedency for physmem.o.
@@ -227,7 +253,7 @@
* physmem.c (physmem_total, physmem_available): De-ANSI-fy.
* configure.in (AC_CHECK_FUNCS): Add pstat_getstatic and
pstat_getdynamic.
-
+
2003-02-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (CFILES): Add physmem.c.
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index d73ab2fef77..5d2dc3cbf8d 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -447,7 +447,8 @@ getpwd.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
getruntime.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
hashtab.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/hashtab.h \
$(INCDIR)/libiberty.h
-hex.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+hex.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
+ $(INCDIR)/safe-ctype.h
lbasename.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
lrealpath.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
diff --git a/libiberty/config.in b/libiberty/config.in
index 51d161a4606..50ed3266852 100644
--- a/libiberty/config.in
+++ b/libiberty/config.in
@@ -291,6 +291,9 @@
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
/* whether byteorder is bigendian */
#undef WORDS_BIGENDIAN
diff --git a/libiberty/configure b/libiberty/configure
index 9182fc3f98e..77d5170a877 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -1492,7 +1492,7 @@ else
fi
echo "$ac_t""$CPP" 1>&6
-for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h
+for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
@@ -2900,7 +2900,7 @@ case "${host}" in
esac
-for ac_hdr in unistd.h
+for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
@@ -3032,11 +3032,24 @@ else
#include <fcntl.h>
#include <sys/mman.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
/* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-# include <unistd.h>
-# endif
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H
@@ -3144,7 +3157,7 @@ main()
}
EOF
-if { (eval echo configure:3148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -3168,7 +3181,7 @@ fi
echo $ac_n "checking for working strncmp""... $ac_c" 1>&6
-echo "configure:3172: checking for working strncmp" >&5
+echo "configure:3185: checking for working strncmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3176,7 +3189,7 @@ else
ac_cv_func_strncmp_works=no
else
cat > conftest.$ac_ext <<EOF
-#line 3180 "configure"
+#line 3193 "configure"
#include "confdefs.h"
/* Test by Jim Wilson and Kaveh Ghazi.
@@ -3240,7 +3253,7 @@ main ()
}
EOF
-if { (eval echo configure:3244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_strncmp_works=yes
else
diff --git a/libiberty/configure.in b/libiberty/configure.in
index 0eab85513da..5dca13ed6f6 100644
--- a/libiberty/configure.in
+++ b/libiberty/configure.in
@@ -143,7 +143,7 @@ AC_SUBST_FILE(host_makefile_frag)
# It's OK to check for header files. Although the compiler may not be
# able to link anything, it had better be able to at least compile
# something.
-AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h)
+AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h)
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
diff --git a/libiberty/functions.texi b/libiberty/functions.texi
index 2d30c5da1f3..aac4424fd8f 100644
--- a/libiberty/functions.texi
+++ b/libiberty/functions.texi
@@ -3,6 +3,28 @@
@c Edit the *.c files, configure with --enable-maintainer-mode,
@c and let gather-docs build you a new copy.
+@c safe-ctype.c:24
+@defvr Extension HOST_CHARSET
+This macro indicates the basic character set and encoding used by the
+host: more precisely, the encoding used for character constants in
+preprocessor @samp{#if} statements (the C "execution character set").
+It is defined by @file{safe-ctype.h}, and will be an integer constant
+with one of the following values:
+
+@ftable @code
+@item HOST_CHARSET_UNKNOWN
+The host character set is unknown - that is, not one of the next two
+possibilities.
+
+@item HOST_CHARSET_ASCII
+The host character set is ASCII.
+
+@item HOST_CHARSET_EBCDIC
+The host character set is some variant of EBCDIC. (Only one of the
+nineteen EBCDIC varying characters is tested; exercise caution.)
+@end ftable
+@end defvr
+
@c alloca.c:26
@deftypefn Replacement void* alloca (size_t @var{size})
@@ -317,7 +339,7 @@ between calls to @code{getpwd}.
@end deftypefn
-@c hex.c:25
+@c hex.c:30
@deftypefn Extension void hex_init (void)
Initializes the array mapping the current character set to
@@ -327,7 +349,7 @@ default ASCII-based table will normally be used on ASCII systems.
@end deftypefn
-@c hex.c:34
+@c hex.c:39
@deftypefn Extension int hex_p (int @var{c})
Evaluates to non-zero if the given character is a valid hex character,
@@ -336,7 +358,7 @@ or zero if it is not. Note that the value you pass will be cast to
@end deftypefn
-@c hex.c:42
+@c hex.c:47
@deftypefn Extension unsigned int hex_value (int @var{c})
Returns the numeric equivalent of the given character when interpreted
@@ -382,6 +404,78 @@ struct qelem @{
@end deftypefn
+@c safe-ctype.c:45
+@deffn Extension ISALPHA (@var{c})
+@deffnx Extension ISALNUM (@var{c})
+@deffnx Extension ISBLANK (@var{c})
+@deffnx Extension ISCNTRL (@var{c})
+@deffnx Extension ISDIGIT (@var{c})
+@deffnx Extension ISGRAPH (@var{c})
+@deffnx Extension ISLOWER (@var{c})
+@deffnx Extension ISPRINT (@var{c})
+@deffnx Extension ISPUNCT (@var{c})
+@deffnx Extension ISSPACE (@var{c})
+@deffnx Extension ISUPPER (@var{c})
+@deffnx Extension ISXDIGIT (@var{c})
+
+These twelve macros are defined by @file{safe-ctype.h}. Each has the
+same meaning as the corresponding macro (with name in lowercase)
+defined by the standard header @file{ctype.h}. For example,
+@code{ISALPHA} returns true for alphabetic characters and false for
+others. However, there are two differences between these macros and
+those provided by @file{ctype.h}:
+
+@itemize @bullet
+@item These macros are guaranteed to have well-defined behavior for all
+values representable by @code{signed char} and @code{unsigned char}, and
+for @code{EOF}.
+
+@item These macros ignore the current locale; they are true for these
+fixed sets of characters:
+@multitable {@code{XDIGIT}} {yada yada yada yada yada yada yada yada}
+@item @code{ALPHA} @tab @kbd{A-Za-z}
+@item @code{ALNUM} @tab @kbd{A-Za-z0-9}
+@item @code{BLANK} @tab @kbd{space tab}
+@item @code{CNTRL} @tab @code{!PRINT}
+@item @code{DIGIT} @tab @kbd{0-9}
+@item @code{GRAPH} @tab @code{ALNUM || PUNCT}
+@item @code{LOWER} @tab @kbd{a-z}
+@item @code{PRINT} @tab @code{GRAPH ||} @kbd{space}
+@item @code{PUNCT} @tab @kbd{`~!@@#$%^&*()_-=+[@{]@}\|;:'",<.>/?}
+@item @code{SPACE} @tab @kbd{space tab \n \r \f \v}
+@item @code{UPPER} @tab @kbd{A-Z}
+@item @code{XDIGIT} @tab @kbd{0-9A-Fa-f}
+@end multitable
+
+Note that, if the host character set is ASCII or a superset thereof,
+all these macros will return false for all values of @code{char} outside
+the range of 7-bit ASCII. In particular, both ISPRINT and ISCNTRL return
+false for characters with numeric values from 128 to 255.
+@end itemize
+@end deffn
+
+@c safe-ctype.c:94
+@deffn Extension ISIDNUM (@var{c})
+@deffnx Extension ISIDST (@var{c})
+@deffnx Extension IS_VSPACE (@var{c})
+@deffnx Extension IS_NVSPACE (@var{c})
+@deffnx Extension IS_SPACE_OR_NUL (@var{c})
+@deffnx Extension IS_ISOBASIC (@var{c})
+These six macros are defined by @file{safe-ctype.h} and provide
+additional character classes which are useful when doing lexical
+analysis of C or similar languages. They are true for the following
+sets of characters:
+
+@multitable {@code{SPACE_OR_NUL}} {yada yada yada yada yada yada yada yada}
+@item @code{IDNUM} @tab @kbd{A-Za-z0-9_}
+@item @code{IDST} @tab @kbd{A-Za-z_}
+@item @code{VSPACE} @tab @kbd{\r \n}
+@item @code{NVSPACE} @tab @kbd{space tab \f \v \0}
+@item @code{SPACE_OR_NUL} @tab @code{VSPACE || NVSPACE}
+@item @code{ISOBASIC} @tab @code{VSPACE || NVSPACE || PRINT}
+@end multitable
+@end deffn
+
@c lbasename.c:23
@deftypefn Replacement {const char*} lbasename (const char *@var{name})
diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c
index 3896328717a..cbf82592be1 100644
--- a/libiberty/hashtab.c
+++ b/libiberty/hashtab.c
@@ -45,6 +45,10 @@ Boston, MA 02111-1307, USA. */
#include <string.h>
#endif
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+
#include <stdio.h>
#include "libiberty.h"
diff --git a/libiberty/hex.c b/libiberty/hex.c
index f425509be75..e4c5dfa2f1d 100644
--- a/libiberty/hex.c
+++ b/libiberty/hex.c
@@ -19,6 +19,11 @@ Boston, MA 02111-1307, USA. */
#include <stdio.h> /* for EOF */
#include "libiberty.h"
+#include "safe-ctype.h" /* for HOST_CHARSET_ASCII */
+
+#if EOF != -1
+ #error "hex.c requires EOF == -1"
+#endif
/*
@@ -62,9 +67,7 @@ systems.
/* Are we ASCII? */
-#if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \
- && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21 \
- && EOF == -1
+#if HOST_CHARSET == HOST_CHARSET_ASCII
const unsigned char _hex_value[_hex_array_size] =
{
diff --git a/libiberty/safe-ctype.c b/libiberty/safe-ctype.c
index 3bac84bf68a..91a0e9a2589 100644
--- a/libiberty/safe-ctype.c
+++ b/libiberty/safe-ctype.c
@@ -19,20 +19,109 @@ License along with libiberty; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* This is a compatible replacement of the standard C library's <ctype.h>
- with the following properties:
-
- - Implements all isxxx() macros required by C99.
- - Also implements some character classes useful when
- parsing C-like languages.
- - Does not change behavior depending on the current locale.
- - Behaves properly for all values in the range of a signed or
- unsigned char. */
+/*
+
+@defvr Extension HOST_CHARSET
+This macro indicates the basic character set and encoding used by the
+host: more precisely, the encoding used for character constants in
+preprocessor @samp{#if} statements (the C "execution character set").
+It is defined by @file{safe-ctype.h}, and will be an integer constant
+with one of the following values:
+
+@ftable @code
+@item HOST_CHARSET_UNKNOWN
+The host character set is unknown - that is, not one of the next two
+possibilities.
+
+@item HOST_CHARSET_ASCII
+The host character set is ASCII.
+
+@item HOST_CHARSET_EBCDIC
+The host character set is some variant of EBCDIC. (Only one of the
+nineteen EBCDIC varying characters is tested; exercise caution.)
+@end ftable
+@end defvr
+
+@deffn Extension ISALPHA (@var{c})
+@deffnx Extension ISALNUM (@var{c})
+@deffnx Extension ISBLANK (@var{c})
+@deffnx Extension ISCNTRL (@var{c})
+@deffnx Extension ISDIGIT (@var{c})
+@deffnx Extension ISGRAPH (@var{c})
+@deffnx Extension ISLOWER (@var{c})
+@deffnx Extension ISPRINT (@var{c})
+@deffnx Extension ISPUNCT (@var{c})
+@deffnx Extension ISSPACE (@var{c})
+@deffnx Extension ISUPPER (@var{c})
+@deffnx Extension ISXDIGIT (@var{c})
+
+These twelve macros are defined by @file{safe-ctype.h}. Each has the
+same meaning as the corresponding macro (with name in lowercase)
+defined by the standard header @file{ctype.h}. For example,
+@code{ISALPHA} returns true for alphabetic characters and false for
+others. However, there are two differences between these macros and
+those provided by @file{ctype.h}:
+
+@itemize @bullet
+@item These macros are guaranteed to have well-defined behavior for all
+values representable by @code{signed char} and @code{unsigned char}, and
+for @code{EOF}.
+
+@item These macros ignore the current locale; they are true for these
+fixed sets of characters:
+@multitable {@code{XDIGIT}} {yada yada yada yada yada yada yada yada}
+@item @code{ALPHA} @tab @kbd{A-Za-z}
+@item @code{ALNUM} @tab @kbd{A-Za-z0-9}
+@item @code{BLANK} @tab @kbd{space tab}
+@item @code{CNTRL} @tab @code{!PRINT}
+@item @code{DIGIT} @tab @kbd{0-9}
+@item @code{GRAPH} @tab @code{ALNUM || PUNCT}
+@item @code{LOWER} @tab @kbd{a-z}
+@item @code{PRINT} @tab @code{GRAPH ||} @kbd{space}
+@item @code{PUNCT} @tab @kbd{`~!@@#$%^&*()_-=+[@{]@}\|;:'",<.>/?}
+@item @code{SPACE} @tab @kbd{space tab \n \r \f \v}
+@item @code{UPPER} @tab @kbd{A-Z}
+@item @code{XDIGIT} @tab @kbd{0-9A-Fa-f}
+@end multitable
+
+Note that, if the host character set is ASCII or a superset thereof,
+all these macros will return false for all values of @code{char} outside
+the range of 7-bit ASCII. In particular, both ISPRINT and ISCNTRL return
+false for characters with numeric values from 128 to 255.
+@end itemize
+@end deffn
+
+@deffn Extension ISIDNUM (@var{c})
+@deffnx Extension ISIDST (@var{c})
+@deffnx Extension IS_VSPACE (@var{c})
+@deffnx Extension IS_NVSPACE (@var{c})
+@deffnx Extension IS_SPACE_OR_NUL (@var{c})
+@deffnx Extension IS_ISOBASIC (@var{c})
+These six macros are defined by @file{safe-ctype.h} and provide
+additional character classes which are useful when doing lexical
+analysis of C or similar languages. They are true for the following
+sets of characters:
+
+@multitable {@code{SPACE_OR_NUL}} {yada yada yada yada yada yada yada yada}
+@item @code{IDNUM} @tab @kbd{A-Za-z0-9_}
+@item @code{IDST} @tab @kbd{A-Za-z_}
+@item @code{VSPACE} @tab @kbd{\r \n}
+@item @code{NVSPACE} @tab @kbd{space tab \f \v \0}
+@item @code{SPACE_OR_NUL} @tab @code{VSPACE || NVSPACE}
+@item @code{ISOBASIC} @tab @code{VSPACE || NVSPACE || PRINT}
+@end multitable
+@end deffn
+
+*/
#include "ansidecl.h"
#include <safe-ctype.h>
#include <stdio.h> /* for EOF */
+#if EOF != -1
+ #error "<safe-ctype.h> requires EOF == -1"
+#endif
+
/* Shorthand */
#define bl _sch_isblank
#define cn _sch_iscntrl
@@ -64,9 +153,7 @@ Boston, MA 02111-1307, USA. */
#define S (const unsigned short) (nv|sp|bl|pr) /* space */
/* Are we ASCII? */
-#if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \
- && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21 \
- && EOF == -1
+#if HOST_CHARSET == HOST_CHARSET_ASCII
const unsigned short _sch_istable[256] =
{
@@ -159,5 +246,9 @@ const unsigned char _sch_toupper[256] =
};
#else
- #error "Unsupported host character set"
-#endif /* not ASCII */
+# if HOST_CHARSET == HOST_CHARSET_EBCDIC
+ #error "FIXME: write tables for EBCDIC"
+# else
+ #error "Unrecognized host character set"
+# endif
+#endif
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index c0483188239..6be66e10b48 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -2598,9 +2598,269 @@ _Utf58_0_1__1_2147483647__2147483648
--format=gnu-v3
St9bad_alloc
std::bad_alloc
+#
+--format=gnu-v3
+_ZN1f1fE
+f::f
+#
+--format=gnu-v3
+_Z1fv
+f()
+#
+--format=gnu-v3
+_Z1fi
+f(int)
+#
+--format=gnu-v3
+_Z3foo3bar
+foo(bar)
+#
+--format=gnu-v3
+_Zrm1XS_
+operator%(X, X)
+#
+--format=gnu-v3
+_ZplR1XS0_
+operator+(X&, X&)
+#
+--format=gnu-v3
+_ZlsRK1XS1_
+operator<<(X const&, X const&)
+#
+--format=gnu-v3
+_ZN3FooIA4_iE3barE
+Foo<int[4]>::bar
+#
+--format=gnu-v3
+_Z1fIiEvi
+void f<int>(int)
+#
+--format=gnu-v3
+_Z5firstI3DuoEvS0_
+void first<Duo>(Duo)
+#
+--format=gnu-v3
+_Z5firstI3DuoEvT_
+void first<Duo>(Duo)
+#
+--format=gnu-v3
+_Z3fooIiFvdEiEvv
+void foo<int, void ()(double), int>()
+#
+--format=gnu-v3
+_ZN1N1fE
+N::f
+#
+--format=gnu-v3
+_ZN6System5Sound4beepEv
+System::Sound::beep()
+#
+--format=gnu-v3
+_ZN5Arena5levelE
+Arena::level
+#
+--format=gnu-v3
+_ZN5StackIiiE5levelE
+Stack<int, int>::level
+#
+--format=gnu-v3
+_Z1fI1XEvPVN1AIT_E1TE
+void f<X>(A<X>::T volatile*)
+#
+--format=gnu-v3
+_ZngILi42EEvN1AIXplT_Li2EEE1TE
+void operator-<42>(A<(42) + (2)>::T)
+#
+--format=gnu-v3
+_Z4makeI7FactoryiET_IT0_Ev
+Factory<int> make<Factory, int>()
+#
+--format=gnu-v3
+_Z4makeI7FactoryiET_IT0_Ev
+Factory<int> make<Factory, int>()
+#
+--format=gnu-v3
+_Z3foo5Hello5WorldS0_S_
+foo(Hello, World, World, Hello)
+#
+--format=gnu-v3
+_Z3fooPM2ABi
+foo(int AB::**)
+#
+--format=gnu-v3
+_ZlsRSoRKSs
+operator<<(std::ostream&, std::string const&)
+#
+--format=gnu-v3
+_ZTI7a_class
+typeinfo for a_class
+#
+--format=gnu-v3
+U4_farrVKPi
+int* restrict volatile const _far
+#
+--format=gnu-v3
+_Z3fooILi2EEvRAplT_Li1E_i
+void foo<2>(int (&) [(2) + (1)])
+#
+--format=gnu-v3
+_Z1fM1AKFvvE
+f(void (A::*)() const)
+#
+--format=gnu-v3
+_Z3fooc
+foo(char)
+#
+--format=gnu-v3
+2CBIL_Z3foocEE
+CB<foo(char)>
+#
+--format=gnu-v3
+2CBIL_Z7IsEmptyEE
+CB<IsEmpty>
+#
+--format=gnu-v3
+_ZZN1N1fEiE1p
+N::f(int)::p
+#
+--format=gnu-v3
+_ZZN1N1fEiEs
+N::f(int)::string literal
+#
+--format=gnu-v3
+_Z1fPFvvEM1SFvvE
+f(void (*)(), void (S::*)())
+#
+--format=gnu-v3
+_ZN1N1TIiiE2mfES0_IddE
+N::T<int, int>::mf(N::T<double, double>)
+#
+--format=gnu-v3
+_ZSt5state
+std::state
+#
+--format=gnu-v3
+_ZNSt3_In4wardE
+std::_In::ward
+#
+--format=gnu-v3
+_Z1fKPFiiE
+f(int (* const)(int))
+#
+--format=gnu-v3
+_Z1fAszL_ZZNK1N1A1fEvE3foo_0E_i
+f(int[sizeof(N::A::f() const::foo)])
+#
+--format=gnu-v3
+_Z1fA37_iPS_
+f(int[37], int (*) [37])
+#
+--format=gnu-v3
+_Z1fM1AFivEPS0_
+f(int (A::*)(), int (*)())
+#
+--format=gnu-v3
+_Z1fPFPA1_ivE
+f(int (*(*)()) [1])
+#
+--format=gnu-v3
+_Z1fPKM1AFivE
+f(int (A::* const*)())
+#
+--format=gnu-v3
+_Z1jM1AFivEPS1_
+j(int (A::*)(), int (A::**)())
+#
+--format=gnu-v3
+_Z1sPA37_iPS0_
+s(int (*) [37], int (**) [37])
+#
+--format=gnu-v3
+_Z3fooA30_A_i
+foo(int[30][])
+#
+--format=gnu-v3
+_Z3kooPA28_A30_i
+koo(int (*) [28][30])
+#
+--format=gnu-v3
+_ZlsRKU3fooU4bart1XS0_
+operator<<(X bart foo const&, X bart)
+#
+--format=gnu-v3
+_ZlsRKU3fooU4bart1XS2_
+operator<<(X bart foo const&, X bart foo const)
+#
+--format=gnu-v3
+_Z1fM1AKFivE
+f(int (A::*)() const)
+#
+--format=gnu-v3
+_Z3absILi11EEvv
+void abs<11>()
+#
+--format=gnu-v3
+_ZN1AIfEcvT_IiEEv
+A<float>::operator int<int>()
+#
+--format=gnu-v3
+_ZN12libcw_app_ct10add_optionIS_EEvMT_FvPKcES3_cS3_S3_
+void libcw_app_ct::add_option<libcw_app_ct>(void (libcw_app_ct::*)(char const*), char const*, char, char const*, char const*)
+#
+--format=gnu-v3
+_ZGVN5libcw24_GLOBAL__N_cbll.cc0ZhUKa23compiler_bug_workaroundISt6vectorINS_13omanip_id_tctINS_5debug32memblk_types_manipulator_data_ctEEESaIS6_EEE3idsE
+guard variable for libcw::(anonymous namespace)::compiler_bug_workaround<std::vector<libcw::omanip_id_tct<libcw::debug::memblk_types_manipulator_data_ct>, std::allocator<libcw::omanip_id_tct<libcw::debug::memblk_types_manipulator_data_ct> > > >::ids
+#
+--format=gnu-v3
+_ZN5libcw5debug13cwprint_usingINS_9_private_12GlobalObjectEEENS0_17cwprint_using_tctIT_EERKS5_MS5_KFvRSt7ostreamE
+libcw::debug::cwprint_using_tct<libcw::_private_::GlobalObject> libcw::debug::cwprint_using<libcw::_private_::GlobalObject>(libcw::_private_::GlobalObject const&, void (libcw::_private_::GlobalObject::*)(std::ostream&) const)
+#
+--format=gnu-v3
+_ZNKSt14priority_queueIP27timer_event_request_base_ctSt5dequeIS1_SaIS1_EE13timer_greaterE3topEv
+std::priority_queue<timer_event_request_base_ct*, std::deque<timer_event_request_base_ct*, std::allocator<timer_event_request_base_ct*> >, timer_greater>::top() const
+#
+--format=gnu-v3
+_ZNKSt15_Deque_iteratorIP15memory_block_stRKS1_PS2_EeqERKS5_
+std::_Deque_iterator<memory_block_st*, memory_block_st* const&, memory_block_st* const*>::operator==(std::_Deque_iterator<memory_block_st*, memory_block_st* const&, memory_block_st* const*> const&) const
+#
+--format=gnu-v3
+_ZNKSt17__normal_iteratorIPK6optionSt6vectorIS0_SaIS0_EEEmiERKS6_
+std::__normal_iterator<option const*, std::vector<option, std::allocator<option> > >::operator-(std::__normal_iterator<option const*, std::vector<option, std::allocator<option> > > const&) const
+#
+--format=gnu-v3
+_ZNSbIcSt11char_traitsIcEN5libcw5debug27no_alloc_checking_allocatorEE12_S_constructIPcEES6_T_S7_RKS3_
+char* std::basic_string<char, std::char_traits<char>, libcw::debug::no_alloc_checking_allocator>::_S_construct<char*>(char*, char*, libcw::debug::no_alloc_checking_allocator const&)
+#
+--format=gnu-v3
+_Z1fI1APS0_PKS0_EvT_T0_T1_PA4_S3_M1CS8_
+void f<A, A*, A const*>(A, A*, A const*, A const* (*) [4], A const* (* C::*) [4])
+#
+--format=gnu-v3
+_Z3fooiPiPS_PS0_PS1_PS2_PS3_PS4_PS5_PS6_PS7_PS8_PS9_PSA_PSB_PSC_
+foo(int, int*, int**, int***, int****, int*****, int******, int*******, int********, int*********, int**********, int***********, int************, int*************, int**************, int***************)
+#
+--format=gnu-v3
+_ZSt1BISt1DIP1ARKS2_PS3_ES0_IS2_RS2_PS2_ES2_ET0_T_SB_SA_PT1_
+std::D<A*, A*&, A**> std::B<std::D<A*, A* const&, A* const*>, std::D<A*, A*&, A**>, A*>(std::D<A*, A* const&, A* const*>, std::D<A*, A* const&, A* const*>, std::D<A*, A*&, A**>, A**)
+#
+--format=gnu-v3
+_X11TransParseAddress
+_X11TransParseAddress
+#
+--format=gnu-v3
+_ZNSt13_Alloc_traitsISbIcSt18string_char_traitsIcEN5libcw5debug9_private_17allocator_adaptorIcSt24__default_alloc_templateILb0ELi327664EELb1EEEENS5_IS9_S7_Lb1EEEE15_S_instancelessE
+std::_Alloc_traits<std::basic_string<char, std::string_char_traits<char>, libcw::debug::_private_::allocator_adaptor<char, std::__default_alloc_template<false, 327664>, true> >, libcw::debug::_private_::allocator_adaptor<std::basic_string<char, std::string_char_traits<char>, libcw::debug::_private_::allocator_adaptor<char, std::__default_alloc_template<false, 327664>, true> >, std::__default_alloc_template<false, 327664>, true> >::_S_instanceless
+#
+--format=gnu-v3
+_GLOBAL__I__Z2fnv
+global constructors keyed to fn()
+#
+--format=gnu-v3
+_Z1rM1GFivEMS_KFivES_M1HFivES1_4whatIKS_E5what2IS8_ES3_
+r(int (G::*)(), int (G::*)() const, G, int (H::*)(), int (G::*)(), what<G const>, what2<G const>, int (G::*)() const)
#
# This caused an infinite loop.
# We still don't demangle this correctly, but at least we don't hang.
--format=auto
__CPR212____ct__Q3_3std141list__tm__128_Q2_3edm41THandle__tm__26_Q2_4emid15EMparticleChunkQ2_3std68allocator__tm__51_Q2_3edmJ37J14const_iteratorFRCQ3_3std18list__tm__7_Z1ZZ2Z8iterator
-_Z1ZZ2Z::__CPR212____ct__Q3_3std141list__tm__128_Q2_3edm41THandle__tm__26_Q2_4emid15EMparticleChunkQ2_3std68allocator__tm__51_Q2_3edmJ37J14const_iteratorFRCQ3_3std18list__tm(iterator)
+__CPR212____ct__Q3_3std141list__tm__128_Q2_3edm41THandle__tm__26_Q2_4emid15EMparticleChunkQ2_3std68allocator__tm__51_Q2_3edmJ37J14const_iteratorFRCQ3_3std18list__tm__7_Z1ZZ2Z8iterator
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index f2d62925748..571bc2a8663 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,706 @@
+2003-06-27 Michael Koch <konqueror@gmx.de>
+
+ * java/security/Certificate.java
+ (getGuarantor): Removed wrong @deprecated tag.
+ (getPrincipal): Likewise.
+ (getPublicKey): Likewise.
+ (encode): Likewise.
+ (decode): Likewise.
+ (getFormat): Likewise.
+ (toString): Likewise.
+ * java/security/cert/PolicyQualifierInfo.java
+ (PolicyQualifierInfo): Made final.
+ * javax/security/auth/x500/X500Principal.java
+ (serialVersionUID): New member variable.
+
+2003-06-27 Michael Koch <konqueror@gmx.de>
+
+ * java/text/Format.java
+ (serialVersionUID): Fixed value.
+
+2003-06-27 Michael Koch <konqueror@gmx.de>
+
+ * java/net/Inet4Address.java
+ (Inet4Address): Made package-private.
+ * java/net/Inet6Address.java
+ (Inet4Address): Made package-private.
+
+2003-06-27 Michael Koch <konqueror@gmx.de>
+
+ * java/io/RandomAccessFile.java
+ (readLine): Removed wrong @deprecated tag.
+ (getChannel): Made final.
+
+2003-06-27 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/FileChannelImpl.java
+ (write): Removed.
+
+2003-06-27 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/ByteBufferImpl.java
+ (ByteBufferImpl): Made it a package-private class
+ * java/nio/CharBufferImpl.java
+ (CharBufferImpl): Made it a package-private class
+ * java/nio/DirectByteBufferImpl.java
+ (DirectByteBufferImpl): Made it a package-private class
+ * java/nio/DoubleBufferImpl.java
+ (DoubleBufferImpl): Made it a package-private class
+ * java/nio/FloatBufferImpl.java
+ (FloatBufferImpl): Made it a package-private class
+ * java/nio/IntBufferImpl.java
+ (IntBufferImpl): Made it a package-private class
+ * java/nio/LongBufferImpl.java
+ (LongBufferImpl): Made it a package-private class
+ * java/nio/ShortBufferImpl.java
+ (ShortBufferImpl): Made it a package-private class
+ * java/nio/channels/FileChannel.java
+ (write): Made final.
+ * java/nio/channels/ServerSocketChannel.java
+ (ServerSocketChanne): Made protected.
+
+2003-06-27 Michael Koch <konqueror@gmx.de>
+
+ * javax/naming/CompositeName.java
+ (serialVersionUID): New member variable.
+ * javax/naming/CompoundName.java
+ (serialVersionUID): New member variable.
+ * javax/naming/InitialContext.java
+ (InitialContext): Throws NamingException.
+ (init): Likewise.
+ * javax/naming/LinkRef.java
+ (serialVersionUID): New member variable.
+ (gteLinkName): Throws NamingException.
+ * javax/naming/NamingException.java
+ (serialVersionUID): New member variable.
+ * javax/naming/NamingSecurityException.java
+ (NamingSecurityException): Made abstract.
+ (serialVersionUID): New member variable.
+ * javax/naming/ReferralException.java
+ (serialVersionUID): New member variable.
+ * javax/naming/StringRefAddr.java
+ (serialVersionUID): New member variable.
+ * javax/naming/directory/BasicAttribute.java:
+ Reworked imports.
+ (serialVersionUID): New member variable.
+ (get): Throws NamingException.
+ (getAll): Throws NamingException.
+ * javax/naming/directory/BasicAttributes.java:
+ Reworked imports.
+ (serialVersionUID): New member variable.
+ * javax/naming/ldap/UnsolicitedNotificationEvent.java
+ (serialVersionUID): New member variable.
+
+2003-06-27 Michael Koch <konqueror@gmx.de>
+
+ * Makefile.am
+ (awt_java_source_files): Added new files:
+ javax/swing/Popup.java,
+ javax/swing/PopupFactory.java
+ * Makefile.in: Regenerated.
+
+2003-06-27 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JWindow.java,
+ javax/swing/event/AncestorEvent.java,
+ javax/swing/event/HyperlinkEvent.java,
+ javax/swing/event/InternalFrameEvent.java,
+ javax/swing/event/ListDataEvent.java,
+ javax/swing/event/TableModelEvent.java,
+ javax/swing/plaf/PopupMenuUI.java,
+ javax/swing/plaf/SplitPaneUI.java,
+ javax/swing/plaf/TabbedPaneUI.java,
+ javax/swing/plaf/TextUI.java,
+ javax/swing/plaf/TreeUI.java,
+ javax/swing/plaf/basic/BasicTextUI.java,
+ javax/swing/plaf/basic/BasicTreeUI.java:
+ New versions from classpath.
+ * javax/swing/Popup.java,
+ javax/swing/PopupFactory.jav:
+ New source files from classpath.
+ * javax/swing/plaf/doc-files/TreeUI-1.png:
+ New binary files from classpath.
+
+2003-06-25 Michael Koch <konqueror@gmx.de>
+
+ * Makefile.am
+ (awt_java_source_files): Added javax/swing/plaf/SpinnerUI.java.
+ * Makefile.in: Regenerated.
+
+2003-06-25 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/plaf/ActionMapUIResource.java,
+ javax/swing/plaf/BorderUIResource.java,
+ javax/swing/plaf/ButtonUI.java,
+ javax/swing/plaf/ColorChooserUI.java,
+ javax/swing/plaf/ColorUIResource.java,
+ javax/swing/plaf/ComboBoxUI.java,
+ javax/swing/plaf/ComponentInputMapUIResource.java,
+ javax/swing/plaf/ComponentUI.java,
+ javax/swing/plaf/DesktopIconUI.java,
+ javax/swing/plaf/DesktopPaneUI.java,
+ javax/swing/plaf/DimensionUIResource.java,
+ javax/swing/plaf/FileChooserUI.java,
+ javax/swing/plaf/FontUIResource.java,
+ javax/swing/plaf/IconUIResource.java,
+ javax/swing/plaf/InputMapUIResource.java,
+ javax/swing/plaf/InsetsUIResource.java,
+ javax/swing/plaf/InternalFrameUI.java,
+ javax/swing/plaf/LabelUI.java,
+ javax/swing/plaf/ListUI.java,
+ javax/swing/plaf/MenuBarUI.java,
+ javax/swing/plaf/MenuItemUI.java,
+ javax/swing/plaf/OptionPaneUI.java,
+ javax/swing/plaf/PanelUI.java,
+ javax/swing/plaf/ProgressBarUI.java,
+ javax/swing/plaf/RootPaneUI.java,
+ javax/swing/plaf/ScrollBarUI.java,
+ javax/swing/plaf/ScrollPaneUI.java,
+ javax/swing/plaf/SeparatorUI.java,
+ javax/swing/plaf/SliderUI.java,
+ javax/swing/plaf/TableHeaderUI.java,
+ javax/swing/plaf/TableUI.java,
+ javax/swing/plaf/ToolBarUI.java,
+ javax/swing/plaf/ToolTipUI.java,
+ javax/swing/plaf/ViewportUI.java:
+ New versions from classpath.
+ * javax/swing/plaf/SpinnerUI.java:
+ New file from classpath
+
+2003-06-25 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/image/ColorModel.java:
+ New version from classpath.
+
+2003-06-25 Michael Koch <konqueror@gmx.de>
+
+ * java/net/PlainDatagramSocketImpl.java:
+ Partly merged with classpath, this mainly adds documentation.
+
+2003-06-25 Michael Koch <konqueror@gmx.de>
+
+ * java/io/ObjectInputStream.java
+ (readClassDescriptor): New method.
+ (readObject): Moved functionality to readClassDescriptor().
+ * java/io/ObjectOutputStream.java
+ (writeClassDescriptor): New method.
+ (writeObject): Moved functionality to writeClassDescriptor().
+
+2003-06-25 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/plaf/basic/BasicListUI.java,
+ javax/swing/plaf/basic/BasicOptionPaneUI.java:
+ Added missing methods.
+
+2003-06-25 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/event/AncestorEvent.java
+ javax/swing/event/HyperlinkEvent.java
+ javax/swing/event/InternalFrameEvent.java
+ javax/swing/event/ListDataEvent.java
+ javax/swing/event/TableModelEvent.java:
+ Compile fixes.
+
+2003-06-24 Michael Koch <konqueror@gmx.de>
+
+ * java/net/URL.java:
+ Renamed "handler" to "ph" in the whole file to match classpaths
+ version.
+ * java/net/URLStreamHandler.java:
+ (equals): Renamed "handler" to "ph".
+
+2003-06-24 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/event/AncestorEvent.java,
+ javax/swing/event/HyperlinkEvent.java,
+ javax/swing/event/InternalFrameEvent.java,
+ javax/swing/event/ListDataEvent.java,
+ javax/swing/event/TableModelEvent.java,
+ javax/swing/event/TreeWillExpandListener.java,
+ javax/swing/plaf/ComponentUI.java,
+ javax/swing/plaf/DesktopIconUI.java,
+ javax/swing/plaf/DesktopPaneUI.java,
+ javax/swing/plaf/DimensionUIResource.java,
+ javax/swing/plaf/FileChooserUI.java,
+ javax/swing/plaf/FontUIResource.java,
+ javax/swing/plaf/IconUIResource.java,
+ javax/swing/plaf/InputMapUIResource.java,
+ javax/swing/plaf/InsetsUIResource.java,
+ javax/swing/plaf/InternalFrameUI.java,
+ javax/swing/plaf/LabelUI.java,
+ javax/swing/plaf/ListUI.java,
+ javax/swing/plaf/MenuBarUI.java,
+ javax/swing/plaf/MenuItemUI.java,
+ javax/swing/plaf/OptionPaneUI.java,
+ javax/swing/plaf/PanelUI.java,
+ javax/swing/plaf/ProgressBarUI.java,
+ javax/swing/plaf/doc-files/ComponentUI-1.dia,
+ javax/swing/plaf/doc-files/ComponentUI-1.png:
+ New versions from classpath.
+
+2003-06-24 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/Buffer.java
+ (cap): Made package-private.
+ (pos): Likewise.
+ (limit): Likewise.
+ (mark): Likewise.
+
+2003-06-24 Michael Koch <konqueror@gmx.de>
+
+ * java/net/SocketImpl.java
+ (shutdownInput): Made it non-abstract method throwing an exception
+ like in SUNs JRE.
+ (shutdownOutput): Likewise.
+ * java/net/SocketInputStream.java,
+ java/net/SocketOutputStream.java:
+ New files from classpath.
+
+2003-06-24 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/Font.java,
+ java/awt/Window.java,
+ java/awt/color/ColorSpace.java,
+ java/awt/datatransfer/StringSelection.java,
+ java/awt/image/ColorModel.java:
+ New versions from classpath.
+
+2003-06-24 Michael Koch <konqueror@gmx.de>
+
+ * Makefile.am
+ (awt_java_source_files): Added new files:
+ javax/swing/plaf/basic/BasicSplitPaneDivider.java,
+ javax/swing/plaf/basic/BasicSplitPaneUI.java
+ * Makefile.in: Regenerated.
+
+2003-06-24 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/text/JTextComponent.java:
+ New version from classpath.
+
+2003-06-24 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/Timer.java,
+ javax/swing/plaf/ActionMapUIResource.java,
+ javax/swing/plaf/ButtonUI.java,
+ javax/swing/plaf/ColorChooserUI.java,
+ javax/swing/plaf/ColorUIResource.java,
+ javax/swing/plaf/ComboBoxUI.java,
+ javax/swing/plaf/ComponentInputMapUIResource.java,
+ javax/swing/plaf/basic/BasicBorders.java:
+ New versions from classpath.
+ * javax/swing/plaf/basic/BasicSplitPaneDivider.java.
+ javax/swing/plaf/basic/BasicSplitPaneUI.java:
+ New file from classpath.
+ * javax/swing/plaf/basic/doc-files/BasicBorders-1.png,
+ javax/swing/plaf/basic/doc-files/BasicBorders-2.png,
+ javax/swing/plaf/basic/doc-files/BasicBorders.FieldBorder-1.png,
+ javax/swing/plaf/doc-files/ComponentUI-1.dia,
+ javax/swing/plaf/doc-files/ComponentUI-1.png:
+ New binary files from classpath.
+
+2003-06-24 Michael Koch <konqueror@gmx.de>
+
+ * java/io/LineNumberReader.java
+ (skip): Dont do line number accounting here as this is already done in
+ read(), simplified.
+
+2003-06-21 Michael Koch <konqueror@gmx.de>
+
+ * java/io/File.java
+ (static): Load javaio lib if existing (only in classpath).
+ (File): Revised documentation to show the correct argument name.
+ (createTempFile): Partly merged with classpath.
+ (compareTo): Simplified.
+ (lastModified): Throw exception if time < 0.
+ (deleteOnExit): Revised documentation.
+
+2003-06-21 Michael Koch <konqueror@gmx.de>
+
+ * java/net/PlainSocketImpl.java:
+ Reformatted.
+ (PlainSocketImpl): Merged class documentaion with classpath.
+ (in): Moved.
+ (out): Moved.
+ (PlainSocketImpl): New empty constructor.
+ (finalize): Moved.
+ (setOption): Merged documentation from classpath.
+ (getOption): Likewise.
+ (create): Likewise.
+ (connect): Likewise.
+ (bind): Likewise.
+ (listen): Likewise.
+ (accept): Likewise.
+ (available): Likewise.
+ (close): Likewise.
+ (read): Likewise.
+ (write): Likewise.
+ (getInputStream): Made synchronozed to get sure that only one stream
+ object can be created for this socket, merged documentation from
+ classpath.
+ (getOutputStream): Likewise.
+
+2003-06-21 Michael Koch <konqueror@gmx.de>
+
+ * java/net/PlainSocketImpl.java:
+ Reformatting.
+ (static): New implicit method.
+ (read): Made package private.
+ (write): Likewise.
+
+2003-06-21 Michael Koch <konqueror@gmx.de>
+
+ * java/util/SimpleTimeZone.java:
+ Removed unneeded import, reformatting.
+
+2003-06-21 Michael Koch <konqueror@gmx.de>
+
+ * java/text/DateFormat.java,
+ java/text/SimpleDateFormat.java,
+ java/util/Locale.java:
+ New versions from classpath.
+
+2003-06-21 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/SpinnerModel.java:
+ New file from classpath.
+ * javax/swing/border/LineBorder.java,
+ javax/swing/border/SoftBevelBorder.java,
+ javax/swing/plaf/BorderUIResource.java,
+ javax/swing/plaf/basic/BasicBorders.java:
+ New versions from classpath.
+ * javax/swing/plaf/basic/doc-files/BasicBorders.MenuBarBorder-1.png,
+ javax/swing/plaf/basic/doc-files/BasicBorders.RadioButtonBorder-1.png,
+ javax/swing/plaf/basic/doc-files/BasicBorders.SplitPaneBorder-1.png,
+ javax/swing/plaf/basic/doc-files/BasicBorders.SplitPaneBorder-2.png,
+ javax/swing/plaf/basic/doc-files/BasicBorders.SplitPaneDividerBorder-1.png,
+ javax/swing/plaf/basic/doc-files/BasicBorders.ToggleButtonBorder-1.png:
+ New binary files from classpath.
+
+2003-06-21 Michael Koch <konqueror@gmx.de>
+
+ * java/util/logging/LogRecord.java,
+ java/util/logging/Logger.java,
+ java/util/logging/SocketHandler.java,
+ java/util/logging/SimpleFormatter.java,
+ java/util/logging/Formatter.java,
+ java/util/logging/ErrorManager.java,
+ java/util/logging/Handler.java,
+ java/util/logging/FileHandler.java,
+ java/util/logging/LogManager.java,
+ java/util/logging/Level.java,
+ java/util/logging/ConsoleHandler.java,
+ java/util/logging/StreamHandler.java,
+ java/util/logging/LoggingPermission.java,
+ java/util/logging/Filter.java,
+ java/util/logging/MemoryHandler.java,
+ java/util/logging/XMLFormatter.java:
+ New files from classpath.
+
+2003-06-20 Michael Koch <konqueror@gmx.de>
+
+ * java/io/ObjectStreamField.java
+ (unshared): new member variable.
+ (ObjectStreamField): New constructor.
+ (isUnshared): New method.
+
+2003-06-20 Michael Koch <konqueror@gmx.de>
+
+ * java/net/URLStreamHandler.java
+ (hostsEqual): Rewritten.
+
+2003-06-20 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/MappedByteFileBuffer.java,
+ gnu/java/nio/natMappedByteFileBuffer.cc:
+ Removed
+ * java/nio/MappedByteBufferImpl.java:
+ New file.
+ * gnu/java/nio/FileChannelImpl.java:
+ Use MappedByteBufferImpl instead of MappedByteFileBuffer.
+ * Makefile.am
+ (ordinary_java_source_files): Removed
+ gnu/java/nio/MappedByteFileBuffer.java and added
+ java/nio/MappedByteBufferImpl.java.
+ (nat_source_files): Removed gnu/java/nio/natMappedByteFileBuffer.cc
+ * Makefile.in: Regenerated.
+
+2003-06-19 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/DatagramChannelImpl.java
+ (fd): Removed.
+ (blocking): New member variable.
+ (socket): Likewise.
+ (DatagramChannelImpl): Throws IOException, initialize socket.
+ (socket):Implemented.
+ (implCloseSelectableChannel): Throws IOException, implemented.
+ (implConfigureBlocking): Likewise.
+ (connect): Likewise.
+ (disconnect): Likewise.
+ (isConnected): Likewise.
+ (write): Likewise.
+ (read): Likewise.
+ (receive): Throws IOException.
+ (send): Likewise.
+ * gnu/java/nio/SocketChannelImpl.java
+ (read): Implemented.
+ (write): Implemented.
+
+2003-06-19 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JComponent.java,
+ javax/swing/JInternalFrame.java,
+ javax/swing/MenuSelectionManager.java,
+ javax/swing/SwingUtilities.java,
+ javax/swing/ToggleButtonModel.java:
+ New versions from classpath.
+
+2003-06-19 Michael Koch <konqueror@gmx.de>
+
+ * java/text/CollationElementIterator.java
+ (NULLORDER): Initialize with -1 as JDK documentation says.
+
+2003-06-19 Michael Koch <konqueror@gmx.de>
+
+ * java/net/HttpURLConnection.java,
+ java/net/Inet4Address.java,
+ java/net/Inet6Address.java,
+ java/net/SocketImpl.java,
+ java/net/URLClassLoader.java:
+ Reworked import statements.
+ * java/net/InetAddress.java
+ (getByAddress): Simplified.
+ * java/net/ServerSocket.java
+ (ServerSocket): Moved special handling during bind operation to
+ bind().
+ (bind): Handle different cases when trying to bind a socket.
+ * java/net/URLConnection.java
+ (getHeaderFieldDate): Merged with classpath.
+ (getHeaderFieldInt): Likewise.
+
+2003-06-19 Michael Koch <konqueror@gmx.de>
+
+ * java/util/zip/InflaterInputStream.java
+ (InflaterInputStream): Throw NullPointerException if in is null (as
+ JDK does).
+
+2003-06-19 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/Font.java
+ javax/swing/UIManager.java
+ javax/swing/border/AbstractBorder.java
+ javax/swing/border/BevelBorder.java
+ javax/swing/border/Border.java
+ javax/swing/border/CompoundBorder.java
+ javax/swing/border/EmptyBorder.java
+ javax/swing/border/EtchedBorder.java
+ javax/swing/border/LineBorder.java
+ javax/swing/border/MatteBorder.java
+ javax/swing/border/TitledBorder.java
+ javax/swing/plaf/BorderUIResource.java
+ javax/swing/plaf/basic/BasicBorders.java
+ javax/swing/plaf/basic/BasicButtonUI.java
+ javax/swing/plaf/basic/BasicCheckBoxUI.java
+ javax/swing/plaf/basic/BasicGraphicsUtils.java
+ javax/swing/plaf/basic/BasicLabelUI.java
+ javax/swing/plaf/basic/BasicRadioButtonUI.java
+ javax/swing/plaf/basic/BasicToggleButtonUI.java:
+ New versions from classpath.
+ * javax/swing/border/SoftBevelBorder.java:
+ New file from classpath.
+ * javax/swing/border/doc-files/LineBorder-1.png,
+ javax/swing/border/doc-files/BevelBorder-1.png,
+ javax/swing/border/doc-files/BevelBorder-2.png,
+ javax/swing/border/doc-files/BevelBorder-3.png,
+ javax/swing/border/doc-files/EmptyBorder-1.png,
+ javax/swing/border/doc-files/EtchedBorder-1.png,
+ javax/swing/border/doc-files/EtchedBorder-2.png,
+ javax/swing/border/doc-files/MatteBorder-1.png,
+ javax/swing/border/doc-files/MatteBorder-2.png,
+ javax/swing/border/doc-files/MatteBorder-3.png,
+ javax/swing/border/doc-files/MatteBorder-4.png,
+ javax/swing/border/doc-files/MatteBorder-5.png,
+ javax/swing/border/doc-files/MatteBorder-6.png,
+ javax/swing/border/doc-files/SoftBevelBorder-1.png,
+ javax/swing/border/doc-files/SoftBevelBorder-2.png,
+ javax/swing/border/doc-files/SoftBevelBorder-3.png,
+ javax/swing/plaf/basic/doc-files/BasicBorders.MarginBorder-1.png,
+ javax/swing/plaf/basic/doc-files/BasicBorders.ButtonBorder-1.png,
+ javax/swing/plaf/basic/doc-files/BasicGraphicsUtils-1.png,
+ javax/swing/plaf/basic/doc-files/BasicGraphicsUtils-2.png,
+ javax/swing/plaf/basic/doc-files/BasicGraphicsUtils-3.png,
+ javax/swing/plaf/basic/doc-files/BasicGraphicsUtils-4.png,
+ javax/swing/plaf/basic/doc-files/BasicGraphicsUtils-5.png,
+ javax/swing/plaf/basic/doc-files/BasicGraphicsUtils-6.png,
+ javax/swing/plaf/basic/doc-files/BasicGraphicsUtils-7.png:
+ New binary files from classpath.
+ * Makefile.am
+ (awt_java_source_files): Added
+ javax/swing/border/SoftBevelBorder.java.
+ * Makefile.in: Regenerated.
+
+2003-06-19 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/security/x509/X509Certificate.java
+ (writeReplace): Merged from classpath.
+
+2003-06-19 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/FileChannelImpl.java
+ (map_address): Made public.
+ (FileChannelImpl): Merged with classpath.
+ * gnu/java/nio/natFileChannelImpl.cc
+ (nio_mmap_file): Commented out unused arguments.
+ (nio_unmmap_file): Likewise.
+ (niu_msync): Likewise.
+
+2003-06-19 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/image/IndexColorModel.java:
+ New version from classpath.
+
+2003-06-18 Tom Tromey <tromey@redhat.com>
+
+ * java/net/Inet6Address.java (isAnyLocalAddress): Don't use "=="
+ on arrays.
+ (isLoopbackAddress): Likewise.
+ * java/net/Inet4Address.java (isAnyLocalAddress): Don't use "=="
+ on arrays.
+
+2003-06-18 Matt Kraai <kraai@alumni.cmu.edu>
+
+ * java/lang/natVMSecurityManager.cc (getClassContext):
+ Use maxlen instead of len for loop bound.
+
+2003-06-18 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/SelectorImpl.java
+ (register): Use fd with value 0 for now, will be fixed later.
+ * gnu/java/nio/ServerSocketChannelImpl.java
+ (fd): Removed.
+ (local_port): Removed.
+ (InetSocketAddress): Removed.
+ (ServerSocketChannelImpl): Just initialize internal socket object.
+ (implCloseSelectableChannel): Close internal socket object.
+ (implConfigureBlocking): Added comment.
+ (accept): Use jaba.net stuff to accept socket.
+ * gnu/java/nio/SocketChannelImpl.java
+ (fd): Removed.
+ (local_port): Removed.
+ (InetSocketAddress): Removed.
+ (SocketCreate): Removed.
+ (SocketConnect): Removed.
+ (SocketBind): Removed.
+ (SocketListen): Removed.
+ (SocketAvailable): Removed.
+ (SocketClose): Removed.
+ (SocketRead): Removed.
+ (SocketWrite): Removed.
+ (SocketChannelImpl): Just initialize internal socket object.
+ (implCloseSelectableChannel): Close internal socket object.
+ (implConfigureBlocking): Fixed implementation, added comment.
+ (connect): Use internal socket object to connect.
+ (socket): No need for sanity checks.
+ (read): Comment out some stuff, this will be reimplemented in the next
+ commit.
+ (write): Likewise.
+ * gnu/java/nio/natFileChannelImpl.cc
+ (nio_mmap_file): Line wrapped.
+ * gnu/java/nio/natSocketChannelImpl.cc: Removed.
+ * Makefile.am
+ (nat_source_files): Removeded gnu/java/nio/natSocketChannelImpl.cc.
+ * Makefile.in: Regenerated.
+
+2003-06-18 Michael Koch <konqueror@gmx.de>
+
+ * java/util/Locale.java
+ (equals): Merged from classpath.
+
+2003-06-18 Michael Koch <konqueror@gmx.de>
+
+ * java/net/InetAddress.java:
+ Reformatted to better match classpath's version.
+ * java/net/URL.java
+ (equals): Simplified.
+ * java/net/URLConnection.java
+ (setDoInput): Revised documentation.
+ (getDefaultUseCaches): Likewise.
+ (setRequestProperty): Added @since tag.
+
+2003-06-17 Michael Koch <konqueror@gmx.de>
+
+ * java/net/InetSocketAddress.java
+ (InetSocketAddress): Use wildcard address if addr is null.
+ (InetSocketAddress): Dont duplicate implementation.
+ (InetSocketAddress): Throw exception when hostname is null.
+ * java/net/Socket.java:
+ Reworked imports.
+ (Socket): Throw exception when raddr is null, handle case when laddr
+ is null.
+
+2003-06-17 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/DirectByteBufferImpl.java
+ (address): Made package private.
+ (DirectByteBufferImpl): New constructor.
+ * java/nio/natDirectByteBufferImpl.cc
+ (allocateImpl): Moved to java.nio namespace, implemented.
+ (freeImpl): Likewise.
+ (getImpl): Likewise.
+ (putImpl): Likewise.
+ * jni.cc
+ (_Jv_JNI_NewDirectByteBuffer): Implemented.
+ (_Jv_JNI_GetDirectBufferAddress): Implemented.
+ (_Jv_JNI_GetDirectBufferCapacity): Implemented.
+
+2003-06-17 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * include/powerpc-signal.h: New File.
+ * configure.in: Use it.
+ * configure: Regenerated.
+
+2003-06-17 Michael Koch <konqueror@gmx.de>
+
+ * java/util/Locale.java
+ (getDisplayLanguage): Made it final.
+ (getDisplayCountry): Likewise.
+ (getDisplayVariant): Likewise.
+ (getDisplayName): Likewise.
+
+2003-06-17 Michael Koch <konqueror@gmx.de>
+
+ * java/util/PropertyResourceBundle.java:
+ Removed unneeded import.
+
+2003-06-17 Michael Koch <konqueror@gmx.de>
+
+ * java/util/prefs/AbstractPreferences.java,
+ java/util/prefs/PreferencesFactory.java:
+ Reworked imports, removed unused imports.
+ * java/util/prefs/Preferences.java
+ (systemNodeForPackage): Method takes a Class not an Object.
+ (userNodeForPackage): Likewise.
+ (nodeForPackage): Likewise.
+
+2003-06-17 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/security/x509/X509Certificate.java:
+ Explicitely import used classes.
+
+2003-06-17 Michael Koch <konqueror@gmx.de>
+
+ * java/util/zip/ZipEntry.java,
+ java/util/zip/ZipFile.java,
+ java/util/zip/ZipInputStream.java,
+ java/util/zip/ZipOutputStream.java:
+ Reworked imports, only import used classes.
+
+2003-06-17 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/lang/ArrayHelper.java,
+ gnu/java/lang/ClassHelper.java:
+ Reformatted to match classpath's versions.
+
2003-06-14 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/FileChannelImpl.java
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index 010bfe6823f..07d6db3cabc 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -1151,6 +1151,7 @@ javax/swing/border/EmptyBorder.java \
javax/swing/border/EtchedBorder.java \
javax/swing/border/LineBorder.java \
javax/swing/border/MatteBorder.java \
+javax/swing/border/SoftBevelBorder.java \
javax/swing/border/TitledBorder.java \
javax/swing/GrayFilter.java \
javax/swing/AbstractAction.java \
@@ -1165,6 +1166,8 @@ javax/swing/plaf/basic/BasicOptionPaneUI.java \
javax/swing/plaf/basic/BasicPanelUI.java \
javax/swing/plaf/basic/BasicRadioButtonUI.java \
javax/swing/plaf/basic/BasicScrollPaneUI.java \
+javax/swing/plaf/basic/BasicSplitPaneDivider.java \
+javax/swing/plaf/basic/BasicSplitPaneUI.java \
javax/swing/plaf/basic/BasicTabbedPaneUI.java \
javax/swing/plaf/basic/BasicTextUI.java \
javax/swing/plaf/basic/BasicToggleButtonUI.java \
@@ -1209,6 +1212,7 @@ javax/swing/plaf/RootPaneUI.java \
javax/swing/plaf/ScrollBarUI.java \
javax/swing/plaf/SeparatorUI.java \
javax/swing/plaf/SliderUI.java \
+javax/swing/plaf/SpinnerUI.java \
javax/swing/plaf/SplitPaneUI.java \
javax/swing/plaf/TableHeaderUI.java \
javax/swing/plaf/TableUI.java \
@@ -1430,6 +1434,8 @@ javax/swing/JSplitPane.java \
javax/swing/JTextPane.java \
javax/swing/JToolBar.java \
javax/swing/OverlayLayout.java \
+javax/swing/Popup.java \
+javax/swing/PopupFactory.java \
javax/swing/ProgressMonitor.java \
javax/swing/ProgressMonitorInputStream.java \
javax/swing/RepaintManager.java \
@@ -2100,7 +2106,6 @@ gnu/java/math/MPN.java \
gnu/java/nio/DatagramChannelImpl.java \
gnu/java/nio/FileChannelImpl.java \
gnu/java/nio/FileLockImpl.java \
-gnu/java/nio/MappedByteFileBuffer.java \
gnu/java/nio/PipeImpl.java \
gnu/java/nio/SelectionKeyImpl.java \
gnu/java/nio/SelectorImpl.java \
@@ -2243,6 +2248,7 @@ java/nio/LongBuffer.java \
java/nio/LongBufferImpl.java \
java/nio/LongViewBufferImpl.java \
java/nio/MappedByteBuffer.java \
+java/nio/MappedByteBufferImpl.java \
java/nio/ReadOnlyBufferException.java \
java/nio/ShortBuffer.java \
java/nio/ShortBufferImpl.java \
@@ -2566,9 +2572,7 @@ gnu/gcj/runtime/natStringBuffer.cc \
gnu/gcj/runtime/natVMClassLoader.cc \
gnu/java/nio/natFileChannelImpl.cc \
gnu/java/nio/natFileLockImpl.cc \
-gnu/java/nio/natMappedByteFileBuffer.cc \
gnu/java/nio/natSelectorImpl.cc \
-gnu/java/nio/natSocketChannelImpl.cc \
java/io/natFile.cc \
java/io/natFileDescriptor.cc \
java/io/natObjectInputStream.cc \
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index 93b93afbadd..8700e237c3d 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -920,6 +920,7 @@ javax/swing/border/EmptyBorder.java \
javax/swing/border/EtchedBorder.java \
javax/swing/border/LineBorder.java \
javax/swing/border/MatteBorder.java \
+javax/swing/border/SoftBevelBorder.java \
javax/swing/border/TitledBorder.java \
javax/swing/GrayFilter.java \
javax/swing/AbstractAction.java \
@@ -934,6 +935,8 @@ javax/swing/plaf/basic/BasicOptionPaneUI.java \
javax/swing/plaf/basic/BasicPanelUI.java \
javax/swing/plaf/basic/BasicRadioButtonUI.java \
javax/swing/plaf/basic/BasicScrollPaneUI.java \
+javax/swing/plaf/basic/BasicSplitPaneDivider.java \
+javax/swing/plaf/basic/BasicSplitPaneUI.java \
javax/swing/plaf/basic/BasicTabbedPaneUI.java \
javax/swing/plaf/basic/BasicTextUI.java \
javax/swing/plaf/basic/BasicToggleButtonUI.java \
@@ -978,6 +981,7 @@ javax/swing/plaf/RootPaneUI.java \
javax/swing/plaf/ScrollBarUI.java \
javax/swing/plaf/SeparatorUI.java \
javax/swing/plaf/SliderUI.java \
+javax/swing/plaf/SpinnerUI.java \
javax/swing/plaf/SplitPaneUI.java \
javax/swing/plaf/TableHeaderUI.java \
javax/swing/plaf/TableUI.java \
@@ -1199,6 +1203,8 @@ javax/swing/JSplitPane.java \
javax/swing/JTextPane.java \
javax/swing/JToolBar.java \
javax/swing/OverlayLayout.java \
+javax/swing/Popup.java \
+javax/swing/PopupFactory.java \
javax/swing/ProgressMonitor.java \
javax/swing/ProgressMonitorInputStream.java \
javax/swing/RepaintManager.java \
@@ -1862,7 +1868,6 @@ gnu/java/math/MPN.java \
gnu/java/nio/DatagramChannelImpl.java \
gnu/java/nio/FileChannelImpl.java \
gnu/java/nio/FileLockImpl.java \
-gnu/java/nio/MappedByteFileBuffer.java \
gnu/java/nio/PipeImpl.java \
gnu/java/nio/SelectionKeyImpl.java \
gnu/java/nio/SelectorImpl.java \
@@ -2005,6 +2010,7 @@ java/nio/LongBuffer.java \
java/nio/LongBufferImpl.java \
java/nio/LongViewBufferImpl.java \
java/nio/MappedByteBuffer.java \
+java/nio/MappedByteBufferImpl.java \
java/nio/ReadOnlyBufferException.java \
java/nio/ShortBuffer.java \
java/nio/ShortBufferImpl.java \
@@ -2327,9 +2333,7 @@ gnu/gcj/runtime/natStringBuffer.cc \
gnu/gcj/runtime/natVMClassLoader.cc \
gnu/java/nio/natFileChannelImpl.cc \
gnu/java/nio/natFileLockImpl.cc \
-gnu/java/nio/natMappedByteFileBuffer.cc \
gnu/java/nio/natSelectorImpl.cc \
-gnu/java/nio/natSocketChannelImpl.cc \
java/io/natFile.cc \
java/io/natFileDescriptor.cc \
java/io/natObjectInputStream.cc \
@@ -2502,8 +2506,7 @@ gnu/gcj/runtime/natFinalizerThread.lo gnu/gcj/runtime/natFirstThread.lo \
gnu/gcj/runtime/natNameFinder.lo gnu/gcj/runtime/natSharedLibLoader.lo \
gnu/gcj/runtime/natStackTrace.lo gnu/gcj/runtime/natStringBuffer.lo \
gnu/gcj/runtime/natVMClassLoader.lo gnu/java/nio/natFileChannelImpl.lo \
-gnu/java/nio/natFileLockImpl.lo gnu/java/nio/natMappedByteFileBuffer.lo \
-gnu/java/nio/natSelectorImpl.lo gnu/java/nio/natSocketChannelImpl.lo \
+gnu/java/nio/natFileLockImpl.lo gnu/java/nio/natSelectorImpl.lo \
java/io/natFile.lo java/io/natFileDescriptor.lo \
java/io/natObjectInputStream.lo java/io/natVMObjectStreamClass.lo \
java/lang/natCharacter.lo java/lang/natClass.lo \
@@ -2966,8 +2969,8 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/locale/LocaleInformation_zh_TW.P \
.deps/gnu/java/math/MPN.P .deps/gnu/java/nio/DatagramChannelImpl.P \
.deps/gnu/java/nio/FileChannelImpl.P .deps/gnu/java/nio/FileLockImpl.P \
-.deps/gnu/java/nio/MappedByteFileBuffer.P .deps/gnu/java/nio/PipeImpl.P \
-.deps/gnu/java/nio/SelectionKeyImpl.P .deps/gnu/java/nio/SelectorImpl.P \
+.deps/gnu/java/nio/PipeImpl.P .deps/gnu/java/nio/SelectionKeyImpl.P \
+.deps/gnu/java/nio/SelectorImpl.P \
.deps/gnu/java/nio/SelectorProviderImpl.P \
.deps/gnu/java/nio/ServerSocketChannelImpl.P \
.deps/gnu/java/nio/SocketChannelImpl.P \
@@ -2982,9 +2985,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/nio/charset/UTF_8.P \
.deps/gnu/java/nio/natFileChannelImpl.P \
.deps/gnu/java/nio/natFileLockImpl.P \
-.deps/gnu/java/nio/natMappedByteFileBuffer.P \
.deps/gnu/java/nio/natSelectorImpl.P \
-.deps/gnu/java/nio/natSocketChannelImpl.P \
.deps/gnu/java/rmi/RMIMarshalledObjectInputStream.P \
.deps/gnu/java/rmi/RMIMarshalledObjectOutputStream.P \
.deps/gnu/java/rmi/dgc/DGCImpl.P .deps/gnu/java/rmi/dgc/DGCImpl_Skel.P \
@@ -3499,7 +3500,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/nio/IntBufferImpl.P .deps/java/nio/IntViewBufferImpl.P \
.deps/java/nio/InvalidMarkException.P .deps/java/nio/LongBuffer.P \
.deps/java/nio/LongBufferImpl.P .deps/java/nio/LongViewBufferImpl.P \
-.deps/java/nio/MappedByteBuffer.P \
+.deps/java/nio/MappedByteBuffer.P .deps/java/nio/MappedByteBufferImpl.P \
.deps/java/nio/ReadOnlyBufferException.P .deps/java/nio/ShortBuffer.P \
.deps/java/nio/ShortBufferImpl.P .deps/java/nio/ShortViewBufferImpl.P \
.deps/java/nio/channels/AlreadyConnectedException.P \
@@ -3996,7 +3997,8 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/javax/swing/MenuElement.P \
.deps/javax/swing/MenuSelectionManager.P \
.deps/javax/swing/MutableComboBoxModel.P \
-.deps/javax/swing/OverlayLayout.P .deps/javax/swing/ProgressMonitor.P \
+.deps/javax/swing/OverlayLayout.P .deps/javax/swing/Popup.P \
+.deps/javax/swing/PopupFactory.P .deps/javax/swing/ProgressMonitor.P \
.deps/javax/swing/ProgressMonitorInputStream.P \
.deps/javax/swing/Renderer.P .deps/javax/swing/RepaintManager.P \
.deps/javax/swing/RootPaneContainer.P \
@@ -4018,6 +4020,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/javax/swing/border/EtchedBorder.P \
.deps/javax/swing/border/LineBorder.P \
.deps/javax/swing/border/MatteBorder.P \
+.deps/javax/swing/border/SoftBevelBorder.P \
.deps/javax/swing/border/TitledBorder.P \
.deps/javax/swing/colorchooser/AbstractColorChooserPanel.P \
.deps/javax/swing/colorchooser/ColorChooserComponentFactory.P \
@@ -4095,7 +4098,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/javax/swing/plaf/ScrollBarUI.P \
.deps/javax/swing/plaf/ScrollPaneUI.P \
.deps/javax/swing/plaf/SeparatorUI.P .deps/javax/swing/plaf/SliderUI.P \
-.deps/javax/swing/plaf/SplitPaneUI.P \
+.deps/javax/swing/plaf/SpinnerUI.P .deps/javax/swing/plaf/SplitPaneUI.P \
.deps/javax/swing/plaf/TabbedPaneUI.P \
.deps/javax/swing/plaf/TableHeaderUI.P .deps/javax/swing/plaf/TableUI.P \
.deps/javax/swing/plaf/TextUI.P .deps/javax/swing/plaf/ToolBarUI.P \
@@ -4114,6 +4117,8 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/javax/swing/plaf/basic/BasicPanelUI.P \
.deps/javax/swing/plaf/basic/BasicRadioButtonUI.P \
.deps/javax/swing/plaf/basic/BasicScrollPaneUI.P \
+.deps/javax/swing/plaf/basic/BasicSplitPaneDivider.P \
+.deps/javax/swing/plaf/basic/BasicSplitPaneUI.P \
.deps/javax/swing/plaf/basic/BasicTabbedPaneUI.P \
.deps/javax/swing/plaf/basic/BasicTextUI.P \
.deps/javax/swing/plaf/basic/BasicToggleButtonUI.P \
diff --git a/libjava/configure b/libjava/configure
index 2e5b34dc112..8eba4cb110f 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -8618,7 +8618,7 @@ case "${host}" in
SIGNAL_HANDLER=include/dwarf2-signal.h
;;
powerpc-*-linux*)
- SIGNAL_HANDLER=include/dwarf2-signal.h
+ SIGNAL_HANDLER=include/powerpc-signal.h
;;
alpha*-*-linux*)
SIGNAL_HANDLER=include/dwarf2-signal.h
diff --git a/libjava/configure.in b/libjava/configure.in
index f1e0a39b222..dcdf4c16872 100644
--- a/libjava/configure.in
+++ b/libjava/configure.in
@@ -1004,7 +1004,7 @@ case "${host}" in
SIGNAL_HANDLER=include/dwarf2-signal.h
;;
powerpc-*-linux*)
- SIGNAL_HANDLER=include/dwarf2-signal.h
+ SIGNAL_HANDLER=include/powerpc-signal.h
;;
alpha*-*-linux*)
SIGNAL_HANDLER=include/dwarf2-signal.h
diff --git a/libjava/gnu/java/lang/ArrayHelper.java b/libjava/gnu/java/lang/ArrayHelper.java
index 271e248f523..0216caba167 100644
--- a/libjava/gnu/java/lang/ArrayHelper.java
+++ b/libjava/gnu/java/lang/ArrayHelper.java
@@ -1,5 +1,5 @@
-/* gnu.java.lang.ArrayHelper
- Copyright (C) 1998 Free Software Foundation, Inc.
+/* ArrayHelper.java -- Helper methods for handling array operations
+ Copyright (C) 1998, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -7,7 +7,7 @@ GNU Classpath 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 Classpath 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
@@ -39,25 +39,42 @@ exception statement from your version. */
package gnu.java.lang;
/**
- ** ArrayHelper helps you do things with arrays.
- **
- ** @author John Keiser
- ** @version 1.1.0, 29 Jul 1998
- **/
-
-public class ArrayHelper {
- public static boolean contains(Object[] array, Object searchFor) {
- return indexOf(array,searchFor) != -1;
- }
+ * ArrayHelper helps you do things with arrays.
+ *
+ * @author John Keiser
+ */
+public class ArrayHelper
+{
+ /**
+ * Counterpart to java.util.Collection.contains.
+ *
+ * @param array the array to search
+ * @param searchFor the object to locate
+ * @return true if some array element <code>equals(searchFor)</code>
+ */
+ public static boolean contains(Object[] array, Object searchFor)
+ {
+ return indexOf(array, searchFor) != -1;
+ }
- public static int indexOf(Object[] array, Object searchFor) {
- for(int i=0;i<array.length;i++) {
- if(array[i].equals(searchFor)) {
- return i;
- }
- }
- return -1;
- }
+ /**
+ * Counterpart to java.util.Collection.indexOf.
+ *
+ * @param array the array to search
+ * @param searchFor the object to locate
+ * @return the index of the first equal object, or -1
+ */
+ public static int indexOf(Object[] array, Object searchFor)
+ {
+ for (int i = 0; i < array.length; i++)
+ {
+ if(array[i].equals(searchFor))
+ {
+ return i;
+ }
+ }
+ return -1;
+ }
public static boolean equalsArray(Object[] a, Object[] b) {
if(a.length == b.length) {
diff --git a/libjava/gnu/java/lang/ClassHelper.java b/libjava/gnu/java/lang/ClassHelper.java
index 0d2ce5d4a77..16d699e3453 100644
--- a/libjava/gnu/java/lang/ClassHelper.java
+++ b/libjava/gnu/java/lang/ClassHelper.java
@@ -1,5 +1,5 @@
-/* gnu.java.lang.ClassHelper
- Copyright (C) 1998 Free Software Foundation, Inc.
+/* ClassHelper.java -- Utility methods to augment java.lang.Class
+ Copyright (C) 1998, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -7,7 +7,7 @@ GNU Classpath 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 Classpath 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
@@ -42,202 +42,144 @@ import java.util.*;
import java.lang.reflect.*;
/**
- ** ClassHelper has various methods that ought to have been
- ** in class.
- **
- ** @author John Keiser
- ** @version 1.1.0, 29 Jul 1998
- **/
-
-public class ClassHelper {
- /** Strip the package part from the class name.
- ** @param clazz the class to get the truncated name from
- ** @return the truncated class name.
- **/
- public static String getTruncatedClassName(Class clazz) {
- return getTruncatedName(clazz.getName());
- }
- /** Strip the package part from the class name, or the
- ** class part from the method or field name.
- ** @param name the name to truncate.
- ** @return the truncated name.
- **/
- public static String getTruncatedName(String name) {
- int lastInd = name.lastIndexOf('.');
- if(lastInd == -1) {
- return name;
- } else {
- return name.substring(lastInd+1);
- }
- }
-
- /** Strip the last portion of the name (after the last
- ** dot).
- ** @param name the name to get package of.
- ** @return the package name. "" if no package.
- **/
- public static String getPackagePortion(String name) {
- int lastInd = name.lastIndexOf('.');
- if(lastInd == -1) {
- return "";
- } else {
- return name.substring(0,lastInd);
- }
- }
-
- static Hashtable allMethods = new Hashtable();
- static Hashtable allMethodsAtDeclaration = new Hashtable();
-
- /** Get all the methods, public, private and
- ** otherwise, from the class, getting them
- ** from the most recent class to find them.
- **/
- public static Method[] getAllMethods(Class clazz) {
- Method[] retval = (Method[])allMethods.get(clazz);
- if(retval == null) {
- Method[] superMethods;
- if(clazz.getSuperclass() != null) {
- superMethods = getAllMethods(clazz.getSuperclass());
- } else {
- superMethods = new Method[0];
- }
- Vector v = new Vector();
- Method[] currentMethods = clazz.getDeclaredMethods();
- for(int i=0;i<currentMethods.length;i++) {
- v.addElement(currentMethods[i]);
- }
- for(int i=0;i<superMethods.length;i++) {
- boolean addOK = true;
- for(int j=0;j<currentMethods.length;j++) {
- if(getTruncatedName(superMethods[i].getName()).equals(getTruncatedName(currentMethods[j].getName()))
- && ArrayHelper.equalsArray(superMethods[i].getParameterTypes(),currentMethods[j].getParameterTypes())) {
- addOK = false;
- }
- }
- if(addOK) {
- v.addElement(superMethods[i]);
- }
- }
-
- retval = new Method[v.size()];
- v.copyInto(retval);
- allMethods.put(clazz,retval);
- }
- return retval;
- }
-
- /** Get all the methods, public, private and
- ** otherwise, from the class, and get them from
- ** their point of declaration.
- **/
- public static Method[] getAllMethodsAtDeclaration(Class clazz) {
- Method[] retval = (Method[])allMethodsAtDeclaration.get(clazz);
- if(retval == null) {
- Method[] superMethods;
- if(clazz.getSuperclass() != null) {
- superMethods = getAllMethodsAtDeclaration(clazz.getSuperclass());
- } else {
- superMethods = new Method[0];
- }
- Vector v = new Vector();
- Method[] currentMethods = clazz.getDeclaredMethods();
- for(int i=0;i<superMethods.length;i++) {
- v.addElement(superMethods[i]);
- }
- for(int i=0;i<superMethods.length;i++) {
- boolean addOK = true;
- for(int j=0;j<currentMethods.length;j++) {
- if(getTruncatedName(superMethods[i].getName()).equals(getTruncatedName(currentMethods[j].getName()))
- && ArrayHelper.equalsArray(superMethods[i].getParameterTypes(),currentMethods[j].getParameterTypes())) {
- addOK = false;
- }
- }
- if(addOK) {
- v.addElement(superMethods[i]);
- }
- }
-
- retval = new Method[v.size()];
- v.copyInto(retval);
- allMethodsAtDeclaration.put(clazz,retval);
- }
- return retval;
- }
-
- static Hashtable allFields = new Hashtable();
- static Hashtable allFieldsAtDeclaration = new Hashtable();
-
- /** Get all the fields, public, private and
- ** otherwise, from the class, getting them
- ** from the most recent class to find them.
- **/
- public static Field[] getAllFields(Class clazz) {
- Field[] retval = (Field[])allFields.get(clazz);
- if(retval == null) {
- Field[] superFields;
- if(clazz.getSuperclass() != null) {
- superFields = getAllFields(clazz.getSuperclass());
- } else {
- superFields = new Field[0];
- }
- Vector v = new Vector();
- Field[] currentFields = clazz.getDeclaredFields();
- for(int i=0;i<currentFields.length;i++) {
- v.addElement(currentFields[i]);
- }
- for(int i=0;i<superFields.length;i++) {
- boolean addOK = true;
- for(int j=0;j<currentFields.length;j++) {
- if(getTruncatedName(superFields[i].getName()).equals(getTruncatedName(currentFields[j].getName()))) {
- addOK = false;
- }
- }
- if(addOK) {
- v.addElement(superFields[i]);
- }
- }
-
- retval = new Field[v.size()];
- v.copyInto(retval);
- allFields.put(clazz,retval);
- }
- return retval;
- }
-
- /** Get all the fields, public, private and
- ** otherwise, from the class, and get them from
- ** their point of declaration.
- **/
- public static Field[] getAllFieldsAtDeclaration(Class clazz) {
- Field[] retval = (Field[])allFieldsAtDeclaration.get(clazz);
- if(retval == null) {
- Field[] superFields;
- if(clazz.getSuperclass() != null) {
- superFields = getAllFieldsAtDeclaration(clazz.getSuperclass());
- } else {
- superFields = new Field[0];
- }
- Vector v = new Vector();
- Field[] currentFields = clazz.getDeclaredFields();
- for(int i=0;i<superFields.length;i++) {
- v.addElement(superFields[i]);
- }
- for(int i=0;i<superFields.length;i++) {
- boolean addOK = true;
- for(int j=0;j<currentFields.length;j++) {
- if(getTruncatedName(superFields[i].getName()).equals(getTruncatedName(currentFields[j].getName()))) {
- addOK = false;
- }
- }
- if(addOK) {
- v.addElement(superFields[i]);
- }
- }
-
- retval = new Field[v.size()];
- v.copyInto(retval);
- allFieldsAtDeclaration.put(clazz,retval);
- }
- return retval;
- }
+ * ClassHelper has various methods that ought to have been in Class.
+ *
+ * @author John Keiser
+ * @author Eric Blake <ebb9@email.byu.edu>
+ */
+public class ClassHelper
+{
+ /**
+ * Strip the package part from the class name.
+ *
+ * @param clazz the class to get the truncated name from
+ * @return the truncated class name
+ */
+ public static String getTruncatedClassName(Class clazz)
+ {
+ return getTruncatedName(clazz.getName());
+ }
+
+ /**
+ * Strip the package part from the class name, or the class part from
+ * the method or field name.
+ *
+ * @param name the name to truncate
+ * @return the truncated name
+ */
+ public static String getTruncatedName(String name)
+ {
+ int lastInd = name.lastIndexOf('.');
+ if (lastInd == -1)
+ return name;
+ return name.substring(lastInd + 1);
+ }
+
+ /**
+ * Strip the last portion of the name (after the last dot).
+ *
+ * @param name the name to get package of
+ * @return the package name, or "" if no package
+ */
+ public static String getPackagePortion(String name)
+ {
+ int lastInd = name.lastIndexOf('.');
+ if (lastInd == -1)
+ return "";
+ return name.substring(0, lastInd);
+ }
+
+ /** Cache of methods found in getAllMethods(). */
+ private static Map allMethods = new HashMap();
+
+ /**
+ * Get all the methods, public, private and otherwise, from the class,
+ * getting them from the most recent class to find them. This may not
+ * be quite the correct approach, as this includes methods that are not
+ * inherited or accessible from clazz, so beware.
+ *
+ * @param clazz the class to start at
+ * @return all methods declared or inherited in clazz
+ */
+ public static Method[] getAllMethods(Class clazz)
+ {
+ Method[] retval = (Method[]) allMethods.get(clazz);
+ if (retval == null)
+ {
+ Set methods = new HashSet();
+ Class c = clazz;
+ while (c != null)
+ {
+ Method[] currentMethods = c.getDeclaredMethods();
+ loop:
+ for (int i = 0; i < currentMethods.length; i++)
+ {
+ Method current = currentMethods[i];
+ int size = methods.size();
+ Iterator iter = methods.iterator();
+ while (--size >= 0)
+ {
+ Method override = (Method) iter.next();
+ if (current.getName().equals(override.getName())
+ && Arrays.equals(current.getParameterTypes(),
+ override.getParameterTypes())
+ && current.getReturnType() == override.getReturnType())
+ continue loop;
+ }
+ methods.add(current);
+ }
+ c = c.getSuperclass();
+ }
+ retval = new Method[methods.size()];
+ methods.toArray(retval);
+ allMethods.put(clazz, retval);
+ }
+ return retval;
+ }
+
+ /** Cache of fields found in getAllFields(). */
+ private static Map allFields = new HashMap();
+
+ /**
+ * Get all the fields, public, private and otherwise, from the class,
+ * getting them from the most recent class to find them. This may not
+ * be quite the correct approach, as this includes fields that are not
+ * inherited or accessible from clazz, so beware.
+ *
+ * @param clazz the class to start at
+ * @return all fields declared or inherited in clazz
+ */
+ public static Field[] getAllFields(Class clazz)
+ {
+ Field[] retval = (Field[]) allFields.get(clazz);
+ if (retval == null)
+ {
+ Set fields = new HashSet();
+ Class c = clazz;
+ while (c != null)
+ {
+ Field[] currentFields = c.getDeclaredFields();
+ loop:
+ for (int i = 0; i < currentFields.length; i++)
+ {
+ Field current = currentFields[i];
+ int size = fields.size();
+ Iterator iter = fields.iterator();
+ while (--size >= 0)
+ {
+ Field override = (Field) iter.next();
+ if (current.getName().equals(override.getName())
+ && current.getType() == override.getType())
+ continue loop;
+ }
+ fields.add(current);
+ }
+ c = c.getSuperclass();
+ }
+ retval = new Field[fields.size()];
+ fields.toArray(retval);
+ allFields.put(clazz, retval);
+ }
+ return retval;
+ }
}
diff --git a/libjava/gnu/java/nio/DatagramChannelImpl.java b/libjava/gnu/java/nio/DatagramChannelImpl.java
index a1e0be15912..dce7dabcdac 100644
--- a/libjava/gnu/java/nio/DatagramChannelImpl.java
+++ b/libjava/gnu/java/nio/DatagramChannelImpl.java
@@ -35,78 +35,120 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package gnu.java.nio;
+import java.io.IOException;
import java.net.DatagramSocket;
import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.DatagramChannel;
+import java.nio.channels.NotYetConnectedException;
import java.nio.channels.spi.SelectorProvider;
public class DatagramChannelImpl extends DatagramChannel
{
- int fd;
-
+ boolean blocking = false;
+ DatagramSocket socket;
+
protected DatagramChannelImpl (SelectorProvider provider)
+ throws IOException
{
super (provider);
+ socket = new DatagramSocket ();
}
- protected void implCloseSelectableChannel ()
+ public DatagramSocket socket ()
{
+ return socket;
}
- protected void implConfigureBlocking (boolean block)
+ protected void implCloseSelectableChannel ()
+ throws IOException
{
+ socket.close ();
}
-
- public int write (ByteBuffer src)
+
+ protected void implConfigureBlocking (boolean blocking)
+ throws IOException
{
- return 0;
+ this.blocking = blocking; // FIXME
}
- public long write (ByteBuffer[] srcs, int offset, int length)
+ public DatagramChannel connect (SocketAddress remote)
+ throws IOException
{
- return 0;
+ socket.connect (remote);
+ return this;
}
-
- public int read (ByteBuffer dst)
+
+ public DatagramChannel disconnect ()
+ throws IOException
{
- return 0;
+ socket.disconnect ();
+ return this;
}
- public DatagramChannel connect (SocketAddress remote)
+ public boolean isConnected ()
{
- return null;
+ return socket.isConnected ();
}
- public DatagramChannel disconnect ()
+ public int write (ByteBuffer src)
+ throws IOException
{
- return null;
- }
+ if (!isConnected ())
+ throw new NotYetConnectedException ();
- public boolean isConnected ()
+ throw new Error ("Not implemented");
+ }
+
+ public long write (ByteBuffer[] srcs, int offset, int length)
+ throws IOException
{
- return false;
+ // FIXME: Should we throw an exception if offset and/or length
+ // have wrong values ?
+
+ long result = 0;
+
+ for (int i = offset; i < offset + length; i++)
+ result += write (srcs [i]);
+
+ return result;
+ }
+
+ public int read (ByteBuffer dst)
+ throws IOException
+ {
+ if (!isConnected ())
+ throw new NotYetConnectedException ();
+
+ throw new Error ("Not implemented");
}
public long read (ByteBuffer[] dsts, int offset, int length)
+ throws IOException
{
- return 0;
+ // FIXME: Should we throw an exception if offset and/or length
+ // have wrong values ?
+
+ long result = 0;
+
+ for (int i = offset; i < offset + length; i++)
+ result += read (dsts [i]);
+
+ return result;
}
public SocketAddress receive (ByteBuffer dst)
+ throws IOException
{
- return null;
+ throw new Error ("Not implemented");
}
public int send (ByteBuffer src, SocketAddress target)
+ throws IOException
{
- return 0;
- }
-
- public DatagramSocket socket ()
- {
- return null;
+ throw new Error ("Not implemented");
}
}
diff --git a/libjava/gnu/java/nio/FileChannelImpl.java b/libjava/gnu/java/nio/FileChannelImpl.java
index cedf3978682..943bdd78652 100644
--- a/libjava/gnu/java/nio/FileChannelImpl.java
+++ b/libjava/gnu/java/nio/FileChannelImpl.java
@@ -46,6 +46,7 @@ import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
+import java.nio.MappedByteBufferImpl;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
@@ -65,7 +66,7 @@ import gnu.gcj.RawData;
public class FileChannelImpl extends FileChannel
{
- RawData map_address;
+ public RawData map_address;
int length;
FileDescriptor fd;
@@ -85,7 +86,7 @@ public class FileChannelImpl extends FileChannel
public FileChannelImpl ()
{
- this (new FileDescriptor (-1), true, null);
+ this (new FileDescriptor (), true, null);
}
private native long implPosition ();
@@ -260,7 +261,7 @@ public class FileChannelImpl extends FileChannel
int cmode = mode.m;
map_address = nio_mmap_file (position, size, cmode);
length = (int) size;
- buf = new MappedByteFileBuffer (this);
+ buf = new MappedByteBufferImpl (this);
return buf;
}
@@ -271,16 +272,10 @@ public class FileChannelImpl extends FileChannel
FileChannelImpl ch = new FileChannelImpl ();
ch.map_address = map_address;
ch.length = (int) length;
- ch.buf = new MappedByteFileBuffer (ch);
+ ch.buf = new MappedByteBufferImpl (ch);
return ch.buf;
}
- public long write (ByteBuffer[] srcs)
- throws IOException
- {
- return write (srcs, 0, srcs.length);
- }
-
/**
* msync with the disk
*/
diff --git a/libjava/gnu/java/nio/MappedByteFileBuffer.java b/libjava/gnu/java/nio/MappedByteFileBuffer.java
deleted file mode 100644
index ec6c83c5d70..00000000000
--- a/libjava/gnu/java/nio/MappedByteFileBuffer.java
+++ /dev/null
@@ -1,449 +0,0 @@
-/* MappedByteFileBuffer.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath 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 Classpath 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 Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.java.nio;
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.DoubleBuffer;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-import java.nio.LongBuffer;
-import java.nio.ShortBuffer;
-import java.nio.MappedByteBuffer;
-import java.io.IOException;
-import gnu.gcj.RawData;
-
-final public class MappedByteFileBuffer
- extends MappedByteBuffer
-{
- RawData map_address;
- boolean readOnly;
- boolean direct;
- public FileChannelImpl ch;
-
- public MappedByteFileBuffer (FileChannelImpl ch) throws IOException
- {
- super ((int) ch.size (), (int) ch.size (), 0, -1);
-
- this.ch = ch;
- map_address = ch.map_address;
-
- try
- {
- long si = ch.size () / 1;
- limit ((int) si);
- }
- catch (IOException e)
- {
- System.err.println ("failed to get size of file-channel's file");
- }
- }
-
- public MappedByteFileBuffer (MappedByteFileBuffer b)
- {
- // FIXME: fix last value
- super (b.capacity (), b.limit (), b.position (), -1);
-
- this.readOnly = b.isReadOnly ();
- this.ch = b.ch;
- map_address = b.map_address;
- limit (b.limit ());
- }
-
- public boolean isReadOnly ()
- {
- return readOnly;
- }
-
- public static native byte nio_read_Byte_file_channel (FileChannelImpl ch,
- int index, int limit,
- RawData map_address);
- public static native void nio_write_Byte_file_channel (FileChannelImpl ch,
- int index, int limit,
- byte value,
- RawData map_address);
- public static native short nio_read_Short_file_channel (FileChannelImpl ch,
- int index, int limit,
- RawData map_address);
- public static native void nio_write_Short_file_channel (FileChannelImpl ch,
- int index, int limit,
- short value,
- RawData map_address);
- public static native char nio_read_Char_file_channel (FileChannelImpl ch,
- int index, int limit,
- RawData map_address);
- public static native void nio_write_Char_file_channel (FileChannelImpl ch,
- int index, int limit,
- char value,
- RawData map_address);
- public static native int nio_read_Int_file_channel (FileChannelImpl ch,
- int index, int limit,
- RawData map_address);
- public static native void nio_write_Int_file_channel (FileChannelImpl ch,
- int index, int limit,
- int value,
- RawData map_address);
- public static native long nio_read_Long_file_channel (FileChannelImpl ch,
- int index, int limit,
- RawData map_address);
- public static native void nio_write_Long_file_channel (FileChannelImpl ch,
- int index, int limit,
- long value,
- RawData map_address);
- public static native float nio_read_Float_file_channel (FileChannelImpl ch,
- int index, int limit,
- RawData map_address);
- public static native void nio_write_Float_file_channel (FileChannelImpl ch,
- int index, int limit,
- float value,
- RawData map_address);
- public static native double
- nio_read_Double_file_channel (FileChannelImpl ch, int index, int limit,
- RawData map_address);
- public static native void nio_write_Double_file_channel (FileChannelImpl ch,
- int index, int limit,
- double value,
- RawData map_address);
-
- final public byte get ()
- {
- byte a = MappedByteFileBuffer.nio_read_Byte_file_channel (ch, position (),
- limit (),
- map_address);
- position (position () + 1);
- return a;
- }
-
- final public ByteBuffer put (byte b)
- {
- MappedByteFileBuffer.nio_write_Byte_file_channel (ch, position (), limit (),
- b, map_address);
- position (position () + 1);
- return this;
- }
-
- final public byte get (int index)
- {
- byte a = MappedByteFileBuffer.nio_read_Byte_file_channel (ch, index,
- limit (),
- map_address);
- return a;
- }
-
- final public ByteBuffer put (int index, byte b)
- {
- MappedByteFileBuffer.nio_write_Byte_file_channel (ch, index, limit (), b,
- map_address);
- return this;
- }
-
- final public ByteBuffer compact ()
- {
- return this;
- }
-
- final public boolean isDirect ()
- {
- return direct;
- }
-
- final public ByteBuffer slice ()
- {
- MappedByteFileBuffer A = new MappedByteFileBuffer (this);
- return A;
- }
-
- public ByteBuffer duplicate ()
- {
- return new MappedByteFileBuffer (this);
- }
-
- public ByteBuffer asReadOnlyBuffer ()
- {
- MappedByteFileBuffer b = new MappedByteFileBuffer (this);
- b.readOnly = true;
- return b;
- }
-
- final public ByteBuffer asByteBuffer ()
- {
-// ByteBuffer res = new MappedByteFileBuffer (ch);
-// res.limit ((limit () * 1) / 1);
-// return res;
- throw new Error ("not implemented");
- }
-
- final public byte getByte ()
- {
- byte a = nio_read_Byte_file_channel (ch, position (), limit (),
- map_address);
- position (position () + 1);
- return a;
- }
-
- final public ByteBuffer putByte (byte value)
- {
- nio_write_Byte_file_channel (ch, position (), limit (), value, map_address);
- position (position () + 1);
- return this;
- }
-
- final public byte getByte (int index)
- {
- byte a = nio_read_Byte_file_channel (ch, index, limit(), map_address);
- return a;
- }
-
- final public ByteBuffer putByte (int index, byte value)
- {
- nio_write_Byte_file_channel (ch, index, limit (), value, map_address);
- return this;
- };
-
- final public CharBuffer asCharBuffer ()
- {
-// CharBuffer res = new MappedCharFileBuffer (ch);
-// res.limit ((limit () * 1) / 2);
-// return res;
- throw new Error ("not implemented");
- }
-
- final public char getChar ()
- {
- char a = nio_read_Char_file_channel (ch, position (), limit (),
- map_address);
- position (position () + 1);
- return a;
- }
-
- final public ByteBuffer putChar (char value)
- {
- nio_write_Char_file_channel (ch, position (), limit (), value, map_address);
- position (position () + 1);
- return this;
- }
-
- final public char getChar (int index)
- {
- char a = nio_read_Char_file_channel (ch, index, limit (), map_address);
- return a;
- }
-
- final public ByteBuffer putChar (int index, char value)
- {
- nio_write_Char_file_channel (ch, index, limit (), value, map_address);
- return this;
- };
-
- final public ShortBuffer asShortBuffer ()
- {
-// ShortBuffer res = new MappedShortFileBuffer (ch);
-// res.limit ((limit () * 1) / 2);
-// return res;
- throw new Error ("not implemented");
- }
-
- final public short getShort ()
- {
- short a = nio_read_Short_file_channel (ch, position (), limit (),
- map_address);
- position (position () + 1);
- return a;
- }
-
- final public ByteBuffer putShort (short value)
- {
- nio_write_Short_file_channel (ch, position (), limit (), value,
- map_address);
- position (position () + 1);
- return this;
- }
-
- final public short getShort (int index)
- {
- short a = nio_read_Short_file_channel (ch, index, limit (), map_address);
- return a;
- }
-
- final public ByteBuffer putShort (int index, short value)
- {
- nio_write_Short_file_channel (ch, index, limit (), value, map_address);
- return this;
- }
-
- final public IntBuffer asIntBuffer ()
- {
-// IntBuffer res = new MappedIntFileBuffer (ch);
-// res.limit ((limit () * 1) / 4);
-// return res;
- throw new Error ("not implemented");
- }
-
- final public int getInt ()
- {
- int a = nio_read_Int_file_channel (ch, position (), limit (), map_address);
- position (position () + 1);
- return a;
- }
-
- final public ByteBuffer putInt (int value)
- {
- nio_write_Int_file_channel (ch, position (), limit (), value, map_address);
- position (position () + 1);
- return this;
- }
-
- final public int getInt (int index)
- {
- int a = nio_read_Int_file_channel (ch, index, limit (), map_address);
- return a;
- }
-
- final public ByteBuffer putInt (int index, int value)
- {
- nio_write_Int_file_channel (ch, index, limit (), value, map_address);
- return this;
- }
-
- final public LongBuffer asLongBuffer ()
- {
-// LongBuffer res = new MappedLongFileBuffer (ch);
-// res.limit ((limit () * 1) / 8);
-// return res;
- throw new Error ("not implemented");
- }
-
- final public long getLong ()
- {
- long a = nio_read_Long_file_channel (ch, position (), limit (),
- map_address);
- position (position () + 1);
- return a;
- }
-
- final public ByteBuffer putLong (long value)
- {
- nio_write_Long_file_channel (ch, position (), limit (), value, map_address);
- position (position () + 1);
- return this;
- }
-
- final public long getLong (int index)
- {
- long a = nio_read_Long_file_channel (ch, index, limit (), map_address);
- return a;
- }
-
- final public ByteBuffer putLong (int index, long value)
- {
- nio_write_Long_file_channel (ch, index, limit (), value, map_address);
- return this;
- }
-
- final public FloatBuffer asFloatBuffer ()
- {
-// FloatBuffer res = new MappedFloatFileBuffer (ch);
-// res.limit ((limit () * 1) / 4);
-// return res;
- throw new Error ("not implemented");
- }
-
- final public float getFloat ()
- {
- float a = nio_read_Float_file_channel (ch, position (), limit (),
- map_address);
- position (position () + 1);
- return a;
- }
-
- final public ByteBuffer putFloat (float value)
- {
- nio_write_Float_file_channel (ch, position (), limit (), value,
- map_address);
- position (position () + 1);
- return this;
- }
-
- final public float getFloat (int index)
- {
- float a = nio_read_Float_file_channel (ch, index, limit (), map_address);
- return a;
- }
-
- final public ByteBuffer putFloat (int index, float value)
- {
- nio_write_Float_file_channel (ch, index, limit (), value, map_address);
- return this;
- }
-
- final public DoubleBuffer asDoubleBuffer ()
- {
-// DoubleBuffer res = new MappedDoubleFileBuffer (ch);
-// res.limit ((limit () * 1) / 8);
-// return res;
- throw new Error ("not implemented");
- }
-
- final public double getDouble ()
- {
- double a = nio_read_Double_file_channel (ch, position (), limit (),
- map_address);
- position (position () + 1);
- return a;
- }
-
- final public ByteBuffer putDouble (double value)
- {
- nio_write_Double_file_channel (ch, position (), limit (), value,
- map_address);
- position (position () + 1);
- return this;
- }
-
- final public double getDouble (int index)
- {
- double a = nio_read_Double_file_channel (ch, index, limit (), map_address);
- return a;
- }
-
- final public ByteBuffer putDouble (int index, double value)
- {
- nio_write_Double_file_channel (ch, index, limit (), value, map_address);
- return this;
- }
-}
diff --git a/libjava/gnu/java/nio/SelectorImpl.java b/libjava/gnu/java/nio/SelectorImpl.java
index f2281a68d5a..9f714cc70c5 100644
--- a/libjava/gnu/java/nio/SelectorImpl.java
+++ b/libjava/gnu/java/nio/SelectorImpl.java
@@ -255,17 +255,17 @@ public class SelectorImpl extends AbstractSelector
if (ch instanceof SocketChannelImpl)
{
SocketChannelImpl sc = (SocketChannelImpl) ch;
- result = new SelectionKeyImpl (ch, this, sc.fd);
+ result = new SelectionKeyImpl (ch, this, 0); // FIXME: last argument
}
else if (ch instanceof DatagramChannelImpl)
{
DatagramChannelImpl dc = (DatagramChannelImpl) ch;
- result = new SelectionKeyImpl (ch, this, dc.fd);
+ result = new SelectionKeyImpl (ch, this, 0); // FIXME: last argument
}
else if (ch instanceof ServerSocketChannelImpl)
{
ServerSocketChannelImpl ssc = (ServerSocketChannelImpl) ch;
- result = new SelectionKeyImpl (ch, this, ssc.fd);
+ result = new SelectionKeyImpl (ch, this, 0); // FIXME: last argument
}
else
{
diff --git a/libjava/gnu/java/nio/ServerSocketChannelImpl.java b/libjava/gnu/java/nio/ServerSocketChannelImpl.java
index aded2207880..05ad0aefc30 100644
--- a/libjava/gnu/java/nio/ServerSocketChannelImpl.java
+++ b/libjava/gnu/java/nio/ServerSocketChannelImpl.java
@@ -35,11 +35,13 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package gnu.java.nio;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
+import java.net.Socket;
import java.net.SocketAddress;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
@@ -48,26 +50,14 @@ import java.nio.channels.spi.SelectorProvider;
class ServerSocketChannelImpl extends ServerSocketChannel
{
ServerSocket serverSocket;
- int fd;
-// int local_port;
boolean blocking = true;
boolean connected = false;
-// InetSocketAddress sa;
protected ServerSocketChannelImpl (SelectorProvider provider)
throws IOException
{
super (provider);
- fd = SocketChannelImpl.SocketCreate ();
-
- try
- {
- serverSocket = new ServerSocket ();
- }
- catch (IOException e)
- {
- System.err.println ("ServerSocket could not be created.");
- }
+ serverSocket = new ServerSocket ();
}
public void finalizer()
@@ -87,20 +77,19 @@ class ServerSocketChannelImpl extends ServerSocketChannel
protected void implCloseSelectableChannel () throws IOException
{
connected = false;
- SocketChannelImpl.SocketClose (fd);
- fd = SocketChannelImpl.SocketCreate ();
+ serverSocket.close();
}
protected void implConfigureBlocking (boolean blocking) throws IOException
{
- this.blocking = blocking;
+ this.blocking = blocking; // FIXME
}
public SocketChannel accept () throws IOException
{
SocketChannelImpl result = new SocketChannelImpl (provider ());
- result.sa = new InetSocketAddress (0);
- //int res = SocketAccept (this,result);
+ Socket socket = serverSocket.accept();
+ //socket.setChannel (result); // FIXME
return result;
}
diff --git a/libjava/gnu/java/nio/SocketChannelImpl.java b/libjava/gnu/java/nio/SocketChannelImpl.java
index 820d62f3b6c..b721c6d7d51 100644
--- a/libjava/gnu/java/nio/SocketChannelImpl.java
+++ b/libjava/gnu/java/nio/SocketChannelImpl.java
@@ -52,30 +52,13 @@ import gnu.classpath.Configuration;
public class SocketChannelImpl extends SocketChannel
{
Socket socket;
- int fd;
- int local_port;
boolean blocking = true;
boolean connected = false;
- InetSocketAddress sa;
-
- static native int SocketCreate();
- static native int SocketConnect(int fd, InetAddress addr, int port);
- static native int SocketBind(int fd, InetAddress addr, int port);
- static native int SocketListen(int fd, int backlog);
- static native int SocketAvailable(int fd);
- static native int SocketClose(int fd);
- static native int SocketRead(int fd, byte b[], int off, int len);
- static native int SocketWrite(int fd, byte b[], int off, int len);
-
- public SocketChannelImpl(SelectorProvider provider)
+
+ public SocketChannelImpl (SelectorProvider provider)
{
- super(provider);
- fd = SocketCreate();
-
- if (fd == -1)
- {
- System.err.println("failed to create socket:"+fd);
- }
+ super (provider);
+ socket = new Socket ();
}
public void finalizer()
@@ -95,39 +78,22 @@ public class SocketChannelImpl extends SocketChannel
protected void implCloseSelectableChannel () throws IOException
{
connected = false;
- SocketClose(fd);
- fd = SocketCreate();
+ socket.close();
}
protected void implConfigureBlocking (boolean blocking) throws IOException
{
- if (this.blocking == blocking)
- return;
+ this.blocking = blocking; // FIXME
}
public boolean connect (SocketAddress remote) throws IOException
{
if (connected)
- {
- throw new AlreadyConnectedException ();
- }
-
- // ok, lets connect !
+ throw new AlreadyConnectedException();
- sa = (InetSocketAddress) remote;
-
- InetAddress addr = sa.getAddress();
- int port = sa.getPort();
- int err = SocketConnect(fd, addr, port);
-
- if (err < 0)
- {
- throw new IOException("Connection refused:"+err + ", connect="+err);
- }
-
- local_port = err;
+ socket.connect (remote, 50);
connected = true;
- return blocking;
+ return blocking; // FIXME
}
public boolean finishConnect ()
@@ -147,30 +113,26 @@ public class SocketChannelImpl extends SocketChannel
public Socket socket ()
{
- if (socket != null)
- {
- //socket.ch = this;
- }
-
return socket;
}
public int read (ByteBuffer dst) throws IOException
{
+ byte[] data;
int bytes = 0;
- int len = 1024;
- byte[]b = new byte[len];
+ int len = dst.remaining ();
- bytes = SocketRead(fd, b, 0, len);
- dst.put(b, 0, bytes);
-
- if (bytes == 0)
+ if (!dst.hasArray ())
{
- // we've hit eof ?
- return -1;
+ data = new byte [len];
+ dst.get (data, 0, len);
}
-
- return bytes;
+ else
+ {
+ data = dst.array ();
+ }
+
+ return socket.getInputStream().read (data, 0, len);
}
public long read (ByteBuffer[] dsts, int offset, int length)
@@ -189,22 +151,22 @@ public class SocketChannelImpl extends SocketChannel
public int write (ByteBuffer src)
throws IOException
{
+ byte[] data;
int bytes = 0;
- int len = src.position();
-
- if (src.hasArray ())
+ int len = src.remaining ();
+
+ if (!src.hasArray ())
{
- byte[] b = src.array ();
- bytes = SocketWrite (fd, b, 0, len);
+ data = new byte [len];
+ src.get (data, 0, len);
}
else
{
- byte[] b = new byte [len];
- src.get (b, 0, len);
- bytes = SocketWrite (fd, b, 0, len);
+ data = src.array ();
}
-
- return bytes;
+
+ socket.getOutputStream().write (data, 0, len);
+ return len;
}
public long write (ByteBuffer[] srcs, int offset, int length)
diff --git a/libjava/gnu/java/nio/natFileChannelImpl.cc b/libjava/gnu/java/nio/natFileChannelImpl.cc
index 6275b6994d9..6119775d55a 100644
--- a/libjava/gnu/java/nio/natFileChannelImpl.cc
+++ b/libjava/gnu/java/nio/natFileChannelImpl.cc
@@ -73,19 +73,22 @@ gnu::java::nio::FileChannelImpl::implTruncate (jlong size)
}
gnu::gcj::RawData*
-gnu::java::nio::FileChannelImpl::nio_mmap_file (jlong pos, jlong size, jint /*mode*/)
+gnu::java::nio::FileChannelImpl::nio_mmap_file (jlong /*pos*/, jlong /*size*/,
+ jint /*mode*/)
{
throw new ::java::io::IOException (JvNewStringUTF ("mmap not implemented"));
}
void
-gnu::java::nio::FileChannelImpl::nio_unmmap_file (gnu::gcj::RawData* map_address, jint size)
+gnu::java::nio::FileChannelImpl::nio_unmmap_file (gnu::gcj::RawData* /*address*/,
+ jint /*size*/)
{
throw new ::java::io::IOException (JvNewStringUTF ("munmap not implemented"));
}
void
-gnu::java::nio::FileChannelImpl::nio_msync (gnu::gcj::RawData* map_address, jint length)
+gnu::java::nio::FileChannelImpl::nio_msync (gnu::gcj::RawData* /*map_address*/,
+ jint /*length*/)
{
throw new ::java::io::IOException (JvNewStringUTF ("msync not implemented"));
}
diff --git a/libjava/gnu/java/nio/natMappedByteFileBuffer.cc b/libjava/gnu/java/nio/natMappedByteFileBuffer.cc
deleted file mode 100644
index e64e27c8829..00000000000
--- a/libjava/gnu/java/nio/natMappedByteFileBuffer.cc
+++ /dev/null
@@ -1,148 +0,0 @@
-// natMappedByteFileBuffer.cc
-
-/* Copyright (C) 2003 Free Software Foundation
-
- This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
-
-#include <config.h>
-
-#include <jvm.h>
-
-#include <errno.h>
-#include <string.h>
-#include <sys/types.h>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#include <gnu/gcj/RawData.h>
-#include <gnu/java/nio/MappedByteFileBuffer.h>
-#include <java/lang/Error.h>
-
-jbyte
-gnu::java::nio::MappedByteFileBuffer::nio_read_Byte_file_channel
- (gnu::java::nio::FileChannelImpl*,
- jint, jint, gnu::gcj::RawData*)
-{
- throw new ::java::lang::Error (_Jv_NewStringUTF ("not implemented"));
-}
-
-jchar
-gnu::java::nio::MappedByteFileBuffer::nio_read_Char_file_channel
- (gnu::java::nio::FileChannelImpl*,
- jint, jint, gnu::gcj::RawData*)
-{
- throw new ::java::lang::Error (_Jv_NewStringUTF ("not implemented"));
-}
-
-jdouble
-gnu::java::nio::MappedByteFileBuffer::nio_read_Double_file_channel
- (gnu::java::nio::FileChannelImpl*,
- jint, jint, gnu::gcj::RawData*)
-{
- throw new ::java::lang::Error (_Jv_NewStringUTF ("not implemented"));
-}
-
-jfloat
-gnu::java::nio::MappedByteFileBuffer::nio_read_Float_file_channel
- (gnu::java::nio::FileChannelImpl*,
- jint, jint, gnu::gcj::RawData*)
-{
- throw new ::java::lang::Error (_Jv_NewStringUTF ("not implemented"));
-}
-
-jint
-gnu::java::nio::MappedByteFileBuffer::nio_read_Int_file_channel
- (gnu::java::nio::FileChannelImpl*,
- jint, jint, gnu::gcj::RawData*)
-{
- throw new ::java::lang::Error (_Jv_NewStringUTF ("not implemented"));
-}
-
-jlong
-gnu::java::nio::MappedByteFileBuffer::nio_read_Long_file_channel
- (gnu::java::nio::FileChannelImpl*,
- jint, jint, gnu::gcj::RawData*)
-{
- throw new ::java::lang::Error (_Jv_NewStringUTF ("not implemented"));
-}
-
-jshort
-gnu::java::nio::MappedByteFileBuffer::nio_read_Short_file_channel
- (gnu::java::nio::FileChannelImpl*,
- jint, jint, gnu::gcj::RawData*)
-{
- throw new ::java::lang::Error (_Jv_NewStringUTF ("not implemented"));
-}
-
-void
-gnu::java::nio::MappedByteFileBuffer::nio_write_Byte_file_channel
- (gnu::java::nio::FileChannelImpl*,
- jint, jint, jbyte,
- gnu::gcj::RawData*)
-{
- throw new ::java::lang::Error (_Jv_NewStringUTF ("not implemented"));
-}
-
-void
-gnu::java::nio::MappedByteFileBuffer::nio_write_Char_file_channel
- (gnu::java::nio::FileChannelImpl*,
- jint, jint, jchar,
- gnu::gcj::RawData*)
-{
- throw new ::java::lang::Error (_Jv_NewStringUTF ("not implemented"));
-}
-
-void
-gnu::java::nio::MappedByteFileBuffer::nio_write_Double_file_channel
- (gnu::java::nio::FileChannelImpl*,
- jint, jint, jdouble,
- gnu::gcj::RawData*)
-{
- throw new ::java::lang::Error (_Jv_NewStringUTF ("not implemented"));
-}
-
-void
-gnu::java::nio::MappedByteFileBuffer::nio_write_Float_file_channel
- (gnu::java::nio::FileChannelImpl*,
- jint, jint, jfloat,
- gnu::gcj::RawData*)
-{
- throw new ::java::lang::Error (_Jv_NewStringUTF ("not implemented"));
-}
-
-void
-gnu::java::nio::MappedByteFileBuffer::nio_write_Int_file_channel
- (gnu::java::nio::FileChannelImpl*,
- jint, jint, jint,
- gnu::gcj::RawData*)
-{
- throw new ::java::lang::Error (_Jv_NewStringUTF ("not implemented"));
-}
-
-void
-gnu::java::nio::MappedByteFileBuffer::nio_write_Long_file_channel
- (gnu::java::nio::FileChannelImpl*,
- jint, jint, jlong,
- gnu::gcj::RawData*)
-{
- throw new ::java::lang::Error (_Jv_NewStringUTF ("not implemented"));
-}
-
-void
-gnu::java::nio::MappedByteFileBuffer::nio_write_Short_file_channel
- (gnu::java::nio::FileChannelImpl*,
- jint, jint, jshort,
- gnu::gcj::RawData*)
-{
- throw new ::java::lang::Error (_Jv_NewStringUTF ("not implemented"));
-}
diff --git a/libjava/gnu/java/nio/natSocketChannelImpl.cc b/libjava/gnu/java/nio/natSocketChannelImpl.cc
deleted file mode 100644
index 480cc94e35a..00000000000
--- a/libjava/gnu/java/nio/natSocketChannelImpl.cc
+++ /dev/null
@@ -1,172 +0,0 @@
-// natSocketChannelImpl.cc
-
-/* Copyright (C) 2002, 2003 Free Software Foundation
-
- This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
-
-#include <config.h>
-#include <platform.h>
-
-#include <errno.h>
-
-#include <gcj/cni.h>
-#include <gnu/java/nio/SocketChannelImpl.h>
-#include <java/io/IOException.h>
-#include <java/net/InetAddress.h>
-#include <java/net/SocketException.h>
-
-
-#ifdef DISABLE_JAVA_NET
-
-jint
-gnu::java::nio::SocketChannelImpl::SocketCreate ()
-{
- throw new ::java::io::IOException (JvNewStringUTF ("SocketCreate not implemented"));
-}
-
-jint
-gnu::java::nio::SocketChannelImpl::SocketConnect (jint,
- ::java::net::InetAddress *,
- jint)
-{
- throw new ::java::io::IOException (JvNewStringUTF ("SocketConnect not implemented"));
-}
-
-jint
-gnu::java::nio::SocketChannelImpl::SocketBind (jint, ::java::net::InetAddress *,
- jint)
-{
- throw new ::java::io::IOException (JvNewStringUTF ("SocketBind not implemented"));
-}
-
-jint
-gnu::java::nio::SocketChannelImpl::SocketListen (jint, jint)
-{
- throw new ::java::io::IOException (JvNewStringUTF ("SocketList not implemented"));
-}
-
-jint
-gnu::java::nio::SocketChannelImpl::SocketAvailable (jint)
-{
- throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketAvailable: not implemented"));
-}
-
-jint
-gnu::java::nio::SocketChannelImpl::SocketClose (jint)
-{
- throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketClose: not implemented"));
-}
-
-jint
-gnu::java::nio::SocketChannelImpl::SocketRead (jint, jbyteArray, jint, jint)
-{
- throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketRead: not implemented"));
-}
-
-jint
-gnu::java::nio::SocketChannelImpl::SocketWrite (jint, jbyteArray, jint, jint)
-{
- throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketWrite: not implemented"));
-}
-
-#else // DISABLE_JAVA_NET
-
-jint
-gnu::java::nio::SocketChannelImpl::SocketCreate ()
-{
- int sock = _Jv_socket (AF_INET, SOCK_STREAM, 0);
-
- if (sock < 0)
- {
- char* strerr = strerror (errno);
- throw new ::java::io::IOException (JvNewStringUTF (strerr));
- }
-
- return sock;
-}
-
-jint
-gnu::java::nio::SocketChannelImpl::SocketConnect (jint fd,
- ::java::net::InetAddress *addr,
- jint port)
-{
- throw new ::java::io::IOException (JvNewStringUTF ("SocketConnect not implemented"));
-}
-
-jint
-gnu::java::nio::SocketChannelImpl::SocketBind (jint fd,
- ::java::net::InetAddress *addr,
- jint port)
-{
- throw new ::java::io::IOException (JvNewStringUTF ("SocketBind not implemented"));
-}
-
-jint
-gnu::java::nio::SocketChannelImpl::SocketListen (jint fd, jint backlog)
-{
- int result = _Jv_listen (fd, backlog);
-
- if (result < 0)
- {
- char* strerr = strerror (errno);
- throw new ::java::io::IOException (JvNewStringUTF (strerr));
- }
-
- return result;
-}
-
-jint
-gnu::java::nio::SocketChannelImpl::SocketAvailable (jint /*fd*/)
-{
- throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketAvailable: not implemented"));
-}
-
-jint
-gnu::java::nio::SocketChannelImpl::SocketClose (jint fd)
-{
- int result = _Jv_close (fd);
-
- if (result < 0)
- {
- char* strerr = strerror (errno);
- throw new ::java::io::IOException (JvNewStringUTF (strerr));
- }
-
- return result;
-}
-
-jint
-gnu::java::nio::SocketChannelImpl::SocketRead (jint fd, jbyteArray data,
- jint offset, jint length)
-{
- int result = ::recv (fd, data, offset, length);
-
- if (result < 0)
- {
- char* strerr = strerror (errno);
- throw new ::java::io::IOException (JvNewStringUTF (strerr));
- }
-
- return result;
-}
-
-jint
-gnu::java::nio::SocketChannelImpl::SocketWrite (jint fd, jbyteArray data,
- jint offset, jint length)
-{
- int result = ::send (fd, data, offset, length);
-
- if (result < 0)
- {
- char* strerr = strerror (errno);
- throw new ::java::io::IOException (JvNewStringUTF (strerr));
- }
-
- return result;
-}
-
-#endif // DISABLE_JAVA_NET
diff --git a/libjava/gnu/java/security/x509/X509Certificate.java b/libjava/gnu/java/security/x509/X509Certificate.java
index bb66f2e67b6..1ec2e87c2c6 100644
--- a/libjava/gnu/java/security/x509/X509Certificate.java
+++ b/libjava/gnu/java/security/x509/X509Certificate.java
@@ -41,10 +41,13 @@ package gnu.java.security.x509;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.IOException;
+import java.io.ObjectStreamException;
import java.io.Serializable;
import java.math.BigInteger;
+import java.net.InetAddress;
+
import java.security.AlgorithmParameters;
import java.security.InvalidKeyException;
import java.security.KeyFactory;
@@ -421,7 +424,7 @@ public class X509Certificate extends java.security.cert.X509Certificate
return subjectKey;
}
- public Object writeReplace() throws java.io.ObjectStreamException
+ protected Object writeReplace() throws ObjectStreamException
{
return super.writeReplace();
}
@@ -469,7 +472,7 @@ public class X509Certificate extends java.security.cert.X509Certificate
nameVal = new String((byte[]) name.getValue());
break;
case IP_ADDRESS:
- nameVal = java.net.InetAddress.getByAddress(
+ nameVal = InetAddress.getByAddress(
(byte[]) name.getValue()).getHostAddress();
break;
case REGISTERED_ID:
diff --git a/libjava/java/awt/Font.java b/libjava/java/awt/Font.java
index d1b2b463d75..b887d8ea5ed 100644
--- a/libjava/java/awt/Font.java
+++ b/libjava/java/awt/Font.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package java.awt;
+import java.awt.font.FontRenderContext;
+import java.awt.font.LineMetrics;
import java.awt.peer.FontPeer;
import java.io.Serializable;
import java.util.StringTokenizer;
@@ -484,5 +486,28 @@ toString()
",size=" + size + ")");
}
+
+ /**
+ * Determines the line metrics for a run of text.
+ *
+ * @param str the text run to be measured.
+ *
+ * @param frc the font rendering parameters that are used for the
+ * measurement. The exact placement and size of text slightly
+ * depends on device-specific characteristics, for instance
+ * the device resolution or anti-aliasing. For this reason,
+ * the returned measurement will only be accurate if the
+ * passed <code>FontRenderContext</code> correctly reflects
+ * the relevant parameters. Hence, <code>frc</code> should be
+ * obtained from the same <code>Graphics2D</code> that will
+ * be used for drawing, and any rendering hints should be set
+ * to the desired values before obtaining <code>frc</code>.
+ *
+ * @see java.awt.Graphics2D#getFontRenderContext()
+ */
+ public LineMetrics getLineMetrics(String str, FontRenderContext frc)
+ {
+ throw new UnsupportedOperationException(); // FIXME
+ }
} // class Font
diff --git a/libjava/java/awt/Window.java b/libjava/java/awt/Window.java
index 44946528f77..2da988507e9 100644
--- a/libjava/java/awt/Window.java
+++ b/libjava/java/awt/Window.java
@@ -50,7 +50,7 @@ import java.util.ResourceBundle;
/**
* This class represents a top-level window with no decorations.
*
- * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Aaron M. Renn <arenn@urbanophile.com>
* @author Warren Levy <warrenl@cygnus.com>
*/
public class Window extends Container
@@ -79,7 +79,7 @@ public class Window extends Container
Window()
{
setVisible(false);
- setLayout((LayoutManager) new BorderLayout());
+ setLayout(new BorderLayout());
}
Window(GraphicsConfiguration gc)
diff --git a/libjava/java/awt/color/ColorSpace.java b/libjava/java/awt/color/ColorSpace.java
index 8bf0a8196c0..905bf9cd769 100644
--- a/libjava/java/awt/color/ColorSpace.java
+++ b/libjava/java/awt/color/ColorSpace.java
@@ -128,7 +128,7 @@ public abstract class ColorSpace implements Serializable
public boolean isCS_sRGB()
{
- return false;
+ return type == CS_sRGB;
}
/**
diff --git a/libjava/java/awt/datatransfer/StringSelection.java b/libjava/java/awt/datatransfer/StringSelection.java
index f6f0116272b..6db74503bb3 100644
--- a/libjava/java/awt/datatransfer/StringSelection.java
+++ b/libjava/java/awt/datatransfer/StringSelection.java
@@ -54,8 +54,10 @@ public class StringSelection implements Transferable, ClipboardOwner
*/
// List of flavors we support
-public static final DataFlavor[] supported_flavors
- = { DataFlavor.plainTextFlavor };
+// XXX: DataFlavor.plainTextFlavor is deprecated.
+static final DataFlavor[] supported_flavors
+ = { DataFlavor.stringFlavor,
+ DataFlavor.plainTextFlavor };
/*************************************************************************/
diff --git a/libjava/java/awt/image/ColorModel.java b/libjava/java/awt/image/ColorModel.java
index 9976985ab52..767b83f7dd0 100644
--- a/libjava/java/awt/image/ColorModel.java
+++ b/libjava/java/awt/image/ColorModel.java
@@ -76,7 +76,7 @@ import gnu.java.awt.Buffers;
* </ul>
*
* @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
- * @author C. Brian Jones (cbj@gnu.org)
+ * @author C. Brian Jones <cbj@gnu.org>
*/
public abstract class ColorModel implements Transparency
{
@@ -155,6 +155,11 @@ public abstract class ColorModel implements Transparency
this.transferType = transferType;
}
+ public void finalize()
+ {
+ // Do nothing here.
+ }
+
/**
* Returns the default color model which in Sun's case is an instance
* of <code>DirectColorModel</code>.
@@ -226,7 +231,7 @@ public abstract class ColorModel implements Transparency
*
* @see #getRed(int)
*/
- public abstract int getGreen(int pixel);
+ public abstract int getGreen(int pixel);
/**
* Converts pixel value to sRGB and extract blue int sample
@@ -384,7 +389,7 @@ public abstract class ColorModel implements Transparency
*/
public Object getDataElements(int rgb, Object pixel)
{
- // FIXME: implement
+ // subclasses has to implement this method.
throw new UnsupportedOperationException();
}
@@ -403,8 +408,9 @@ public abstract class ColorModel implements Transparency
* according to the color model. Each component sample is stored
* as a separate element in the array.
*/
- public int[] getComponents(int pixel, int[] components, int offset) {
- // FIXME: implement
+ public int[] getComponents(int pixel, int[] components, int offset)
+ {
+ // subclasses has to implement this method.
throw new UnsupportedOperationException();
}
@@ -426,6 +432,7 @@ public abstract class ColorModel implements Transparency
*/
public int[] getComponents(Object pixel, int[] components, int offset)
{
+ // subclasses has to implement this method.
throw new UnsupportedOperationException();
}
@@ -476,6 +483,19 @@ public abstract class ColorModel implements Transparency
}
/**
+ * Convert unnormalized components to normalized components.
+ *
+ * @since 1.4
+ */
+ public float[] getNormalizedComponents (Object pixel,
+ float[] normComponents,
+ int normOffset)
+ {
+ // subclasses has to implement this method.
+ throw new UnsupportedOperationException();
+ }
+
+ /**
* Converts the unnormalized component samples from an array to a
* pixel value. I.e. composes the pixel from component samples, but
* does not perform any color conversion or scaling of the samples.
@@ -499,14 +519,28 @@ public abstract class ColorModel implements Transparency
*/
public int getDataElement(int[] components, int offset)
{
+ // subclasses has to implement this method.
throw new UnsupportedOperationException();
}
+ public int getDataElement (float[] components, int offset)
+ {
+ // subclasses has to implement this method.
+ throw new UnsupportedOperationException();
+ }
+
public Object getDataElements(int[] components, int offset, Object obj)
{
+ // subclasses has to implement this method.
throw new UnsupportedOperationException();
}
+ public int getDataElements (float[] components, Object obj)
+ {
+ // subclasses has to implement this method.
+ throw new UnsupportedOperationException();
+ }
+
public boolean equals(Object obj)
{
if (!(obj instanceof ColorModel)) return false;
@@ -589,8 +623,9 @@ public abstract class ColorModel implements Transparency
return sm.getTransferType() == transferType;
}
- public void finalize()
+ public final int getTransferType ()
{
+ return transferType;
}
/**
diff --git a/libjava/java/awt/image/IndexColorModel.java b/libjava/java/awt/image/IndexColorModel.java
index 3e56f85e79f..066c8682acc 100644
--- a/libjava/java/awt/image/IndexColorModel.java
+++ b/libjava/java/awt/image/IndexColorModel.java
@@ -39,7 +39,6 @@ exception statement from your version. */
package java.awt.image;
/**
- *
* @author C. Brian Jones (cbj@gnu.org)
*/
public class IndexColorModel extends ColorModel
@@ -47,7 +46,6 @@ public class IndexColorModel extends ColorModel
private int map_size;
private boolean opaque;
private int trans = -1;
-
private int[] rgb;
/**
@@ -63,7 +61,8 @@ public class IndexColorModel extends ColorModel
* @param blues the blue component of all colors
*/
public IndexColorModel(int bits, int size, byte[] reds, byte[] greens,
- byte[] blues) {
+ byte[] blues)
+ {
this(bits, size, reds, greens, blues, (byte[])null);
}
@@ -81,7 +80,8 @@ public class IndexColorModel extends ColorModel
* @param trans the index of the transparent color
*/
public IndexColorModel(int bits, int size, byte[] reds, byte[] greens,
- byte[] blues, int trans) {
+ byte[] blues, int trans)
+ {
this(bits, size, reds, greens, blues, (byte[])null);
this.trans = trans;
}
@@ -100,26 +100,31 @@ public class IndexColorModel extends ColorModel
* @param alphas the alpha component of all colors
*/
public IndexColorModel(int bits, int size, byte[] reds, byte[] greens,
- byte[] blues, byte[] alphas) {
+ byte[] blues, byte[] alphas)
+ {
super(bits);
map_size = size;
opaque = (alphas == null);
rgb = new int[size];
- if (alphas == null) {
- for (int i = 0; i < size; i++) {
- rgb[i] = 0xff000000 |
- ((reds[i] & 0xff) << 16) |
- ((greens[i] & 0xff) << 8) |
- (blues[i] & 0xff);
+ if (alphas == null)
+ {
+ for (int i = 0; i < size; i++)
+ {
+ rgb[i] = (0xff000000
+ | ((reds[i] & 0xff) << 16)
+ | ((greens[i] & 0xff) << 8)
+ | (blues[i] & 0xff));
}
}
- else {
- for (int i = 0; i < size; i++) {
- rgb[i] = ((alphas[i] & 0xff) << 24 |
- ((reds[i] & 0xff) << 16) |
- ((greens[i] & 0xff) << 8) |
- (blues[i] & 0xff));
+ else
+ {
+ for (int i = 0; i < size; i++)
+ {
+ rgb[i] = ((alphas[i] & 0xff) << 24
+ | ((reds[i] & 0xff) << 16)
+ | ((greens[i] & 0xff) << 8)
+ | (blues[i] & 0xff));
}
}
}
@@ -137,7 +142,8 @@ public class IndexColorModel extends ColorModel
* @param hasAlpha <code>cmap</code> has alpha values
*/
public IndexColorModel(int bits, int size, byte[] cmap, int start,
- boolean hasAlpha) {
+ boolean hasAlpha)
+ {
this(bits, size, cmap, start, hasAlpha, -1);
}
@@ -155,49 +161,56 @@ public class IndexColorModel extends ColorModel
* @param trans the index of the transparent color
*/
public IndexColorModel(int bits, int size, byte[] cmap, int start,
- boolean hasAlpha, int trans) {
+ boolean hasAlpha, int trans)
+ {
super(bits);
map_size = size;
opaque = !hasAlpha;
this.trans = trans;
}
- public final int getMapSize() {
+ public final int getMapSize ()
+ {
return map_size;
}
/**
* Get the index of the transparent color in this color model
*/
- public final int getTransparentPixel() {
+ public final int getTransparentPixel ()
+ {
return trans;
}
/**
* <br>
*/
- public final void getReds(byte[] r) {
+ public final void getReds (byte[] r)
+ {
getComponents( r, 2 );
}
/**
* <br>
*/
- public final void getGreens(byte[] g) {
+ public final void getGreens (byte[] g)
+ {
getComponents( g, 1 );
}
/**
* <br>
*/
- public final void getBlues(byte[] b) {
+ public final void getBlues (byte[] b)
+ {
getComponents( b, 0 );
}
/**
* <br>
*/
- public final void getAlphas(byte[] a) {
+ public final void getAlphas (byte[] a)
+ {
getComponents( a, 3 );
}
@@ -210,54 +223,59 @@ public class IndexColorModel extends ColorModel
/**
* Get the red component of the given pixel.
- * <br>
*/
- public final int getRed(int pixel) {
+ public final int getRed (int pixel)
+ {
if( pixel < map_size )
return (int)(( generateMask( 2 ) & rgb[pixel]) >> (2 * pixel_bits ) );
+
return 0;
}
/**
* Get the green component of the given pixel.
- * <br>
*/
- public final int getGreen(int pixel) {
+ public final int getGreen (int pixel)
+ {
if( pixel < map_size )
return (int)(( generateMask( 1 ) & rgb[pixel]) >> (1 * pixel_bits ) );
+
return 0;
}
/**
* Get the blue component of the given pixel.
- * <br>
*/
- public final int getBlue(int pixel) {
+ public final int getBlue (int pixel)
+ {
if( pixel < map_size )
return (int)( generateMask( 0 ) & rgb[pixel]);
+
return 0;
}
/**
* Get the alpha component of the given pixel.
- * <br>
*/
- public final int getAlpha(int pixel) {
+ public final int getAlpha (int pixel)
+ {
if( pixel < map_size )
return (int)(( generateMask( 3 ) & rgb[pixel]) >> (3 * pixel_bits ) );
+
return 0;
}
/**
* Get the RGB color value of the given pixel using the default
* RGB color model.
- * <br>
*
* @param pixel a pixel value
*/
- public final int getRGB(int pixel) {
+ public final int getRGB (int pixel)
+ {
if( pixel < map_size )
return rgb[pixel];
+
return 0;
}
diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java
index da0a9c55f11..ba18a596c2a 100644
--- a/libjava/java/io/File.java
+++ b/libjava/java/io/File.java
@@ -40,6 +40,7 @@ package java.io;
import java.net.MalformedURLException;
import java.net.URL;
+import gnu.classpath.Configuration;
import gnu.gcj.runtime.FileDeleter;
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
@@ -111,7 +112,6 @@ public class File implements Serializable, Comparable
*/
public static final char pathSeparatorChar = pathSeparator.charAt(0);
-
static final String tmpdir = System.getProperty("java.io.tmpdir");
static int maxPathLen;
static boolean caseSensitive;
@@ -119,7 +119,12 @@ public class File implements Serializable, Comparable
static
{
- init_native();
+ if (Configuration.INIT_LOAD_LIBRARY)
+ {
+ System.loadLibrary ("javaio");
+ }
+
+ init_native ();
}
// Native function called at class initialization. This should should
@@ -345,7 +350,7 @@ public class File implements Serializable, Comparable
* name. If the directory path name ends in the separator string, another
* separator string will still be appended.
*
- * @param dirname The path to the directory the file resides in
+ * @param dirPath The path to the directory the file resides in
* @param name The name of the file
*/
public File (String dirPath, String name)
@@ -711,7 +716,6 @@ public class File implements Serializable, Comparable
* This native function actually produces the list of file in this
* directory
*/
-
private final native Object[] performList (FilenameFilter filter,
FileFilter fileFilter,
Class result_type);
@@ -984,21 +988,21 @@ public class File implements Serializable, Comparable
// Grab the system temp directory if necessary
if (directory == null)
{
- String dirname = tmpdir;
- if (dirname == null)
- throw
- new IOException ("Cannot determine system temporary directory");
+ String dirname = tmpdir;
+ if (dirname == null)
+ throw new IOException ("Cannot determine system temporary directory");
- directory = new File (dirname);
- if (!directory.exists ())
- throw new IOException ("System temporary directory "
- + directory.getName() + " does not exist.");
- if (!directory.isDirectory())
- throw new IOException ("System temporary directory "
- + directory.getName()
- + " is not really a directory.");
+ directory = new File (dirname);
+ if (!directory.exists ())
+ throw new IOException ("System temporary directory "
+ + directory.getName () + " does not exist.");
+ if (!directory.isDirectory ())
+ throw new IOException ("System temporary directory "
+ + directory.getName ()
+ + " is not really a directory.");
}
+ // Now process the prefix and suffix.
if (prefix.length () < 3)
throw new IllegalArgumentException ("Prefix too short: " + prefix);
@@ -1162,7 +1166,7 @@ public class File implements Serializable, Comparable
*
* @since 1.2
*/
- public int compareTo(File other)
+ public int compareTo (File other)
{
if (caseSensitive)
return path.compareTo (other.path);
@@ -1191,10 +1195,9 @@ public class File implements Serializable, Comparable
*
* @since 1.2
*/
- public int compareTo(Object o)
+ public int compareTo (Object obj)
{
- File other = (File) o;
- return compareTo (other);
+ return compareTo ((File) obj);
}
/*
@@ -1250,6 +1253,9 @@ public class File implements Serializable, Comparable
*/
public boolean setLastModified (long time)
{
+ if (time < 0)
+ throw new IllegalArgumentException("Negative modification time: " + time);
+
checkWrite ();
return performSetLastModified(time);
}
@@ -1276,6 +1282,8 @@ public class File implements Serializable, Comparable
* Add this File to the set of files to be deleted upon normal
* termination.
*
+ * @exception SecurityException If deleting of the file is not allowed
+ *
* @since 1.2
*/
// FIXME: This should use the ShutdownHook API once we implement that.
diff --git a/libjava/java/io/LineNumberReader.java b/libjava/java/io/LineNumberReader.java
index 9d80745d2fa..12bafe39675 100644
--- a/libjava/java/io/LineNumberReader.java
+++ b/libjava/java/io/LineNumberReader.java
@@ -374,37 +374,22 @@ public class LineNumberReader extends BufferedReader
*
* @exception IOException If an error occurs
*/
- public long skip(long count) throws IOException
+ public long skip (long count) throws IOException
{
if (count <= 0)
return 0;
- long to_do = count;
- do
+
+ int skipped;
+
+ for (skipped = 0; skipped < count; skipped++)
{
- int ch = read();
- if (ch < 0)
- break;
- to_do--;
- if (ch == '\n' || ch == '\r')
- lineNumber++;
- else
- {
- long fence = pos + to_do;
- if (limit < fence)
- fence = limit;
- int end = pos;
- for (; end < fence; end++)
- {
- char endch = buffer[end];
- if (endch == '\n' || endch == '\r')
- break;
- }
- to_do -= end - pos;
- pos = end;
- }
+ int ch = read();
+
+ if (ch < 0)
+ break;
}
- while (to_do > 0);
- return count - to_do;
+
+ return skipped;
}
}
diff --git a/libjava/java/io/ObjectInputStream.java b/libjava/java/io/ObjectInputStream.java
index e3e2412967f..ef79727c1e1 100644
--- a/libjava/java/io/ObjectInputStream.java
+++ b/libjava/java/io/ObjectInputStream.java
@@ -219,44 +219,7 @@ public class ObjectInputStream extends InputStream
case TC_CLASSDESC:
{
- dumpElement ("CLASSDESC NAME=");
- String name = this.realInputStream.readUTF ();
- dumpElement (name + "; UID=");
- long uid = this.realInputStream.readLong ();
- dumpElement (Long.toHexString(uid) + "; FLAGS=");
- byte flags = this.realInputStream.readByte ();
- dumpElement (Integer.toHexString(flags) + "; FIELD COUNT=");
- short field_count = this.realInputStream.readShort ();
- dumpElementln (Short.toString(field_count));
- ObjectStreamField[] fields = new ObjectStreamField[field_count];
- ObjectStreamClass osc = new ObjectStreamClass (name, uid,
- flags, fields);
- assignNewHandle (osc);
-
- for (int i=0; i < field_count; i++)
- {
- dumpElement (" TYPE CODE=");
- char type_code = (char)this.realInputStream.readByte ();
- dumpElement (type_code + "; FIELD NAME=");
- String field_name = this.realInputStream.readUTF ();
- dumpElementln (field_name);
- String class_name;
-
- if (type_code == 'L' || type_code == '[')
- class_name = (String)readObject ();
- else
- class_name = String.valueOf (type_code);
-
- // There're many cases you can't get java.lang.Class from
- // typename if your context class loader can't load it,
- // then use typename to construct the field
- fields[i] =
- new ObjectStreamField (field_name, class_name);
- }
-
- boolean oldmode = setBlockDataMode (true);
- osc.setClass (resolveClass (osc));
- setBlockDataMode (oldmode);
+ ObjectStreamClass osc = readClassDescriptor ();
if (!is_consumed)
{
@@ -451,6 +414,51 @@ public class ObjectInputStream extends InputStream
return ret_val;
}
+ protected ObjectStreamClass readClassDescriptor ()
+ throws ClassNotFoundException, IOException
+ {
+ dumpElement ("CLASSDESC NAME=");
+ String name = this.realInputStream.readUTF ();
+ dumpElement (name + "; UID=");
+ long uid = this.realInputStream.readLong ();
+ dumpElement (Long.toHexString(uid) + "; FLAGS=");
+ byte flags = this.realInputStream.readByte ();
+ dumpElement (Integer.toHexString(flags) + "; FIELD COUNT=");
+ short field_count = this.realInputStream.readShort ();
+ dumpElementln (Short.toString(field_count));
+ ObjectStreamField[] fields = new ObjectStreamField[field_count];
+ ObjectStreamClass osc = new ObjectStreamClass (name, uid,
+ flags, fields);
+ assignNewHandle (osc);
+
+ for (int i=0; i < field_count; i++)
+ {
+ dumpElement (" TYPE CODE=");
+ char type_code = (char)this.realInputStream.readByte ();
+ dumpElement (type_code + "; FIELD NAME=");
+ String field_name = this.realInputStream.readUTF ();
+ dumpElementln (field_name);
+ String class_name;
+
+ if (type_code == 'L' || type_code == '[')
+ class_name = (String)readObject ();
+ else
+ class_name = String.valueOf (type_code);
+
+ // There're many cases you can't get java.lang.Class from
+ // typename if your context class loader can't load it,
+ // then use typename to construct the field
+ fields[i] =
+ new ObjectStreamField (field_name, class_name);
+ }
+
+ boolean oldmode = setBlockDataMode (true);
+ osc.setClass (resolveClass (osc));
+ setBlockDataMode (oldmode);
+
+ return osc;
+ }
+
/**
* Reads the current objects non-transient, non-static fields from
* the current class from the underlying output stream.
diff --git a/libjava/java/io/ObjectOutputStream.java b/libjava/java/io/ObjectOutputStream.java
index cb461231b33..da01b57ba8d 100644
--- a/libjava/java/io/ObjectOutputStream.java
+++ b/libjava/java/io/ObjectOutputStream.java
@@ -224,46 +224,7 @@ public class ObjectOutputStream extends OutputStream
}
if (obj instanceof ObjectStreamClass)
- {
- ObjectStreamClass osc = (ObjectStreamClass)obj;
- realOutput.writeByte (TC_CLASSDESC);
- realOutput.writeUTF (osc.getName ());
- realOutput.writeLong (osc.getSerialVersionUID ());
- assignNewHandle (obj);
-
- int flags = osc.getFlags ();
-
- if (protocolVersion == PROTOCOL_VERSION_2
- && osc.isExternalizable ())
- flags |= SC_BLOCK_DATA;
-
- realOutput.writeByte (flags);
-
- ObjectStreamField[] fields = osc.fields;
- realOutput.writeShort (fields.length);
-
- ObjectStreamField field;
- for (int i=0; i < fields.length; i++)
- {
- field = fields[i];
- realOutput.writeByte (field.getTypeCode ());
- realOutput.writeUTF (field.getName ());
-
- if (! field.isPrimitive ())
- writeObject (field.getTypeString ());
- }
-
- boolean oldmode = setBlockDataMode (true);
- annotateClass (osc.forClass ());
- setBlockDataMode (oldmode);
- realOutput.writeByte (TC_ENDBLOCKDATA);
-
- if (osc.isSerializable ())
- writeObject (osc.getSuper ());
- else
- writeObject (null);
- break;
- }
+ writeClassDescriptor ((ObjectStreamClass) obj);
if ((replacementEnabled || obj instanceof Serializable)
&& ! replaceDone)
@@ -406,6 +367,46 @@ public class ObjectOutputStream extends OutputStream
}
}
+ protected void writeClassDescriptor (ObjectStreamClass osc) throws IOException
+ {
+ realOutput.writeByte (TC_CLASSDESC);
+ realOutput.writeUTF (osc.getName ());
+ realOutput.writeLong (osc.getSerialVersionUID ());
+ assignNewHandle (osc);
+
+ int flags = osc.getFlags ();
+
+ if (protocolVersion == PROTOCOL_VERSION_2
+ && osc.isExternalizable ())
+ flags |= SC_BLOCK_DATA;
+
+ realOutput.writeByte (flags);
+
+ ObjectStreamField[] fields = osc.fields;
+ realOutput.writeShort (fields.length);
+
+ ObjectStreamField field;
+ for (int i=0; i < fields.length; i++)
+ {
+ field = fields[i];
+ realOutput.writeByte (field.getTypeCode ());
+ realOutput.writeUTF (field.getName ());
+
+ if (! field.isPrimitive ())
+ writeObject (field.getTypeString ());
+ }
+
+ boolean oldmode = setBlockDataMode (true);
+ annotateClass (osc.forClass ());
+ setBlockDataMode (oldmode);
+ realOutput.writeByte (TC_ENDBLOCKDATA);
+
+ if (osc.isSerializable ())
+ writeObject (osc.getSuper ());
+ else
+ writeObject (null);
+ }
+
/**
Writes the current objects non-transient, non-static fields from
the current class to the underlying output stream.
diff --git a/libjava/java/io/ObjectStreamField.java b/libjava/java/io/ObjectStreamField.java
index 56f0d1aa872..9edb1dc4cc4 100644
--- a/libjava/java/io/ObjectStreamField.java
+++ b/libjava/java/io/ObjectStreamField.java
@@ -41,13 +41,25 @@ package java.io;
import gnu.java.lang.reflect.TypeSignature;
// XXX doc
-public class ObjectStreamField implements java.lang.Comparable
+public class ObjectStreamField implements Comparable
{
+ private String name;
+ private Class type;
+ private String typename;
+ private int offset = -1; // XXX make sure this is correct
+ private boolean unshared;
+
public ObjectStreamField (String name, Class type)
{
+ this (name, type, false);
+ }
+
+ public ObjectStreamField (String name, Class type, boolean unshared)
+ {
this.name = name;
this.type = type;
this.typename = TypeSignature.getEncodingOfClass(type);
+ this.unshared = unshared;
}
/**
@@ -99,6 +111,11 @@ public class ObjectStreamField implements java.lang.Comparable
offset = off;
}
+ public boolean isUnshared ()
+ {
+ return unshared;
+ }
+
public boolean isPrimitive ()
{
return type.isPrimitive ();
@@ -123,10 +140,5 @@ public class ObjectStreamField implements java.lang.Comparable
{
return "ObjectStreamField< " + type + " " + name + " >";
}
-
- private String name;
- private Class type;
- private String typename;
- private int offset = -1; // XXX make sure this is correct
}
diff --git a/libjava/java/io/RandomAccessFile.java b/libjava/java/io/RandomAccessFile.java
index 0ff2ff65ce9..08fedb0e095 100644
--- a/libjava/java/io/RandomAccessFile.java
+++ b/libjava/java/io/RandomAccessFile.java
@@ -488,8 +488,6 @@ public class RandomAccessFile implements DataOutput, DataInput
* @exception IOException If an error occurs
*
* @see DataOutput
- *
- * @deprecated
*/
public final String readLine () throws IOException
{
@@ -962,7 +960,7 @@ public class RandomAccessFile implements DataOutput, DataInput
* A file channel must be created by first creating an instance of
* Input/Output/RandomAccessFile and invoking the getChannel() method on it.
*/
- public synchronized FileChannel getChannel ()
+ public final synchronized FileChannel getChannel ()
{
if (ch == null)
ch = new FileChannelImpl (fd, true, this);
diff --git a/libjava/java/lang/natVMSecurityManager.cc b/libjava/java/lang/natVMSecurityManager.cc
index 33aa8873f1d..8fd2875aedc 100644
--- a/libjava/java/lang/natVMSecurityManager.cc
+++ b/libjava/java/lang/natVMSecurityManager.cc
@@ -28,7 +28,7 @@ java::lang::VMSecurityManager::getClassContext ()
int maxlen = t->length();
int len = 0;
- for (int i=0; i<len; i++)
+ for (int i=0; i<maxlen; i++)
{
jclass klass = t->classAt(i);
if (klass != NULL && klass != &java::lang::VMSecurityManager::class$
@@ -41,7 +41,7 @@ java::lang::VMSecurityManager::getClassContext ()
NULL);
len = 0;
- for (int i=0; i<len; i++)
+ for (int i=0; i<maxlen; i++)
{
jclass klass = t->classAt(i);
if (klass != NULL && klass != &java::lang::VMSecurityManager::class$
diff --git a/libjava/java/net/HttpURLConnection.java b/libjava/java/net/HttpURLConnection.java
index 4cdeaf19712..2f12fe57d46 100644
--- a/libjava/java/net/HttpURLConnection.java
+++ b/libjava/java/net/HttpURLConnection.java
@@ -1,7 +1,6 @@
-// HttpURLConnection.java - Subclass of communications links using
-// Hypertext Transfer Protocol.
-
-/* Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation
+/* HttpURLConnection.java - Subclass of communications links using
+ Hypertext Transfer Protocol.
+ Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation
This file is part of GNU Classpath.
@@ -37,9 +36,12 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.net;
-import java.io.*;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.PushbackInputStream;
import java.security.Permission;
/*
diff --git a/libjava/java/net/Inet4Address.java b/libjava/java/net/Inet4Address.java
index c635c671d0e..25d296f995a 100644
--- a/libjava/java/net/Inet4Address.java
+++ b/libjava/java/net/Inet4Address.java
@@ -1,5 +1,5 @@
/* Inet4Address.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,10 +35,11 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.net;
-import java.io.IOException;
import java.io.ObjectStreamException;
+import java.util.Arrays;
/**
* @author Michael Koch
@@ -71,7 +72,7 @@ public final class Inet4Address extends InetAddress
* @param addr The IP address
* @param host The Hostname
*/
- protected Inet4Address(byte[] addr, String host)
+ Inet4Address(byte[] addr, String host)
{
super (addr, host);
}
@@ -103,7 +104,7 @@ public final class Inet4Address extends InetAddress
{
byte[] anylocal = { 0, 0, 0, 0 };
- return addr == anylocal;
+ return Arrays.equals(addr, anylocal);
}
/**
diff --git a/libjava/java/net/Inet6Address.java b/libjava/java/net/Inet6Address.java
index 8d3c0c3af44..4f4563ddcc5 100644
--- a/libjava/java/net/Inet6Address.java
+++ b/libjava/java/net/Inet6Address.java
@@ -1,5 +1,5 @@
/* Inet6Address.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,9 +35,10 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.net;
-import java.io.IOException;
+import java.util.Arrays;
/**
* @author Michael Koch
@@ -65,7 +66,7 @@ public final class Inet6Address extends InetAddress
* @param addr The IP address
* @param host The hostname
*/
- protected Inet6Address (byte[] addr, String host)
+ Inet6Address (byte[] addr, String host)
{
super (addr, host);
this.ipaddress = addr;
@@ -91,7 +92,7 @@ public final class Inet6Address extends InetAddress
byte[] anylocal = { 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0 };
- return ipaddress == anylocal;
+ return Arrays.equals(ipaddress, anylocal);
}
/**
@@ -104,7 +105,7 @@ public final class Inet6Address extends InetAddress
byte[] loopback = { 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1 };
- return ipaddress == loopback;
+ return Arrays.equals(ipaddress, loopback);
}
/**
diff --git a/libjava/java/net/InetAddress.java b/libjava/java/net/InetAddress.java
index 34d4ad1eed9..8ef63668a55 100644
--- a/libjava/java/net/InetAddress.java
+++ b/libjava/java/net/InetAddress.java
@@ -68,19 +68,21 @@ import java.io.ObjectStreamException;
*/
public class InetAddress implements Serializable
{
+ private static final long serialVersionUID = 3286316764910316507L;
+
// The Serialized Form specifies that an int 'address' is saved/restored.
// This class uses a byte array internally so we'll just do the conversion
// at serialization time and leave the rest of the algorithm as is.
private int address;
transient byte[] addr;
String hostName;
+
// The field 'family' seems to be the AF_ value.
// FIXME: Much of the code in the other java.net classes does not make
// use of this family field. A better implementation would be to make
// use of getaddrinfo() and have other methods just check the family
// field rather than examining the length of the address each time.
int family;
- private static final long serialVersionUID = 3286316764910316507L;
/**
* Needed for serialization
@@ -90,14 +92,16 @@ public class InetAddress implements Serializable
// FIXME: implement this
}
- private void readObject(ObjectInputStream ois)
+ private void readObject (ObjectInputStream ois)
throws IOException, ClassNotFoundException
{
- ois.defaultReadObject();
- addr = new byte[4];
- addr[3] = (byte) address;
+ ois.defaultReadObject ();
+ addr = new byte [4];
+ addr [3] = (byte) address;
+
for (int i = 2; i >= 0; --i)
- addr[i] = (byte) (address >>= 8);
+ addr [i] = (byte) (address >>= 8);
+
// Ignore family from serialized data. Since the saved address is 32 bits
// the deserialized object will have an IPv4 address i.e. AF_INET family.
// FIXME: An alternative is to call the aton method on the deserialized
@@ -106,15 +110,17 @@ public class InetAddress implements Serializable
family = getFamily (addr);
}
- private void writeObject(ObjectOutputStream oos) throws IOException
+ private void writeObject (ObjectOutputStream oos) throws IOException
{
// Build a 32 bit address from the last 4 bytes of a 4 byte IPv4 address
// or a 16 byte IPv6 address.
int len = addr.length;
int i = len - 4;
+
for (; i < len; i++)
- address = address << 8 | (((int) addr[i]) & 0xFF);
- oos.defaultWriteObject();
+ address = address << 8 | (((int) addr [i]) & 0xFF);
+
+ oos.defaultWriteObject ();
}
private static native int getFamily (byte[] address);
@@ -123,6 +129,7 @@ public class InetAddress implements Serializable
{
addr = address;
hostName = hostname;
+
if (address != null)
family = getFamily (address);
}
@@ -135,10 +142,13 @@ public class InetAddress implements Serializable
public boolean isMulticastAddress ()
{
int len = addr.length;
+
if (len == 4)
- return (addr[0] & 0xF0) == 0xE0;
+ return (addr [0] & 0xF0) == 0xE0;
+
if (len == 16)
- return addr[0] == (byte) 0xFF;
+ return addr [0] == (byte) 0xFF;
+
return false;
}
@@ -164,7 +174,7 @@ public class InetAddress implements Serializable
// This is the IPv4 implementation.
// Any class derived from InetAddress should override this.
- return addr[0] == 0x7F;
+ return addr [0] == 0x7F;
}
/**
@@ -192,18 +202,20 @@ public class InetAddress implements Serializable
// Any class derived from InetAddress should override this.
// 10.0.0.0/8
- if (addr[0] == 0x0A)
+ if (addr [0] == 0x0A)
return true;
// XXX: Suns JDK 1.4.1 (on Linux) seems to have a bug here:
// it says 172.16.0.0 - 172.255.255.255 are site local addresses
// 172.16.0.0/12
- if (addr[0] == 0xAC && (addr[1] & 0xF0) == 0x01)
+ if (addr [0] == 0xAC
+ && (addr [1] & 0xF0) == 0x01)
return true;
// 192.168.0.0/16
- if (addr[0] == 0xC0 && addr[1] == 0xA8)
+ if (addr [0] == 0xC0
+ && addr [1] == 0xA8)
return true;
// XXX: Do we need to check more addresses here ?
@@ -251,13 +263,13 @@ public class InetAddress implements Serializable
if (!isMulticastAddress ())
return false;
- return (addr[0] == 0xE0
- && addr[1] == 0x00
- && addr[2] == 0x00);
+ return (addr [0] == 0xE0
+ && addr [1] == 0x00
+ && addr [2] == 0x00);
}
/**
- * Utility reoutine to check if InetAddress is a site local multicast address
+ * Utility routine to check if InetAddress is a site local multicast address
*
* @since 1.4
*/
@@ -328,24 +340,26 @@ public class InetAddress implements Serializable
{
// An experiment shows that JDK1.2 returns a different byte array each
// time. This makes sense, in terms of security.
- return (byte[]) addr.clone();
+ return (byte[]) addr.clone ();
}
/* Helper function due to a CNI limitation. */
private static InetAddress[] allocArray (int count)
{
- return new InetAddress[count];
+ return new InetAddress [count];
}
/* Helper function due to a CNI limitation. */
private static SecurityException checkConnect (String hostname)
{
- SecurityManager s = System.getSecurityManager();
+ SecurityManager s = System.getSecurityManager ();
+
if (s == null)
return null;
+
try
{
- s.checkConnect(hostname, -1);
+ s.checkConnect (hostname, -1);
return null;
}
catch (SecurityException ex)
@@ -361,7 +375,7 @@ public class InetAddress implements Serializable
*/
public String getHostAddress ()
{
- StringBuffer sbuf = new StringBuffer(40);
+ StringBuffer sbuf = new StringBuffer (40);
int len = addr.length;
int i = 0;
if (len == 16)
@@ -369,37 +383,37 @@ public class InetAddress implements Serializable
for (; ; i += 2)
{
if (i >= 16)
- return sbuf.toString();
- int x = ((addr[i] & 0xFF) << 8) | (addr[i+1] & 0xFF);
- boolean empty = sbuf.length() == 0;
+ return sbuf.toString ();
+ int x = ((addr [i] & 0xFF) << 8) | (addr [i + 1] & 0xFF);
+ boolean empty = sbuf.length () == 0;
if (empty)
{
if (i == 10 && x == 0xFFFF)
{ // IPv4-mapped IPv6 address.
- sbuf.append(":FFFF:");
+ sbuf.append (":FFFF:");
break; // Continue as IPv4 address;
}
else if (i == 12)
{ // IPv4-compatible IPv6 address.
- sbuf.append(':');
+ sbuf.append (':');
break; // Continue as IPv4 address.
}
else if (i > 0)
- sbuf.append("::");
+ sbuf.append ("::");
}
else
- sbuf.append(':');
+ sbuf.append (':');
if (x != 0 || i >= 14)
- sbuf.append(Integer.toHexString(x).toUpperCase());
+ sbuf.append (Integer.toHexString (x).toUpperCase ());
}
}
for ( ; ; )
{
- sbuf.append(addr[i] & 0xFF);
+ sbuf.append (addr[i] & 0xFF);
i++;
if (i == len)
break;
- sbuf.append('.');
+ sbuf.append ('.');
}
return sbuf.toString();
@@ -408,15 +422,17 @@ public class InetAddress implements Serializable
/**
* Returns a hashcode of the InetAddress
*/
- public int hashCode()
+ public int hashCode ()
{
// There hashing algorithm is not specified, but a simple experiment
// shows that it is equal to the address, as a 32-bit big-endian integer.
int hash = 0;
int len = addr.length;
int i = len > 4 ? len - 4 : 0;
+
for ( ; i < len; i++)
hash = (hash << 8) | (addr[i] & 0xFF);
+
return hash;
}
@@ -425,7 +441,8 @@ public class InetAddress implements Serializable
*/
public boolean equals (Object obj)
{
- if (obj == null || ! (obj instanceof InetAddress))
+ if (obj == null
+ || ! (obj instanceof InetAddress))
return false;
// "The Java Class Libraries" 2nd edition says "If a machine has
@@ -436,25 +453,30 @@ public class InetAddress implements Serializable
// shows that the latter is correct.
byte[] addr1 = addr;
byte[] addr2 = ((InetAddress) obj).addr;
+
if (addr1.length != addr2.length)
return false;
+
for (int i = addr1.length; --i >= 0; )
if (addr1[i] != addr2[i])
return false;
+
return true;
}
/**
* Returns then <code>InetAddress</code> as string
*/
- public String toString()
+ public String toString ()
{
String result;
- String address = getHostAddress();
+ String address = getHostAddress ();
+
if (hostName != null)
result = hostName + "/" + address;
else
result = address;
+
return result;
}
@@ -470,16 +492,10 @@ public class InetAddress implements Serializable
*
* @since 1.4
*/
- public static InetAddress getByAddress(byte[] addr)
+ public static InetAddress getByAddress (byte[] addr)
throws UnknownHostException
{
- if (addr.length != 4 && addr.length != 16)
- throw new UnknownHostException ("IP address has illegal length");
-
- if (addr.length == 4)
- return new Inet4Address (addr, null);
-
- return new Inet6Address (addr, null);
+ return getByAddress (null, addr);
}
/**
@@ -505,8 +521,10 @@ public class InetAddress implements Serializable
throw new UnknownHostException ("IP address has illegal length");
}
- /** If host is a valid numeric IP address, return the numeric address.
- * Otherwise, return null. */
+ /**
+ * If host is a valid numeric IP address, return the numeric address.
+ * Otherwise, return null.
+ */
private static native byte[] aton (String host);
private static native InetAddress[] lookup (String hostname,
@@ -523,13 +541,13 @@ public class InetAddress implements Serializable
public static InetAddress getByName (String hostname)
throws UnknownHostException
{
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkConnect (hostname, -1);
+ SecurityManager s = System.getSecurityManager ();
+ if (s != null)
+ s.checkConnect (hostname, -1);
// Default to current host if necessary
if (hostname == null)
- return getLocalHost();
+ return getLocalHost ();
// Assume that the host string is an IP address
byte[] address = aton (hostname);
@@ -539,13 +557,13 @@ public class InetAddress implements Serializable
return new Inet4Address (address, null);
else if (address.length == 16)
{
- if ((address[10] == 0xFF) && (address[11] == 0xFF))
+ if ((address [10] == 0xFF) && (address [11] == 0xFF))
{
- byte[] ip4addr = new byte[4];
- ip4addr[0] = address[12];
- ip4addr[1] = address[13];
- ip4addr[2] = address[14];
- ip4addr[3] = address[15];
+ byte[] ip4addr = new byte [4];
+ ip4addr [0] = address [12];
+ ip4addr [1] = address [13];
+ ip4addr [2] = address [14];
+ ip4addr [3] = address [15];
return new Inet4Address (ip4addr, null);
}
return new Inet6Address (address, null);
@@ -556,7 +574,7 @@ public class InetAddress implements Serializable
// Try to resolve the host by DNS
InetAddress[] addresses = getAllByName (hostname);
- return addresses[0];
+ return addresses [0];
}
/**
@@ -571,16 +589,16 @@ public class InetAddress implements Serializable
public static InetAddress[] getAllByName (String hostname)
throws UnknownHostException
{
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkConnect(hostname, -1);
+ SecurityManager s = System.getSecurityManager ();
+ if (s != null)
+ s.checkConnect (hostname, -1);
// Check if hostname is an IP address
byte[] address = aton (hostname);
if (address != null)
{
- InetAddress[] result = new InetAddress[1];
- result[0] = new InetAddress(address, null);
+ InetAddress[] result = new InetAddress [1];
+ result [0] = new InetAddress (address, null);
return result;
}
@@ -588,10 +606,10 @@ public class InetAddress implements Serializable
return lookup (hostname, null, true);
}
- static final byte[] zeros = {0,0,0,0};
+ static final byte[] zeros = { 0, 0, 0, 0 };
/* dummy InetAddress, used to bind socket to any (all) network interfaces */
- static final InetAddress ANY_IF = new InetAddress(zeros, null);
+ static final InetAddress ANY_IF = new InetAddress (zeros, null);
private static final byte[] localhostAddress = { 127, 0, 0, 1 };
@@ -605,25 +623,29 @@ public class InetAddress implements Serializable
* @exception UnknownHostException If no IP address for the host could
* be found
*/
- public static InetAddress getLocalHost() throws UnknownHostException
+ public static InetAddress getLocalHost () throws UnknownHostException
{
- SecurityManager s = System.getSecurityManager();
+ SecurityManager s = System.getSecurityManager ();
+
// Experimentation shows that JDK1.2 does cache the result.
// However, if there is a security manager, and the cached result
// is other than "localhost", we need to check again.
if (localhost == null
|| (s != null && localhost.addr != localhostAddress))
- getLocalHost(s);
+ getLocalHost (s);
+
return localhost;
}
- private static synchronized void getLocalHost(SecurityManager s)
+ private static synchronized void getLocalHost (SecurityManager s)
throws UnknownHostException
{
// Check the localhost cache again, now that we've synchronized.
if (s == null && localhost != null)
return;
- String hostname = getLocalHostname();
+
+ String hostname = getLocalHostname ();
+
if (s != null)
{
// "The Java Class Libraries" suggests that if the security
@@ -636,24 +658,26 @@ public class InetAddress implements Serializable
{
// This is wrong, if the name returned from getLocalHostname()
// is not a fully qualified name. FIXME.
- s.checkConnect(hostname, -1);
+ s.checkConnect (hostname, -1);
}
catch (SecurityException ex)
{
hostname = null;
}
}
+
if (hostname != null)
{
try
{
- localhost = new InetAddress(null, null);
- lookup(hostname, localhost, false);
+ localhost = new InetAddress (null, null);
+ lookup (hostname, localhost, false);
}
catch (Exception ex)
{
}
}
+
if (localhost == null)
localhost = new InetAddress (localhostAddress, "localhost");
}
diff --git a/libjava/java/net/InetSocketAddress.java b/libjava/java/net/InetSocketAddress.java
index 3c54b51a0f0..c720fbcfe61 100644
--- a/libjava/java/net/InetSocketAddress.java
+++ b/libjava/java/net/InetSocketAddress.java
@@ -69,6 +69,9 @@ public class InetSocketAddress extends SocketAddress
{
if (port < 0 || port > 65535)
throw new IllegalArgumentException();
+
+ if (addr == null)
+ addr = InetAddress.ANY_IF;
this.addr = addr;
this.port = port;
@@ -85,25 +88,9 @@ public class InetSocketAddress extends SocketAddress
public InetSocketAddress(int port)
throws IllegalArgumentException
{
- if (port < 0 || port > 65535)
- throw new IllegalArgumentException();
-
- this.port = port;
-
- try
- {
- byte[] any = { 0, 0, 0, 0 };
- this.addr = InetAddress.getByAddress (any);
- this.hostname = "0.0.0.0";
- }
- catch (UnknownHostException e)
- {
- this.addr = null;
- this.hostname = "";
- }
+ this ((InetAddress) null, port);
}
-
/**
* Constructs an InetSocketAddress instance.
*
@@ -115,7 +102,8 @@ public class InetSocketAddress extends SocketAddress
public InetSocketAddress(String hostname, int port)
throws IllegalArgumentException
{
- if (port < 0 || port > 65535)
+ if (port < 0 || port > 65535
+ || hostname == null)
throw new IllegalArgumentException();
this.port = port;
diff --git a/libjava/java/net/PlainDatagramSocketImpl.java b/libjava/java/net/PlainDatagramSocketImpl.java
index 69e17888995..83fdb633d99 100644
--- a/libjava/java/net/PlainDatagramSocketImpl.java
+++ b/libjava/java/net/PlainDatagramSocketImpl.java
@@ -39,6 +39,7 @@ exception statement from your version. */
package java.net;
import java.io.IOException;
+import gnu.classpath.Configuration;
/**
* Written using on-line Java Platform 1.2 API Specification, as well
@@ -47,11 +48,24 @@ import java.io.IOException;
*/
/**
+ * This is the default socket implementation for datagram sockets.
+ * It makes native calls to C routines that implement BSD style
+ * SOCK_DGRAM sockets in the AF_INET family.
+ *
+ * @author Aaron M. Renn <arenn@urbanophile.com>
* @author Warren Levy <warrenl@cygnus.com>
- * @date May 3, 1999.
*/
class PlainDatagramSocketImpl extends DatagramSocketImpl
{
+ // Static initializer to load native library
+ static
+ {
+ if (Configuration.INIT_LOAD_LIBRARY)
+ {
+ System.loadLibrary("javanet");
+ }
+ }
+
// These fields are mirrored for use in native code to avoid cpp conflicts
// when the #defines in system header files are the same as the public fields.
static final int _Jv_TCP_NODELAY_ = SocketOptions.TCP_NODELAY,
@@ -69,6 +83,9 @@ class PlainDatagramSocketImpl extends DatagramSocketImpl
_Jv_SO_RCVBUF_ = SocketOptions.SO_RCVBUF,
_Jv_SO_KEEPALIVE_ = SocketOptions.SO_KEEPALIVE;
+ /**
+ * This is the actual underlying file descriptor
+ */
int fnum = -1;
// FIXME: Is this necessary? Could it help w/ DatagramSocket.getLocalAddress?
@@ -80,50 +97,152 @@ class PlainDatagramSocketImpl extends DatagramSocketImpl
// 'timeout' is set/read by setOption/getOption.
int timeout = 0;
- // FIXME: Probably should have bind (and create?) calls from DatagramSocket
- // constuctor. If so, then same change should be made to the corresponding
- // Socket (non-datagram) classes. This allows the implementation more
- // complete control over how the socket is set up and used (e.g. connect,
- // setting options, etc.).
+ /**
+ * Default do nothing constructor
+ */
public PlainDatagramSocketImpl()
{
}
+ /**
+ * Binds this socket to a particular port and interface
+ *
+ * @param port The port to bind to
+ * @param addr The address to bind to
+ *
+ * @exception SocketException If an error occurs
+ */
protected native void bind(int lport, InetAddress laddr)
throws SocketException;
+
protected native void connect (InetAddress i, int port)
throws SocketException;
+
protected native void disconnect ();
+
+ /**
+ * Creates a new datagram socket
+ *
+ * @exception SocketException If an error occurs
+ */
protected native void create() throws SocketException;
+
protected native int peek(InetAddress i) throws IOException;
+
protected native int peekData (DatagramPacket dp) throws IOException;
+
+ /**
+ * Sets the Time to Live value for the socket
+ *
+ * @param ttl The new TTL value
+ *
+ * @exception IOException If an error occurs
+ */
protected native void setTimeToLive(int ttl) throws IOException;
+
+ /**
+ * Gets the Time to Live value for the socket
+ *
+ * @return The TTL value
+ *
+ * @exception IOException If an error occurs
+ */
protected native int getTimeToLive() throws IOException;
+
+ /**
+ * Sends a packet of data to a remote host
+ *
+ * @param packet The packet to send
+ *
+ * @exception IOException If an error occurs
+ */
protected native void send(DatagramPacket p) throws IOException;
+
+ /**
+ * Receives a UDP packet from the network
+ *
+ * @param packet The packet to fill in with the data received
+ *
+ * @exception IOException IOException If an error occurs
+ */
protected native void receive(DatagramPacket p) throws IOException;
+
+ /**
+ * Sets the value of an option on the socket
+ *
+ * @param option_id The identifier of the option to set
+ * @param val The value of the option to set
+ *
+ * @exception SocketException If an error occurs
+ */
public native void setOption(int optID, Object value) throws SocketException;
+
+ /**
+ * Retrieves the value of an option on the socket
+ *
+ * @param option_id The identifier of the option to retrieve
+ *
+ * @return The value of the option
+ *
+ * @exception SocketException If an error occurs
+ */
public native Object getOption(int optID) throws SocketException;
+
private native void mcastGrp(InetAddress inetaddr, NetworkInterface netIf,
boolean join) throws IOException;
+
+ /**
+ * Closes the socket
+ */
protected native void close();
- // Deprecated in JDK 1.2.
+ /**
+ * Gets the Time to Live value for the socket
+ *
+ * @return The TTL value
+ *
+ * @exception IOException If an error occurs
+ *
+ * @deprecated 1.2
+ */
protected byte getTTL() throws IOException
{
return (byte) getTimeToLive();
}
- // Deprecated in JDK 1.2.
+ /**
+ * Sets the Time to Live value for the socket
+ *
+ * @param ttl The new TTL value
+ *
+ * @exception IOException If an error occurs
+ *
+ * @deprecated 1.2
+ */
protected void setTTL(byte ttl) throws IOException
{
setTimeToLive(((int) ttl) & 0xFF);
}
+ /**
+ * Joins a multicast group
+ *
+ * @param addr The group to join
+ *
+ * @exception IOException If an error occurs
+ */
protected void join(InetAddress inetaddr) throws IOException
{
mcastGrp(inetaddr, null, true);
}
+ /**
+ * Leaves a multicast group
+ *
+ * @param addr The group to leave
+ *
+ * @exception IOException If an error occurs
+ */
protected void leave(InetAddress inetaddr) throws IOException
{
mcastGrp(inetaddr, null, false);
diff --git a/libjava/java/net/PlainSocketImpl.java b/libjava/java/net/PlainSocketImpl.java
index ed63b57bc43..ad0ce46c7ea 100644
--- a/libjava/java/net/PlainSocketImpl.java
+++ b/libjava/java/net/PlainSocketImpl.java
@@ -41,18 +41,35 @@ package java.net;
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
+import gnu.classpath.Configuration;
/**
- * The standard GCJ socket implementation.
* Written using on-line Java Platform 1.2 API Specification, as well
* as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
* Status: Believed complete and correct.
+ */
+
+/**
+ * Unless the application installs its own SocketImplFactory, this is the
+ * default socket implemetation that will be used. It simply uses a
+ * combination of Java and native routines to implement standard BSD
+ * style sockets of family AF_INET and types SOCK_STREAM and SOCK_DGRAM
*
* @author Per Bothner <bothner@cygnus.com>
* @author Nic Ferrier <nferrier@tapsellferrier.co.uk>
+ * @author Aaron M. Renn <arenn@urbanophile.com>
*/
class PlainSocketImpl extends SocketImpl
{
+ // Static initializer to load native library.
+ static
+ {
+ if (Configuration.INIT_LOAD_LIBRARY)
+ {
+ System.loadLibrary("javanet");
+ }
+ }
+
// These fields are mirrored for use in native code to avoid cpp conflicts
// when the #defines in system header files are the same as the public fields.
static final int _Jv_TCP_NODELAY_ = SocketOptions.TCP_NODELAY,
@@ -85,21 +102,101 @@ class PlainSocketImpl extends SocketImpl
// localAddress cache
InetAddress localAddress;
+ /**
+ * A cached copy of the in stream for reading from the socket.
+ */
+ private InputStream in;
+
+ /**
+ * A cached copy of the out stream for writing to the socket.
+ */
+ private OutputStream out;
+
+ /**
+ * Default do nothing constructor
+ */
+ public PlainSocketImpl()
+ {
+ }
+
+ protected void finalize() throws Throwable
+ {
+ synchronized (this)
+ {
+ if (fnum != -1)
+ try
+ {
+ close();
+ }
+ catch (IOException ex)
+ {
+ // ignore
+ }
+ }
+ super.finalize();
+ }
+
+ /**
+ * Sets the specified option on a socket to the passed in object. For
+ * options that take an integer argument, the passed in object is an
+ * Integer. The option_id parameter is one of the defined constants in
+ * this interface.
+ *
+ * @param option_id The identifier of the option
+ * @param val The value to set the option to
+ *
+ * @exception SocketException If an error occurs
+ */
public native void setOption(int optID, Object value) throws SocketException;
+ /**
+ * Returns the current setting of the specified option. The Object returned
+ * will be an Integer for options that have integer values. The option_id
+ * is one of the defined constants in this interface.
+ *
+ * @param option_id The option identifier
+ *
+ * @return The current value of the option
+ *
+ * @exception SocketException If an error occurs
+ */
public native Object getOption(int optID) throws SocketException;
public native void shutdownInput () throws IOException;
public native void shutdownOutput () throws IOException;
+ /**
+ * Creates a new socket that is not bound to any local address/port and
+ * is not connected to any remote address/port. This will be created as
+ * a stream socket if the stream parameter is true, or a datagram socket
+ * if the stream parameter is false.
+ *
+ * @param stream true for a stream socket, false for a datagram socket
+ */
protected native void create (boolean stream) throws IOException;
+ /**
+ * Connects to the remote hostname and port specified as arguments.
+ *
+ * @param hostname The remote hostname to connect to
+ * @param port The remote port to connect to
+ *
+ * @exception IOException If an error occurs
+ */
protected void connect (String host, int port) throws IOException
{
connect (new InetSocketAddress (InetAddress.getByName(host), port), 0);
}
+ /**
+ * Connects to the remote address and port specified as arguments.
+ *
+ * @param addr The remote address to connect to
+ * @param port The remote port to connect to
+ *
+ * @exception IOException If an error occurs
+ */
protected void connect (InetAddress host, int port) throws IOException
{
connect (new InetSocketAddress (host, port), 0);
@@ -108,80 +205,121 @@ class PlainSocketImpl extends SocketImpl
protected native void connect (SocketAddress addr, int timeout)
throws IOException;
+ /**
+ * Binds to the specified port on the specified addr. Note that this addr
+ * must represent a local IP address. **** How bind to INADDR_ANY? ****
+ *
+ * @param addr The address to bind to
+ * @param port The port number to bind to
+ *
+ * @exception IOException If an error occurs
+ */
protected native void bind (InetAddress host, int port) throws IOException;
+ /**
+ * Starts listening for connections on a socket. The queuelen parameter
+ * is how many pending connections will queue up waiting to be serviced
+ * before being accept'ed. If the queue of pending requests exceeds this
+ * number, additional connections will be refused.
+ *
+ * @param queuelen The length of the pending connection queue
+ *
+ * @exception IOException If an error occurs
+ */
protected native void listen (int backlog) throws IOException;
private native void accept (PlainSocketImpl s) throws IOException;
+ /**
+ * Accepts a new connection on this socket and returns in in the
+ * passed in SocketImpl.
+ *
+ * @param impl The SocketImpl object to accept this connection.
+ */
protected void accept (SocketImpl s) throws IOException
{
accept((PlainSocketImpl) s);
}
+ /**
+ * Returns the number of bytes that the caller can read from this socket
+ * without blocking.
+ *
+ * @return The number of readable bytes before blocking
+ *
+ * @exception IOException If an error occurs
+ */
protected native int available() throws IOException;
+ /**
+ * Closes the socket. This will cause any InputStream or OutputStream
+ * objects for this Socket to be closed as well.
+ * <p>
+ * Note that if the SO_LINGER option is set on this socket, then the
+ * operation could block.
+ *
+ * @exception IOException If an error occurs
+ */
protected native void close () throws IOException;
protected native void sendUrgentData(int data)
throws IOException;
- // Stream handling.
-
- /** A cached copy of the in stream for reading from the socket. */
- private InputStream in;
-
- /** A cached copy of the out stream for writing to the socket. */
- private OutputStream out;
-
-
- // The native read methods.
+ native int read() throws IOException;
- private native int read() throws IOException;
-
- private native int read(byte[] buffer, int offset, int count)
+ /**
+ * Internal method used by SocketInputStream for reading data from
+ * the connection. Reads up to len bytes of data into the buffer
+ * buf starting at offset bytes into the buffer.
+ *
+ * @return The actual number of bytes read or -1 if end of stream.
+ *
+ * @exception IOException If an error occurs
+ */
+ native int read(byte[] buffer, int offset, int count)
throws IOException;
+ native void write(int c) throws IOException;
- // The native write methods.
-
- private native void write(int c) throws IOException;
-
- private native void write(byte[] buffer, int offset, int count)
+ /**
+ * Internal method used by SocketOuputStream for writing data to
+ * the connection. Writes up to len bytes of data from the buffer
+ * buf starting at offset bytes into the buffer.
+ *
+ * @exception IOException If an error occurs
+ */
+ native void write(byte[] buffer, int offset, int count)
throws IOException;
- protected void finalize() throws Throwable
- {
- synchronized (this)
- {
- if (fnum != -1)
- try
- {
- close();
- }
- catch (IOException ex)
- {
- // ignore
- }
- }
- super.finalize();
- }
-
- /** @return the input stream attached to the socket.
+ /**
+ * Returns an InputStream object for reading from this socket. This will
+ * be an instance of SocketInputStream.
+ *
+ * @return An input stream attached to the socket.
+ *
+ * @exception IOException If an error occurs
*/
- protected InputStream getInputStream() throws IOException
+ protected synchronized InputStream getInputStream() throws IOException
{
if (in == null)
in = new SocketInputStream();
+
return in;
}
- /** @return the output stream attached to the socket.
+ /**
+ * Returns an OutputStream object for writing to this socket. This will
+ * be an instance of SocketOutputStream.
+ *
+ * @return An output stream attached to the socket.
+ *
+ * @exception IOException If an error occurs
*/
- protected OutputStream getOutputStream() throws IOException
+ protected synchronized OutputStream getOutputStream() throws IOException
{
if (out == null)
out = new SocketOutputStream();
+
return out;
}
diff --git a/libjava/java/net/ServerSocket.java b/libjava/java/net/ServerSocket.java
index 2d04eac452f..8dd420bbd3b 100644
--- a/libjava/java/net/ServerSocket.java
+++ b/libjava/java/net/ServerSocket.java
@@ -157,57 +157,11 @@ public class ServerSocket
if (impl == null)
throw new IOException("Cannot initialize Socket implementation");
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkListen(port);
-
- if (bindAddr == null)
- bindAddr = InetAddress.ANY_IF;
-
// create socket
impl.create(true);
- // bind to address/port
- try
- {
- impl.bind(bindAddr, port);
- }
- catch (IOException exception)
- {
- impl.close();
- throw exception;
- }
- catch (RuntimeException exception)
- {
- impl.close();
- throw exception;
- }
- catch (Error error)
- {
- impl.close();
- throw error;
- }
-
- // listen on socket
- try
- {
- impl.listen(backlog);
- }
- catch (IOException exception)
- {
- impl.close();
- throw exception;
- }
- catch (RuntimeException exception)
- {
- impl.close();
- throw exception;
- }
- catch (Error error)
- {
- impl.close();
- throw error;
- }
+ // bind/listen socket
+ bind (new InetSocketAddress (bindAddr, port), backlog);
}
/**
@@ -258,9 +212,48 @@ public class ServerSocket
if (s != null)
s.checkListen (tmp.getPort ());
+ // bind to address/port
+ try
+ {
impl.bind (tmp.getAddress (), tmp.getPort ());
+ }
+ catch (IOException exception)
+ {
+ impl.close();
+ throw exception;
+ }
+ catch (RuntimeException exception)
+ {
+ impl.close();
+ throw exception;
+ }
+ catch (Error error)
+ {
+ impl.close();
+ throw error;
+ }
+
+ // listen on socket
+ try
+ {
impl.listen(backlog);
}
+ catch (IOException exception)
+ {
+ impl.close();
+ throw exception;
+ }
+ catch (RuntimeException exception)
+ {
+ impl.close();
+ throw exception;
+ }
+ catch (Error error)
+ {
+ impl.close();
+ throw error;
+ }
+ }
/**
* This method returns the local address to which this socket is bound
diff --git a/libjava/java/net/Socket.java b/libjava/java/net/Socket.java
index 8535fa9ef61..38b31ec8cc8 100644
--- a/libjava/java/net/Socket.java
+++ b/libjava/java/net/Socket.java
@@ -37,7 +37,9 @@ exception statement from your version. */
package java.net;
-import java.io.*;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
import java.nio.channels.SocketChannel;
import java.nio.channels.IllegalBlockingModeException;
@@ -87,8 +89,6 @@ public class Socket
private boolean closed = false;
- // Constructors
-
/**
* Initializes a new instance of <code>Socket</code> object without
* connecting to a remote host. This useful for subclasses of socket that
@@ -282,6 +282,9 @@ public class Socket
{
this();
+ if (raddr == null)
+ throw new NullPointerException ();
+
if (impl == null)
throw new IOException("Cannot initialize Socket implementation");
@@ -289,8 +292,12 @@ public class Socket
if (sm != null)
sm.checkConnect(raddr.getHostName(), rport);
- // bind/connect socket
- bind (new InetSocketAddress (laddr, lport));
+ // bind socket
+ SocketAddress bindaddr =
+ laddr == null ? null : new InetSocketAddress (laddr, lport);
+ bind (bindaddr);
+
+ // connect socket
connect (new InetSocketAddress (raddr, rport));
// FIXME: JCL p. 1586 says if localPort is unspecified, bind to any port,
diff --git a/libjava/java/net/SocketImpl.java b/libjava/java/net/SocketImpl.java
index 25ffe91d1d2..14101513e09 100644
--- a/libjava/java/net/SocketImpl.java
+++ b/libjava/java/net/SocketImpl.java
@@ -1,5 +1,6 @@
/* SocketImpl.java -- Abstract socket implementation class
- Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
+ Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,9 +36,13 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.net;
-import java.io.*;
+import java.io.FileDescriptor;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
/* Written using on-line Java Platform 1.2 API Specification.
* Believed complete and correct.
@@ -282,7 +287,10 @@ public abstract class SocketImpl implements SocketOptions
*
* @exception IOException if an error occurs
*/
- protected abstract void shutdownInput () throws IOException;
+ protected void shutdownInput () throws IOException
+ {
+ throw new IOException ("Not implemented in this socket class");
+ }
/**
* Shut down the output side of this socket. Subsequent writes will
@@ -290,5 +298,8 @@ public abstract class SocketImpl implements SocketOptions
*
* @exception IOException if an error occurs
*/
- protected abstract void shutdownOutput () throws IOException;
+ protected void shutdownOutput () throws IOException
+ {
+ throw new IOException ("Not implemented in this socket class");
+ }
}
diff --git a/libjava/java/net/URL.java b/libjava/java/net/URL.java
index 5e32e2e67ef..12c86914e30 100644
--- a/libjava/java/net/URL.java
+++ b/libjava/java/net/URL.java
@@ -147,7 +147,7 @@ public final class URL implements Serializable
/**
* The protocol handler in use for this URL
*/
- transient URLStreamHandler handler;
+ transient URLStreamHandler ph;
/**
* This a table where we cache protocol handlers to avoid the overhead
@@ -223,24 +223,25 @@ public final class URL implements Serializable
* @since 1.2
*/
public URL(String protocol, String host, int port, String file,
- URLStreamHandler handler) throws MalformedURLException
+ URLStreamHandler ph)
+ throws MalformedURLException
{
if (protocol == null)
throw new MalformedURLException("null protocol");
this.protocol = protocol.toLowerCase();
- if (handler != null)
+ if (ph != null)
{
SecurityManager s = System.getSecurityManager();
if (s != null)
s.checkPermission (new NetPermission ("specifyStreamHandler"));
- this.handler = handler;
+ this.ph = ph;
}
else
- this.handler = getURLStreamHandler(protocol);
+ this.ph = getURLStreamHandler(protocol);
- if (this.handler == null)
+ if (this.ph == null)
throw new MalformedURLException (
"Protocol handler not found: " + protocol);
@@ -328,7 +329,7 @@ public final class URL implements Serializable
*
* @since 1.2
*/
- public URL(URL context, String spec, URLStreamHandler handler)
+ public URL(URL context, String spec, URLStreamHandler ph)
throws MalformedURLException
{
/* A protocol is defined by the doc as the substring before a ':'
@@ -381,18 +382,18 @@ public final class URL implements Serializable
throw new
MalformedURLException("Absolute URL required with null context");
- if (handler != null)
+ if (ph != null)
{
SecurityManager s = System.getSecurityManager ();
if (s != null)
s.checkPermission (new NetPermission ("specifyStreamHandler"));
- this.handler = handler;
+ this.ph = ph;
}
else
- this.handler = getURLStreamHandler(protocol);
+ this.ph = getURLStreamHandler(protocol);
- if (this.handler == null)
+ if (this.ph == null)
throw new MalformedURLException("Protocol handler not found: "
+ protocol);
@@ -400,8 +401,8 @@ public final class URL implements Serializable
// is to be excluded by passing the 'limit' as the indexOf the '#'
// if one exists, otherwise pass the end of the string.
int hashAt = spec.indexOf('#', colon + 1);
- this.handler.parseURL(this, spec, colon + 1,
- hashAt < 0 ? spec.length() : hashAt);
+ this.ph.parseURL(this, spec, colon + 1,
+ hashAt < 0 ? spec.length() : hashAt);
if (hashAt >= 0)
ref = spec.substring(hashAt + 1);
@@ -418,14 +419,12 @@ public final class URL implements Serializable
*
* @return true if the URL is equal, false otherwise
*/
- public boolean equals(Object obj)
+ public boolean equals (Object obj)
{
if (obj == null || ! (obj instanceof URL))
return false;
- URL uObj = (URL) obj;
-
- return handler.equals (this, uObj);
+ return ph.equals (this, (URL) obj);
}
/**
@@ -514,7 +513,7 @@ public final class URL implements Serializable
*/
public int getDefaultPort()
{
- return handler.getDefaultPort();
+ return ph.getDefaultPort();
}
/**
@@ -568,7 +567,7 @@ public final class URL implements Serializable
if (hashCode != 0)
return hashCode; // Use cached value if available.
else
- return handler.hashCode (this);
+ return ph.hashCode (this);
}
/**
@@ -581,7 +580,7 @@ public final class URL implements Serializable
*/
public URLConnection openConnection() throws IOException
{
- return handler.openConnection(this);
+ return ph.openConnection(this);
}
/**
@@ -607,7 +606,7 @@ public final class URL implements Serializable
*/
public boolean sameFile(URL other)
{
- return handler.sameFile(this, other);
+ return ph.sameFile(this, other);
}
/**
@@ -629,7 +628,7 @@ public final class URL implements Serializable
// invalid protocol. It will cause the handler to be set to null
// thus overriding a valid handler. Callers of this method should
// be aware of this.
- this.handler = getURLStreamHandler(protocol);
+ this.ph = getURLStreamHandler(protocol);
this.protocol = protocol.toLowerCase();
this.authority = null;
this.port = port;
@@ -654,7 +653,7 @@ public final class URL implements Serializable
// invalid protocol. It will cause the handler to be set to null
// thus overriding a valid handler. Callers of this method should
// be aware of this.
- this.handler = getURLStreamHandler(protocol);
+ this.ph = getURLStreamHandler(protocol);
this.protocol = protocol.toLowerCase();
if (userInfo == null)
this.host = host;
@@ -703,7 +702,7 @@ public final class URL implements Serializable
public String toExternalForm()
{
// Identical to toString().
- return handler.toExternalForm(this);
+ return ph.toExternalForm(this);
}
/**
@@ -716,24 +715,24 @@ public final class URL implements Serializable
public String toString()
{
// Identical to toExternalForm().
- return handler.toExternalForm(this);
+ return ph.toExternalForm(this);
}
private static synchronized URLStreamHandler
getURLStreamHandler (String protocol)
{
- URLStreamHandler handler;
+ URLStreamHandler ph;
// See if a handler has been cached for this protocol.
- if ((handler = (URLStreamHandler) handlers.get(protocol)) != null)
- return handler;
+ if ((ph = (URLStreamHandler) handlers.get(protocol)) != null)
+ return ph;
// If a non-default factory has been set, use it to find the protocol.
if (factory != null)
- handler = factory.createURLStreamHandler(protocol);
+ ph = factory.createURLStreamHandler(protocol);
else if (protocol.equals ("core"))
{
- handler = new gnu.gcj.protocol.core.Handler ();
+ ph = new gnu.gcj.protocol.core.Handler ();
}
else if (protocol.equals ("file"))
{
@@ -747,12 +746,12 @@ public final class URL implements Serializable
// fix this problem. If other protocols are required in a
// statically linked application they will need to be handled in
// the same way as "file".
- handler = new gnu.gcj.protocol.file.Handler ();
+ ph = new gnu.gcj.protocol.file.Handler ();
}
// Non-default factory may have returned null or a factory wasn't set.
// Use the default search algorithm to find a handler for this protocol.
- if (handler == null)
+ if (ph == null)
{
// Get the list of packages to check and append our default handler
// to it, along with the JDK specified default as a last resort.
@@ -769,34 +768,33 @@ public final class URL implements Serializable
".Handler";
try
{
- handler =
- (URLStreamHandler) Class.forName(facName).newInstance();
+ ph = (URLStreamHandler) Class.forName(facName).newInstance();
}
catch (Exception e)
{
// Can't instantiate; handler still null, go on to next element.
}
- } while ((handler == null ||
- ! (handler instanceof URLStreamHandler)) &&
+ } while ((ph == null ||
+ ! (ph instanceof URLStreamHandler)) &&
pkgPrefix.hasMoreTokens());
}
// Update the hashtable with the new protocol handler.
- if (handler != null)
- if (handler instanceof URLStreamHandler)
- handlers.put(protocol, handler);
+ if (ph != null)
+ if (ph instanceof URLStreamHandler)
+ handlers.put(protocol, ph);
else
- handler = null;
+ ph = null;
- return handler;
+ return ph;
}
private void readObject(ObjectInputStream ois)
throws IOException, ClassNotFoundException
{
ois.defaultReadObject();
- this.handler = getURLStreamHandler(protocol);
- if (this.handler == null)
+ this.ph = getURLStreamHandler(protocol);
+ if (this.ph == null)
throw new IOException("Handler for protocol " + protocol + " not found");
}
diff --git a/libjava/java/net/URLClassLoader.java b/libjava/java/net/URLClassLoader.java
index d7fc77f8ab4..10b67352f04 100644
--- a/libjava/java/net/URLClassLoader.java
+++ b/libjava/java/net/URLClassLoader.java
@@ -35,14 +35,13 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.net;
import java.io.ByteArrayOutputStream;
import java.io.EOFException;
import java.io.File;
import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FilterInputStream;
import java.io.FilePermission;
import java.io.InputStream;
import java.io.IOException;
@@ -60,7 +59,6 @@ import java.util.jar.Attributes;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
-import java.util.zip.ZipException;
/**
* A secure class loader that can load classes and resources from
diff --git a/libjava/java/net/URLConnection.java b/libjava/java/net/URLConnection.java
index 7684e527816..3b8a85be139 100644
--- a/libjava/java/net/URLConnection.java
+++ b/libjava/java/net/URLConnection.java
@@ -331,20 +331,19 @@ public abstract class URLConnection
*/
public int getHeaderFieldInt(String name, int defaultValue)
{
- String str = getHeaderField(name);
- int result = defaultValue;
+ String value = getHeaderField (name);
+ if (value == null)
+ return defaultValue;
+
try
{
- if (str != null)
- result = Integer.parseInt (str);
+ return Integer.parseInt (value);
}
catch (NumberFormatException e)
{
- ; // Do nothing; defaultValue is the default.
+ return defaultValue;
}
-
- return result;
}
/**
@@ -353,27 +352,32 @@ public abstract class URLConnection
* value if the field is not present or cannot be converted to a date.
*
* @param name The name of the header field
- * @param val The dafault date
+ * @param defaultValue The default date if the header field is not found
+ * or can't be converted.
*
* @return Returns the date value of the header filed or the default value
* if the field is missing or malformed
*/
- public long getHeaderFieldDate(String name, long val)
+ public long getHeaderFieldDate (String name, long defaultValue)
{
if (! dateformats_initialized)
- initializeDateFormats();
- String str = getHeaderField(name);
+ initializeDateFormats ();
+
+ long result = defaultValue;
+ String str = getHeaderField (name);
+
if (str != null)
{
- Date date;
- if ((date = dateFormat1.parse(str, new ParsePosition(0))) != null)
- val = date.getTime();
- else if ((date = dateFormat2.parse(str, new ParsePosition(0))) != null)
- val = date.getTime();
- else if ((date = dateFormat3.parse(str, new ParsePosition(0))) != null)
- val = date.getTime();
+ Date date;
+ if ((date = dateFormat1.parse (str, new ParsePosition (0))) != null)
+ result = date.getTime ();
+ else if ((date = dateFormat2.parse (str, new ParsePosition (0))) != null)
+ result = date.getTime ();
+ else if ((date = dateFormat3.parse (str, new ParsePosition (0))) != null)
+ result = date.getTime ();
}
- return val;
+
+ return result;
}
/**
@@ -387,7 +391,7 @@ public abstract class URLConnection
* @return The header field key or null if index is past the end
* of the headers.
*/
- public String getHeaderFieldKey(int index)
+ public String getHeaderFieldKey (int index)
{
// Subclasses for specific protocols override this.
return null;
@@ -509,7 +513,8 @@ public abstract class URLConnection
* to be done for this connection. This default to true unless the
* doOutput flag is set to false, in which case this defaults to false.
*
- * @param doinput The new value of the doInput field
+ * @param input <code>true</code> if input is to be done,
+ * <code>false</code> otherwise
*
* @exception IllegalStateException If already connected
*/
@@ -671,7 +676,10 @@ public abstract class URLConnection
}
/**
- * Returns the default value of the useCaches field
+ * Returns the default value used to determine whether or not caching
+ * of documents will be done when possible.
+ *
+ * @return true if caches will be used, false otherwise
*/
public boolean getDefaultUseCaches()
{
@@ -701,6 +709,8 @@ public abstract class URLConnection
*
* @see URLConnection#getRequestProperty(String key)
* @see URLConnection#addRequestProperty(String key, String value)
+ *
+ * @since 1.4
*/
public void setRequestProperty(String key, String value)
{
diff --git a/libjava/java/net/URLStreamHandler.java b/libjava/java/net/URLStreamHandler.java
index 604279defa2..93a8ab27814 100644
--- a/libjava/java/net/URLStreamHandler.java
+++ b/libjava/java/net/URLStreamHandler.java
@@ -269,10 +269,10 @@ public abstract class URLStreamHandler
return false;
int p1 = url1.getPort ();
if (p1 == -1)
- p1 = url1.handler.getDefaultPort ();
+ p1 = url1.ph.getDefaultPort ();
int p2 = url2.getPort ();
if (p2 == -1)
- p2 = url2.handler.getDefaultPort ();
+ p2 = url2.ph.getDefaultPort ();
if (p1 != p2)
return false;
String s1, s2;
@@ -380,12 +380,20 @@ public abstract class URLStreamHandler
* @exception UnknownHostException If an unknown host is found
*/
protected boolean hostsEqual (URL url1, URL url2)
- throws UnknownHostException
{
- InetAddress addr1 = InetAddress.getByName (url1.getHost ());
- InetAddress addr2 = InetAddress.getByName (url2.getHost ());
+ InetAddress addr1 = getHostAddress (url1);
+ InetAddress addr2 = getHostAddress (url2);
- return addr1.equals (addr2);
+ if (addr1 != null || addr2 != null)
+ return addr1.equals (addr2);
+
+ String host1 = url1.getHost();
+ String host2 = url2.getHost();
+
+ if (host1 != null && host2 != null)
+ return host1.equalsIgnoreCase (host2);
+
+ return host1 == null && host2 == null;
}
/**
diff --git a/libjava/java/nio/Buffer.java b/libjava/java/nio/Buffer.java
index 693765f3e46..9221d755be9 100644
--- a/libjava/java/nio/Buffer.java
+++ b/libjava/java/nio/Buffer.java
@@ -35,14 +35,15 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.nio;
public abstract class Buffer
{
- private int cap = 0;
- private int limit = 0;
- private int pos = 0;
- private int mark = -1;
+ int cap = 0;
+ int limit = 0;
+ int pos = 0;
+ int mark = -1;
// Creates a new Buffer.
//
diff --git a/libjava/java/nio/ByteBufferImpl.java b/libjava/java/nio/ByteBufferImpl.java
index 4642288e79a..37db881fa4c 100644
--- a/libjava/java/nio/ByteBufferImpl.java
+++ b/libjava/java/nio/ByteBufferImpl.java
@@ -41,7 +41,7 @@ package java.nio;
/**
* This is a Heap memory implementation
*/
-public final class ByteBufferImpl extends ByteBuffer
+final class ByteBufferImpl extends ByteBuffer
{
private boolean readOnly;
diff --git a/libjava/java/nio/CharBufferImpl.java b/libjava/java/nio/CharBufferImpl.java
index 708ab403f54..d22b4d1b2bb 100644
--- a/libjava/java/nio/CharBufferImpl.java
+++ b/libjava/java/nio/CharBufferImpl.java
@@ -41,7 +41,7 @@ package java.nio;
/**
* This is a Heap memory implementation
*/
-public final class CharBufferImpl extends CharBuffer
+final class CharBufferImpl extends CharBuffer
{
private boolean readOnly;
diff --git a/libjava/java/nio/DirectByteBufferImpl.java b/libjava/java/nio/DirectByteBufferImpl.java
index b037385c4af..352016372f7 100644
--- a/libjava/java/nio/DirectByteBufferImpl.java
+++ b/libjava/java/nio/DirectByteBufferImpl.java
@@ -40,11 +40,16 @@ package java.nio;
import gnu.gcj.RawData;
-public class DirectByteBufferImpl extends ByteBuffer
+class DirectByteBufferImpl extends ByteBuffer
{
- private RawData address;
+ RawData address;
private int offset;
private boolean readOnly;
+
+ public DirectByteBufferImpl (RawData address, long len)
+ {
+ this (address, 0, (int) len, (int) len, 0, -1, false);
+ }
public DirectByteBufferImpl (RawData address, int offset, int capacity,
int limit, int position, int mark,
diff --git a/libjava/java/nio/DoubleBufferImpl.java b/libjava/java/nio/DoubleBufferImpl.java
index dbc63bbad29..8dacec9be34 100644
--- a/libjava/java/nio/DoubleBufferImpl.java
+++ b/libjava/java/nio/DoubleBufferImpl.java
@@ -41,7 +41,7 @@ package java.nio;
/**
* This is a Heap memory implementation
*/
-public final class DoubleBufferImpl extends DoubleBuffer
+final class DoubleBufferImpl extends DoubleBuffer
{
private boolean readOnly;
diff --git a/libjava/java/nio/FloatBufferImpl.java b/libjava/java/nio/FloatBufferImpl.java
index 93dd1d0b35a..db0f52bb412 100644
--- a/libjava/java/nio/FloatBufferImpl.java
+++ b/libjava/java/nio/FloatBufferImpl.java
@@ -41,7 +41,7 @@ package java.nio;
/**
* This is a Heap memory implementation
*/
-public final class FloatBufferImpl extends FloatBuffer
+final class FloatBufferImpl extends FloatBuffer
{
private boolean readOnly;
diff --git a/libjava/java/nio/IntBufferImpl.java b/libjava/java/nio/IntBufferImpl.java
index ebf33ecbc51..ec444c014c3 100644
--- a/libjava/java/nio/IntBufferImpl.java
+++ b/libjava/java/nio/IntBufferImpl.java
@@ -41,7 +41,7 @@ package java.nio;
/**
* This is a Heap memory implementation
*/
-public final class IntBufferImpl extends IntBuffer
+final class IntBufferImpl extends IntBuffer
{
private boolean readOnly;
diff --git a/libjava/java/nio/LongBufferImpl.java b/libjava/java/nio/LongBufferImpl.java
index 08d4ac5486f..b4fb3de5f8a 100644
--- a/libjava/java/nio/LongBufferImpl.java
+++ b/libjava/java/nio/LongBufferImpl.java
@@ -41,7 +41,7 @@ package java.nio;
/**
* This is a Heap memory implementation
*/
-public final class LongBufferImpl extends LongBuffer
+final class LongBufferImpl extends LongBuffer
{
private boolean readOnly;
diff --git a/libjava/java/nio/ShortBufferImpl.java b/libjava/java/nio/ShortBufferImpl.java
index fcfbee64f96..5f6c60137a1 100644
--- a/libjava/java/nio/ShortBufferImpl.java
+++ b/libjava/java/nio/ShortBufferImpl.java
@@ -41,7 +41,7 @@ package java.nio;
/**
* This is a Heap memory implementation
*/
-public final class ShortBufferImpl extends ShortBuffer
+final class ShortBufferImpl extends ShortBuffer
{
private boolean readOnly;
diff --git a/libjava/java/nio/channels/FileChannel.java b/libjava/java/nio/channels/FileChannel.java
index 708a50c9a39..9def4631652 100644
--- a/libjava/java/nio/channels/FileChannel.java
+++ b/libjava/java/nio/channels/FileChannel.java
@@ -112,7 +112,7 @@ public abstract class FileChannel extends AbstractInterruptibleChannel
*
* @exception IOException If an I/O error occurs.
*/
- public long write (ByteBuffer[] srcs) throws IOException
+ public final long write (ByteBuffer[] srcs) throws IOException
{
long result = 0;
diff --git a/libjava/java/nio/channels/ServerSocketChannel.java b/libjava/java/nio/channels/ServerSocketChannel.java
index 27870077608..a116731c602 100644
--- a/libjava/java/nio/channels/ServerSocketChannel.java
+++ b/libjava/java/nio/channels/ServerSocketChannel.java
@@ -53,7 +53,7 @@ public abstract class ServerSocketChannel
/**
* Initializes this channel.
*/
- public ServerSocketChannel (SelectorProvider provider)
+ protected ServerSocketChannel (SelectorProvider provider)
{
super (provider);
}
diff --git a/libjava/java/nio/natDirectByteBufferImpl.cc b/libjava/java/nio/natDirectByteBufferImpl.cc
index 82863900256..2ceea170551 100644
--- a/libjava/java/nio/natDirectByteBufferImpl.cc
+++ b/libjava/java/nio/natDirectByteBufferImpl.cc
@@ -13,33 +13,33 @@ details. */
#include <gcj/cni.h>
#include <jvm.h>
+#include <stdlib.h>
+
#include <gnu/gcj/RawData.h>
#include <java/nio/DirectByteBufferImpl.h>
gnu::gcj::RawData*
-java::nio::DirectByteBufferImpl::allocateImpl (jint /*capacity*/)
+java::nio::DirectByteBufferImpl::allocateImpl (jint capacity)
{
- // FIXME: implement this
- return 0;
+ return reinterpret_cast<gnu::gcj::RawData*> (::malloc (capacity));
}
void
-java::nio::DirectByteBufferImpl::freeImpl (gnu::gcj::RawData* /*address*/)
+java::nio::DirectByteBufferImpl::freeImpl (gnu::gcj::RawData* address)
{
- // FIXME: implement this
+ ::free (reinterpret_cast<void*> (address));
}
jbyte
-java::nio::DirectByteBufferImpl::getImpl (jint /*index*/)
+java::nio::DirectByteBufferImpl::getImpl (jint index)
{
- // FIXME: implement this
- // Dont forget: add offset to index
- return 0;
+ jbyte* pointer = reinterpret_cast<jbyte*> (address) + offset + index;
+ return *pointer;
}
void
-java::nio::DirectByteBufferImpl::putImpl (jint /*index*/, jbyte /*value*/)
+java::nio::DirectByteBufferImpl::putImpl (jint index, jbyte value)
{
- // FIXME: implement this
- // Dont forget: add offset to index
+ jbyte* pointer = reinterpret_cast<jbyte*> (address) + offset + index;
+ *pointer = value;
}
diff --git a/libjava/java/rmi/server/SkeletonNotFoundException.java b/libjava/java/rmi/server/SkeletonNotFoundException.java
index 41819d938f5..93ad1ecf1db 100644
--- a/libjava/java/rmi/server/SkeletonNotFoundException.java
+++ b/libjava/java/rmi/server/SkeletonNotFoundException.java
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.rmi.server;
import java.rmi.RemoteException;
@@ -59,7 +60,6 @@ public class SkeletonNotFoundException extends RemoteException
* Create an exception with the specified message.
*
* @param s the message
- * @deprecated no longer needed
*/
public SkeletonNotFoundException(String s)
{
@@ -71,7 +71,6 @@ public class SkeletonNotFoundException extends RemoteException
*
* @param s the message
* @param e the cause
- * @deprecated no longer needed
*/
public SkeletonNotFoundException(String s, Exception e)
{
diff --git a/libjava/java/rmi/server/UnicastRemoteObject.java b/libjava/java/rmi/server/UnicastRemoteObject.java
index 4e2f06ae64b..8e010e7e5e8 100644
--- a/libjava/java/rmi/server/UnicastRemoteObject.java
+++ b/libjava/java/rmi/server/UnicastRemoteObject.java
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.rmi.server;
import java.rmi.RemoteException;
@@ -89,7 +90,7 @@ public static RemoteStub exportObject(Remote obj) throws RemoteException {
return exportObject(obj, port, null);
}
- protected static Remote exportObject(Remote obj, int port, RMIServerSocketFactory ssf)
+ static Remote exportObject(Remote obj, int port, RMIServerSocketFactory ssf)
throws RemoteException
{
UnicastServerRef sref = null;
@@ -103,7 +104,7 @@ public static RemoteStub exportObject(Remote obj) throws RemoteException {
}
/**
- * FIX ME
+ * FIXME
*/
public static Remote exportObject(Remote obj, int port, RMIClientSocketFactory csf,
RMIServerSocketFactory ssf)
diff --git a/libjava/java/security/Certificate.java b/libjava/java/security/Certificate.java
index f37d919a733..5b0f9ae8d21 100644
--- a/libjava/java/security/Certificate.java
+++ b/libjava/java/security/Certificate.java
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.security;
import java.io.InputStream;
@@ -62,7 +63,6 @@ public interface Certificate
* this certificate.
*
* @return the <code>Principal</code> guaranteeing the certificate
- * @deprecated this entire interface is deprecated
*/
Principal getGuarantor();
@@ -71,7 +71,6 @@ public interface Certificate
* this certificate.
*
* @return the <code>Principal</code> guaranteed by this certificate
- * @deprecated this entire interface is deprecated
*/
Principal getPrincipal();
@@ -80,7 +79,6 @@ public interface Certificate
* is being guaranteed.
*
* @return the <code>PublicKey</code> of the Principal being guaranteed
- * @deprecated this entire interface is deprecated
*/
PublicKey getPublicKey();
@@ -93,7 +91,6 @@ public interface Certificate
* @throws IOException if an error occurs writing to the stream
* @see #decode(InputStream)
* @see #getFormat()
- * @deprecated this entire interface is deprecated
*/
void encode(OutputStream out) throws KeyException, IOException;
@@ -105,7 +102,6 @@ public interface Certificate
* @throws IOException if an error occurs reading from the stream
* @see #encode(OutputStream)
* @see #getFormat()
- * @deprecated this entire interface is deprecated
*/
void decode(InputStream in) throws KeyException, IOException;
@@ -115,7 +111,6 @@ public interface Certificate
* <code>decode</code> methods.
*
* @return the encoding format being used
- * @deprecated this entire interface is deprecated
*/
String getFormat();
@@ -125,7 +120,6 @@ public interface Certificate
*
* @param detail true to provided more detailed information
* @return the string representation
- * @deprecated this entire interface is deprecated
*/
String toString(boolean detail);
} // interface Certificate
diff --git a/libjava/java/security/cert/PolicyQualifierInfo.java b/libjava/java/security/cert/PolicyQualifierInfo.java
index a46b6ba89be..8dede47fcb8 100644
--- a/libjava/java/security/cert/PolicyQualifierInfo.java
+++ b/libjava/java/security/cert/PolicyQualifierInfo.java
@@ -65,7 +65,7 @@ import gnu.java.security.der.DERWriter;
*
* @since JDK 1.4
*/
-public class PolicyQualifierInfo
+public final class PolicyQualifierInfo
{
// Fields.
diff --git a/libjava/java/text/CollationElementIterator.java b/libjava/java/text/CollationElementIterator.java
index ba60f205f3c..94c65005e8f 100644
--- a/libjava/java/text/CollationElementIterator.java
+++ b/libjava/java/text/CollationElementIterator.java
@@ -1,6 +1,6 @@
/* CollationElementIterator.java -- Walks through collation elements
+ Copyright (C) 1998, 1999, 2001, 2002, 2003 Free Software Foundation
-/* Copyright (C) 1999, 2001 Free Software Foundation
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
@@ -60,7 +60,7 @@ public final class CollationElementIterator
* This is a constant value that is returned to indicate that the end of
* the string was encountered.
*/
- public static final int NULLORDER = 0xffffffff;
+ public static final int NULLORDER = -1;
/**
* This is the RuleBasedCollator this object was created from.
@@ -92,6 +92,7 @@ public final class CollationElementIterator
{
if (index == text.length())
return NULLORDER;
+
return collator.ceiNext(this);
}
diff --git a/libjava/java/text/DateFormat.java b/libjava/java/text/DateFormat.java
index c298ef23342..df2b270e4f3 100644
--- a/libjava/java/text/DateFormat.java
+++ b/libjava/java/text/DateFormat.java
@@ -101,7 +101,7 @@ public abstract class DateFormat extends Format implements Cloneable
* <ul>
* <li>Is not <code>null</code>.
* <li>Is an instance of <code>DateFormat</code>.
- * <li>Has the same calendar and numberFormat field values as this object.
+ * <li>Has the same numberFormat field value as this object.
* </ul>
*
* @param obj The object to test for equality against.
@@ -111,10 +111,12 @@ public abstract class DateFormat extends Format implements Cloneable
*/
public boolean equals (Object obj)
{
- if (! (obj instanceof DateFormat))
+ if (!(obj instanceof DateFormat))
return false;
+
DateFormat d = (DateFormat) obj;
- return calendar.equals(d.calendar) && numberFormat.equals(d.numberFormat);
+
+ return numberFormat.equals(d.numberFormat);
}
/**
@@ -467,10 +469,10 @@ public abstract class DateFormat extends Format implements Cloneable
*/
public int hashCode ()
{
- int hash = calendar.hashCode();
if (numberFormat != null)
- hash ^= numberFormat.hashCode();
- return hash;
+ return numberFormat.hashCode();
+ else
+ return 0;
}
/**
diff --git a/libjava/java/text/Format.java b/libjava/java/text/Format.java
index 804ef43ff29..ab61f28ae30 100644
--- a/libjava/java/text/Format.java
+++ b/libjava/java/text/Format.java
@@ -59,7 +59,7 @@ import java.io.Serializable;
*/
public abstract class Format implements Serializable, Cloneable
{
- static final long serialVersionUID = -299282585814624189L;
+ static final long serialVersionUID = 4479235611355683992L;
/**
* This method initializes a new instance of <code>Format</code>.
diff --git a/libjava/java/text/SimpleDateFormat.java b/libjava/java/text/SimpleDateFormat.java
index 7b282f3c62f..67523e1628d 100644
--- a/libjava/java/text/SimpleDateFormat.java
+++ b/libjava/java/text/SimpleDateFormat.java
@@ -384,10 +384,10 @@ public class SimpleDateFormat extends DateFormat
SimpleDateFormat sdf = (SimpleDateFormat)o;
- if (!toPattern().equals(sdf.toPattern()))
+ if (defaultCentury != sdf.defaultCentury)
return false;
- if (!get2DigitYearStart().equals(sdf.get2DigitYearStart()))
+ if (!toPattern().equals(sdf.toPattern()))
return false;
if (!getDateFormatSymbols().equals(sdf.getDateFormatSymbols()))
@@ -396,6 +396,17 @@ public class SimpleDateFormat extends DateFormat
return true;
}
+ /**
+ * This method returns a hash value for this object.
+ *
+ * @return A hash value for this object.
+ */
+ public int hashCode()
+ {
+ return super.hashCode() ^ toPattern().hashCode() ^ defaultCentury ^
+ getDateFormatSymbols().hashCode();
+ }
+
/**
* Formats the date input according to the format string in use,
diff --git a/libjava/java/util/Locale.java b/libjava/java/util/Locale.java
index 22e19384c59..431824f0c35 100644
--- a/libjava/java/util/Locale.java
+++ b/libjava/java/util/Locale.java
@@ -231,9 +231,9 @@ public final class Locale implements Serializable, Cloneable
// default locale.
if (defaultLocale != null)
{
- language = convertLanguage(language);
- country = country.toUpperCase();
- variant = variant.toUpperCase();
+ language = convertLanguage(language).intern();
+ country = country.toUpperCase().intern();
+ variant = variant.toUpperCase().intern();
}
this.language = language;
this.country = country;
@@ -436,7 +436,7 @@ public final class Locale implements Serializable, Cloneable
*/
public String getISO3Language()
{
- if ("".equals(language))
+ if (language == "")
return "";
int index
= ("aa,ab,af,am,ar,as,ay,az,ba,be,bg,bh,bi,bn,bo,br,ca,co,cs,cy,da,"
@@ -472,7 +472,7 @@ public final class Locale implements Serializable, Cloneable
*/
public String getISO3Country()
{
- if ("".equals(country))
+ if (country == "")
return "";
int index
= ("AD,AE,AF,AG,AI,AL,AM,AN,AO,AQ,AR,AS,AT,AU,AW,AZ,BA,BB,BD,BE,BF,"
@@ -520,7 +520,7 @@ public final class Locale implements Serializable, Cloneable
* @return the language name of this locale localized to the default locale,
* with the ISO code as backup
*/
- public String getDisplayLanguage()
+ public final String getDisplayLanguage()
{
return getDisplayLanguage(defaultLocale);
}
@@ -558,7 +558,7 @@ public final class Locale implements Serializable, Cloneable
* @return the country name of this locale localized to the given locale,
* with the ISO code as backup
*/
- public String getDisplayCountry()
+ public final String getDisplayCountry()
{
return getDisplayCountry(defaultLocale);
}
@@ -596,7 +596,7 @@ public final class Locale implements Serializable, Cloneable
* @return the variant code of this locale localized to the given locale,
* with the ISO code as backup
*/
- public String getDisplayVariant()
+ public final String getDisplayVariant()
{
return getDisplayVariant(defaultLocale);
}
@@ -635,7 +635,7 @@ public final class Locale implements Serializable, Cloneable
*
* @return String version of this locale, suitable for display to the user
*/
- public String getDisplayName()
+ public final String getDisplayName()
{
return getDisplayName(defaultLocale);
}
@@ -723,12 +723,19 @@ public final class Locale implements Serializable, Cloneable
*/
public boolean equals(Object obj)
{
+ if (this == obj)
+ return true;
if (! (obj instanceof Locale))
return false;
Locale l = (Locale) obj;
- return (language.equals(l.language)
- && country.equals(l.country)
- && variant.equals(l.variant));
+
+ // ??? We might also want to add:
+ // hashCode() == l.hashCode()
+ // But this is a synchronized method. Is the overhead worth it?
+ // Measure this to make a decision.
+ return (language == l.language
+ && country == l.country
+ && variant == l.variant);
}
/**
diff --git a/libjava/java/util/PropertyResourceBundle.java b/libjava/java/util/PropertyResourceBundle.java
index a3173cf9eb7..7ebe2b1e6df 100644
--- a/libjava/java/util/PropertyResourceBundle.java
+++ b/libjava/java/util/PropertyResourceBundle.java
@@ -40,7 +40,6 @@ package java.util;
import java.io.IOException;
import java.io.InputStream;
-import gnu.java.util.DoubleEnumeration;
/**
* This class is a concrete <code>ResourceBundle</code> that gets it
diff --git a/libjava/java/util/SimpleTimeZone.java b/libjava/java/util/SimpleTimeZone.java
index c2e2560fc78..e777fbd456a 100644
--- a/libjava/java/util/SimpleTimeZone.java
+++ b/libjava/java/util/SimpleTimeZone.java
@@ -38,8 +38,6 @@ exception statement from your version. */
package java.util;
-import java.text.DateFormatSymbols;
-
/**
* This class represents a simple time zone offset and handles
* daylight savings. It can only handle one daylight savings rule, so
@@ -88,6 +86,7 @@ public class SimpleTimeZone extends TimeZone
private static final int DOW_IN_MONTH_MODE = 2;
private static final int DOW_GE_DOM_MODE = 3;
private static final int DOW_LE_DOM_MODE = 4;
+
/**
* The mode of the start rule. This takes one of the following values:
* <dl>
@@ -488,7 +487,8 @@ public class SimpleTimeZone extends TimeZone
/**
* Returns the time zone offset to GMT in milliseconds, ignoring
* day light savings.
- * @return the time zone offset. */
+ * @return the time zone offset.
+ */
public int getRawOffset()
{
return rawOffset;
@@ -508,7 +508,8 @@ public class SimpleTimeZone extends TimeZone
* milliseconds with respect to standard time. Typically this
* is one hour, but for some time zones this may be half an our.
* @return the daylight savings offset in milliseconds.
- * @since JDK1.1.4?
+ *
+ * @since JDK1.2
*/
public int getDSTSavings()
{
diff --git a/libjava/java/util/prefs/AbstractPreferences.java b/libjava/java/util/prefs/AbstractPreferences.java
index d192c1f6717..a6a3e9a82f2 100644
--- a/libjava/java/util/prefs/AbstractPreferences.java
+++ b/libjava/java/util/prefs/AbstractPreferences.java
@@ -35,17 +35,15 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.util.prefs;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.io.InputStream;
import java.io.OutputStream;
-
import java.util.Iterator;
import java.util.HashMap;
import java.util.TreeSet;
-
import gnu.java.util.prefs.NodeWriter;
/**
diff --git a/libjava/java/util/prefs/Preferences.java b/libjava/java/util/prefs/Preferences.java
index 8705b77191c..af2535966be 100644
--- a/libjava/java/util/prefs/Preferences.java
+++ b/libjava/java/util/prefs/Preferences.java
@@ -238,10 +238,10 @@ public abstract class Preferences {
* @exception SecurityException when a security manager is installed and
* the caller does not have <code>RuntimePermission("preferences")</code>.
*/
- public static Preferences systemNodeForPackage(Object o)
+ public static Preferences systemNodeForPackage(Class c)
throws SecurityException
{
- return nodeForPackage(o, systemRoot());
+ return nodeForPackage(c, systemRoot());
}
/**
@@ -257,10 +257,10 @@ public abstract class Preferences {
* @exception SecurityException when a security manager is installed and
* the caller does not have <code>RuntimePermission("preferences")</code>.
*/
- public static Preferences userNodeForPackage(Object o)
+ public static Preferences userNodeForPackage(Class c)
throws SecurityException
{
- return nodeForPackage(o, userRoot());
+ return nodeForPackage(c, userRoot());
}
/**
@@ -269,9 +269,9 @@ public abstract class Preferences {
* root it returns the correct Preference node for the package node name
* of the given object.
*/
- private static Preferences nodeForPackage(Object o, Preferences root) {
+ private static Preferences nodeForPackage(Class c, Preferences root) {
// Get the package path
- String className = o.getClass().getName();
+ String className = c.getName();
String packagePath;
int index = className.lastIndexOf('.');
if(index == -1) {
diff --git a/libjava/java/util/prefs/PreferencesFactory.java b/libjava/java/util/prefs/PreferencesFactory.java
index f43497894f1..9b2b4129356 100644
--- a/libjava/java/util/prefs/PreferencesFactory.java
+++ b/libjava/java/util/prefs/PreferencesFactory.java
@@ -35,9 +35,8 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-package java.util.prefs;
-import java.util.EventListener;
+package java.util.prefs;
/**
* Preferences system and user root factory interface. Defines how to get
diff --git a/libjava/java/util/zip/InflaterInputStream.java b/libjava/java/util/zip/InflaterInputStream.java
index b04534977f1..8ee88e5f11c 100644
--- a/libjava/java/util/zip/InflaterInputStream.java
+++ b/libjava/java/util/zip/InflaterInputStream.java
@@ -73,6 +73,10 @@ public class InflaterInputStream extends FilterInputStream
public InflaterInputStream (InputStream in, Inflater infl, int bufsize)
{
super (in);
+
+ if (in == null)
+ throw new NullPointerException();
+
this.inf = infl;
this.buf = new byte[bufsize];
}
diff --git a/libjava/java/util/zip/ZipEntry.java b/libjava/java/util/zip/ZipEntry.java
index 5284d793f6c..e2262812b9f 100644
--- a/libjava/java/util/zip/ZipEntry.java
+++ b/libjava/java/util/zip/ZipEntry.java
@@ -35,9 +35,10 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.util.zip;
+
import java.util.Calendar;
-import java.util.TimeZone;
import java.util.Date;
/**
diff --git a/libjava/java/util/zip/ZipFile.java b/libjava/java/util/zip/ZipFile.java
index 8f7ef6f8d6f..06238cea176 100644
--- a/libjava/java/util/zip/ZipFile.java
+++ b/libjava/java/util/zip/ZipFile.java
@@ -38,9 +38,7 @@ exception statement from your version. */
package java.util.zip;
import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
import java.io.DataInput;
-import java.io.DataInputStream;
import java.io.File;
import java.io.InputStream;
import java.io.IOException;
diff --git a/libjava/java/util/zip/ZipInputStream.java b/libjava/java/util/zip/ZipInputStream.java
index 2fba9f556dc..40ba8055b51 100644
--- a/libjava/java/util/zip/ZipInputStream.java
+++ b/libjava/java/util/zip/ZipInputStream.java
@@ -35,11 +35,12 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.util.zip;
+
import java.io.EOFException;
import java.io.InputStream;
import java.io.IOException;
-import java.util.Enumeration;
/**
* This is a FilterInputStream that reads the files in an zip archive
diff --git a/libjava/java/util/zip/ZipOutputStream.java b/libjava/java/util/zip/ZipOutputStream.java
index 44c4a9cc9b1..7d36e45214d 100644
--- a/libjava/java/util/zip/ZipOutputStream.java
+++ b/libjava/java/util/zip/ZipOutputStream.java
@@ -35,12 +35,13 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.util.zip;
-import java.io.OutputStream;
+
import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.Vector;
+import java.io.OutputStream;
import java.util.Enumeration;
+import java.util.Vector;
/**
* This is a FilterOutputStream that writes the files into a zip
diff --git a/libjava/javax/naming/CompositeName.java b/libjava/javax/naming/CompositeName.java
index 71cdaaf7ba9..e3559a911cf 100644
--- a/libjava/javax/naming/CompositeName.java
+++ b/libjava/javax/naming/CompositeName.java
@@ -52,6 +52,8 @@ import java.util.Vector;
*/
public class CompositeName implements Name, Cloneable, Serializable
{
+ private static final long serialVersionUID = 1667768148915813118L;
+
public CompositeName ()
{
elts = new Vector ();
diff --git a/libjava/javax/naming/CompoundName.java b/libjava/javax/naming/CompoundName.java
index 686a3a3d348..20b6cc51cb3 100644
--- a/libjava/javax/naming/CompoundName.java
+++ b/libjava/javax/naming/CompoundName.java
@@ -58,6 +58,8 @@ import java.util.Vector;
*/
public class CompoundName implements Name, Cloneable, Serializable
{
+ private static final long serialVersionUID = 3513100557083972036L;
+
private CompoundName (Properties syntax)
{
elts = new Vector ();
diff --git a/libjava/javax/naming/InitialContext.java b/libjava/javax/naming/InitialContext.java
index 705e24ad1eb..62837ab9ee5 100644
--- a/libjava/javax/naming/InitialContext.java
+++ b/libjava/javax/naming/InitialContext.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package javax.naming;
+import java.applet.Applet;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -46,8 +47,6 @@ import java.net.URL;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Properties;
-import java.applet.Applet;
-import java.util.Hashtable;
import javax.naming.spi.NamingManager;
public class InitialContext implements Context
@@ -57,22 +56,27 @@ public class InitialContext implements Context
protected Hashtable myProps;
public InitialContext (Hashtable environment)
+ throws NamingException
{
init (environment);
}
protected InitialContext (boolean lazy)
+ throws NamingException
{
if (! lazy)
init (null);
}
public InitialContext ()
+ throws NamingException
{
init (null);
}
-
+
+ /** @since 1.3 */
protected void init (Hashtable environment)
+ throws NamingException
{
// FIXME: Is this enough?
final String[] properties = {
diff --git a/libjava/javax/naming/LinkRef.java b/libjava/javax/naming/LinkRef.java
index a8a22adca8f..51b0f1bf771 100644
--- a/libjava/javax/naming/LinkRef.java
+++ b/libjava/javax/naming/LinkRef.java
@@ -46,6 +46,8 @@ import java.io.Serializable;
*/
public class LinkRef extends Reference
{
+ private static final long serialVersionUID = -5386290613498931298L;
+
public LinkRef (Name name)
{
this (name.toString ());
@@ -58,6 +60,7 @@ public class LinkRef extends Reference
}
public String getLinkName ()
+ throws NamingException
{
StringRefAddr sra = (StringRefAddr) get (0);
return (String) sra.getContent ();
diff --git a/libjava/javax/naming/NamingException.java b/libjava/javax/naming/NamingException.java
index 6c0f0172dc1..0cb2d5547cd 100644
--- a/libjava/javax/naming/NamingException.java
+++ b/libjava/javax/naming/NamingException.java
@@ -55,6 +55,7 @@ import java.io.PrintWriter;
*/
public class NamingException extends Exception
{
+ private static final long serialVersionUID = -1299181962103167177L;
/**
* The root cause of this exception. Might be null. Set by calling
diff --git a/libjava/javax/naming/NamingSecurityException.java b/libjava/javax/naming/NamingSecurityException.java
index 71d538a0b0e..5972f56b052 100644
--- a/libjava/javax/naming/NamingSecurityException.java
+++ b/libjava/javax/naming/NamingSecurityException.java
@@ -40,8 +40,10 @@ package javax.naming;
import java.lang.Exception;
-public class NamingSecurityException extends NamingException
+public abstract class NamingSecurityException extends NamingException
{
+ private static final long serialVersionUID = 5855287647294685775L;
+
public NamingSecurityException ()
{
super ();
diff --git a/libjava/javax/naming/ReferralException.java b/libjava/javax/naming/ReferralException.java
index 5becc6b3162..1be6c6649e4 100644
--- a/libjava/javax/naming/ReferralException.java
+++ b/libjava/javax/naming/ReferralException.java
@@ -48,6 +48,8 @@ import java.util.Hashtable;
public abstract class ReferralException extends NamingException
{
+ private static final long serialVersionUID = -2881363844695698876L;
+
protected ReferralException ()
{
super ();
diff --git a/libjava/javax/naming/StringRefAddr.java b/libjava/javax/naming/StringRefAddr.java
index 3859ec300dc..fbb57cbfe67 100644
--- a/libjava/javax/naming/StringRefAddr.java
+++ b/libjava/javax/naming/StringRefAddr.java
@@ -48,6 +48,7 @@ package javax.naming;
*/
public class StringRefAddr extends RefAddr
{
+ private static final long serialVersionUID = -8913762495138505527L;
/**
* The possibly null content of this RefAddr.
diff --git a/libjava/javax/naming/directory/BasicAttribute.java b/libjava/javax/naming/directory/BasicAttribute.java
index 6bf77f1712e..8065ae970e1 100644
--- a/libjava/javax/naming/directory/BasicAttribute.java
+++ b/libjava/javax/naming/directory/BasicAttribute.java
@@ -38,8 +38,11 @@ exception statement from your version. */
package javax.naming.directory;
-import javax.naming.*;
-import java.util.*;
+import java.util.NoSuchElementException;
+import java.util.Vector;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.OperationNotSupportedException;
/**
* @author Tom Tromey <tromey@redhat.com>
@@ -47,6 +50,8 @@ import java.util.*;
*/
public class BasicAttribute implements Attribute
{
+ private static final long serialVersionUID = 6743528196119291326L;
+
/** The ID of this attribute. */
protected String attrID;
/** True if this attribute's values are ordered. */
@@ -159,6 +164,7 @@ public class BasicAttribute implements Attribute
}
public Object get ()
+ throws NamingException
{
if (values.size () == 0)
throw new NoSuchElementException ("no values");
@@ -166,11 +172,13 @@ public class BasicAttribute implements Attribute
}
public Object get (int index)
+ throws NamingException
{
return values.get (index);
}
public NamingEnumeration getAll ()
+ throws NamingException
{
return new BasicAttributeEnumeration ();
}
diff --git a/libjava/javax/naming/directory/BasicAttributes.java b/libjava/javax/naming/directory/BasicAttributes.java
index 331a3c2a3e7..e9b4d073377 100644
--- a/libjava/javax/naming/directory/BasicAttributes.java
+++ b/libjava/javax/naming/directory/BasicAttributes.java
@@ -38,8 +38,10 @@ exception statement from your version. */
package javax.naming.directory;
-import javax.naming.*;
-import java.util.*;
+import java.util.NoSuchElementException;
+import java.util.Vector;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
/**
* @author Tom Tromey <tromey@redhat.com>
@@ -47,6 +49,8 @@ import java.util.*;
*/
public class BasicAttributes implements Attributes
{
+ private static final long serialVersionUID = 4980164073184639448L;
+
public BasicAttributes ()
{
this (false);
diff --git a/libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java b/libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java
index 93d9144232e..4d5161c3093 100644
--- a/libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java
+++ b/libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java
@@ -37,15 +37,17 @@ exception statement from your version. */
package javax.naming.ldap;
+
import java.util.EventObject;
/**
* @author Warren Levy <warrenl@redhat.com>
* @date June 5, 2001
*/
-
public class UnsolicitedNotificationEvent extends EventObject
{
+ private static final long serialVersionUID = -2382603380799883705L;
+
// Serialized fields.
private UnsolicitedNotification notice;
diff --git a/libjava/javax/security/auth/x500/X500Principal.java b/libjava/javax/security/auth/x500/X500Principal.java
index fc72e7b268e..036cab7f91a 100644
--- a/libjava/javax/security/auth/x500/X500Principal.java
+++ b/libjava/javax/security/auth/x500/X500Principal.java
@@ -55,6 +55,7 @@ import gnu.java.security.x509.X500DistinguishedName;
public final class X500Principal implements Principal, Serializable
{
+ private static final long serialVersionUID = -500463348111345721L;
// Constants and fields.
// ------------------------------------------------------------------------
diff --git a/libjava/javax/swing/JComponent.java b/libjava/javax/swing/JComponent.java
index 7cfa7435d7b..a0409a4fbfe 100644
--- a/libjava/javax/swing/JComponent.java
+++ b/libjava/javax/swing/JComponent.java
@@ -66,7 +66,6 @@ import java.util.Hashtable;
import javax.accessibility.Accessible;
import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleExtendedComponent;
-import javax.accessibility.AccessibleKeyBinding;
import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleStateSet;
import javax.swing.event.AncestorListener;
@@ -116,16 +115,6 @@ public abstract class JComponent extends Container implements Serializable
* AccessibleFocusHandler
*/
protected class AccessibleFocusHandler implements FocusListener {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
/**
* Constructor AccessibleFocusHandler
* @param component TODO
@@ -134,11 +123,6 @@ public abstract class JComponent extends Container implements Serializable
// TODO
} // AccessibleFocusHandler()
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
/**
* focusGained
* @param event TODO
@@ -154,24 +138,12 @@ public abstract class JComponent extends Container implements Serializable
public void focusLost(FocusEvent valevent) {
// TODO
} // focusLost()
-
-
} // AccessibleFocusHandler
/**
* AccessibleContainerHandler
*/
protected class AccessibleContainerHandler implements ContainerListener {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
/**
* Constructor AccessibleContainerHandler
* @param component TODO
@@ -180,11 +152,6 @@ public abstract class JComponent extends Container implements Serializable
// TODO
} // AccessibleContainerHandler()
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
/**
* componentAdded
* @param event TODO
@@ -200,15 +167,8 @@ public abstract class JComponent extends Container implements Serializable
public void componentRemoved(ContainerEvent valevent) {
// TODO
} // componentRemoved()
-
-
} // AccessibleContainerHandler
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
/**
* accessibleContainerHandler
*/
@@ -219,11 +179,6 @@ public abstract class JComponent extends Container implements Serializable
*/
protected FocusListener accessibleFocusHandler;
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
/**
* Constructor AccessibleJComponent
* @param component TODO
@@ -233,11 +188,6 @@ public abstract class JComponent extends Container implements Serializable
// TODO
} // AccessibleJComponent()
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
/**
* addPropertyChangeListener
* @param listener TODO
@@ -327,7 +277,6 @@ public abstract class JComponent extends Container implements Serializable
//updateUI(); // get a proper ui
}
-
// protected EventListenerList listenerList
public boolean contains(int x, int y)
{
@@ -335,14 +284,12 @@ public abstract class JComponent extends Container implements Serializable
return super.contains(x,y);
}
-
public void addNotify()
{
//Notification to this component that it now has a parent component.
super.addNotify();
}
-
Hashtable get_prop_hash()
{
if (prop_hash == null)
@@ -374,7 +321,6 @@ public abstract class JComponent extends Container implements Serializable
public void putClientProperty(Object key, Object value)
{ get_prop_hash().put(key, value); }
-
public void removeAncestorListener(AncestorListener listener)
{ get_ancestor_list().removeElement(listener); }
@@ -405,7 +351,6 @@ public abstract class JComponent extends Container implements Serializable
//super.computeVisibleRect(rect);
}
-
public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
{
//Reports a bound property change.
@@ -446,7 +391,6 @@ public abstract class JComponent extends Container implements Serializable
// Reports a bound property change.
}
-
protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue)
{
// Support for reporting constrained property changes.
@@ -658,16 +602,6 @@ public abstract class JComponent extends Container implements Serializable
}
}
-
-
- /*********************************************************************
- *
- *
- * tooltips:
- *
- *
- **************************************/
-
public JToolTip createToolTip()
{
if (tooltip == null)
@@ -687,15 +621,6 @@ public abstract class JComponent extends Container implements Serializable
public String getToolTipText(MouseEvent event)
{ return tool_tip_text; }
- /*********************************************************************
- *
- *
- * things to do with visibility:
- *
- *
- **************************************/
-
-
public Container getTopLevelAncestor()
{
// Returns the top-level ancestor of this component (either the containing Window or Applet), or null if this component has not been added to any container.
@@ -953,7 +878,6 @@ public abstract class JComponent extends Container implements Serializable
// If true this component will automatically scroll its contents when dragged, if contained in a component that supports scrolling, such as JViewport
}
-
public void setDebugGraphicsOptions(int debugOptions)
{
// Enables or disables diagnostic information about every graphics operation performed within the component or one of its children.
@@ -977,6 +901,7 @@ public abstract class JComponent extends Container implements Serializable
revalidate();
repaint();
}
+
public void setBackground(Color bg)
{
super.setBackground(bg);
@@ -1043,16 +968,6 @@ public abstract class JComponent extends Container implements Serializable
paint(g);
}
-
-
- /******************************************
- *
- *
- * UI management
- *
- *
- *********/
-
public String getUIClassID()
{
/// Return the UIDefaults key used to look up the name of the swing.
diff --git a/libjava/javax/swing/JInternalFrame.java b/libjava/javax/swing/JInternalFrame.java
index 55162393412..034050b6456 100644
--- a/libjava/javax/swing/JInternalFrame.java
+++ b/libjava/javax/swing/JInternalFrame.java
@@ -35,11 +35,27 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing;
-/**
- * STUBBED
- */
+
+import java.awt.Component;
+import java.awt.Container;
+import javax.accessibility.Accessible;
+
public class JInternalFrame extends JComponent
/*implements Accessible, WindowConstants, RootPaneContainer*/
{
+ private static final long serialVersionUID = -5425177187760785402L;
+
+ public static final String CONTENT_PANE_PROPERTY = "contentPane";
+ public static final String MENU_BAR_PROPERTY = "JMenuBar";
+ public static final String TITLE_PROPERTY = "title";
+ public static final String LAYERED_PANE_PROPERTY = "layeredPane";
+ public static final String ROOT_PANE_PROPERTY = "rootPane";
+ public static final String GLASS_PANE_PROPERTY = "glassPane";
+ public static final String FRAME_ICON_PROPERTY = "frameIcon";
+ public static final String IS_SELECTED_PROPERTY = "selected";
+ public static final String IS_CLOSED_PROPERTY = "closed";
+ public static final String IS_MAXIMUM_PROPERTY = "maximum";
+ public static final String IS_ICON_PROPERTY = "icon";
} // class JInternalFrame
diff --git a/libjava/javax/swing/JWindow.java b/libjava/javax/swing/JWindow.java
index 50d0c316895..5edf5b25412 100644
--- a/libjava/javax/swing/JWindow.java
+++ b/libjava/javax/swing/JWindow.java
@@ -1,5 +1,5 @@
/* JWindow.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -78,6 +78,11 @@ public class JWindow extends Window implements Accessible
*
*************/
+ public JWindow()
+ {
+ this(null);
+ }
+
// huuu ?
public JWindow(Frame f)
{
diff --git a/libjava/javax/swing/MenuSelectionManager.java b/libjava/javax/swing/MenuSelectionManager.java
index 4d635c0e81c..9088968538a 100644
--- a/libjava/javax/swing/MenuSelectionManager.java
+++ b/libjava/javax/swing/MenuSelectionManager.java
@@ -35,10 +35,42 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing;
-/**
- * STUBBED
- */
+
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.EventListenerList;
+
public class MenuSelectionManager
{
+ protected ChangeEvent changeEvent;
+
+ protected EventListenerList listenerList = new EventListenerList ();
+
+ protected void fireStateChanged ()
+ {
+ ChangeListener[] listeners = getChangeListeners ();
+
+ for (int i = 0; i < listeners.length; i++)
+ {
+ listeners [i].stateChanged (new ChangeEvent (this));
+ }
+ }
+
+ public void addChangeListener (ChangeListener listener)
+ {
+ listenerList.add (ChangeListener.class, listener);
+ }
+
+ public void removeChangeListener (ChangeListener listener)
+ {
+ listenerList.remove (ChangeListener.class, listener);
+ }
+
+ /** @since 1.4 */
+ public ChangeListener[] getChangeListeners ()
+ {
+ return (ChangeListener[]) listenerList.getListeners (ChangeListener.class);
+ }
} // class MenuSelectionManager
diff --git a/libjava/javax/swing/SwingUtilities.java b/libjava/javax/swing/SwingUtilities.java
index 974ee4f8d0e..a123ad83438 100644
--- a/libjava/javax/swing/SwingUtilities.java
+++ b/libjava/javax/swing/SwingUtilities.java
@@ -35,20 +35,34 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-package javax.swing;
-
-import java.awt.*;
+package javax.swing;
-public class SwingUtilities
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.EventQueue;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Toolkit;
+import java.awt.Window;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.lang.reflect.InvocationTargetException;
+import javax.accessibility.Accessible;
+import javax.accessibility.AccessibleStateSet;
+
+public class SwingUtilities implements SwingConstants
+{
+ public static FontMetrics getFontMetrics (Font font)
{
-
- public static FontMetrics getFontMetrics ( Font font ) {
return Toolkit.getDefaultToolkit().getFontMetrics(font);
}
-
- static JRootPane getRootPane(Component a)
+ public static JRootPane getRootPane (Component a)
{
if (a instanceof JRootPane)
return (JRootPane) a;
@@ -63,11 +77,11 @@ public class SwingUtilities
return null;
}
- static void updateComponentTreeUI(JFrame comp)
+ public static void updateComponentTreeUI(JFrame comp)
{
}
- static public String layoutCompoundLabel(JComponent c,
+ public static String layoutCompoundLabel(JComponent c,
FontMetrics fm,
String text,
Icon i,
diff --git a/libjava/javax/swing/Timer.java b/libjava/javax/swing/Timer.java
index 80eb13a1a44..89df756eee2 100644
--- a/libjava/javax/swing/Timer.java
+++ b/libjava/javax/swing/Timer.java
@@ -47,12 +47,13 @@ import javax.swing.event.EventListenerList;
public class Timer implements Serializable
{
+ protected EventListenerList listenerList = new EventListenerList();
+
int ticks;
static boolean verbose;
boolean running;
boolean repeat_ticks = true;
long interval, init_delay;
- Vector actions = new Vector();
class Waker extends Thread
{
@@ -86,23 +87,44 @@ public class Timer implements Serializable
public void addActionListener(ActionListener listener)
{
- actions.addElement(listener);
+ listenerList.add (ActionListener.class, listener);
}
+
public void removeActionListener(ActionListener listener)
{
- actions.removeElement(listener);
+ listenerList.remove (ActionListener.class, listener);
+ }
+
+ /**
+ * @since 1.3
+ */
+ public EventListener[] getListeners (Class listenerType)
+ {
+ return listenerList.getListeners (listenerType);
+ }
+
+ /**
+ * @since 1.4
+ */
+ public ActionListener[] getActionListeners ()
+ {
+ return (ActionListener[]) listenerList.getListeners (ActionListener.class);
}
- void fireActionPerformed()
+ protected void fireActionPerformed (ActionEvent event)
{
- for (int i=0;i<actions.size();i++)
+ ActionListener[] listeners = getActionListeners();
+
+ for (int i = 0; i < listeners.length; i++)
{
- ActionListener a = (ActionListener) actions.elementAt(i);
- a.actionPerformed(new ActionEvent(this, ticks, "Timer"));
+ listeners [i].actionPerformed (event);
}
}
-
+ void fireActionPerformed ()
+ {
+ fireActionPerformed (new ActionEvent (this, ticks, "Timer"));
+ }
public static void setLogTimers(boolean flag)
{
diff --git a/libjava/javax/swing/ToggleButtonModel.java b/libjava/javax/swing/ToggleButtonModel.java
index 0128258bd76..b268925d1b9 100644
--- a/libjava/javax/swing/ToggleButtonModel.java
+++ b/libjava/javax/swing/ToggleButtonModel.java
@@ -35,14 +35,10 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-package javax.swing;
-import java.util.*;
-import java.awt.event.*;
-import javax.swing.event.*;
+package javax.swing;
-public
-class ToggleButtonModel extends DefaultButtonModel
+public class ToggleButtonModel extends DefaultButtonModel
{
ToggleButtonModel(JComponent c)
{
diff --git a/libjava/javax/swing/UIManager.java b/libjava/javax/swing/UIManager.java
index 8c4f9cc4af7..556e8fffdf7 100644
--- a/libjava/javax/swing/UIManager.java
+++ b/libjava/javax/swing/UIManager.java
@@ -174,11 +174,21 @@ public class UIManager implements Serializable
System.out.println("UIManager.getDim");
return new Dimension(200,100);
}
- static Font getFont(Object key)
- // Returns a drawing font from the defaults table.
- {
- return (Font) getLookAndFeel().getDefaults().get(key);
- }
+
+
+ /**
+ * Retrieves a font from the defaults table of the current
+ * LookAndFeel.
+ *
+ * @param key an Object that specifies the font. Typically,
+ * this is a String such as
+ * <code>&quot;TitledBorder.font&quot;</code>.
+ */
+ public static Font getFont(Object key)
+ {
+ return (Font) getLookAndFeel().getDefaults().get(key);
+ }
+
static Icon getIcon(Object key)
// Returns an Icon from the defaults table.
{
@@ -207,11 +217,17 @@ public class UIManager implements Serializable
return look_and_feel;
}
- static UIDefaults getLookAndFeelDefaults()
- // Returns the default values for this look and feel.
- {
- return getLookAndFeel().getDefaults();
- }
+
+ /**
+ * Returns the <code>UIDefaults</code> table of the currently active
+ * look and feel.
+ */
+ public static UIDefaults getLookAndFeelDefaults()
+ {
+ return getLookAndFeel().getDefaults();
+ }
+
+
static String getString(Object key)
// Returns a string from the defaults table.
{
diff --git a/libjava/javax/swing/border/AbstractBorder.java b/libjava/javax/swing/border/AbstractBorder.java
index 663fb1130e0..9c1f06be7d1 100644
--- a/libjava/javax/swing/border/AbstractBorder.java
+++ b/libjava/javax/swing/border/AbstractBorder.java
@@ -91,15 +91,16 @@ public abstract class AbstractBorder
/**
- * Determines the insets of this border. The implementation provided
- * by AbstractButton returns Insets for a zero-width border, whose
- * <code>left</code>, <code>right</code>, <code>top</code> and
- * <code>bottom</code> fields are all zero.
+ * Measures the width of this border.
*
* @param c the component whose border is to be measured.
*
- * @return a newly created Insets object, indicating a zero-width
- * border.
+ * @return an Insets object whose <code>left</code>, <code>right</code>,
+ * <code>top</code> and <code>bottom</code> fields indicate the
+ * width of the border at the respective edge, which is zero
+ * for the default implementation provided by AbstractButton.
+ *
+ * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
*/
public Insets getBorderInsets (Component c)
{
@@ -113,12 +114,11 @@ public abstract class AbstractBorder
* <code>top</code> and <code>bottom</code> fields of the passed
* <code>insets</code> parameter to zero.
*
- * @param c the component in the center of this border.
+ * @param c the component whose border is to be measured.
*
- * @param insets an Insets object for holding the insets of this
- * border.
+ * @return the same object that was passed for <code>insets</code>.
*
- * @return the <code>insets</code> object.
+ * @see #getBorderInsets()
*/
public Insets getBorderInsets (Component c, Insets insets)
{
diff --git a/libjava/javax/swing/border/BevelBorder.java b/libjava/javax/swing/border/BevelBorder.java
index a681b16a303..87bf04a0c61 100644
--- a/libjava/javax/swing/border/BevelBorder.java
+++ b/libjava/javax/swing/border/BevelBorder.java
@@ -1,5 +1,5 @@
/* BevelBorder.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,51 +40,529 @@ package javax.swing.border;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
+import java.awt.Insets;
-public class BevelBorder extends AbstractBorder
+
+/**
+ * A rectangular, two pixel thick border that causes the enclosed area
+ * to appear as if it was raising out of or lowered into the screen. Some
+ * LookAndFeels use this kind of border for rectangular buttons.
+ *
+ * <p>A BevelBorder has a highlight and a shadow color. In the raised
+ * variant, the highlight color is used for the top and left edges,
+ * and the shadow color is used for the bottom and right edge. For an
+ * image, see the documentation of the individual constructors.
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public class BevelBorder
+ extends AbstractBorder
{
- public static final int LOWERED = 1;
+ /**
+ * Determined using the <code>serialver</code> tool
+ * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
+ */
+ static final long serialVersionUID = -1034942243356299676L;
+
+
+ /**
+ * Indicates that the BevelBorder looks like if the enclosed area was
+ * raising out of the screen.
+ */
public static final int RAISED = 0;
-
+
+
+ /**
+ * Indicates that the BevelBorder looks like if the enclosed area was
+ * pressed into the screen.
+ */
+ public static final int LOWERED = 1;
+
+
+ /**
+ * The type of this BevelBorder, which is either {@link #RAISED}
+ * or {@link #LOWERED}.
+ */
protected int bevelType;
+
+
+ /**
+ * The outer highlight color, or <code>null</code> to indicate that
+ * the color shall be derived from the background of the component
+ * whose border is being painted.
+ */
protected Color highlightOuter;
+
+
+ /**
+ * The inner highlight color, or <code>null</code> to indicate that
+ * the color shall be derived from the background of the component
+ * whose border is being painted.
+ */
protected Color highlightInner;
+
+
+ /**
+ * The outer shadow color, or <code>null</code> to indicate that the
+ * color shall be derived from the background of the component whose
+ * border is being painted.
+ */
protected Color shadowOuter;
+
+
+ /**
+ * The inner shadow color, or <code>null</code> to indicate that the
+ * color shall be derived from the background of the component whose
+ * border is being painted.
+ */
protected Color shadowInner;
- public BevelBorder (int bevelType)
+
+ /**
+ * Constructs a BevelBorder whose colors will be derived from the
+ * background of the enclosed component. The background color is
+ * retrieved each time the border is painted, so a BevelBorder
+ * constructed by this method will automatically reflect a change
+ * to the component&#x2019;s background color.
+ *
+ * <p><img src="BevelBorder-1.png" width="500" height="150"
+ * alt="[An illustration showing raised and lowered BevelBorders]" />
+ *
+ * @param bevelType the desired appearance of the border. The value
+ * must be either {@link #RAISED} or {@link #LOWERED}.
+ *
+ * @throws IllegalArgumentException if <code>bevelType</code> has
+ * an unsupported value.
+ */
+ public BevelBorder(int bevelType)
{
- this (bevelType, null, null, null, null);
+ if ((bevelType != RAISED) && (bevelType != LOWERED))
+ throw new IllegalArgumentException();
+
+ this.bevelType = bevelType;
}
+
+ /**
+ * Constructs a BevelBorder given its appearance type and two colors
+ * for its highlight and shadow.
+ *
+ * <p><img src="BevelBorder-2.png" width="500" height="150"
+ * alt="[An illustration showing BevelBorders that were constructed
+ * with this method]" />
+ *
+ * @param bevelType the desired appearance of the border. The value
+ * must be either {@link #RAISED} or {@link #LOWERED}.
+ *
+ * @param highlight the color that will be used for the inner
+ * side of the highlighted edges (top and left if
+ * if <code>bevelType</code> is {@link #RAISED}; bottom
+ * and right otherwise). The color for the outer side
+ * is a brightened version of this color.
+ *
+ * @param shadow the color that will be used for the outer
+ * side of the shadowed edges (bottom and right
+ * if <code>bevelType</code> is {@link #RAISED}; top
+ * and left otherwise). The color for the inner side
+ * is a brightened version of this color.
+ *
+ * @throws IllegalArgumentException if <code>bevelType</code> has
+ * an unsupported value.
+ *
+ * @throws NullPointerException if <code>highlight</code> or
+ * <code>shadow</code> is <code>null</code>.
+ *
+ * @see java.awt.Color.brighter()
+ */
public BevelBorder(int bevelType, Color highlight, Color shadow)
{
- this (bevelType, highlight, highlight, shadow, shadow);
+ this(bevelType,
+ /* highlightOuter */ highlight.brighter(),
+ /* highlightInner */ highlight,
+ /* shadowOuter */ shadow,
+ /* shadowInner */ shadow.brighter());
}
- public BevelBorder (int bevelType, Color highlightOuter,
- Color highlightInner, Color shadowOuter,
- Color shadowInner)
+
+ /**
+ * Constructs a BevelBorder given its appearance type and all
+ * colors.
+ *
+ * <p><img src="BevelBorder-3.png" width="500" height="150"
+ * alt="[An illustration showing BevelBorders that were constructed
+ * with this method]" />
+ *
+ * @param bevelType the desired appearance of the border. The value
+ * must be either {@link #RAISED} or {@link #LOWERED}.
+ *
+ * @param highlightOuter the color that will be used for the outer
+ * side of the highlighted edges (top and left if
+ * <code>bevelType</code> is {@link #RAISED}; bottom and
+ * right otherwise).
+ *
+ * @param highlightInner the color that will be used for the inner
+ * side of the highlighted edges.
+ *
+ * @param shadowOuter the color that will be used for the outer
+ * side of the shadowed edges (bottom and right
+ * if <code>bevelType</code> is {@link #RAISED}; top
+ * and left otherwise).
+ *
+ * @param shadowInner the color that will be used for the inner
+ * side of the shadowed edges.
+ *
+ * @throws IllegalArgumentException if <code>bevelType</code> has
+ * an unsupported value.
+ *
+ * @throws NullPointerException if one of the passed colors
+ * is <code>null</code>.
+ */
+ public BevelBorder(int bevelType,
+ Color highlightOuter, Color highlightInner,
+ Color shadowOuter, Color shadowInner)
{
- this.bevelType = bevelType;
+ this(bevelType); // checks the validity of bevelType
+
+ if ((highlightOuter == null) || (highlightInner == null)
+ || (shadowOuter == null) || (shadowInner == null))
+ throw new NullPointerException();
+
this.highlightOuter = highlightOuter;
this.highlightInner = highlightInner;
this.shadowOuter = shadowOuter;
this.shadowInner = shadowInner;
}
- public boolean isBorderOpaque()
+
+ /**
+ * Paints the border for a given component.
+ *
+ * @param c the component whose border is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ */
+ public void paintBorder(Component c, Graphics g,
+ int x, int y, int width, int height)
+ {
+ switch (bevelType)
+ {
+ case RAISED:
+ paintRaisedBevel(c, g, x, y, width, height);
+ break;
+
+ case LOWERED:
+ paintLoweredBevel(c, g, x, y, width, height);
+ break;
+ }
+ }
+
+
+ /**
+ * Measures the width of this border.
+ *
+ * @param c the component whose border is to be measured.
+ *
+ * @return an Insets object whose <code>left</code>, <code>right</code>,
+ * <code>top</code> and <code>bottom</code> fields indicate the
+ * width of the border at the respective edge.
+ *
+ * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
+ */
+ public Insets getBorderInsets(Component c)
+ {
+ return new Insets(2, 2, 2, 2);
+ }
+
+
+ /**
+ * Measures the width of this border, storing the results into a
+ * pre-existing Insets object.
+ *
+ * @param insets an Insets object for holding the result values.
+ * After invoking this method, the <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ *
+ * @return the same object that was passed for <code>insets</code>.
+ *
+ * @see #getBorderInsets()
+ */
+ public Insets getBorderInsets(Component c, Insets insets)
+ {
+ insets.left = insets.right = insets.top = insets.bottom = 2;
+ return insets;
+ }
+
+
+ /**
+ * Determines the color that will be used for the outer side of
+ * highlighted edges when painting the border. If a highlight color
+ * has been specified upon constructing the border, that color is
+ * returned. Otherwise, the inner highlight color is brightened.
+ *
+ * @param c the component enclosed by this border.
+ *
+ * @see #getHighlightInnerColor(java.awt.Component)
+ * @see java.awt.Color#brighter()
+ */
+ public Color getHighlightOuterColor(Component c)
+ {
+ if (highlightOuter != null)
+ return highlightOuter;
+ else
+ return getHighlightInnerColor(c).brighter();
+ }
+
+
+ /**
+ * Determines the color that will be used for the inner side of
+ * highlighted edges when painting the border. If a highlight color
+ * has been specified upon constructing the border, that color is
+ * returned. Otherwise, the background color of the enclosed
+ * component is brightened.
+ *
+ * @param c the component enclosed by this border.
+ *
+ * @see java.awt.Component#getBackground()
+ * @see java.awt.Color#brighter()
+ */
+ public Color getHighlightInnerColor(Component c)
+ {
+ if (highlightInner != null)
+ return highlightInner;
+ else
+ return c.getBackground().brighter();
+ }
+
+
+ /**
+ * Determines the color that will be used for the inner side of
+ * shadowed edges when painting the border. If a shadow color has
+ * been specified upon constructing the border, that color is
+ * returned. Otherwise, the background color of the enclosed
+ * component is darkened.
+ *
+ * @param c the component enclosed by this border.
+ *
+ * @see java.awt.Component#getBackground()
+ * @see java.awt.Color#darker()
+ */
+ public Color getShadowInnerColor(Component c)
+ {
+ if (shadowInner != null)
+ return shadowInner;
+ else
+ return c.getBackground().darker();
+ }
+
+
+ /**
+ * Determines the color that will be used for the outer side of
+ * shadowed edges when painting the border. If a shadow color
+ * has been specified upon constructing the border, that color is
+ * returned. Otherwise, the inner shadow color is darkened.
+ *
+ * @param c the component enclosed by this border.
+ *
+ * @see #getShadowInnerColor(java.awt.Component)
+ * @see java.awt.Color#darker()
+ */
+ public Color getShadowOuterColor(Component c)
+ {
+ if (shadowOuter != null)
+ return shadowOuter;
+ else
+ return getShadowInnerColor(c).darker();
+ }
+
+
+ /**
+ * Returns the color that will be used for the outer side of
+ * highlighted edges when painting the border, or <code>null</code>
+ * if that color will be derived from the background of the enclosed
+ * Component.
+ */
+ public Color getHighlightOuterColor()
+ {
+ return highlightOuter;
+ }
+
+
+ /**
+ * Returns the color that will be used for the inner side of
+ * highlighted edges when painting the border, or <code>null</code>
+ * if that color will be derived from the background of the enclosed
+ * Component.
+ */
+ public Color getHighlightInnerColor()
+ {
+ return highlightInner;
+ }
+
+
+ /**
+ * Returns the color that will be used for the inner side of
+ * shadowed edges when painting the border, or <code>null</code> if
+ * that color will be derived from the background of the enclosed
+ * Component.
+ */
+ public Color getShadowInnerColor()
+ {
+ return shadowInner;
+ }
+
+
+ /**
+ * Returns the color that will be used for the outer side of
+ * shadowed edges when painting the border, or <code>null</code> if
+ * that color will be derived from the background of the enclosed
+ * Component.
+ */
+ public Color getShadowOuterColor()
+ {
+ return shadowOuter;
+ }
+
+
+ /**
+ * Returns the appearance of this border, which is either {@link
+ * #RAISED} or {@link #LOWERED}.
+ */
+ public int getBevelType()
+ {
+ return bevelType;
+ }
+
+
+ /**
+ * Determines whether this border fills every pixel in its area
+ * when painting.
+ *
+ * <p>If the border colors are derived from the background color of
+ * the enclosed component, the result is <code>true</code> because
+ * the derivation method always returns opaque colors. Otherwise,
+ * the result depends on the opacity of the individual colors.
+ *
+ * @return <code>true</code> if the border is fully opaque, or
+ * <code>false</code> if some pixels of the background
+ * can shine through the border.
+ */
+ public boolean isBorderOpaque()
+ {
+ /* If the colors are to be drived from the enclosed Component's
+ * background color, the border is guaranteed to be fully opaque
+ * because Color.brighten() and Color.darken() always return an
+ * opaque color.
+ */
+ return
+ ((highlightOuter == null) || (highlightOuter.getAlpha() == 255))
+ && ((highlightInner == null) || (highlightInner.getAlpha() == 255))
+ && ((shadowInner == null) || (shadowInner.getAlpha() == 255))
+ && ((shadowOuter == null) ||(shadowOuter.getAlpha() == 255));
+ }
+
+
+ /**
+ * Paints a raised bevel border around a component.
+ *
+ * @param c the component whose border is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ */
+ protected void paintRaisedBevel(Component c, Graphics g,
+ int x, int y, int width, int height)
+ {
+ paintBevel(g, x, y, width, height,
+ getHighlightOuterColor(c), getHighlightInnerColor(c),
+ getShadowInnerColor(c), getShadowOuterColor(c));
+ }
+
+
+ /**
+ * Paints a lowered bevel border around a component.
+ *
+ * @param c the component whose border is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ */
+ protected void paintLoweredBevel(Component c, Graphics g,
+ int x, int y, int width, int height)
+ {
+ paintBevel(g, x, y, width, height,
+ getShadowInnerColor(c), getShadowOuterColor(c),
+ getHighlightInnerColor(c), getHighlightOuterColor(c));
+ }
+
+
+ /**
+ * Paints a two-pixel bevel in four colors.
+ *
+ * <pre>
+ * @@@@@@@@@@@@
+ * @..........# @ = color a
+ * @. X# . = color b
+ * @. X# X = color c
+ * @.XXXXXXXXX# # = color d
+ * ############</pre>
+ *
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ * @param a the color for the outer side of the top and left edges.
+ * @param b the color for the inner side of the top and left edges.
+ * @param c the color for the inner side of the bottom and right edges.
+ * @param d the color for the outer side of the bottom and right edges.
+ */
+ private static void paintBevel(Graphics g,
+ int x, int y, int width, int height,
+ Color a, Color b, Color c, Color d)
+ {
+ Color oldColor;
+
+ oldColor = g.getColor();
+ g.translate(x, y);
+ width = width - 1;
+ height = height - 1;
+
+ try
{
- return false;
+ /* To understand this code, it might be helpful to look at the
+ * images that are included with the JavaDoc. They are located
+ * in the "doc-files" subdirectory.
+ */
+ g.setColor(a);
+ g.drawLine(0, 0, width, 0); // a, horizontal
+ g.drawLine(0, 1, 0, height); // a, vertical
+
+ g.setColor(b);
+ g.drawLine(1, 1, width - 1, 1); // b, horizontal
+ g.drawLine(1, 2, 1, height - 1); // b, vertical
+
+ g.setColor(c);
+ g.drawLine(2, height - 1, width - 1, height - 1); // c, horizontal
+ g.drawLine(width - 1, 2, width - 1, height - 2); // c, vertical
+
+ g.setColor(d);
+ g.drawLine(1, height, width, height); // d, horizontal
+ g.drawLine(width, 1, width, height - 1); // d, vertical
}
-
- public void paintBorder(Component c,
- Graphics g,
- int x,
- int y,
- int width,
- int height)
+ finally
{
+ g.translate(-x, -y);
+ g.setColor(oldColor);
}
+ }
}
diff --git a/libjava/javax/swing/border/Border.java b/libjava/javax/swing/border/Border.java
index 307dbb6e368..1f2fb827e96 100644
--- a/libjava/javax/swing/border/Border.java
+++ b/libjava/javax/swing/border/Border.java
@@ -1,5 +1,5 @@
/* Border.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,10 +42,64 @@ import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
+
+/**
+ * An interface for decorative or spacing borders around a Component.
+ *
+ * <p>To reduce memory consumption, several Components may share a
+ * single Border instance. {@link javax.swing.BorderFactory} is a
+ * factory class for producing commonly used shared borders.
+ *
+ * @see javax.swing.BorderFactory
+ * @see EmptyBorder
+ * @see CompoundBorder
+ * @see BevelBorder
+ * @see EtchedBorder
+ * @see LineBorder
+ * @see MatteBorder
+ * @see SoftBevelBorder
+ * @see TitledBorder
+ * @see AbstractBorder
+ *
+ * @author Ronald Veldema (rveldema@cs.vu.nl)
+ * @author Michael Koch (konqueror@gmx.de)
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
public interface Border
{
- public Insets getBorderInsets (Component c);
- public boolean isBorderOpaque ();
- public void paintBorder (Component c, Graphics g, int x, int y,
- int width, int height);
+ /**
+ * Paints the border for a given component.
+ *
+ * @param c the component whose border is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ */
+ public void paintBorder(Component c, Graphics g,
+ int x, int y, int width, int height);
+
+
+ /**
+ * Measures the width of this border.
+ *
+ * @param c the component whose border is to be measured.
+ *
+ * @return an Insets object whose <code>left</code>, <code>right</code>,
+ * <code>top</code> and <code>bottom</code> fields indicate the
+ * width of the border at the respective edge.
+ */
+ public Insets getBorderInsets(Component c);
+
+
+ /**
+ * Determines whether this border fills every pixel in its area
+ * when painting.
+ *
+ * @return <code>true</code> if the border is fully opaque, or
+ * <code>false</code> if some pixels of the background
+ * can shine through the border.
+ */
+ public boolean isBorderOpaque();
}
diff --git a/libjava/javax/swing/border/CompoundBorder.java b/libjava/javax/swing/border/CompoundBorder.java
index 102a220e103..d75f4c0dca6 100644
--- a/libjava/javax/swing/border/CompoundBorder.java
+++ b/libjava/javax/swing/border/CompoundBorder.java
@@ -51,6 +51,10 @@ import java.awt.Insets;
public class CompoundBorder
extends AbstractBorder
{
+ /**
+ * Determined using the <code>serialver</code> tool
+ * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
+ */
static final long serialVersionUID = 9054540377030555103L;
@@ -90,14 +94,14 @@ public class CompoundBorder
* outside borders.
*
* @param outsideBorder the outside border, which is painted to the
- * outside of both <code>insideBorder</code> and the bordered
- * compoonent. It is acceptable to pass <code>null</code>, in
- * which no outside border is painted.
+ * outside of both <code>insideBorder</code> and the enclosed
+ * component. It is acceptable to pass <code>null</code>, in
+ * which case no outside border is painted.
*
* @param insideBorder the inside border, which is painted to
- * between <code>outsideBorder</code> and the bordered
+ * between <code>outsideBorder</code> and the enclosed
* component. It is acceptable to pass <code>null</code>, in
- * which no intside border is painted.
+ * which case no inside border is painted.
*/
public CompoundBorder (Border outsideBorder, Border insideBorder)
{
diff --git a/libjava/javax/swing/border/EmptyBorder.java b/libjava/javax/swing/border/EmptyBorder.java
index 16cb7935be9..6360063ffa4 100644
--- a/libjava/javax/swing/border/EmptyBorder.java
+++ b/libjava/javax/swing/border/EmptyBorder.java
@@ -1,5 +1,5 @@
/* EmptyBorder.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,47 +42,182 @@ import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
-public class EmptyBorder extends AbstractBorder
+
+/**
+ * A border for leaving a specifiable number of pixels empty around
+ * the enclosed component. An EmptyBorder requires some space on each
+ * edge, but does not perform any drawing.
+ *
+ * <p><img src="EmptyBorder-1.png" width="290" height="200"
+ * alt="[An illustration of EmptyBorder]" />
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public class EmptyBorder
+ extends AbstractBorder
{
+ /**
+ * Determined using the <code>serialver</code> tool
+ * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
+ */
+ static final long serialVersionUID = -8116076291731988694L;
+
+
+ /**
+ * The number of pixels required at the left edge.
+ */
protected int left;
+
+
+ /**
+ * The number of pixels required at the right edge.
+ */
protected int right;
- protected int bottom;
+
+
+ /**
+ * The number of pixels required at the top edge.
+ */
protected int top;
- public EmptyBorder (Insets borderInsets)
- {
- this (borderInsets.left, borderInsets.right,
- borderInsets.top, borderInsets.bottom);
- }
- public EmptyBorder (int left, int right, int top, int bottom)
+ /**
+ * The number of pixels required at the bottom edge.
+ */
+ protected int bottom;
+
+
+ /**
+ * Constructs an empty border given the number of pixels required
+ * on each side.
+ *
+ * @param top the number of pixels that the border will need
+ * for its top edge.
+ *
+ * @param left the number of pixels that the border will need
+ * for its left edge.
+ *
+ * @param bottom the number of pixels that the border will need
+ * for its bottom edge.
+ *
+ * @param right the number of pixels that the border will need
+ * for its right edge.
+ */
+ public EmptyBorder(int top, int left, int bottom, int right)
{
- this.left = left;
- this.right = right;
this.top = top;
+ this.left = left;
this.bottom = bottom;
+ this.right = right;
}
- public Insets getBorderInsets (Component c, Insets s)
+
+ /**
+ * Constructs an empty border given the number of pixels required
+ * on each side, passed in an Insets object.
+ *
+ * @param borderInsets the Insets for the new border.
+ */
+ public EmptyBorder(Insets borderInsets)
{
- if (s == null)
- s = new Insets (0,0,0,0);
-
- s.left = left;
- s.right = right;
- s.top = top;
- s.bottom = bottom;
- return s;
+ this(borderInsets.top, borderInsets.left,
+ borderInsets.bottom, borderInsets.right);
}
-
- public boolean isBorderOpaque ()
+
+
+ /**
+ * Performs nothing because an EmptyBorder does not paint any
+ * pixels. While the inherited implementation provided by
+ * {@link AbstractBorder#paintBorder} is a no-op as well,
+ * it is overwritten in order to match the API of the Sun
+ * reference implementation.
+ *
+ * @param c the component whose border is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ */
+ public void paintBorder(Component c, Graphics g,
+ int x, int y, int width, int height)
{
- return false;
}
- public void paintBorder (Component c, Graphics g, int x, int y,
- int width, int height)
+
+ /**
+ * Measures the width of this border.
+ *
+ * @param c the component whose border is to be measured.
+ *
+ * @return an Insets object whose <code>left</code>, <code>right</code>,
+ * <code>top</code> and <code>bottom</code> fields indicate the
+ * width of the border at the respective edge.
+ *
+ * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
+ */
+ public Insets getBorderInsets(Component c)
{
+ return getBorderInsets(c, null);
}
-}
+
+ /**
+ * Measures the width of this border, storing the results into a
+ * pre-existing Insets object.
+ *
+ * @param insets an Insets object for holding the result values.
+ * After invoking this method, the <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ *
+ * @return the same object that was passed for <code>insets</code>.
+ *
+ * @see #getBorderInsets()
+ */
+ public Insets getBorderInsets(Component c, Insets insets)
+ {
+ if (insets == null)
+ insets = new Insets(0, 0, 0, 0);
+
+ insets.left = left;
+ insets.right = right;
+ insets.top = top;
+ insets.bottom = bottom;
+ return insets;
+ }
+
+
+ /**
+ * Measures the width of this border.
+ *
+ * @return an Insets object whose <code>left</code>, <code>right</code>,
+ * <code>top</code> and <code>bottom</code> fields indicate the
+ * width of the border at the respective edge.
+ *
+ * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
+ */
+ public Insets getBorderInsets()
+ {
+ return getBorderInsets(null, null);
+ }
+
+
+ /**
+ * Determines whether this border fills every pixel in its area
+ * when painting. Since an empty border does not paint any pixels
+ * whatsoever, the result is <code>false</code>.
+ *
+ * @return <code>false</code>.
+ */
+ public boolean isBorderOpaque()
+ {
+ /* The inherited implementation of AbstractBorder.isBorderOpaque()
+ * would also return false. It is not clear why this is overriden
+ * in the Sun implementation, at least not from just reading the
+ * JavaDoc.
+ */
+ return false;
+ }
+}
diff --git a/libjava/javax/swing/border/EtchedBorder.java b/libjava/javax/swing/border/EtchedBorder.java
index 11421b5fd73..bb16ae925b1 100644
--- a/libjava/javax/swing/border/EtchedBorder.java
+++ b/libjava/javax/swing/border/EtchedBorder.java
@@ -1,5 +1,5 @@
/* EtchedBorder.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,50 +41,371 @@ package javax.swing.border;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
+import java.awt.Insets;
-public class EtchedBorder extends AbstractBorder
+
+/**
+ * A border that looks like an engraving etched into the background
+ * surface, or (in its raised variant) coming out of the surface
+ * plane. Using different constructors, it is possible to either
+ * explicitly specify the border colors, or to let the colors derive
+ * from the background color of the enclosed Component.
+ *
+ * <p><img src="EtchedBorder-1.png" width="500" height="200"
+ * alt="[An illustration of the two EtchedBorder variants]" />
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public class EtchedBorder
+ extends AbstractBorder
{
- public static final int LOWERED = 1;
+ /**
+ * Determined using the <code>serialver</code> tool
+ * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
+ */
+ static final long serialVersionUID = 4001244046866360638L;
+
+
+ /**
+ * Indicates that the border appears as coming out of the
+ * background.
+ */
public static final int RAISED = 0;
-
+
+
+ /**
+ * Indicates that the border appears as engraved into the
+ * background.
+ */
+ public static final int LOWERED = 1;
+
+
+ /**
+ * The type of this EtchedBorder, which is either {@link #RAISED}
+ * or {@link #LOWERED}.
+ */
protected int etchType;
+
+
+ /**
+ * The highlight color, or <code>null</code> to indicate that the
+ * color shall be derived from the background of the enclosed
+ * component.
+ */
protected Color highlight;
+
+
+ /**
+ * The shadow color, or <code>null</code> to indicate that the
+ * color shall be derived from the background of the enclosed
+ * component.
+ */
protected Color shadow;
- public EtchedBorder ()
+
+ /**
+ * Constructs a lowered EtchedBorder. The colors will be derived
+ * from the background color of the enclosed Component when the
+ * border gets painted.
+ */
+ public EtchedBorder()
{
- this (LOWERED, null, null);
+ this(LOWERED);
}
- public EtchedBorder (Color highlight, Color shadow)
+
+ /**
+ * Constructs an EtchedBorder with the specified appearance. The
+ * colors will be derived from the background color of the enclosed
+ * Component when the border gets painted.
+ *
+ * <p><img src="EtchedBorder-1.png" width="500" height="200"
+ * alt="[An illustration of the two EtchedBorder variants]" />
+ *
+ * @param etchType the desired appearance of the border. The value
+ * must be either {@link #RAISED} or {@link #LOWERED}.
+ *
+ * @throws IllegalArgumentException if <code>etchType</code> has
+ * an unsupported value.
+ */
+ public EtchedBorder(int etchType)
{
- this (LOWERED, highlight, shadow);
- }
+ if ((etchType != RAISED) && (etchType != LOWERED))
+ throw new IllegalArgumentException();
+
+ this.etchType = etchType;
- public EtchedBorder (int etchType)
+ /* The highlight and shadow fields already have a null value
+ * when the constructor gets called, so there is no need to
+ * assign a value here.
+ */
+ }
+
+
+ /**
+ * Constructs a lowered EtchedBorder, explicitly selecting the
+ * colors that will be used for highlight and shadow.
+ *
+ * @param highlight the color that will be used for painting
+ * the highlight part of the border.
+ *
+ * @param shadow the color that will be used for painting
+ * the shadow part of the border.
+ *
+ * @see #EtchedBorder(int, Color, Color)
+ */
+ public EtchedBorder(Color highlight, Color shadow)
{
- this (etchType, null, null);
+ this(LOWERED, highlight, shadow);
}
-
- public EtchedBorder (int etchType, Color highlight, Color shadow)
+
+
+ /**
+ * Constructs an EtchedBorder with the specified appearance,
+ * explicitly selecting the colors that will be used for
+ * highlight and shadow.
+ *
+ * <p><img src="EtchedBorder-2.png" width="500" height="200"
+ * alt="[An illustration that shows which pixels get painted
+ * in what color]" />
+ *
+ * @param etchType the desired appearance of the border. The value
+ * must be either {@link #RAISED} or {@link #LOWERED}.
+ *
+ * @param highlight the color that will be used for painting
+ * the highlight part of the border.
+ *
+ * @param shadow the color that will be used for painting
+ * the shadow part of the border.
+ *
+ * @throws IllegalArgumentException if <code>etchType</code> has
+ * an unsupported value.
+ */
+ public EtchedBorder(int etchType, Color highlight, Color shadow)
{
- this.etchType = etchType;
+ this(etchType); // Checks the validity of the value.
this.highlight = highlight;
this.shadow = shadow;
}
-
- public boolean isBorderOpaque()
+
+
+ /**
+ * Paints the border for a given component.
+ *
+ * @param c the component whose border is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ */
+ public void paintBorder(Component c, Graphics g,
+ int x, int y, int width, int height)
+ {
+ switch (etchType)
+ {
+ case RAISED:
+ paintEtchedBorder(g, x, y, width, height,
+ getHighlightColor(c), getShadowColor(c));
+ break;
+
+ case LOWERED:
+ paintEtchedBorder(g, x, y, width, height,
+ getShadowColor(c), getHighlightColor(c));
+ break;
+ }
+ }
+
+
+ /**
+ * Measures the width of this border.
+ *
+ * @param c the component whose border is to be measured.
+ *
+ * @return an Insets object whose <code>left</code>, <code>right</code>,
+ * <code>top</code> and <code>bottom</code> fields indicate the
+ * width of the border at the respective edge.
+ *
+ * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
+ */
+ public Insets getBorderInsets(Component c)
+ {
+ return new Insets(2, 2, 2, 2);
+ }
+
+
+ /**
+ * Measures the width of this border, storing the results into a
+ * pre-existing Insets object.
+ *
+ * @param insets an Insets object for holding the result values.
+ * After invoking this method, the <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ *
+ * @return the same object that was passed for <code>insets</code>.
+ *
+ * @see #getBorderInsets()
+ */
+ public Insets getBorderInsets(Component c, Insets insets)
+ {
+ insets.left = insets.right = insets.top = insets.bottom = 2;
+ return insets;
+ }
+
+
+ /**
+ * Determines whether this border fills every pixel in its area
+ * when painting.
+ *
+ * <p>If the border colors are derived from the background color of
+ * the enclosed component, the result is <code>true</code> because
+ * the derivation method always returns opaque colors. Otherwise,
+ * the result depends on the opacity of the individual colors.
+ *
+ * @return <code>true</code> if the border is fully opaque, or
+ * <code>false</code> if some pixels of the background
+ * can shine through the border.
+ */
+ public boolean isBorderOpaque()
+ {
+ /* If the colors are to be drived from the enclosed Component's
+ * background color, the border is guaranteed to be fully opaque
+ * because Color.brighten() and Color.darken() always return an
+ * opaque color.
+ */
+ return
+ ((highlight == null) || (highlight.getAlpha() == 255))
+ && ((shadow == null) || (shadow.getAlpha() == 255));
+ }
+
+
+ /**
+ * Returns the appearance of this EtchedBorder, which is either
+ * {@link #RAISED} or {@link #LOWERED}.
+ */
+ public int getEtchType()
+ {
+ return etchType;
+ }
+
+
+ /**
+ * Determines the color that will be used for highlighted parts when
+ * painting the border around a given component. If a highlight
+ * color has been specified upon constructing the border, that color
+ * is returned. Otherwise, the background color of the enclosed
+ * component is brightened.
+ *
+ * @param c the component enclosed by this border.
+ *
+ * @see java.awt.Component#getBackground()
+ * @see java.awt.Color#brighter()
+ */
+ public Color getHighlightColor(Component c)
+ {
+ if (highlight != null)
+ return highlight;
+ else
+ return c.getBackground().brighter();
+ }
+
+
+ /**
+ * Returns the color that will be used for highlighted parts when
+ * painting the border, or <code>null</code> if that color will be
+ * derived from the background of the enclosed Component.
+ */
+ public Color getHighlightColor()
+ {
+ return highlight;
+ }
+
+
+ /**
+ * Determines the color that will be used for shadowed parts when
+ * painting the border around a given component. If a shadow color
+ * has been specified upon constructing the border, that color is
+ * returned. Otherwise, the background color of the enclosed
+ * component is darkened.
+ *
+ * @param c the component enclosed by this border.
+ *
+ * @see java.awt.Component#getBackground()
+ * @see java.awt.Color#darker()
+ */
+ public Color getShadowColor(Component c)
+ {
+ if (shadow != null)
+ return shadow;
+ else
+ return c.getBackground().darker();
+ }
+
+
+ /**
+ * Returns the color that will be used for shadowed parts when
+ * painting the border, or <code>null</code> if that color will be
+ * derived from the background of the enclosed Component.
+ */
+ public Color getShadowColor()
+ {
+ return shadow;
+ }
+
+
+ /**
+ * Paints a two-pixel etching in two colors.
+ *
+ * <pre>
+ * @@@@@@@@@@@.
+ * @.........@. @ = color a
+ * @. @. . = color b
+ * @. @.
+ * @@@@@@@@@@@.
+ * ............</pre>
+ *
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ * @param a one of the two colors.
+ * @param b the second of the two colors.
+ */
+ private static void paintEtchedBorder(Graphics g,
+ int x, int y, int width, int height,
+ Color a, Color b)
+ {
+ Color oldColor;
+
+ oldColor = g.getColor();
+ g.translate(x, y);
+ width = width - 1;
+ height = height - 1;
+
+ try
{
- return false;
+ /* To understand this code, it might be helpful to look at the
+ * images that are included with the JavaDoc. They are located
+ * in the "doc-files" subdirectory. EtchedBorder-2.png might
+ * be especially informative.
+ */
+ g.setColor(a);
+ g.drawRect(0, 0, width - 1, height - 1);
+
+ g.setColor(b);
+ g.drawLine(1, 1, width - 2, 1); // top edge
+ g.drawLine(1, 2, 1, height - 2); // left edge
+ g.drawLine(0, height, width, height); // bottom edge
+ g.drawLine(width, 0, width, height - 1); // right edge
}
-
- public void paintBorder(Component c,
- Graphics g,
- int x,
- int y,
- int width,
- int height)
+ finally
{
+ g.translate(-x, -y);
+ g.setColor(oldColor);
}
+ }
}
diff --git a/libjava/javax/swing/border/LineBorder.java b/libjava/javax/swing/border/LineBorder.java
index b42bdf770a6..3c85c29dfdb 100644
--- a/libjava/javax/swing/border/LineBorder.java
+++ b/libjava/javax/swing/border/LineBorder.java
@@ -1,5 +1,5 @@
/* LineBorder.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,45 +41,303 @@ package javax.swing.border;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
+import java.awt.Insets;
-public class LineBorder extends AbstractBorder
+
+/**
+ * A border that consists of a line whose thickness and color can be
+ * specified. There also is a variant with rounded corners.
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public class LineBorder
+ extends AbstractBorder
{
+ /**
+ * Determined using the <code>serialver</code> tool
+ * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
+ */
+ static final long serialVersionUID = -787563427772288970L;
+
+
+ /**
+ * A shared instance of a black, one pixel thick, plain LineBorder.
+ * The singleton object is lazily created by {@link
+ * #createBlackLineBorder()} upon its first invocation.
+ */
+ private static LineBorder blackLineBorder;
+
+
+ /**
+ * A shared instance of a gray, one pixel thick, plain LineBorder.
+ * The singleton object is lazily created by {@link
+ * #createBlackGrayBorder()} upon its first invocation.
+ */
+ private static LineBorder grayLineBorder;
+
+
+ /**
+ * The width of the line in pixels.
+ */
+ protected int thickness;
+
+
+ /**
+ * The color of the line.
+ */
protected Color lineColor;
+
+
+ /**
+ * Indicates whether the line is drawn with rounded corners
+ * (<code>true</code>) or not ((<code>false</code>).
+ */
protected boolean roundedCorners;
- protected int thickness;
- public LineBorder (Color color)
+
+ /**
+ * Constructs a LineBorder given its color. The border will be one
+ * pixel thick and have plain corners.
+ *
+ * @param color the color for drawing the border.
+ *
+ * @see #LineBorder(java.awt.Color, int, boolean)
+ */
+ public LineBorder(Color color)
{
- this (color, 1);
+ this(color, /* thickness */ 1, /* roundedCorners */ false);
}
- public LineBorder (Color color, int thickness)
+
+ /**
+ * Constructs a LineBorder given its color and thickness. The
+ * border will have plain corners.
+ *
+ * @param color the color for drawing the border.
+ * @param thickness the width of the line in pixels.
+ *
+ * @see #LineBorder(java.awt.Color, int, boolean)
+ */
+ public LineBorder(Color color, int thickness)
{
- this (color, thickness, false); // FIXME: check roundedCorners argument
+ this (color, thickness, /* roundedCorners */ false);
}
-
+
+
/**
+ * Constructs a LineBorder given its color, thickness, and whether
+ * it has rounded corners.
+ *
+ * <p><img src="LineBorder-1.png" width="500" height="200"
+ * alt="[An illustration of two LineBorders] />
+ *
+ * <p>Note that the enlarged view in the right-hand picture shows
+ * that the implementation draws one more pixel than specified,
+ * provided that <code>roundedCorders</code> is <code>true</code>
+ * and anti-aliasing is turned on while painting. While this might
+ * be considered a bug, the Sun reference implementation (at least
+ * JDK 1.3.1 on Apple MacOS X 10.1.5) can be observed to fill
+ * exactly the same pixels as shown above. The GNU Classpath
+ * LineBorder replicates the observed behavior of the Sun
+ * implementation.
+ *
+ * @param color the color for drawing the border.
+ * @param thickness the width of the line in pixels.
+ * @param roundedCorners <code>true</code> for rounded corners,
+ * <code>false</code> for plain corners.
+ *
* @since 1.3
*/
- public LineBorder (Color color, int thickness, boolean roundedCorners)
+ // For the bug mentioned in the JavaDoc, please see also the comment
+ // in the paintBorder method below.
+ //
+ public LineBorder(Color color, int thickness, boolean roundedCorners)
{
+ if ((color == null) || (thickness < 0))
+ throw new IllegalArgumentException();
+
this.lineColor = color;
this.thickness = thickness;
this.roundedCorners = roundedCorners;
}
+
+
+ /**
+ * Returns a black, one pixel thick, plain LineBorder. The method
+ * may always return the same (singleton) LineBorder instance.
+ */
+ public static Border createBlackLineBorder()
+ {
+ /* Swing is not designed to be thread-safe, so there is no
+ * need to synchronize the access to the global variable.
+ */
+ if (blackLineBorder == null)
+ blackLineBorder = new LineBorder(Color.black);
- public boolean isBorderOpaque()
+ return blackLineBorder;
+ }
+
+
+ /**
+ * Returns a gray, one pixel thick, plain LineBorder. The method
+ * may always return the same (singleton) LineBorder instance.
+ */
+ public static Border createGrayLineBorder()
+ {
+ /* Swing is not designed to be thread-safe, so there is no
+ * need to synchronize the access to the global variable.
+ */
+ if (grayLineBorder == null)
+ grayLineBorder = new LineBorder(Color.gray);
+
+ return grayLineBorder;
+ }
+
+
+ /**
+ * Paints the line border around a given Component.
+ *
+ * @param c the component whose border is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ */
+ public void paintBorder(Component c, Graphics g,
+ int x, int y, int width, int height)
+ {
+ Color oldColor = g.getColor();
+
+ try
{
- return false;
+ g.setColor(lineColor);
+
+ /* If width and height were not adjusted, the border would
+ * appear one pixel too large in both directions.
+ */
+ width -= 1;
+ height -= 1;
+
+ /* Blurred, too large appearance
+ * -----------------------------
+ * While Java 2D has introduced line strokes of arbitrary width,
+ * it seems desirable to keep this code independent of Java 2D.
+ * Therefore, multiple nested rectangles (or rounded rectangles)
+ * are drawn in order to simulate a line whose thickness is
+ * greater than one pixel.
+ *
+ * This hack causes a blurred appearance when anti-aliasing is
+ * on. Interestingly enough, though, the Sun JDK 1.3.1 (at least
+ * on MacOS X 10.1.5) shows exactly the same appearance under
+ * this condition. It thus seems likely that Sun does the same
+ * hack for simulating thick lines. For this reason, the
+ * blurred appearance seems acceptable -- especially since GNU
+ * Classpath tries to be compatible with the Sun reference
+ * implementation.
+ */
+ for (int i = 0; i < thickness; i++)
+ {
+ if (roundedCorners)
+ g.drawRoundRect(x, y, width, height, thickness, thickness);
+ else
+ g.drawRect(x, y, width, height);
+
+ x += 1;
+ y += 1;
+ width -= 2;
+ height -= 2;
+ }
}
-
- public void paintBorder(Component c,
- Graphics g,
- int x,
- int y,
- int width,
- int height)
+ finally
{
+ g.setColor(oldColor);
}
+ }
+
+
+ /**
+ * Measures the width of this border.
+ *
+ * @param c the component whose border is to be measured.
+ *
+ * @return an Insets object whose <code>left</code>, <code>right</code>,
+ * <code>top</code> and <code>bottom</code> fields indicate the
+ * width of the border at the respective edge, which is the
+ * thickness of the line.
+ *
+ * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
+ */
+ public Insets getBorderInsets(Component c)
+ {
+ return new Insets(thickness, thickness, thickness, thickness);
+ }
+
+
+ /**
+ * Measures the width of this border, storing the results into a
+ * pre-existing Insets object.
+ *
+ * @param insets an Insets object for holding the result values.
+ * After invoking this method, the <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge, which is the thickness
+ * of the line.
+ *
+ * @return the same object that was passed for <code>insets</code>.
+ *
+ * @see #getBorderInsets()
+ */
+ public Insets getBorderInsets(Component c, Insets insets)
+ {
+ insets.left = insets.right = insets.top = insets.bottom = thickness;
+ return insets;
+ }
+
+
+ /**
+ * Returns the color of the line.
+ */
+ public Color getLineColor()
+ {
+ return lineColor;
+ }
+
+
+ /**
+ * Returns the thickness of the line in pixels.
+ */
+ public int getThickness()
+ {
+ return thickness;
+ }
+
+
+ /**
+ * Returns whether this LineBorder os drawm with rounded
+ * or with plain corners.
+ *
+ * @return <code>true</code> if the corners are rounded,
+ * <code>false</code> if the corners are plain.
+ */
+ public boolean getRoundedCorners()
+ {
+ return roundedCorners;
+ }
+
+
+ /**
+ * Determines whether this border fills every pixel in its area
+ * when painting.
+ *
+ * @return <code>true</code> if the corners are plain and the line
+ * color is fully opaque; <code>false</code> if the corners
+ * are rounded or the line color is partially transparent.
+ */
+ public boolean isBorderOpaque()
+ {
+ return (!roundedCorners) && (lineColor.getAlpha() == 255);
+ }
}
diff --git a/libjava/javax/swing/border/MatteBorder.java b/libjava/javax/swing/border/MatteBorder.java
index d3adfea44f3..1cc66f70a1f 100644
--- a/libjava/javax/swing/border/MatteBorder.java
+++ b/libjava/javax/swing/border/MatteBorder.java
@@ -1,5 +1,5 @@
/* MatteBorder.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,53 +44,361 @@ import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.Icon;
-public class MatteBorder extends EmptyBorder
+
+/**
+ * A border that is filled with either a solid color or with repeated
+ * icon tiles.
+ *
+ * <p><img src="MatteBorder-1.png" width="500" height="150"
+ * alt="[Two MatteBorders]" />
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public class MatteBorder
+ extends EmptyBorder
{
+ /**
+ * Determined using the <code>serialver</code> tool
+ * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
+ */
+ static final long serialVersionUID = 4422248989617298224L;
+
+
+ /**
+ * The color that is used for filling the border, or
+ * <code>null</code> if the border is filled with repetitions of a
+ * tile icon.
+ *
+ * @see #tileIcon
+ */
protected Color color;
+
+
+ /**
+ * The icon is used for filling the border with a tile, or
+ * <code>null</code> if the border is filled with a solid
+ * color.
+ *
+ * @see #color
+ */
protected Icon tileIcon;
-
- public MatteBorder (Icon tileIcon)
+
+
+ /**
+ * Constructs a MatteBorder given the width on each side
+ * and a fill color.
+ *
+ * <p><img src="MatteBorder-2.png" width="500" height="150"
+ * alt="[A picture of a MatteBorder made by this constructor]" />
+ *
+ * @param top the width of the border at its top edge.
+ * @param left the width of the border at its left edge.
+ * @param bottom the width of the border at its bottom edge.
+ * @param right the width of the border at its right edge.
+ * @param matteColor the color for filling the border.
+ */
+ public MatteBorder(int top, int left, int bottom, int right,
+ Color matteColor)
{
- // FIXME: implement this
- this (null, tileIcon);
+ super(top, left, bottom, right);
+
+ if (matteColor == null)
+ throw new IllegalArgumentException();
+
+ this.color = matteColor;
}
- public MatteBorder (Insets borderInsets, Color color)
+
+ /**
+ * Constructs a MatteBorder given its insets and fill color.
+ *
+ * <p><img src="MatteBorder-3.png" width="500" height="150"
+ * alt="[A picture of a MatteBorder made by this constructor]" />
+ *
+ * @param borderInsets an Insets object whose <code>top</code>,
+ * <code>left</code>, <code>bottom</code> and <code>right</code>
+ * fields indicate the with of the border at the respective
+ * edge.
+ *
+ * @param matteColor the color for filling the border.
+ */
+ public MatteBorder(Insets borderInsets, Color matteColor)
{
- this (borderInsets.top, borderInsets.left, borderInsets.bottom,
- borderInsets.right, color);
+ this(borderInsets.top, borderInsets.left,
+ borderInsets.bottom, borderInsets.right,
+ matteColor);
}
- public MatteBorder (Insets borderInsets, Icon tileIcon)
+
+ /**
+ * Constructs a MatteBorder given the width on each side
+ * and an icon for tiling the border area.
+ *
+ * <p><img src="MatteBorder-4.png" width="500" height="150"
+ * alt="[A picture of a MatteBorder made by this constructor]" />
+ *
+ * @param top the width of the border at its top edge.
+ * @param left the width of the border at its left edge.
+ * @param bottom the width of the border at its bottom edge.
+ * @param right the width of the border at its right edge.
+ * @param tileIcon an icon for tiling the border area.
+ */
+ public MatteBorder(int top, int left, int bottom, int right,
+ Icon tileIcon)
{
- this (borderInsets.top, borderInsets.left, borderInsets.bottom,
- borderInsets.right, tileIcon);
+ super(top, left, bottom, right);
+
+ if (tileIcon == null)
+ throw new IllegalArgumentException();
+
+ this.tileIcon = tileIcon;
}
- public MatteBorder (int top, int left, int bottom, int right, Icon tileIcon)
+
+ /**
+ * Constructs a MatteBorder given its insets and an icon
+ * for tiling the border area.
+ *
+ * <p><img src="MatteBorder-5.png" width="500" height="150"
+ * alt="[A picture of a MatteBorder made by this constructor]" />
+ *
+ * @param borderInsets an Insets object whose <code>top</code>,
+ * <code>left</code>, <code>bottom</code> and <code>right</code>
+ * fields indicate the with of the border at the respective
+ * edge.
+ *
+ * @param tileIcon an icon for tiling the border area.
+ */
+ public MatteBorder(Insets borderInsets, Icon tileIcon)
{
- super (top, left, bottom, right);
- this.tileIcon = tileIcon;
+ this(borderInsets.top, borderInsets.left,
+ borderInsets.bottom, borderInsets.right,
+ tileIcon);
+ }
+
+
+ /**
+ * Constructs a MatteBorder given an icon for tiling the
+ * border area. The icon width is used for the border insets
+ * at the left and right edge, the icon height for the top and
+ * bottom edge.
+ *
+ * <p><img src="MatteBorder-6.png" width="500" height="150"
+ * alt="[A picture of a MatteBorder made by this constructor]" />
+ *
+ * @param tileIcon an icon for tiling the border area.
+ */
+ public MatteBorder(Icon tileIcon)
+ {
+ this(-1, -1, -1, -1, tileIcon);
+ }
+
+
+ /**
+ * Paints the border for a given component.
+ *
+ * @param c the component whose border is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ */
+ public void paintBorder(Component c, Graphics g,
+ int x, int y, int width, int height)
+ {
+ Insets i = getBorderInsets();
+ paintEdge(c, g, x, y, width, i.top, 0, 0); // top edge
+ paintEdge(c, g, x, y + height - i.bottom, // bottom edge
+ width, i.bottom,
+ 0, height - i.bottom);
+ paintEdge(c, g, x, y + i.top, // left edge
+ i.left, height - i.top,
+ 0, i.top);
+ paintEdge(c, g, x + width - i.right, y + i.top, // right edge
+ i.right, height - i.bottom,
+ width - i.right, i.top);
}
+
+
+ /**
+ * Measures the width of this border.
+ *
+ * @param c the component whose border is to be measured.
+ *
+ * @return an Insets object whose <code>left</code>, <code>right</code>,
+ * <code>top</code> and <code>bottom</code> fields indicate the
+ * width of the border at the respective edge.
+ *
+ * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
+ */
+ public Insets getBorderInsets(Component c)
+ {
+ /* There is no obvious reason for overriding this method, but we
+ * try to have exactly the same API as the Sun reference
+ * implementation.
+ */
+ return this.getBorderInsets(c, null);
+ }
+
+
+ /**
+ * Measures the width of this border, storing the results into a
+ * pre-existing Insets object.
+ *
+ * @param insets an Insets object for holding the result values.
+ * After invoking this method, the <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ *
+ * @return the same object that was passed for <code>insets</code>.
+ *
+ * @see #getBorderInsets()
+ */
+ public Insets getBorderInsets(Component c, Insets insets)
+ {
+ if (insets == null)
+ insets = new Insets(0, 0, 0, 0);
+
+ if ((tileIcon != null)
+ && (top < 0) && (left < 0)
+ && (right < 0) && (bottom < 0))
+ {
+ insets.left = insets.right = tileIcon.getIconWidth();
+ insets.top = insets.bottom = tileIcon.getIconHeight();
+ return insets;
+ }
- public MatteBorder (int top, int left, int bottom, int right, Color color)
+ /* Copy top, left, bottom and right into the respective
+ * field of insets.
+ */
+ return super.getBorderInsets(c, insets);
+ }
+
+
+ /**
+ * Measures the width of this border.
+ *
+ * @return an Insets object whose <code>left</code>, <code>right</code>,
+ * <code>top</code> and <code>bottom</code> fields indicate the
+ * width of the border at the respective edge.
+ *
+ * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
+ */
+ public Insets getBorderInsets()
+ {
+ /* The inherited implementation of EmptyBorder.isBorderOpaque()
+ * would do the same. It is not clear why this is overriden in the
+ * Sun implementation, at least not from just reading the JavaDoc.
+ */
+ return this.getBorderInsets(null, null);
+ }
+
+
+ /**
+ * Returns the color that is used for filling the border, or
+ * <code>null</code> if the border is filled with repetitions of a
+ * tile icon.
+ */
+ public Color getMatteColor()
{
- super (top, left, bottom, right);
- this.color = color;
+ return color;
}
-
- public boolean isBorderOpaque()
+
+
+ /**
+ * Returns the icon is used for tiling the border, or
+ * <code>null</code> if the border is filled with a color instead of
+ * an icon.
+ */
+ public Icon getTileIcon()
+ {
+ return tileIcon;
+ }
+
+
+ /**
+ * Determines whether this border fills every pixel in its area
+ * when painting.
+ *
+ * @return <code>true</code> if the border is filled with an
+ * opaque color; <code>false</code> if it is filled with
+ * a semi-transparent color or with an icon.
+ */
+ public boolean isBorderOpaque()
+ {
+ return (color != null) && (color.getAlpha() == 255);
+ }
+
+
+ /**
+ * Paints a rectangular area of the border. This private helper
+ * method is called once for each of the border edges
+ * by {@link #paintBorder}.
+ *
+ * @param c the component whose border is being painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position of the rectangular area.
+ * @param y the vertical position of the rectangular area.
+ * @param width the width of the rectangular area.
+ * @param height the height of the rectangular area.
+ * @param dx the x displacement for repeating the tile.
+ * @param dy the y displacement for repeating the tile.
+ */
+ private void paintEdge(Component c, Graphics g,
+ int x, int y, int width, int height,
+ int dx, int dy)
+ {
+ Color oldColor;
+ int iconWidth, iconHeight;
+ Graphics clipped;
+
+ if ((width <= 0) || (height <= 0))
+ return;
+
+ /* Paint a colored rectangle if desired. */
+ if (color != null)
{
- return false;
+ oldColor = g.getColor();
+ try
+ {
+ g.setColor(color);
+ g.fillRect(x, y, width, height);
+ }
+ finally
+ {
+ g.setColor(oldColor);
+ }
+ return;
}
-
- public void paintBorder(Component c,
- Graphics g,
- int x,
- int y,
- int width,
- int height)
+
+ /* Determine the width and height of the icon. Some icons return
+ * -1 if it is an image whose dimensions have not yet been
+ * retrieved. There is not much we can do about this, but we
+ * should at least avoid entering the paint loop below
+ * with negative increments.
+ */
+ iconWidth = tileIcon.getIconWidth();
+ iconHeight = tileIcon.getIconHeight();
+ if ((iconWidth <= 0) || (iconHeight <= 0))
+ return;
+
+ dx = dx % iconWidth;
+ dy = dy % iconHeight;
+
+ clipped = g.create();
+ try
+ {
+ clipped.setClip(x, y, width, height);
+ for (int ty = y - dy; ty < y + height; ty += iconHeight)
+ for (int tx = x - dx; tx < x + width; tx += iconWidth)
+ tileIcon.paintIcon(c, clipped, tx, ty);
+ }
+ finally
{
+ clipped.dispose();
}
+ }
}
diff --git a/libjava/javax/swing/border/TitledBorder.java b/libjava/javax/swing/border/TitledBorder.java
index 2679ee68d3a..3b6a791630c 100644
--- a/libjava/javax/swing/border/TitledBorder.java
+++ b/libjava/javax/swing/border/TitledBorder.java
@@ -1,5 +1,5 @@
/* TitledBorder.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,104 +42,1114 @@ import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
+import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Insets;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import javax.swing.UIManager;
-public class TitledBorder extends AbstractBorder
+
+/**
+ * A border that paints a title on top of another border.
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public class TitledBorder
+ extends AbstractBorder
{
- public static final int ABOVE_BOTTOM = 4;
+ /**
+ * A value for the <code>titlePosition</code> property that vertically
+ * positions the title text at the default vertical position, which
+ * is in the middle of the top line of the border.
+ *
+ * @see #getTitlePosition()
+ * @see #setTitlePosition(int)
+ */
+ public static final int DEFAULT_POSITION = 0;
+
+
+ /**
+ * A value for the <code>titlePosition</code> property that vertically
+ * positions the title text above the top line of the border.
+ *
+ * @see #getTitlePosition()
+ * @see #setTitlePosition(int)
+ */
public static final int ABOVE_TOP = 1;
- public static final int BELOW_BOTTOM = 6;
+
+
+ /**
+ * A value for the <code>titlePosition</code> property that vertically
+ * positions the title text at the middle of the top line
+ * of the border.
+ *
+ * @see #getTitlePosition()
+ * @see #setTitlePosition(int)
+ */
+ public static final int TOP = 2;
+
+
+ /**
+ * A value for the <code>titlePosition</code> property that vertically
+ * positions the title text below the top line of the border.
+ *
+ * @see #getTitlePosition()
+ * @see #setTitlePosition(int)
+ */
public static final int BELOW_TOP = 3;
+
+
+ /**
+ * A value for the <code>titlePosition</code> property that vertically
+ * positions the title text above the bottom line of the border.
+ *
+ * @see #getTitlePosition()
+ * @see #setTitlePosition(int)
+ */
+ public static final int ABOVE_BOTTOM = 4;
+
+
+ /**
+ * A value for the <code>titlePosition</code> property that vertically
+ * positions the title text at the center of the bottom line
+ * of the border.
+ *
+ * @see #getTitlePosition()
+ * @see #setTitlePosition(int)
+ */
public static final int BOTTOM = 5;
- public static final int CENTER = 2;
+
+
+ /**
+ * A value for the <code>titlePosition</code> property that vertically
+ * positions the title text below the bottom line of the border.
+ *
+ * @see #getTitlePosition()
+ * @see #setTitlePosition(int)
+ */
+ public static final int BELOW_BOTTOM = 6;
+
+
+ /**
+ * A value for the <code>titleJustification</code> property that
+ * horizontally aligns the title text with either the left or the
+ * right edge of the border, depending on the orientation of the
+ * component nested into the border. If the component orientation
+ * is left-to-right, the title text is aligned with the left edge;
+ * otherwise, it is aligned with the right edge. This is the same
+ * behavior as with {@link #LEADING}.
+ *
+ * @see #getTitleJustification()
+ * @see #setTitleJustification(int)
+ * @see java.awt.ComponentOrientation#isLeftToRight()
+ */
public static final int DEFAULT_JUSTIFICATION = 0;
- public static final int DEFAULT_POSITION = 0;
- public static final int LEADING = 4;
+
+
+ /**
+ * A value for the <code>titleJustification</code> property that
+ * horizontally aligns the title text with the left-hand edge of
+ * the border.
+ *
+ * @see #getTitleJustification()
+ * @see #setTitleJustification(int)
+ */
public static final int LEFT = 1;
+
+
+ /**
+ * A value for the <code>titleJustification</code> property that
+ * horizontally aligns the title text with the center of the border.
+ *
+ * @see #getTitleJustification()
+ * @see #setTitleJustification(int)
+ */
+ public static final int CENTER = 2;
+
+
+ /**
+ * A value for the <code>titleJustification</code> property that
+ * horizontally aligns the title text with the right-hand edge of
+ * the border.
+ *
+ * @see #getTitleJustification()
+ * @see #setTitleJustification(int)
+ */
public static final int RIGHT = 3;
- public static final int TOP = 2;
+
+
+ /**
+ * A value for the <code>titleJustification</code> property that
+ * horizontally aligns the title text with either the left or the
+ * right edge of the border, depending on the orientation of the
+ * component nested into the border. If the component orientation
+ * is left-to-right, the title text is aligned with the left edge;
+ * otherwise, it is aligned with the right edge. This is the same
+ * behavior as with {@link #DEFAULT_JUSTIFICATION}.
+ *
+ * @see #getTitleJustification()
+ * @see #setTitleJustification(int)
+ * @see java.awt.ComponentOrientation#isLeftToRight()
+ */
+ public static final int LEADING = 4;
+
+
+ /**
+ * A value for the <code>titleJustification</code> property that
+ * horizontally aligns the title text with either the right or the
+ * left edge of the border, depending on the orientation of the
+ * component nested into the border. If the component orientation
+ * is left-to-right, the title text is aligned with the right edge;
+ * otherwise, it is aligned with the left edge.
+ *
+ * @see #getTitleJustification()
+ * @see #setTitleJustification(int)
+ * @see java.awt.ComponentOrientation#isLeftToRight()
+ */
public static final int TRAILING = 5;
+
+ /**
+ * The number of pixels between the inside of {@link #border}
+ * and the bordered component.
+ */
protected static final int EDGE_SPACING = 2;
+
+
+ /**
+ * The number of pixels between the outside of this TitledBorder
+ * and the beginning (if left-aligned) or end (if right-aligned)
+ * of the title text.
+ */
protected static final int TEXT_INSET_H = 5;
+
+
+ /**
+ * The number of pixels between the title text and {@link #border}.
+ * This value is only relevant if the title text does not intersect
+ * {@link #border}. No intersection occurs if {@link #titlePosition}
+ * is one of {@link #ABOVE_TOP}, {@link #BELOW_TOP}, {@link #ABOVE_BOTTOM},
+ * or {@link #BELOW_BOTTOM}.
+ */
protected static final int TEXT_SPACING = 2;
- protected Border border;
+
+ /**
+ * Determined using the <code>serialver</code> tool of Apple/Sun JDK 1.3.1
+ * on MacOS X 10.1.5.
+ */
+ static final long serialVersionUID = 8012999415147721601L;
+
+
+ /**
+ * The title, or <code>null</code> to display no title.
+ */
protected String title;
- protected Color titleColor;
- protected Font titleFont;
- protected int titleJustification;
- protected int titlePosition;
- private static Border defaultBorder = new LineBorder (Color.black);
- private static Font defaultFont = null;
- private static Color defaultColor = Color.black;
+
+ /**
+ * The border underneath the title. If this value is
+ * <code>null</code>, the border will be retrieved from the {@link
+ * javax.swing.UIManager}&#x2019;s defaults table using the key
+ * <code>&quot;TitledBorder.border&quot;</code>.
+ */
+ protected Border border;
+
- public TitledBorder (String title)
+ /**
+ * The vertical position of the title text relative to the border,
+ * which is one of {@link #ABOVE_TOP}, {@link #TOP}, {@link
+ * #BELOW_TOP}, {@link #ABOVE_BOTTOM}, {@link #BOTTOM}, {@link
+ * #BELOW_BOTTOM}, or {@link #DEFAULT_POSITION}.
+ */
+ protected int titlePosition;
+
+
+ /**
+ * The horizontal alignment of the title text in relation to the
+ * border, which is one of {@link #LEFT}, {@link #CENTER}, {@link
+ * #RIGHT}, {@link #LEADING}, {@link #TRAILING}, or {@link
+ * #DEFAULT_JUSTIFICATION}.
+ */
+ protected int titleJustification;
+
+
+ /**
+ * The font for displaying the title text. If this value is
+ * <code>null</code>, the font will be retrieved from the {@link
+ * javax.swing.UIManager}&#x2019;s defaults table using the key
+ * <code>&quot;TitledBorder.font&quot;</code>.
+ */
+ protected Font titleFont;
+
+
+ /**
+ * The color for displaying the title text. If this value is
+ * <code>null</code>, the color will be retrieved from the {@link
+ * javax.swing.UIManager}&#x2019;s defaults table using the key
+ * <code>&quot;TitledBorder.titleColor&quot;</code>.
+ */
+ protected Color titleColor;
+
+
+ /**
+ * Constructs a TitledBorder given the text of its title.
+ *
+ * @param title the title text, or <code>null</code> to use no title text.
+ */
+ public TitledBorder(String title)
{
- this (defaultBorder, title, DEFAULT_JUSTIFICATION, DEFAULT_POSITION,
- defaultFont, defaultColor);
+ this(/* border */ null,
+ title, DEFAULT_JUSTIFICATION, DEFAULT_POSITION,
+ /* titleFont */ null, /* titleColor */ null);
}
- public TitledBorder (Border border)
+
+ /**
+ * Constructs an initially untitled TitledBorder given another border.
+ *
+ * @param border the border underneath the title, or <code>null</code>
+ * to use a default from the current look and feel.
+ */
+ public TitledBorder(Border border)
{
- this (border, "", DEFAULT_JUSTIFICATION, DEFAULT_POSITION, defaultFont,
- defaultColor);
+ this(border, /* title */ "", DEFAULT_JUSTIFICATION, DEFAULT_POSITION,
+ /* titleFont */ null, /* titleColor */ null);
}
- public TitledBorder (Border border, String title)
+
+ /**
+ * Constructs a TitledBorder given its border and title text.
+ *
+ * @param border the border underneath the title, or <code>null</code>
+ * to use a default from the current look and feel.
+ *
+ * @param title the title text, or <code>null</code> to use no title
+ * text.
+ */
+ public TitledBorder(Border border, String title)
{
- this (border, title, DEFAULT_JUSTIFICATION, DEFAULT_POSITION, defaultFont,
- defaultColor);
+ this(border, title, DEFAULT_JUSTIFICATION, DEFAULT_POSITION,
+ /* titleFont */ null, /* titleColor */ null);
}
- public TitledBorder (Border border, String title, int titleJustification,
- int titlePosition)
+
+ /**
+ * Constructs a TitledBorder given its border, title text, horizontal
+ * alignment, and vertical position.
+ *
+ * @param border the border underneath the title, or <code>null</code>
+ * to use a default from the current look and feel.
+ *
+ * @param title the title text, or <code>null</code> to use no title
+ * text.
+ *
+ * @param titleJustification the horizontal alignment of the title
+ * text in relation to the border. The value must be one of
+ * {@link #LEFT}, {@link #CENTER}, {@link #RIGHT}, {@link #LEADING},
+ * {@link #TRAILING}, or {@link #DEFAULT_JUSTIFICATION}.
+
+ * @param titlePosition the vertical position of the title text
+ * in relation to the border. The value must be one of
+ * {@link #ABOVE_TOP}, {@link #TOP}, {@link #BELOW_TOP},
+ * {@link #ABOVE_BOTTOM}, {@link #BOTTOM}, {@link #BELOW_BOTTOM},
+ * or {@link #DEFAULT_POSITION}.
+ *
+ * @throws IllegalArgumentException if <code>titleJustification</code>
+ * or <code>titlePosition</code> have an unsupported value.
+ */
+ public TitledBorder(Border border, String title, int titleJustification,
+ int titlePosition)
{
- this (border, title, titleJustification, titlePosition, defaultFont,
- defaultColor);
+ this(border, title, titleJustification, titlePosition,
+ /* titleFont */ null, /* titleColor */ null);
}
- public TitledBorder (Border border, String title, int titleJustification,
- int titlePosition, Font titleFont)
+
+ /**
+ * Constructs a TitledBorder given its border, title text, horizontal
+ * alignment, vertical position, and font.
+ *
+ * @param border the border underneath the title, or <code>null</code>
+ * to use a default from the current look and feel.
+ *
+ * @param title the title text, or <code>null</code> to use no title
+ * text.
+ *
+ * @param titleJustification the horizontal alignment of the title
+ * text in relation to the border. The value must be one of
+ * {@link #LEFT}, {@link #CENTER}, {@link #RIGHT}, {@link #LEADING},
+ * {@link #TRAILING}, or {@link #DEFAULT_JUSTIFICATION}.
+ *
+ * @param titlePosition the vertical position of the title text
+ * in relation to the border. The value must be one of
+ * {@link #ABOVE_TOP}, {@link #TOP}, {@link #BELOW_TOP},
+ * {@link #ABOVE_BOTTOM}, {@link #BOTTOM}, {@link #BELOW_BOTTOM},
+ * or {@link #DEFAULT_POSITION}.
+ *
+ * @param titleFont the font for the title text, or <code>null</code>
+ * to use a default from the current look and feel.
+ *
+ * @throws IllegalArgumentException if <code>titleJustification</code>
+ * or <code>titlePosition</code> have an unsupported value.
+ */
+ public TitledBorder(Border border, String title, int titleJustification,
+ int titlePosition, Font titleFont)
{
- this (border, title, titleJustification, titlePosition, titleFont,
- defaultColor);
+ this(border, title, titleJustification, titlePosition, titleFont,
+ /* titleColor */ null);
}
- public TitledBorder (Border border, String title, int titleJustification,
- int titlePosition, Font titleFont, Color titleColor)
+
+ /**
+ * Constructs a TitledBorder given its border, title text, horizontal
+ * alignment, vertical position, font, and color.
+ *
+ * @param border the border underneath the title, or <code>null</code>
+ * to use a default from the current look and feel.
+ *
+ * @param title the title text, or <code>null</code> to use no title
+ * text.
+ *
+ * @param titleJustification the horizontal alignment of the title
+ * text in relation to the border. The value must be one of
+ * {@link #LEFT}, {@link #CENTER}, {@link #RIGHT}, {@link #LEADING},
+ * {@link #TRAILING}, or {@link #DEFAULT_JUSTIFICATION}.
+ *
+ * @param titlePosition the vertical position of the title text
+ * in relation to the border. The value must be one of
+ * {@link #ABOVE_TOP}, {@link #TOP}, {@link #BELOW_TOP},
+ * {@link #ABOVE_BOTTOM}, {@link #BOTTOM}, {@link #BELOW_BOTTOM},
+ * or {@link #DEFAULT_POSITION}.
+ *
+ * @param titleFont the font for the title text, or <code>null</code>
+ * to use a default from the current look and feel.
+ *
+ * @param titleColor the color for the title text, or <code>null</code>
+ * to use a default from the current look and feel.
+ *
+ * @throws IllegalArgumentException if <code>titleJustification</code>
+ * or <code>titlePosition</code> have an unsupported value.
+ */
+ public TitledBorder(Border border, String title, int titleJustification,
+ int titlePosition, Font titleFont, Color titleColor)
{
this.border = border;
this.title = title;
- this.titleJustification = titleJustification;
+
+ /* Invoking the setter methods ensures that the newly constructed
+ * TitledBorder has valid property values.
+ */
+ setTitleJustification(titleJustification);
+ setTitlePosition(titlePosition);
+
+ this.titleFont = titleFont;
+ this.titleColor = titleColor;
+ }
+
+
+ /**
+ * Paints the border and the title text.
+ *
+ * @param c the component whose border is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ */
+ public void paintBorder(Component c, Graphics g,
+ int x, int y, int width, int height)
+ {
+ Measurements mes = getMeasurements(c);
+ Font oldFont = g.getFont();
+ Color oldColor = g.getColor();
+
+ /**
+ * A local helper class for painting the border without changing
+ * any pixels inside the rectangle of the title text.
+ */
+ class BorderPainter
+ {
+ private Component c;
+ private Border b;
+ private int x, y, width, height;
+
+ /**
+ * Constructs a BorderPainter.
+ *
+ * @param c the component whose border is being painted.
+ * @param b the border object.
+ * @param x the x coordinate of the rectangle delimiting the border.
+ * @param y the y coordinate of the rectangle delimiting the border.
+ * @param width the width of the rectangle delimiting the border.
+ * @param height the width of the rectangle delimiting the border.
+ */
+ public BorderPainter(Component c, Border b,
+ int x, int y, int width, int height)
+ {
+ this.c = c;
+ this.b = b;
+ this.x = x;
+ this.y = y;
+ this.width = width;
+ this.height = height;
+ }
+
+
+ /**
+ * Paints the entire border.
+ */
+ public void paint(Graphics g)
+ {
+ if (b != null)
+ b.paintBorder(c, g, x, y, width - 1, height - 1);
+ }
+
+
+ /**
+ * Paints the border, clipping the drawing operation to a
+ * given rectangular area.
+ */
+ private void paint(Graphics g,
+ int clipX, int clipY, int clipWidth, int clipHeight)
+ {
+ Shape oldClip = g.getClip();
+ try
+ {
+ g.clipRect(clipX, clipY, clipWidth, clipHeight);
+ paint(g);
+ }
+ finally
+ {
+ g.setClip(oldClip);
+ }
+ }
+
+
+ /**
+ * Paints the border without affecting a given rectangular area.
+ * This is used for painting the border without drawing anything
+ * underneath the title text.
+ *
+ * <p>Since we do not want to introduce unnecessary dependencies
+ * on Java 2D, we perform the clipping without constructive geometry
+ * (provided by java.awt.geom.Area). Instead, the border&#x2019;s
+ * bounding rectangle is split into smaller parts, which are then
+ * clipped and painted individually.:
+ *
+ * <p><pre>
+ * +--------------------+ +--------------------+
+ * | | | 1 |
+ * | +--------+ | +---+--------+-------+
+ * | | hole | | |====> | 2 | hole | 3 |
+ * | +--------+ | |---+--------+-------+
+ * | | | 4 |
+ * +--------------------+ +--------------------+</pre>
+ *
+ */
+ public void paintExcept(Graphics g,
+ int holeX, int holeY, int holeWidth, int holeHeight)
+ {
+ int stripeHeight;
+
+ stripeHeight = holeY - y;
+ if (stripeHeight > 0)
+ paint(g, x, y, width, stripeHeight); // patch #1 in the image above
+
+ stripeHeight = holeHeight;
+ if (stripeHeight > 0)
+ {
+ paint(g, x, holeY, holeX - x, stripeHeight); // patches #2 and #3
+ paint(g, holeX + holeWidth, holeY, width - (holeX + holeWidth), stripeHeight);
+ }
+
+ stripeHeight = height - (holeY - y + holeHeight);
+ if (stripeHeight > 0)
+ paint(g, x, y + height - stripeHeight, width, stripeHeight); // #4
+ }
+ };
+
+ BorderPainter bp;
+ int textX, textY, borderWidth, borderHeight;
+
+ borderWidth = width - (mes.borderSpacing.left + mes.borderSpacing.right);
+ borderHeight = height - (mes.borderSpacing.top + mes.borderSpacing.bottom);
+ bp = new BorderPainter(c, getBorder(),
+ x + mes.borderSpacing.left, y + mes.borderSpacing.top,
+ borderWidth, borderHeight);
+
+ switch (getRealTitleJustification(c))
+ {
+ case LEFT:
+ textX = x + TEXT_INSET_H;
+ break;
+
+ case CENTER:
+ textX = x + (borderWidth - mes.textWidth) / 2;
+ break;
+
+ case RIGHT:
+ textX = x + borderWidth - (mes.textWidth + TEXT_INSET_H);
+ break;
+
+ default:
+ throw new IllegalStateException();
+ }
+
+ switch (titlePosition)
+ {
+ case ABOVE_TOP:
+ textY = y;
+ break;
+
+ case TOP:
+ case DEFAULT_POSITION:
+ default:
+ textY = y + mes.borderSpacing.top + mes.borderInsets.top - mes.textAscent;
+ break;
+
+ case BELOW_TOP:
+ textY = y + mes.borderSpacing.top + mes.borderInsets.top + TEXT_SPACING;
+ break;
+
+ case ABOVE_BOTTOM:
+ textY = y + height - mes.borderSpacing.bottom - mes.borderInsets.bottom
+ - TEXT_SPACING - (mes.textAscent + mes.textDescent);
+ break;
+
+ case BOTTOM:
+ case BELOW_BOTTOM:
+ textY = y + height - (mes.textAscent + mes.textDescent);
+ break;
+ }
+
+ if (mes.trimmedText == null)
+ bp.paint(g);
+ else
+ {
+ try
+ {
+ g.setFont(mes.font);
+ g.setColor(getTitleColor());
+ g.drawString(mes.trimmedText, textX, textY + mes.textAscent);
+ }
+ finally
+ {
+ g.setFont(oldFont);
+ g.setColor(oldColor);
+ }
+ bp.paintExcept(g, textX - 2, textY,
+ mes.textWidth + 2, mes.textAscent + mes.textDescent);
+ }
+ }
+
+
+ /**
+ * Measures the width of this border.
+ *
+ * @param c the component whose border is to be measured.
+ *
+ * @return an Insets object whose <code>left</code>, <code>right</code>,
+ * <code>top</code> and <code>bottom</code> fields indicate the
+ * width of the border at the respective edge.
+ *
+ * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
+ */
+ public Insets getBorderInsets(Component c)
+ {
+ return getBorderInsets(c, new Insets(0, 0, 0, 0));
+ }
+
+
+ /**
+ * Measures the width of this border, storing the results into a
+ * pre-existing Insets object.
+ *
+ * @param insets an Insets object for holding the result values.
+ * After invoking this method, the <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ *
+ * @return the same object that was passed for <code>insets</code>.
+ *
+ * @see #getBorderInsets()
+ */
+ public Insets getBorderInsets(Component c, Insets insets)
+ {
+ return getMeasurements(c).getContentInsets(insets);
+ }
+
+
+ /**
+ * Returns <code>false</code>, indicating that there are pixels inside
+ * the area of this border where the background shines through.
+ *
+ * @return <code>false</code>.
+ */
+ public boolean isBorderOpaque()
+ {
+ /* Note that the AbstractBorder.isBorderOpaque would also return
+ * false, so there is actually no need to override the inherited
+ * implementation. However, GNU Classpath strives for exact
+ * compatibility with the Sun reference implementation, which
+ * overrides isBorderOpaque for unknown reasons.
+ */
+ return false;
+ }
+
+
+ /**
+ * Returns the text of the title.
+ *
+ * @return the title text, or <code>null</code> if no title is
+ * displayed.
+ */
+ public String getTitle()
+ {
+ return title;
+ }
+
+
+ /**
+ * Retrieves the border underneath the title. If no border has been
+ * set, or if it has been set to<code>null</code>, the current
+ * {@link javax.swing.LookAndFeel} will be asked for a border
+ * using the key <code>&quot;TitledBorder.border&quot;</code>.
+ *
+ * @return a border, or <code>null</code> if the current LookAndFeel
+ * does not provide a border for the key
+ * <code>&quot;TitledBorder.border&quot;</code>.
+ *
+ * @see javax.swing.UIManager#getBorder(Object)
+ */
+ public Border getBorder()
+ {
+ if (border != null)
+ return border;
+
+ return UIManager.getBorder("TitledBorder.border");
+ }
+
+
+ /**
+ * Returns the vertical position of the title text in relation
+ * to the border.
+ *
+ * @return one of the values {@link #ABOVE_TOP}, {@link #TOP},
+ * {@link #BELOW_TOP}, {@link #ABOVE_BOTTOM}, {@link #BOTTOM},
+ * {@link #BELOW_BOTTOM}, or {@link #DEFAULT_POSITION}.
+ */
+ public int getTitlePosition()
+ {
+ return titlePosition;
+ }
+
+
+ /**
+ * Returns the horizontal alignment of the title text in relation to
+ * the border.
+ *
+ * @return one of the values {@link #LEFT}, {@link #CENTER}, {@link
+ * #RIGHT}, {@link #LEADING}, {@link #TRAILING}, or {@link
+ * #DEFAULT_JUSTIFICATION}.
+ */
+ public int getTitleJustification()
+ {
+ return titleJustification;
+ }
+
+
+ /**
+ * Retrieves the font for displaying the title text. If no font has
+ * been set, or if it has been set to<code>null</code>, the current
+ * {@link javax.swing.LookAndFeel} will be asked for a font
+ * using the key <code>&quot;TitledBorder.font&quot;</code>.
+ *
+ * @return a font, or <code>null</code> if the current LookAndFeel
+ * does not provide a font for the key
+ * <code>&quot;TitledBorder.font&quot;</code>.
+ *
+ * @see javax.swing.UIManager#getFont(Object)
+ */
+ public Font getTitleFont()
+ {
+ if (titleFont != null)
+ return titleFont;
+
+ return UIManager.getFont("TitledBorder.font");
+ }
+
+
+ /**
+ * Retrieves the color for displaying the title text. If no color has
+ * been set, or if it has been set to<code>null</code>, the current
+ * {@link javax.swing.LookAndFeel} will be asked for a color
+ * using the key <code>&quot;TitledBorder.titleColor&quot;</code>.
+ *
+ * @return a color, or <code>null</code> if the current LookAndFeel
+ * does not provide a color for the key
+ * <code>&quot;TitledBorder.titleColor&quot;</code>.
+ *
+ * @see javax.swing.UIManager#getColor(Object)
+ */
+ public Color getTitleColor()
+ {
+ if (titleColor != null)
+ return titleColor;
+
+ return UIManager.getColor("TitledBorder.titleColor");
+ }
+
+
+ /**
+ * Sets the text of the title.
+ *
+ * @param title the new title text, or <code>null</code> for displaying
+ * no text at all.
+ */
+ public void setTitle(String title)
+ {
+ // Swing borders are not JavaBeans, thus no need to fire an event.
+ this.title = title;
+ }
+
+
+ /**
+ * Sets the border underneath the title.
+ *
+ * @param border a border, or <code>null</code> to use the
+ * border that is supplied by the current LookAndFeel.
+ *
+ * @see #getBorder()
+ */
+ public void setBorder(Border border)
+ {
+ // Swing borders are not JavaBeans, thus no need to fire an event.
+ this.border = border;
+ }
+
+
+ /**
+ * Sets the vertical position of the title text in relation
+ * to the border.
+ *
+ * @param titlePosition one of the values {@link #ABOVE_TOP},
+ * {@link #TOP}, {@link #BELOW_TOP}, {@link #ABOVE_BOTTOM},
+ * {@link #BOTTOM}, {@link #BELOW_BOTTOM},
+ * or {@link #DEFAULT_POSITION}.
+ *
+ * @throws IllegalArgumentException if an unsupported value is passed
+ * for <code>titlePosition</code>.
+ */
+ public void setTitlePosition(int titlePosition)
+ {
+ if ((titlePosition < DEFAULT_POSITION) || (titlePosition > BELOW_BOTTOM))
+ throw new IllegalArgumentException();
+
+ // Swing borders are not JavaBeans, thus no need to fire an event.
this.titlePosition = titlePosition;
+ }
+
+
+ /**
+ * Sets the horizontal alignment of the title text in relation to the border.
+ *
+ * @param titleJustification the new alignment, which must be one of
+ * {@link #LEFT}, {@link #CENTER}, {@link #RIGHT}, {@link #LEADING},
+ * {@link #TRAILING}, or {@link #DEFAULT_JUSTIFICATION}.
+ *
+ * @throws IllegalArgumentException if an unsupported value is passed
+ * for <code>titleJustification</code>.
+ */
+ public void setTitleJustification(int titleJustification)
+ {
+ if ((titleJustification < DEFAULT_JUSTIFICATION)
+ || (titleJustification > TRAILING))
+ throw new IllegalArgumentException();
+
+ // Swing borders are not JavaBeans, thus no need to fire an event.
+ this.titleJustification = titleJustification;
+ }
+
+
+ /**
+ * Sets the font for displaying the title text.
+ *
+ * @param titleFont the font, or <code>null</code> to use the font
+ * provided by the current {@link javax.swing.LookAndFeel}.
+ *
+ * @see #getTitleFont()
+ */
+ public void setTitleFont(Font titleFont)
+ {
+ // Swing borders are not JavaBeans, thus no need to fire an event.
this.titleFont = titleFont;
+ }
+
+
+ /**
+ * Sets the color for displaying the title text.
+ *
+ * @param titleColor the color, or <code>null</code> to use the color
+ * provided by the current {@link javax.swing.LookAndFeel}.
+ *
+ * @see #getTitleColor()
+ */
+ public void setTitleColor(Color titleColor)
+ {
+ // Swing borders are not JavaBeans, thus no need to fire an event.
this.titleColor = titleColor;
}
-
- public Insets getBorderInsets(Component c,
- Insets s)
+
+
+ /**
+ * Calculates the minimum size needed for displaying the border
+ * and its title.
+ *
+ * @param c the Component for which this TitledBorder consitutes
+ * a border.
+ */
+ public Dimension getMinimumSize(Component c)
+ {
+ return getMeasurements(c).getMinimumSize();
+ }
+
+
+ /**
+ * Returns the font that is used for displaying the title text for
+ * a given Component.
+ *
+ * @param c the Component for which this TitledBorder is the border.
+ *
+ * @return The font returned by {@link #getTitleFont()}, or a fallback
+ * if {@link #getTitleFont()} returned <code>null</code>.
+ */
+ protected Font getFont(Component c)
+ {
+ Font f;
+
+ f = getTitleFont();
+ if (f != null)
+ return f;
+
+ return new Font("Dialog", Font.PLAIN, 12);
+ }
+
+
+ /**
+ * Returns the horizontal alignment of the title text in relation to
+ * the border, mapping the component-dependent alignment constants
+ * {@link #LEADING}, {@link #TRAILING} and {@link #DEFAULT_JUSTIFICATION}
+ * to the correct value according to the embedded component&#x2019;s
+ * orientation.
+ *
+ * @param c the Component for which this TitledBorder is the border.
+ *
+ * @return one of the values {@link #LEFT}, {@link #CENTER}, or {@link
+ * #RIGHT}.
+ */
+ private int getRealTitleJustification(Component c)
+ {
+ switch (titleJustification)
+ {
+ case DEFAULT_JUSTIFICATION:
+ case LEADING:
+ if ((c == null) || c.getComponentOrientation().isLeftToRight())
+ return LEFT;
+ else
+ return RIGHT;
+
+ case TRAILING:
+ if ((c == null) || c.getComponentOrientation().isLeftToRight())
+ return RIGHT;
+ else
+ return LEFT;
+
+ default:
+ return titleJustification;
+ }
+ }
+
+
+ /**
+ * Performs various measurements for the current state of this TitledBorder
+ * and the given Component.
+ */
+ private Measurements getMeasurements(Component c)
+ {
+ Measurements m = new Measurements();
+ FontMetrics fmet;
+
+ m.font = getFont(c);
+ fmet = c.getFontMetrics(m.font);
+ m.border = getBorder();
+ if (m.border != null)
+ m.borderInsets = m.border.getBorderInsets(c);
+ else
+ m.borderInsets = new Insets(0, 0, 0, 0);
+
+ if (title != null)
{
- s.left = s.right = s.top = s.bottom = 5;
- return s;
+ m.trimmedText = title.trim();
+ if (m.trimmedText.length() == 0)
+ m.trimmedText = null;
}
+ m.textAscent = fmet.getAscent();
+ m.textDescent = fmet.getDescent();
+ if (m.trimmedText != null)
+ m.textWidth = fmet.stringWidth(m.trimmedText) + 3;
+
+ m.edgeSpacing = new Insets(EDGE_SPACING, EDGE_SPACING, EDGE_SPACING, EDGE_SPACING);
+ m.borderSpacing = new Insets(0, 0, 0, 0);
+
+ switch (titlePosition)
+ {
+ case ABOVE_TOP:
+ m.borderSpacing.top += m.textAscent + m.textDescent + TEXT_SPACING;
+ break;
+
+ case BELOW_TOP:
+ m.edgeSpacing.top += m.textAscent + m.textDescent + TEXT_SPACING;
+ break;
+
+ case ABOVE_BOTTOM:
+ m.edgeSpacing.bottom += m.textAscent + m.textDescent + TEXT_SPACING;
+ break;
+
+ case BOTTOM:
+ m.edgeSpacing.bottom += Math.max(m.textAscent - m.borderInsets.bottom, 0);
+ m.borderSpacing.bottom += m.textDescent;
+ break;
+
+ case BELOW_BOTTOM:
+ m.borderSpacing.bottom += m.textAscent + m.textDescent + TEXT_SPACING;
+ break;
+
+ default:
+ m.borderSpacing.top += m.textAscent;
+ }
+
+ return m;
+ }
+
+
+ /**
+ * A private helper class for holding the result of measuring the
+ * distances of a TitledBorder. While it would be possible to cache
+ * these objects, it does not seem to be worth the effort. Note that
+ * invalidating the cache would be tricky, especially since there is
+ * no notification mechanism that would inform the cache when
+ * border has changed, so it would return different insets.
+ */
+ private static class Measurements
+ {
+ /**
+ * The font used for displaying the title text. Note that it can
+ * well be that the TitledBorder&#x2019;s font is <code>null</code>,
+ * which means that the font is to be retrieved from the current
+ * LookAndFeel. In this case, this <code>font</code> field will
+ * contain the result of the retrieval. Therefore, it is safe
+ * to assume that his <code>font</code> field will never have
+ * a <code>null</code> value.
+ */
+ Font font;
+
+
+ /**
+ * The number of pixels between the base line and the top of the
+ * text box.
+ */
+ int textAscent;
+
+
+ /**
+ * The number of pixels between the base line and the bottom of
+ * the text box.
+ */
+ int textDescent;
+
+
+ /**
+ * The title text after removing leading and trailing white space
+ * characters. If the title consists only of white space, the
+ * value of <code>trimmedText</code> will be <code>null</code>.
+ */
+ String trimmedText;
+
+
+ /**
+ * The width of the trimmed title text in pixels.
+ */
+ int textWidth;
+
+
+ /**
+ * The border that constitues the &quot;interior&quot; border
+ * underneath the title text.
+ */
+ Border border;
+
+
+ /**
+ * The distance between the TitledBorder and the interior border.
+ */
+ Insets borderSpacing;
+
+ /**
+ * The width of the interior border, as returned by
+ * <code>border.getBorderInsets()</code>.
+ */
+ Insets borderInsets;
+
- public boolean isBorderOpaque()
+ /**
+ * The distance between the interior border and the nested
+ * Component for which this TitledBorder is a border.
+ */
+ Insets edgeSpacing;
+
+
+ /**
+ * Determines the insets of the nested component when it has a
+ * TitledBorder as its border. Used by {@link
+ * TitledBorder#getBorderInsets()}.
+ *
+ * @param i an Insets object for storing the results into, or
+ * <code>null</code> to cause the creation of a
+ * new instance.
+ *
+ * @return the <code>i</code> object, or a new Insets object
+ * if <code>null</code> was passed for <code>i</code>.
+ */
+ public Insets getContentInsets(Insets i)
{
- return false;
+ if (i == null)
+ i = new Insets(0, 0, 0, 0);
+ i.left = borderSpacing.left + borderInsets.left + edgeSpacing.left;
+ i.right = borderSpacing.right + borderInsets.right + edgeSpacing.right;
+ i.top = borderSpacing.top + borderInsets.top + edgeSpacing.top;
+ i.bottom = borderSpacing.bottom + borderInsets.bottom + edgeSpacing.bottom;
+ return i;
}
-
- public void paintBorder(Component c,
- Graphics g,
- int x,
- int y,
- int width,
- int height)
+
+
+ /**
+ * Calculates the minimum size needed for displaying the border
+ * and its title. Used by {@link TitledBorder#getMiminumSize()}.
+ */
+ public Dimension getMinimumSize()
{
+ int width;
+ Insets insets;
+
+ insets = getContentInsets(null);
+ width = Math.max(insets.left + insets.right, textWidth + 2 * TEXT_INSET_H);
+ return new Dimension(width, insets.top + insets.bottom);
}
+ }
}
-
diff --git a/libjava/javax/swing/event/AncestorEvent.java b/libjava/javax/swing/event/AncestorEvent.java
index 0c86badc764..c6173932bb9 100644
--- a/libjava/javax/swing/event/AncestorEvent.java
+++ b/libjava/javax/swing/event/AncestorEvent.java
@@ -43,99 +43,57 @@ import java.awt.Container;
import javax.swing.JComponent;
/**
- * Ancestor Event
* @author Andrew Selkirk
* @author Ronald Veldema
*/
-public class AncestorEvent extends AWTEvent {
-
- //-------------------------------------------------------------
- // Constants --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * ANCESTOR_ADDED constant
- */
- public static int ANCESTOR_ADDED = 0;
-
- /**
- * ANCESTOR_MOVED constant
- */
- public static int ANCESTOR_MOVED = 1;
-
- /**
- * ANCESTOR_REMOVED constant
- */
- public static int ANCESTOR_REMOVED = 2;
-
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Source component
- */
- private JComponent sourceComponent = null;
-
- /**
- * Ancestor
- */
- private Container ancestor = null;
-
- /**
- * Ancestor Parent
- */
- private Container ancestorParent = null;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor AncestorEvent
- * @param source Source component
- * @param id ID
- * @param ancestor ancestor
- * @param ancestorParent parent ancestor
- */
- public AncestorEvent(JComponent source, int id, Container ancestor,
- Container ancestorParent) {
- super(source, id);
- this.sourceComponent = source;
- this.ancestor = ancestor;
- this.ancestorParent = ancestorParent;
- } // AncestorEvent()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Get ancestor
- * @return ancestor
- */
- public Container getAncestor() {
- return ancestor;
- } // getAncestor()
-
- /**
- * Get ancestor parent
- * @return ancestor parent
- */
- public Container getAncestorParent() {
- return ancestorParent;
- } // getAncestorParent()
-
- /**
- * Get component
- * @return component
- */
- public JComponent getComponent() {
- return sourceComponent;
- } // getComponent()
-
-
-} // AncestorEvent
+public class AncestorEvent extends AWTEvent
+{
+ private static final long serialVersionUID = -8079801679695605002L;
+
+ public static final int ANCESTOR_ADDED = 0;
+ public static final int ANCESTOR_MOVED = 1;
+ public static final int ANCESTOR_REMOVED = 2;
+
+ private JComponent sourceComponent;
+ private Container ancestor;
+ private Container ancestorParent;
+
+ /**
+ * @param source Source component
+ * @param id ID
+ * @param ancestor ancestor
+ * @param ancestorParent parent ancestor
+ */
+ public AncestorEvent(JComponent source, int id, Container ancestor,
+ Container ancestorParent)
+ {
+ super(source, id);
+ this.sourceComponent = source;
+ this.ancestor = ancestor;
+ this.ancestorParent = ancestorParent;
+ }
+
+ /**
+ * Returns the ancestor of this event.
+ */
+ public Container getAncestor()
+ {
+ return ancestor;
+ }
+
+ /**
+ * Returns the ancester parent of this event.
+ */
+ public Container getAncestorParent()
+ {
+ return ancestorParent;
+ }
+
+ /**
+ * Returns the source of this event.
+ */
+ public JComponent getComponent()
+ {
+ return sourceComponent;
+ }
+}
diff --git a/libjava/javax/swing/event/HyperlinkEvent.java b/libjava/javax/swing/event/HyperlinkEvent.java
index 26ccaa81c50..c979fbf62da 100644
--- a/libjava/javax/swing/event/HyperlinkEvent.java
+++ b/libjava/javax/swing/event/HyperlinkEvent.java
@@ -43,155 +43,119 @@ import java.util.EventObject;
import javax.swing.text.Element;
/**
- * HyperlinkEvent
* @author Andrew Selkirk
* @author Ronald Veldema
*/
public class HyperlinkEvent extends EventObject
{
-
- //-------------------------------------------------------------
- // Classes ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * EventType
- */
- public static final class EventType {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * ENTERED
- */
- public static final EventType ENTERED = new EventType("ENTERED"); // TODO
-
- /**
- * EXITED
- */
- public static final EventType EXITED = new EventType("EXITED"); // TODO
-
- /**
- * ACTIVATED
- */
- public static final EventType ACTIVATED = new EventType("ACTIVATED"); // TODO
-
- /**
- * type
- */
- private String type;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor EventType
- * @param type TODO
- */
- private EventType(String type) {
- this.type = type;
- } // EventType()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * toString
- * @returns String
- */
- public String toString() {
- return type; // TODO
- } // toString()
-
-
- } // EventType
-
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * type
- */
- private EventType type;
-
- /**
- * url
- */
- private URL url;
-
- /**
- * description
- */
- private String description;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor HyperlinkEvent
- * @param source TODO
- * @param type TODO
- * @param url TODO
- */
- public HyperlinkEvent(Object source, EventType type, URL url) {
- super(source);
- this.type = type;
- this.url = url;
- this.description = null;
- } // HyperlinkEvent()
-
- /**
- * Constructor HyperlinkEvent
- * @param source TODO
- * @param type TODO
- * @param url TODO
- * @param description TODO
- */
- public HyperlinkEvent(Object source, EventType type, URL url, String description) {
- super(source);
- this.type = type;
- this.url = url;
- this.description = null;
- } // HyperlinkEvent()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getURL
- * @returns URL
- */
- public URL getURL() {
- return url;
- } // getURL()
-
- /**
- * getEventType
- * @returns EventType
- */
- public EventType getEventType() {
- return type;
- } // getEventType()
-
- /**
- * getDescription
- * @returns String
- */
- public String getDescription() {
- return description;
- } // getDescription()
-
-
-} // HyperlinkEvent
+ public static final class EventType
+ {
+ public static final EventType ENTERED = new EventType("ENTERED"); // TODO
+ public static final EventType EXITED = new EventType("EXITED"); // TODO
+ public static final EventType ACTIVATED = new EventType("ACTIVATED"); // TODO
+
+ private String type;
+
+ /**
+ * Creates a new Event type.
+ *
+ * @param type String representing the event type.
+ */
+ private EventType(String type)
+ {
+ this.type = type;
+ }
+
+ /**
+ * Returns a <code>String</code> of this object.
+ */
+ public String toString()
+ {
+ return type;
+ }
+ }
+
+ private static final long serialVersionUID = -2054640811732867012L;
+
+ private EventType type;
+ private URL url;
+ private String description;
+ private Element element;
+
+ /**
+ * Creates a new <code>HyperlinkEvent</code> with the given arguments.
+ *
+ * @param source The object this link is associated to.
+ * @param type The type of event.
+ * @param url The URL this link pointing too.
+ */
+ public HyperlinkEvent(Object source, EventType type, URL url)
+ {
+ this (source, type, url, null, null);
+ }
+
+ /**
+ * Creates a new <code>HyperlinkEvent</code> with the given arguments.
+ *
+ * @param source The object this link is associated to.
+ * @param type The type of event.
+ * @param url The URL this link pointing too.
+ * @param description The description for this link.
+ */
+ public HyperlinkEvent(Object source, EventType type, URL url,
+ String description)
+ {
+ this (source, type, url, description, null);
+ }
+
+ /**
+ * Creates a new <code>HyperlinkEvent</code> with the given arguments.
+ *
+ * @param source The object this link is associated to.
+ * @param type The type of event.
+ * @param url The URL this link pointing too.
+ * @param description The description for this link.
+ * @param element The element in the document representing the anchor.
+ */
+ public HyperlinkEvent(Object source, EventType type, URL url,
+ String description, Element element)
+ {
+ super(source);
+ this.type = type;
+ this.url = url;
+ this.description = description;
+ this.element = element;
+ }
+
+ /**
+ * Returns the element of the document repesenting this anchor.
+ */
+ public Element getSourceElement()
+ {
+ return element;
+ }
+
+ /**
+ * Returns the URL of this event.
+ */
+ public URL getURL()
+ {
+ return url;
+ }
+
+ /**
+ * Returns the type of this event.
+ */
+ public EventType getEventType()
+ {
+ return type;
+ }
+
+ /**
+ * Returns the description of this event.
+ */
+ public String getDescription()
+ {
+ return description;
+ }
+}
diff --git a/libjava/javax/swing/event/InternalFrameEvent.java b/libjava/javax/swing/event/InternalFrameEvent.java
index 345568b7b61..15d12f2efcf 100644
--- a/libjava/javax/swing/event/InternalFrameEvent.java
+++ b/libjava/javax/swing/event/InternalFrameEvent.java
@@ -42,73 +42,73 @@ import java.awt.AWTEvent;
import javax.swing.JInternalFrame;
/**
- * InternalFrameEvent
* @author Andrew Selkirk
*/
-public class InternalFrameEvent extends AWTEvent {
-
- //-------------------------------------------------------------
- // Constants --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Internal frame activated event
- */
- public static int INTERNAL_FRAME_ACTIVATED = 25554;
-
- /**
- * Internal frame closed event
- */
- public static int INTERNAL_FRAME_CLOSED = 25551;
-
- /**
- * Internal frame closing event
- */
- public static int INTERNAL_FRAME_CLOSING = 25550;
-
- /**
- * Internal frame deactivated event
- */
- public static int INTERNAL_FRAME_DEACTIVATED = 25555;
-
- /**
- * Internal frame deiconifed event
- */
- public static int INTERNAL_FRAME_DEICONIFIED = 25553;
-
- /**
- * Internal frame frame first event
- */
- public static int INTERNAL_FRAME_FIRST = 25549;
-
- /**
- * Internal frame iconified event
- */
- public static int INTERNAL_FRAME_ICONIFIED = 2552;
-
- /**
- * Internal frame last event
- */
- public static int INTERNAL_FRAME_LAST = 25555;
-
- /**
- * Internal frame opened event
- */
- public static int INTERNAL_FRAME_OPENED = 25550;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor InternalFrameEvent
- * @param source JInternalFrame
- * @param id Event ID
- */
- public InternalFrameEvent(JInternalFrame source, int id) {
- super(source, id);
- } // InternalFrameEvent()
-
-
-} // InternalFrameEvent
+public class InternalFrameEvent extends AWTEvent
+{
+ private static final long serialVersionUID = -5204823611874873183L;
+
+ /**
+ * Internal frame activated event
+ */
+ public static final int INTERNAL_FRAME_ACTIVATED = 25554;
+
+ /**
+ * Internal frame closed event
+ */
+ public static final int INTERNAL_FRAME_CLOSED = 25551;
+
+ /**
+ * Internal frame closing event
+ */
+ public static final int INTERNAL_FRAME_CLOSING = 25550;
+
+ /**
+ * Internal frame deactivated event
+ */
+ public static final int INTERNAL_FRAME_DEACTIVATED = 25555;
+
+ /**
+ * Internal frame deiconifed event
+ */
+ public static final int INTERNAL_FRAME_DEICONIFIED = 25553;
+
+ /**
+ * Internal frame frame first event
+ */
+ public static final int INTERNAL_FRAME_FIRST = 25549;
+
+ /**
+ * Internal frame iconified event
+ */
+ public static final int INTERNAL_FRAME_ICONIFIED = 2552;
+
+ /**
+ * Internal frame last event
+ */
+ public static final int INTERNAL_FRAME_LAST = 25555;
+
+ /**
+ * Internal frame opened event
+ */
+ public static final int INTERNAL_FRAME_OPENED = 25550;
+
+ /**
+ * Creates a <code>JInternalFrameEvent</code> object.
+ *
+ * @param source The source of this event.
+ * @param id Then event ID of this event.
+ */
+ public InternalFrameEvent(JInternalFrame source, int id)
+ {
+ super(source, id);
+ }
+
+ /**
+ * Returns the <code>JInternalFrame</code> object stored in this event.
+ */
+ public JInternalFrame getInternalFrame()
+ {
+ return (JInternalFrame) source;
+ }
+}
diff --git a/libjava/javax/swing/event/ListDataEvent.java b/libjava/javax/swing/event/ListDataEvent.java
index 4c6e39f00a3..c86e86abe92 100644
--- a/libjava/javax/swing/event/ListDataEvent.java
+++ b/libjava/javax/swing/event/ListDataEvent.java
@@ -41,99 +41,58 @@ package javax.swing.event;
import java.util.EventObject;
/**
- * ListDataEvent
* @author Andrew Selkirk
* @author Ronald Veldema
*/
-public class ListDataEvent extends EventObject {
-
- //-------------------------------------------------------------
- // Constants --------------------------------------------------
- //-------------------------------------------------------------
+public class ListDataEvent extends EventObject
+{
+ private static final long serialVersionUID = 2510353260071004774L;
+
+ public static final int CONTENTS_CHANGED = 0;
+ public static final int INTERVAL_ADDED = 1;
+ public static final int INTERVAL_REMOVED = 2;
+
+ private int type = 0;
+ private int index0 = 0;
+ private int index1 = 0;
- /**
- * Contents changed
- */
- public static int CONTENTS_CHANGED = 0;
-
- /**
- * Internal added
- */
- public static int INTERVAL_ADDED = 1;
-
- /**
- * Interval removed
- */
- public static int INTERVAL_REMOVED = 2;
-
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * type
- */
- private int type = 0;
-
- /**
- * index0
- */
- private int index0 = 0;
+ /**
+ * Creates a <code>ListDataEvent</code> object.
+ *
+ * @param source The source of the event.
+ * @param type The type of the event
+ * @param index0 Bottom of range
+ * @param index1 Top of range
+ */
+ public ListDataEvent(Object source, int type, int index0, int index1)
+ {
+ super(source);
+ this.type = type;
+ this.index0 = index0;
+ this.index1 = index1;
+ }
- /**
- * index1
- */
- private int index1 = 0;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor ListDataEvent
- * @param source Source
- * @param type Event type
- * @param index0 Bottom of range
- * @param index1 Top of range
- */
- public ListDataEvent(Object source, int type,
- int index0, int index1) {
- super(source);
- this.type = type;
- this.index0 = index0;
- this.index1 = index1;
- } // ListDataEvent()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getIndex0
- * @returns index0
- */
- public int getIndex0() {
- return index0;
- } // getIndex0()
-
- /**
- * getIndex1
- * @returns index1
- */
- public int getIndex1() {
- return index1;
- } // getIndex1()
-
- /**
- * Event type
- * @returns Event type
- */
- public int getType() {
- return type;
- } // getType()
-
-
-} // ListDataEvent
+ /**
+ * Returns the bottom index.
+ */
+ public int getIndex0()
+ {
+ return index0;
+ }
+
+ /**
+ * Returns the top index.
+ */
+ public int getIndex1()
+ {
+ return index1;
+ }
+
+ /**
+ * Returns the type of this event.
+ */
+ public int getType()
+ {
+ return type;
+ }
+}
diff --git a/libjava/javax/swing/event/TableModelEvent.java b/libjava/javax/swing/event/TableModelEvent.java
index c5989558099..6bd96971950 100644
--- a/libjava/javax/swing/event/TableModelEvent.java
+++ b/libjava/javax/swing/event/TableModelEvent.java
@@ -42,163 +42,116 @@ import java.util.EventObject;
import javax.swing.table.TableModel;
/**
- * TableModelEvent
* @author Andrew Selkirk
*/
-public class TableModelEvent extends EventObject {
-
- //-------------------------------------------------------------
- // Constants --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * ALL_COLUMNS
- */
- public static int ALL_COLUMNS = -1;
-
- /**
- * DELETE
- */
- public static int DELETE = -1;
-
- /**
- * HEADER_ROW
- */
- public static int HEADER_ROW = -1;
-
- /**
- * INSERT
- */
- public static int INSERT = 1;
-
- /**
- * UPDATE
- */
- public static int UPDATE = 0;
-
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * column
- */
- protected int column = 0;
-
- /**
- * firstRow
- */
- protected int firstRow = 0;
-
- /**
- * lastRow
- */
- protected int lastRow = 0;
-
- /**
- * type
- */
- protected int type = 0;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor TableModelEvent
- * @param source Source object
- */
- public TableModelEvent(TableModel source) {
- this(source, 0, source.getRowCount(), ALL_COLUMNS, UPDATE);
- } // TableModelEvent()
-
- /**
- * Constructor TableModelEvent
- * @param source Source table model
- * @param row Updated row
- */
- public TableModelEvent(TableModel source, int row) {
- this(source, row, row, ALL_COLUMNS, UPDATE);
- } // TableModelEvent()
-
- /**
- * Constructor TableModelEvent
- * @param source Source table model
- * @param firstRow First row of update
- * @param lastRow Last row of update
- */
- public TableModelEvent(TableModel source, int firstRow,
- int lastRow) {
- this(source, firstRow, lastRow, ALL_COLUMNS, UPDATE);
- } // TableModelEvent()
-
- /**
- * Constructor TableModelEvent
- * @param source Source table model
- * @param firstRow First row of update
- * @param lastRow Last row of update
- * @param column Affected column
- */
- public TableModelEvent(TableModel source, int firstRow,
- int lastRow, int column) {
- this(source, firstRow, lastRow, column, UPDATE);
- } // TableModelEvent()
-
- /**
- * Constructor TableModelEvent
- * @param source Source table model
- * @param firstRow First row of update
- * @param lastRow Last row of update
- * @param column Affected column
- * @param type Type of change
- */
- public TableModelEvent(TableModel source, int firstRow,
- int lastRow, int column, int type) {
- super(source);
- this.firstRow = firstRow;
- this.lastRow = lastRow;
- this.column = column;
- this.type = type;
- } // TableModelEvent()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getColumn
- * @returns column
- */
- public int getColumn() {
- return column;
- } // getColumn()
-
- /**
- * getFirstRow
- * @returns row
- */
- public int getFirstRow() {
- return firstRow;
- } // getFirstRow()
-
- /**
- * getLastRow
- * @returns row
- */
- public int getLastRow() {
- return lastRow;
- } // getLastRow()
-
- /**
- * Get type
- * @returns Type of event
- */
- public int getType() {
- return type;
- } // getType()
-
-
-} // TableModelEvent
+public class TableModelEvent extends EventObject
+{
+ private static final long serialVersionUID = -7849342674552212824L;
+
+ public static final int ALL_COLUMNS = -1;
+ public static final int DELETE = -1;
+ public static final int HEADER_ROW = -1;
+ public static final int INSERT = 1;
+ public static final int UPDATE = 0;
+
+ protected int column = 0;
+ protected int firstRow = 0;
+ protected int lastRow = 0;
+ protected int type = 0;
+
+ /**
+ * Creates a <code>TableModelEvent</code> event.
+ *
+ * @param source The source object
+ */
+ public TableModelEvent(TableModel source)
+ {
+ this(source, 0, source.getRowCount(), ALL_COLUMNS, UPDATE);
+ }
+
+ /**
+ * Creates a <code>TableModelEvent</code> event.
+ *
+ * @param source The source object
+ * @param row The updated row
+ */
+ public TableModelEvent(TableModel source, int row)
+ {
+ this(source, row, row, ALL_COLUMNS, UPDATE);
+ }
+
+ /**
+ * Creates a <code>TableModelEvent</code> event.
+ *
+ * @param source The source object
+ * @param firstRow The first row of update
+ * @param lastRow The last row of update
+ */
+ public TableModelEvent(TableModel source, int firstRow, int lastRow)
+ {
+ this(source, firstRow, lastRow, ALL_COLUMNS, UPDATE);
+ }
+
+ /**
+ * Creates a <code>TableModelEvent</code> event.
+ *
+ * @param source The source object
+ * @param firstRow The first row of update
+ * @param lastRow The last row of update
+ * @param column The affected column
+ */
+ public TableModelEvent(TableModel source, int firstRow, int lastRow, int column)
+ {
+ this(source, firstRow, lastRow, column, UPDATE);
+ }
+
+ /**
+ * Creates a <code>TableModelEvent</code> event.
+ *
+ * @param source The source object
+ * @param firstRow The first row of update
+ * @param lastRow The last row of update
+ * @param column The affected column
+ * @param type The type of change
+ */
+ public TableModelEvent(TableModel source, int firstRow, int lastRow, int column, int type)
+ {
+ super(source);
+ this.firstRow = firstRow;
+ this.lastRow = lastRow;
+ this.column = column;
+ this.type = type;
+ }
+
+ /**
+ * Returns the affected column of this event.
+ */
+ public int getColumn()
+ {
+ return column;
+ }
+
+ /**
+ * Returns the first affected row of this event.
+ */
+ public int getFirstRow()
+ {
+ return firstRow;
+ }
+
+ /**
+ * Returns the last affected row of this event.
+ */
+ public int getLastRow()
+ {
+ return lastRow;
+ }
+
+ /**
+ * Returns the type of change of this event.
+ */
+ public int getType()
+ {
+ return type;
+ }
+}
diff --git a/libjava/javax/swing/event/TreeWillExpandListener.java b/libjava/javax/swing/event/TreeWillExpandListener.java
index e11416dbf1f..c286fef8016 100644
--- a/libjava/javax/swing/event/TreeWillExpandListener.java
+++ b/libjava/javax/swing/event/TreeWillExpandListener.java
@@ -42,22 +42,23 @@ import java.util.EventListener;
import javax.swing.tree.ExpandVetoException;
/**
- * TreeWillExpandListener interface
* @author Andrew Selkirk
*/
-public interface TreeWillExpandListener extends EventListener {
+public interface TreeWillExpandListener extends EventListener
+{
+ /**
+ * Invoked whenever a node in the tree is about to be collapsed.
+ *
+ * @param event The tree expansion Event
+ */
+ public void treeWillCollapse(TreeExpansionEvent event)
+ throws ExpandVetoException;
- /**
- * Tree will collapse
- * @param event Tree Expansion Event
- */
- public void treeWillCollapse(TreeExpansionEvent event);
-
- /**
- * Tree will expand
- * @param event Tree Expansion Event
- */
- public void treeWillExpand(TreeExpansionEvent event);
-
-
-} // TreeWillExpandListener
+ /**
+ * Invoked whenever a node in the tree is about to be expanded.
+ *
+ * @param event The tree expansion Event
+ */
+ public void treeWillExpand(TreeExpansionEvent event)
+ throws ExpandVetoException;
+}
diff --git a/libjava/javax/swing/plaf/ActionMapUIResource.java b/libjava/javax/swing/plaf/ActionMapUIResource.java
index cd9771b2dbb..640f3a75628 100644
--- a/libjava/javax/swing/plaf/ActionMapUIResource.java
+++ b/libjava/javax/swing/plaf/ActionMapUIResource.java
@@ -1,5 +1,5 @@
/* ActionMapUIResource.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,26 +37,28 @@ exception statement from your version. */
package javax.swing.plaf;
-// Imports
-import javax.swing.*;
+import javax.swing.ActionMap;
+
/**
- * ActionMapUIResource
- * @author Andrew Selkirk
- * @version 1.0
+ * An <code>ActionMap</code> that implements the {@link UIResource}
+ * interface to indicate that it belongs to a pluggable
+ * LookAndFeel.
+ *
+ * @see javax.swing.ActionMap
+ *
+ * @author Andrew Selkirk
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public class ActionMapUIResource extends ActionMap implements UIResource {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor ActionMapUIResource
- */
- public ActionMapUIResource() {
- // TODO
- } // ActionMapUIResource()
-
-
-} // ActionMapUIResource
+public class ActionMapUIResource
+ extends ActionMap
+ implements UIResource
+{
+ /**
+ * Constructs a new ActionMapUIResource.
+ */
+ public ActionMapUIResource()
+ {
+ /* The constructor does nothing. */
+ }
+}
diff --git a/libjava/javax/swing/plaf/BorderUIResource.java b/libjava/javax/swing/plaf/BorderUIResource.java
index 3dc092db93d..aebb1a03fe3 100644
--- a/libjava/javax/swing/plaf/BorderUIResource.java
+++ b/libjava/javax/swing/plaf/BorderUIResource.java
@@ -1,5 +1,5 @@
/* BorderUIResource.java
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,6 +37,7 @@ exception statement from your version. */
package javax.swing.plaf;
+
import javax.swing.border.*;
import javax.swing.Icon;
import java.io.Serializable;
@@ -47,233 +48,858 @@ import java.awt.Font;
import java.awt.Color;
/**
+ * A wrapper for {@link javax.swing.border.Border} that also
+ * implements the {@link UIResource} marker interface. This is useful
+ * for implementing pluggable look-and-feels: When switching the
+ * current LookAndFeel, only those borders are replaced that are
+ * marked as {@link UIResource}. For this reason, a look-and-feel
+ * should always install borders that implement
+ * <code>UIResource</code>, such as the borders provided by this
+ * class.
+ *
* @serial
* @serialField delegate Border the <code>Border</code> wrapped
- * @author Brian Jones
+ *
+ * @author Brian Jones (cbj@gnu.org)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public class BorderUIResource
- extends Object
- implements Border, UIResource, Serializable
+ extends Object
+ implements Border, UIResource, Serializable
{
+ /**
+ * Verified using the <code>serialver</code> tool
+ * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
+ */
static final long serialVersionUID = -3440553684010079691L;
- private Border delegate;
+ /**
+ * A shared instance of an {@link EtchedBorderUIResource}, or
+ * <code>null</code> if the {@link #getEtchedBorderUIResource()}
+ * method has not yet been called.
+ */
+ private static Border etchedBorderUIResource;
+
+
+ /**
+ * A shared instance of a {@link BevelBorderUIResource} whose
+ * <code>bevelType</code> is {@link
+ * javax.swing.border.BevelBorder#LOWERED}, or <code>null</code> if
+ * the {@link #getLoweredBevelBorderUIResource()} has not yet been
+ * called.
+ */
+ private static Border loweredBevelBorderUIResource;
+
+
+ /**
+ * A shared instance of a {@link BevelBorderUIResource} whose
+ * <code>bevelType</code> is {@link
+ * javax.swing.border.BevelBorder#RAISED}, or <code>null</code> if
+ * the {@link #getRaisedBevelBorderUIResource()} has not yet been
+ * called.
+ */
+ private static Border raisedBevelBorderUIResource;
+
+
+ /**
+ * A shared instance of a {@link LineBorderUIResource} for
+ * a one-pixel thick black line, or <code>null</code> if
+ * the {@link #getBlackLineBorderUIResource()} has not yet been
+ * called.
+ */
+ private static Border blackLineBorderUIResource;
+
+
+ /**
+ * Returns a shared instance of an etched border which also
+ * is marked as an {@link UIResource}.
+ *
+ * @see javax.swing.border.EtchedBorder
+ */
+ public static Border getEtchedBorderUIResource()
+ {
+ /* Swing is not designed to be thread-safe, so there is no
+ * need to synchronize the access to the global variable.
+ */
+ if (etchedBorderUIResource == null)
+ etchedBorderUIResource = new EtchedBorderUIResource();
+ return etchedBorderUIResource;
+ }
+
+
+ /**
+ * Returns a shared instance of {@link BevelBorderUIResource} whose
+ * <code>bevelType</code> is {@link
+ * javax.swing.border.BevelBorder#LOWERED}.
+ *
+ * @see javax.swing.border.BevelBorder
+ */
+ public static Border getLoweredBevelBorderUIResource()
+ {
+ /* Swing is not designed to be thread-safe, so there is no
+ * need to synchronize the access to the global variable.
+ */
+ if (loweredBevelBorderUIResource == null)
+ loweredBevelBorderUIResource = new BevelBorderUIResource(
+ BevelBorder.LOWERED);
+ return loweredBevelBorderUIResource;
+ }
+
+
+ /**
+ * Returns a shared instance of {@link BevelBorderUIResource} whose
+ * <code>bevelType</code> is {@link
+ * javax.swing.border.BevelBorder#RAISED}.
+ *
+ * @see javax.swing.border.BevelBorder
+ */
+ public static Border getRaisedBevelBorderUIResource()
+ {
+ /* Swing is not designed to be thread-safe, so there is no
+ * need to synchronize the access to the global variable.
+ */
+ if (raisedBevelBorderUIResource == null)
+ raisedBevelBorderUIResource = new BevelBorderUIResource(
+ BevelBorder.RAISED);
+ return raisedBevelBorderUIResource;
+ }
+
+
+ /**
+ * Returns a shared instance of {@link LineBorderUIResource} for
+ * a black, one-pixel width border.
+ *
+ * @see javax.swing.border.LineBorder
+ */
+ public static Border getBlackLineBorderUIResource()
+ {
+ /* Swing is not designed to be thread-safe, so there is no
+ * need to synchronize the access to the global variable.
+ */
+ if (blackLineBorderUIResource == null)
+ blackLineBorderUIResource = new LineBorderUIResource(Color.black);
+ return blackLineBorderUIResource;
+ }
+
+
+ /**
+ * The wrapped border.
+ */
+ private Border delegate;
+
+
+ /**
+ * Constructs a <code>BorderUIResource</code> for wrapping
+ * a <code>Border</code> object.
+ *
+ * @param delegate the border to be wrapped.
+ */
+ public BorderUIResource(Border delegate)
+ {
+ if (delegate == null)
+ throw new IllegalArgumentException();
+
+ this.delegate = delegate;
+ }
+
+
+ /**
+ * Paints the border around an enclosed component by calling
+ * the <code>paintBorder</code> method of the wrapped delegate.
+ *
+ * @param c the component whose border is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ */
+ public void paintBorder(Component c, Graphics g,
+ int x, int y, int width, int height)
+ {
+ delegate.paintBorder(c, g, x, y, width, height);
+ }
+
+
+ /**
+ * Measures the width of this border by calling the
+ * <code>getBorderInsets</code> method of the wrapped
+ * delegate.
+ *
+ * @param c the component whose border is to be measured.
+ *
+ * @return an Insets object whose <code>left</code>, <code>right</code>,
+ * <code>top</code> and <code>bottom</code> fields indicate the
+ * width of the border at the respective edge.
+ */
+ public Insets getBorderInsets(Component c)
+ {
+ return delegate.getBorderInsets(c);
+ }
+
+
+ /**
+ * Determines whether this border fills every pixel in its area
+ * when painting by calling the <code>isBorderOpaque</code>
+ * method of the wrapped delegate.
+ *
+ * @return <code>true</code> if the border is fully opaque, or
+ * <code>false</code> if some pixels of the background
+ * can shine through the border.
+ */
+ public boolean isBorderOpaque()
+ {
+ return delegate.isBorderOpaque();
+ }
+
+
+ /**
+ * A {@link javax.swing.border.BevelBorder} that also implements the
+ * {@link UIResource} marker interface. This is useful for
+ * implementing pluggable look-and-feels: When switching the current
+ * LookAndFeel, only those borders are replaced that are marked as
+ * {@link UIResource}. For this reason, a look-and-feel should
+ * always install borders that implement <code>UIResource</code>,
+ * such as the borders provided by this class.
+ *
+ * @author Brian Jones (cbj@gnu.org)
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+ public static class BevelBorderUIResource
+ extends BevelBorder
+ implements UIResource, Serializable
+ {
/**
- * Creates a <code>UIResource</code> wrapper for a <code>Border</code>
- * object.
- *
- * @param delegate the border to be wrapped
+ * Constructs a BevelBorderUIResource whose colors will be derived
+ * from the background of the enclosed component. The background
+ * color is retrieved each time the border is painted, so a border
+ * constructed by this method will automatically reflect a change
+ * to the component&#x2019;s background color.
+ *
+ * <p><img src="../border/BevelBorder-1.png" width="500" height="150"
+ * alt="[An illustration showing raised and lowered BevelBorders]" />
+ *
+ * @param bevelType the desired appearance of the border. The value
+ * must be either {@link javax.swing.border.BevelBorder#RAISED}
+ * or {@link javax.swing.border.BevelBorder#LOWERED}.
+ *
+ * @throws IllegalArgumentException if <code>bevelType</code> has
+ * an unsupported value.
+ */
+ public BevelBorderUIResource(int bevelType)
+ {
+ super(bevelType);
+ }
+
+
+ /**
+ * Constructs a BevelBorderUIResource given its appearance type
+ * and two colors for its highlight and shadow.
+ *
+ * <p><img src="../border/BevelBorder-2.png" width="500" height="150"
+ * alt="[An illustration showing BevelBorders that were constructed
+ * with this method]" />
+ *
+ * @param bevelType the desired appearance of the border. The value
+ * must be either {@link javax.swing.border.BevelBorder#RAISED}
+ * or {@link javax.swing.border.BevelBorder#LOWERED}.
+ *
+ * @param highlight the color that will be used for the inner side
+ * of the highlighted edges (top and left if if
+ * <code>bevelType</code> is {@link
+ * javax.swing.border.BevelBorder#RAISED}; bottom and right
+ * otherwise). The color for the outer side is a brightened
+ * version of this color.
+ *
+ * @param shadow the color that will be used for the outer side of
+ * the shadowed edges (bottom and right if
+ * <code>bevelType</code> is {@link
+ * javax.swing.border.BevelBorder#RAISED}; top and left
+ * otherwise). The color for the inner side is a brightened
+ * version of this color.
+ *
+ * @throws IllegalArgumentException if <code>bevelType</code> has
+ * an unsupported value.
+ *
+ * @throws NullPointerException if <code>highlight</code> or
+ * <code>shadow</code> is <code>null</code>.
*/
- public BorderUIResource(Border delegate)
+ public BevelBorderUIResource(int bevelType,
+ Color highlight,
+ Color shadow)
{
- this.delegate = delegate;
+ super(bevelType, highlight, shadow);
}
+
/**
+ * Constructs a BevelBorderUIResource given its appearance type
+ * and all its colors.
+ *
+ * <p><img src="../border/BevelBorder-3.png" width="500" height="150"
+ * alt="[An illustration showing BevelBorders that were constructed
+ * with this method]" />
+ *
+ * @param bevelType the desired appearance of the border. The value
+ * must be either {@link javax.swing.border.BevelBorder#RAISED}
+ * or {@link javax.swing.border.BevelBorder#LOWERED}.
+ *
+ * @param highlightOuter the color that will be used for the outer
+ * side of the highlighted edges (top and left if
+ * <code>bevelType</code> is {@link
+ * javax.swing.border.BevelBorder#RAISED}; bottom and right
+ * otherwise).
+ *
+ * @param highlightInner the color that will be used for the inner
+ * side of the highlighted edges.
+ *
+ * @param shadowOuter the color that will be used for the outer
+ * side of the shadowed edges (bottom and right if
+ * <code>bevelType</code> is {@link
+ * javax.swing.border.BevelBorder#RAISED}; top and left
+ * otherwise).
+ *
+ * @param shadowInner the color that will be used for the inner
+ * side of the shadowed edges.
+ *
+ * @throws IllegalArgumentException if <code>bevelType</code> has
+ * an unsupported value.
+ *
+ * @throws NullPointerException if one of the passed colors
+ * is <code>null</code>.
*/
- public static Border getEtchedBorderUIResource() {
- return null;
+ public BevelBorderUIResource(int bevelType,
+ Color highlightOuter,
+ Color highlightInner,
+ Color shadowOuter,
+ Color shadowInner)
+ {
+ super(bevelType,
+ highlightOuter, highlightInner,
+ shadowOuter, shadowInner);
}
-
+ }
+
+
+ /**
+ * A {@link javax.swing.border.CompoundBorder} that also implements the
+ * {@link UIResource} marker interface. This is useful for
+ * implementing pluggable look-and-feels: When switching the current
+ * LookAndFeel, only those borders are replaced that are marked as
+ * {@link UIResource}. For this reason, a look-and-feel should
+ * always install borders that implement <code>UIResource</code>,
+ * such as the borders provided by this class.
+ *
+ * @author Brian Jones (cbj@gnu.org)
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+ public static class CompoundBorderUIResource
+ extends CompoundBorder
+ implements UIResource, Serializable
+ {
/**
+ * Constructs a CompoundBorderUIResource with the specified inside
+ * and outside borders.
+ *
+ * @param outsideBorder the outside border, which is painted to the
+ * outside of both <code>insideBorder</code> and the enclosed
+ * component. It is acceptable to pass <code>null</code>, in
+ * which case no outside border is painted.
+ *
+ * @param insideBorder the inside border, which is painted to
+ * between <code>outsideBorder</code> and the enclosed
+ * component. It is acceptable to pass <code>null</code>, in
+ * which case no inside border is painted.
*/
- public static Border getLoweredBevelBorderUIResource() {
- return null;
+ public CompoundBorderUIResource(Border outsideBorder,
+ Border insideBorder)
+ {
+ super(outsideBorder, insideBorder);
}
-
+ }
+
+
+ /**
+ * An {@link javax.swing.border.EmptyBorder} that also implements the
+ * {@link UIResource} marker interface. This is useful for
+ * implementing pluggable look-and-feels: When switching the current
+ * LookAndFeel, only those borders are replaced that are marked as
+ * {@link UIResource}. For this reason, a look-and-feel should
+ * always install borders that implement <code>UIResource</code>,
+ * such as the borders provided by this class.
+ *
+ * <p><img src="../border/EmptyBorder-1.png" width="290" height="200"
+ * alt="[An illustration of EmptyBorder]" />
+ *
+ * @author Brian Jones (cbj@gnu.org)
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+ public static class EmptyBorderUIResource
+ extends EmptyBorder
+ implements UIResource, Serializable
+ {
/**
+ * Constructs an empty border given the number of pixels required
+ * on each side.
+ *
+ * @param top the number of pixels that the border will need
+ * for its top edge.
+ *
+ * @param left the number of pixels that the border will need
+ * for its left edge.
+ *
+ * @param bottom the number of pixels that the border will need
+ * for its bottom edge.
+ *
+ * @param right the number of pixels that the border will need
+ * for its right edge.
*/
- public static Border getRaisedBevelBorderUIResource() {
- return null;
+ public EmptyBorderUIResource(int top, int left, int bottom, int right)
+ {
+ super(top, left, bottom, right);
}
-
+
+
/**
+ * Constructs an empty border given the number of pixels required
+ * on each side, passed in an Insets object.
+ *
+ * @param insets the Insets for the new border.
*/
- public static Border getBlackLineBorderUIResource() {
- return null;
+ public EmptyBorderUIResource(Insets insets)
+ {
+ super(insets);
}
-
+ }
+
+
+ /**
+ * An {@link javax.swing.border.EtchedBorder} that also implements the
+ * {@link UIResource} marker interface. This is useful for
+ * implementing pluggable look-and-feels: When switching the current
+ * LookAndFeel, only those borders are replaced that are marked as
+ * {@link UIResource}. For this reason, a look-and-feel should
+ * always install borders that implement <code>UIResource</code>,
+ * such as the borders provided by this class.
+ *
+ * <p><img src="../border/EtchedBorder-1.png" width="500" height="200"
+ * alt="[An illustration of the two EtchedBorder variants]" />
+ *
+ * @author Brian Jones (cbj@gnu.org)
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+ public static class EtchedBorderUIResource
+ extends EtchedBorder
+ implements UIResource, Serializable
+ {
/**
+ * Constructs an EtchedBorderUIResource that appears lowered into
+ * the surface. The colors will be derived from the background
+ * color of the enclosed Component when the border gets painted.
*/
- public void paintBorder(Component c, Graphics g, int x, int y,
- int width, int height) { }
-
+ public EtchedBorderUIResource()
+ {
+ super();
+ }
+
+
/**
+ * Constructs an EtchedBorderUIResource with the specified
+ * appearance. The colors will be derived from the background
+ * color of the enclosed Component when the border gets painted.
+ *
+ * <p><img src="../border/EtchedBorder-1.png" width="500" height="200"
+ * alt="[An illustration of the two EtchedBorder variants]" />
+ *
+ * @param etchType the desired appearance of the border. The value
+ * must be either {@link javax.swing.border.EtchedBorder#RAISED}
+ * or {@link javax.swing.border.EtchedBorder#LOWERED}.
+ *
+ * @throws IllegalArgumentException if <code>etchType</code> has
+ * an unsupported value.
*/
- public Insets getBorderInsets(Component c) {
- return null;
+ public EtchedBorderUIResource(int etchType)
+ {
+ super(etchType);
}
-
+
+
/**
+ * Constructs a lowered EtchedBorderUIResource, explicitly
+ * selecting the colors that will be used for highlight and
+ * shadow.
+ *
+ * @param highlight the color that will be used for painting
+ * the highlight part of the border.
+ *
+ * @param shadow the color that will be used for painting
+ * the shadow part of the border.
+ *
+ * @see #EtchedBorderUIResource(int, Color, Color)
*/
- public boolean isBorderOpaque() {
- return false;
+ public EtchedBorderUIResource(Color highlight, Color shadow)
+ {
+ super(highlight, shadow);
}
-
+
+
/**
- * @serial
+ * Constructs an EtchedBorderUIResource with the specified
+ * appearance, explicitly selecting the colors that will be used
+ * for highlight and shadow.
+ *
+ * <p><img src="../border/EtchedBorder-2.png" width="500"
+ * height="200" alt="[An illustration that shows which pixels get
+ * painted in what color]" />
+ *
+ * @param etchType the desired appearance of the border. The value
+ * must be either {@link javax.swing.border.EtchedBorder#RAISED}
+ * or {@link javax.swing.border.EtchedBorder#LOWERED}.
+ *
+ * @param highlight the color that will be used for painting
+ * the highlight part of the border.
+ *
+ * @param shadow the color that will be used for painting
+ * the shadow part of the border.
+ *
+ * @throws IllegalArgumentException if <code>etchType</code> has
+ * an unsupported value.
*/
- public static class BevelBorderUIResource
- extends BevelBorder
- implements UIResource, Serializable
+ public EtchedBorderUIResource(int etchType,
+ Color highlight, Color shadow)
{
- public BevelBorderUIResource(int bevelType)
- {
- super (bevelType);
- }
-
- public BevelBorderUIResource(int bevelType,
- Color highlight,
- Color shadow)
- {
- super (bevelType, highlight, shadow);
- }
- public BevelBorderUIResource(int bevelType,
- Color highlightOuter,
- Color highlightInner,
- Color shadowOuter,
- Color shadowInner)
- {
- super (bevelType, highlightOuter, highlightInner, shadowOuter,
- shadowInner);
- }
+ super(etchType, highlight, shadow);
}
-
+ }
+
+
+ /**
+ * A {@link javax.swing.border.LineBorder} that also implements the
+ * {@link UIResource} marker interface. This is useful for
+ * implementing pluggable look-and-feels: When switching the current
+ * LookAndFeel, only those borders are replaced that are marked as
+ * {@link UIResource}. For this reason, a look-and-feel should
+ * always install borders that implement <code>UIResource</code>,
+ * such as the borders provided by this class.
+ *
+ * <p><img src="../border/LineBorder-1.png" width="500" height="200"
+ * alt="[An illustration of two LineBorders] />
+ *
+ * @author Brian Jones (cbj@gnu.org)
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+ public static class LineBorderUIResource
+ extends LineBorder
+ implements UIResource, Serializable
+ {
/**
- * @serial
+ * Constructs a LineBorderUIResource given its color. The border
+ * will be one pixel thick and have plain corners.
+ *
+ * @param color the color for drawing the border.
*/
- public static class CompoundBorderUIResource
- extends CompoundBorder
- implements UIResource, Serializable
+ public LineBorderUIResource(Color color)
{
- public CompoundBorderUIResource(Border outsideBorder,
- Border insideBorder)
- {
- super (outsideBorder, insideBorder);
- }
+ super(color);
}
-
+
+
/**
- * @serial
+ * Constructs a LineBorder given its color and thickness. The
+ * border will have plain corners.
+ *
+ * @param color the color for drawing the border.
+ * @param thickness the width of the line in pixels.
*/
- public static class EmptyBorderUIResource
- extends EmptyBorder
- implements UIResource, Serializable
+ public LineBorderUIResource(Color color, int thickness)
{
- public EmptyBorderUIResource(int top, int left, int bottom, int right)
- {
- this(new Insets(top,left,bottom,right));
- }
-
- public EmptyBorderUIResource(Insets insets)
- {
- super (insets);
- }
+ super(color, thickness);
}
+
+
+ /* Note: Since JDK1.3, javax.swing.border.LineBorder also has a
+ * constructor which accepts a value for the roundedCorners
+ * property. However, as of JDK1.4.1, the LineBorderUIResource
+ * subclass does not have a corresponding constructor.
+ *
+ * A request for enhancing the Swing API has been filed with Sun:
+ * http://developer.java.sun.com/developer/bugParade/bugs/4879999.html
+ */
+ }
+
+ /**
+ * A {@link javax.swing.border.MatteBorder} that also implements the
+ * {@link UIResource} marker interface. This is useful for
+ * implementing pluggable look-and-feels: When switching the current
+ * LookAndFeel, only those borders are replaced that are marked as
+ * {@link UIResource}. For this reason, a look-and-feel should
+ * always install borders that implement <code>UIResource</code>,
+ * such as the borders provided by this class.
+ *
+ * <p><img src="../border/MatteBorder-1.png" width="500" height="150"
+ * alt="[An illustration of two MatteBorders] />
+ *
+ * @author Brian Jones (cbj@gnu.org)
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+ public static class MatteBorderUIResource
+ extends MatteBorder
+ implements UIResource, Serializable
+ {
/**
- * @serial
+ * Constructs a MatteBorderUIResource given the width on each side
+ * and a fill color.
+ *
+ * <p><img src="../border/MatteBorder-2.png" width="500" height="150"
+ * alt="[A picture of a MatteBorder made by this constructor]" />
+ *
+ * @param top the width of the border at its top edge.
+ * @param left the width of the border at its left edge.
+ * @param bottom the width of the border at its bottom edge.
+ * @param right the width of the border at its right edge.
+ * @param matteColor the color for filling the border.
*/
- public static class EtchedBorderUIResource
- extends EtchedBorder
- implements UIResource, Serializable
+ public MatteBorderUIResource(int top, int left,
+ int bottom, int right,
+ Color color)
{
- public EtchedBorderUIResource() { }
- public EtchedBorderUIResource(int etchType)
- {
- super (etchType);
- }
- public EtchedBorderUIResource(Color highlight, Color shadow)
- {
- super (highlight, shadow);
- }
- public EtchedBorderUIResource(int etchType, Color highlight,
- Color shadow)
- {
- super (etchType, highlight, shadow);
- }
-
+ super(top, left, bottom, right, color);
}
-
+
+
+ /**
+ * Constructs a MatteBorderUIResource given the width on each side
+ * and an icon for tiling the border area.
+ *
+ * <p><img src="../border/MatteBorder-4.png" width="500"
+ * height="150" alt="[A picture of a MatteBorder made by this
+ * constructor]" />
+ *
+ * @param top the width of the border at its top edge.
+ * @param left the width of the border at its left edge.
+ * @param bottom the width of the border at its bottom edge.
+ * @param right the width of the border at its right edge.
+ * @param tileIcon an icon for tiling the border area.
+ */
+ public MatteBorderUIResource(int top, int left,
+ int bottom, int right,
+ Icon tileIcon)
+ {
+ super(top, left, bottom, right, tileIcon);
+ }
+
+
/**
- * @serial
+ * Constructs a MatteBorderUIResource given an icon for tiling the
+ * border area. The icon width is used for the border insets at
+ * the left and right edge, the icon height for the top and bottom
+ * edge.
+ *
+ * <p><img src="../border/MatteBorder-6.png" width="500" height="150"
+ * alt="[A picture of a MatteBorder made by this constructor]" />
+ *
+ * @param tileIcon an icon for tiling the border area.
*/
- public static class LineBorderUIResource
- extends LineBorder
- implements UIResource, Serializable
+ public MatteBorderUIResource(Icon tileIcon)
{
- public LineBorderUIResource(Color color)
- {
- super (color);
- }
- public LineBorderUIResource(Color color,
- int thickness)
- {
- super (color, thickness);
- }
+ super(tileIcon);
+ }
+ }
+
+
+ /**
+ * A {@link javax.swing.border.TitledBorder} that also implements the
+ * {@link UIResource} marker interface. This is useful for
+ * implementing pluggable look-and-feels: When switching the current
+ * LookAndFeel, only those borders are replaced that are marked as
+ * {@link UIResource}. For this reason, a look-and-feel should
+ * always install borders that implement <code>UIResource</code>,
+ * such as the borders provided by this class.
+ *
+ * @author Brian Jones (cbj@gnu.org)
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+ public static class TitledBorderUIResource
+ extends TitledBorder
+ implements UIResource, Serializable
+ {
+ /**
+ * Constructs a TitledBorderUIResource given the text of its title.
+ *
+ * @param title the title text, or <code>null</code> to use no
+ * title text.
+ */
+ public TitledBorderUIResource(String title)
+ {
+ super(title);
+ }
+
+
+ /**
+ * Constructs an initially untitled TitledBorderUIResource
+ * given another border.
+ *
+ * @param border the border underneath the title, or
+ * <code>null</code> to use a default from
+ * the current look and feel.
+ */
+ public TitledBorderUIResource(Border border)
+ {
+ super(border);
+ }
+
+
+ /**
+ * Constructs a TitledBorder given its border and title text.
+ *
+ * @param border the border underneath the title, or
+ * <code>null</code> to use a default from
+ * the current look and feel.
+ *
+ * @param title the title text, or <code>null</code>
+ * to use no title text.
+ */
+ public TitledBorderUIResource(Border border, String title)
+ {
+ super(border, title);
}
+
/**
- * @serial
+ * Constructs a TitledBorderUIResource given its border, title
+ * text, horizontal alignment, and vertical position.
+ *
+ * @param border the border underneath the title, or
+ * <code>null</code> to use a default
+ * from the current look and feel.
+ *
+ * @param title the title text, or <code>null</code>
+ * to use no title text.
+ *
+ * @param titleJustification the horizontal alignment of the title
+ * text in relation to the border. The value must be one of
+ * {@link javax.swing.border.TitledBorder#LEFT},
+ * {@link javax.swing.border.TitledBorder#CENTER},
+ * {@link javax.swing.border.TitledBorder#RIGHT},
+ * {@link javax.swing.border.TitledBorder#LEADING},
+ * {@link javax.swing.border.TitledBorder#TRAILING}, or
+ * {@link javax.swing.border.TitledBorder#DEFAULT_JUSTIFICATION}.
+ *
+ * @param titlePosition the vertical position of the title text
+ * in relation to the border. The value must be one of
+ * {@link javax.swing.border.TitledBorder#ABOVE_TOP},
+ * {@link javax.swing.border.TitledBorder#TOP},
+ * {@link javax.swing.border.TitledBorder#BELOW_TOP},
+ * {@link javax.swing.border.TitledBorder#ABOVE_BOTTOM},
+ * {@link javax.swing.border.TitledBorder#BOTTOM},
+ * {@link javax.swing.border.TitledBorder#BELOW_BOTTOM},
+ * or {@link javax.swing.border.TitledBorder#DEFAULT_POSITION}.
+ *
+ * @throws IllegalArgumentException if <code>titleJustification</code>
+ * or <code>titlePosition</code> have an unsupported value.
*/
- public static class MatteBorderUIResource
- extends MatteBorder
- implements UIResource, Serializable
+ public TitledBorderUIResource(Border border, String title,
+ int titleJustification,
+ int titlePosition)
{
- public MatteBorderUIResource(int top, int left, int bottom,
- int right, Color color)
- {
- super (new Insets (top, left, bottom, right), color);
- }
- public MatteBorderUIResource(int top, int left, int bottom,
- int right, Icon tileIcon)
- {
- super (new Insets (top, left, bottom, right), tileIcon);
-
- }
- public MatteBorderUIResource(Icon tileIcon)
- {
- super (tileIcon);
- }
+ super(border, title, titleJustification, titlePosition);
}
+
+ /**
+ * Constructs a TitledBorder given its border, title text,
+ * horizontal alignment, vertical position, and font.
+ *
+ * @param border the border underneath the title, or
+ * <code>null</code> to use a default
+ * from the current look and feel.
+ *
+ * @param title the title text, or <code>null</code>
+ * to use no title text.
+ *
+ * @param titleJustification the horizontal alignment of the title
+ * text in relation to the border. The value must be one of
+ * {@link javax.swing.border.TitledBorder#LEFT},
+ * {@link javax.swing.border.TitledBorder#CENTER},
+ * {@link javax.swing.border.TitledBorder#RIGHT},
+ * {@link javax.swing.border.TitledBorder#LEADING},
+ * {@link javax.swing.border.TitledBorder#TRAILING}, or
+ * {@link javax.swing.border.TitledBorder#DEFAULT_JUSTIFICATION}.
+ *
+ * @param titlePosition the vertical position of the title text
+ * in relation to the border. The value must be one of
+ * {@link javax.swing.border.TitledBorder#ABOVE_TOP},
+ * {@link javax.swing.border.TitledBorder#TOP},
+ * {@link javax.swing.border.TitledBorder#BELOW_TOP},
+ * {@link javax.swing.border.TitledBorder#ABOVE_BOTTOM},
+ * {@link javax.swing.border.TitledBorder#BOTTOM},
+ * {@link javax.swing.border.TitledBorder#BELOW_BOTTOM},
+ * or {@link javax.swing.border.TitledBorder#DEFAULT_POSITION}.
+ *
+ * @param titleFont the font for the title text, or <code>null</code>
+ * to use a default from the current look and feel.
+ *
+ * @throws IllegalArgumentException if <code>titleJustification</code>
+ * or <code>titlePosition</code> have an unsupported value.
+ */
+ public TitledBorderUIResource(Border border, String title,
+ int titleJustification,
+ int titlePosition,
+ Font titleFont)
+ {
+ super(border, title, titleJustification, titlePosition,
+ titleFont);
+ }
+
+
/**
- * @serial
+ * Constructs a TitledBorder given its border, title text,
+ * horizontal alignment, vertical position, font, and color.
+ *
+ * @param border the border underneath the title, or
+ * <code>null</code> to use a default
+ * from the current look and feel.
+ *
+ * @param title the title text, or <code>null</code>
+ * to use no title text.
+ *
+ * @param titleJustification the horizontal alignment of the title
+ * text in relation to the border. The value must be one of
+ * {@link javax.swing.border.TitledBorder#LEFT},
+ * {@link javax.swing.border.TitledBorder#CENTER},
+ * {@link javax.swing.border.TitledBorder#RIGHT},
+ * {@link javax.swing.border.TitledBorder#LEADING},
+ * {@link javax.swing.border.TitledBorder#TRAILING}, or
+ * {@link javax.swing.border.TitledBorder#DEFAULT_JUSTIFICATION}.
+ *
+ * @param titlePosition the vertical position of the title text
+ * in relation to the border. The value must be one of
+ * {@link javax.swing.border.TitledBorder#ABOVE_TOP},
+ * {@link javax.swing.border.TitledBorder#TOP},
+ * {@link javax.swing.border.TitledBorder#BELOW_TOP},
+ * {@link javax.swing.border.TitledBorder#ABOVE_BOTTOM},
+ * {@link javax.swing.border.TitledBorder#BOTTOM},
+ * {@link javax.swing.border.TitledBorder#BELOW_BOTTOM},
+ * or {@link javax.swing.border.TitledBorder#DEFAULT_POSITION}.
+ *
+ * @param titleFont the font for the title text, or <code>null</code>
+ * to use a default from the current look and feel.
+ *
+ * @param titleColor the color for the title text, or <code>null</code>
+ * to use a default from the current look and feel.
+ *
+ * @throws IllegalArgumentException if <code>titleJustification</code>
+ * or <code>titlePosition</code> have an unsupported value.
*/
- public static class TitledBorderUIResource
- extends TitledBorder
- implements UIResource, Serializable
+ public TitledBorderUIResource(Border border, String title,
+ int titleJustification, int titlePosition,
+ Font titleFont, Color titleColor)
{
- TitledBorderUIResource(String title)
- {
- super (title);
- }
- TitledBorderUIResource(Border border)
- {
- super (border);
- }
- TitledBorderUIResource(Border border, String title)
- {
- super (border, title);
- }
- TitledBorderUIResource(Border border, String title,
- int titleJustification, int titlePosition)
- {
- super (border, title, titleJustification, titlePosition);
- }
- TitledBorderUIResource(Border border, String title,
- int titleJustification, int titlePosition,
- Font titleFont)
- {
- super (border, title, titleJustification, titlePosition, titleFont);
- }
- TitledBorderUIResource(Border border, String title,
- int titleJustification, int titlePosition,
- Font titleFont, Color titleColor)
- {
- super (border, title, titleJustification, titlePosition, titleFont, titleColor);
- }
+ super(border, title, titleJustification, titlePosition,
+ titleFont, titleColor);
}
+ }
}
diff --git a/libjava/javax/swing/plaf/ButtonUI.java b/libjava/javax/swing/plaf/ButtonUI.java
index 56599af7709..4fdaee5055f 100644
--- a/libjava/javax/swing/plaf/ButtonUI.java
+++ b/libjava/javax/swing/plaf/ButtonUI.java
@@ -1,5 +1,5 @@
/* ButtonUI.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +38,15 @@ exception statement from your version. */
package javax.swing.plaf;
-public class ButtonUI extends ComponentUI
+/**
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JButton</code>.
+ *
+ * @see javax.swing.JButton
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public abstract class ButtonUI
+ extends ComponentUI
{
}
diff --git a/libjava/javax/swing/plaf/ColorChooserUI.java b/libjava/javax/swing/plaf/ColorChooserUI.java
index e2a839ac28d..e290a972a69 100644
--- a/libjava/javax/swing/plaf/ColorChooserUI.java
+++ b/libjava/javax/swing/plaf/ColorChooserUI.java
@@ -1,5 +1,5 @@
/* ColorChooserUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,22 +38,23 @@ exception statement from your version. */
package javax.swing.plaf;
/**
- * ColorChooserUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JColorChooser</code>.
+ *
+ * @see javax.swing.JColorChooser
+ *
+ * @author Andrew Selkirk
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class ColorChooserUI extends ComponentUI {
+public abstract class ColorChooserUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a ColorChooserUI.
+ */
+ public ColorChooserUI()
+ {
+ /* The constructor does not do anything. */
+ }
+}
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor ColorChooserUI
- */
- public ColorChooserUI() {
- // TODO
- } // ColorChooserUI()
-
-
-} // ColorChooserUI
diff --git a/libjava/javax/swing/plaf/ColorUIResource.java b/libjava/javax/swing/plaf/ColorUIResource.java
index 18b6b83a3fe..caa644c4952 100644
--- a/libjava/javax/swing/plaf/ColorUIResource.java
+++ b/libjava/javax/swing/plaf/ColorUIResource.java
@@ -1,5 +1,5 @@
/* ColorUIResource.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,26 +37,78 @@ exception statement from your version. */
package javax.swing.plaf;
+
import java.awt.Color;
+
+
/**
- * STUBBED
+ * A Color that is marked as <code>UIResource</code>, which indicates that
+ * the color has been installed by a pluggable LookAndFeel. Such colors
+ * are replaced when the LookAndFeel changes.
+ *
+ * @see java.awt.Color
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public class ColorUIResource extends Color implements UIResource
+public class ColorUIResource
+ extends Color
+ implements UIResource
{
- public ColorUIResource(Color c)
+ /**
+ * Constructs a <code>ColorUIResource</code> using the specified
+ * red, green, and blue values, which must be given as integers in
+ * the range of 0-255. The alpha channel value will default to 255,
+ * meaning that the color is fully opaque.
+ *
+ * @param r the red intensity, which must be in the range [0 .. 255].
+ * @param g the green intensity, which must be in the range [0 .. 255].
+ * @param b the blue intensity, which must be in the range [0 .. 255].
+ */
+ public ColorUIResource(int r, int g, int b)
{
- super(c.getRGB());
+ super(r, g, b);
}
- public ColorUIResource(float r, float g, float b)
+
+
+ /**
+ * Consructs a <code>ColorUIResource</code> using the specified
+ * RGB value. The blue value is in bits 0-7, green in bits 8-15, and
+ * red in bits 16-23. The other bits are ignored. The alpha value is set
+ * to 255, meaning that the color is fully opaque.
+ *
+ * @param rgb the rgb value, as discussed above.
+ */
+ public ColorUIResource(int rgb)
{
- super(r, g, b, 1.0f);
+ super(rgb);
}
- public ColorUIResource(int rgb)
+
+
+ /**
+ * Constructs a <code>ColorUIResource</code> using the specified
+ * red, green, and blue intensities, which must be given as floats in
+ * the range of 0-1. The alpha channel value will default to 1.0f,
+ * meaning that the color is fully opaque.
+ *
+ * @param r the red intensity, which must be in the range [0.0 .. 1.0].
+ * @param g the green intensity, which must be in the range [0.0 .. 1.0].
+ * @param b the blue intensity, which must be in the range [0.0 .. 1.0].
+ */
+ public ColorUIResource(float r, float g, float b)
{
- super(rgb, false);
+ super(r, g, b);
}
- public ColorUIResource(int r, int g, int b)
+
+
+ /**
+ * Constructs a <code>ColorUIResource</code>, using the intensities
+ * of another color.
+ *
+ * @param c the color whose intensities will be considered when
+ * constructing this <code>ColorUIResource</code>.
+ */
+ public ColorUIResource(Color c)
{
- super(r, g, b, 255);
+ super(c.getRGB());
}
-} // class ColorUIResource
+}
diff --git a/libjava/javax/swing/plaf/ComboBoxUI.java b/libjava/javax/swing/plaf/ComboBoxUI.java
index 9c045e6f8c3..83286d95ba6 100644
--- a/libjava/javax/swing/plaf/ComboBoxUI.java
+++ b/libjava/javax/swing/plaf/ComboBoxUI.java
@@ -1,5 +1,5 @@
/* ComboBoxUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,52 +37,60 @@ exception statement from your version. */
package javax.swing.plaf;
-// Imports
-import javax.swing.*;
+import javax.swing.JComboBox;
/**
- * ComboBoxUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JButton</code>.
+ *
+ * @see javax.swing.JComboBox
+ *
+ * @author Andrew Selkirk
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class ComboBoxUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor ComboBoxUI
- */
- public ComboBoxUI() {
- // TODO
- } // ComboBoxUI()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * setPopupVisible
- * @param combobox TODO
- * @param visible TODO
- */
- public abstract void setPopupVisible(JComboBox combobox, boolean visible);
-
- /**
- * isPopupVisible
- * @param combobox TODO
- * @returns boolean
- */
- public abstract boolean isPopupVisible(JComboBox combobox);
-
- /**
- * isFocusTraversable
- * @param combobox TODO
- * @returns boolean
- */
- public abstract boolean isFocusTraversable(JComboBox combobox);
-
-
-} // ComboBoxUI
+public abstract class ComboBoxUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>ComboBoxUI</code>.
+ */
+ public ComboBoxUI()
+ {
+ }
+
+
+ /**
+ * Sets the visibility of the popup button.
+ *
+ * @param c the <code>JComboBox</code> whose popup
+ * is shown or hidden.
+ *
+ * @param visible <code>true</code> to show the popup, <code>false</code>
+ * to hide it.
+ */
+ public abstract void setPopupVisible(JComboBox c, boolean visible);
+
+
+ /**
+ * Determines whether the popup button is currently visible.
+ *
+ * @param c the <code>JComboBox</code> whose popup visibility
+ * is retrieved.
+ *
+ * @return <code>true</code> if the popup button is currently
+ * visible, <code>false</code> otherwise.
+ */
+ public abstract boolean isPopupVisible(JComboBox c);
+
+
+ /**
+ * Determines whether the combo box can receive input focus.
+ *
+ * @param c <code>JComboBox</code> whose focus traversability
+ * is to be retrieved.
+ *
+ * @returns <code>true</code> if <code>c</code> can receive
+ * input focus, <code>false</code> otherwise.
+ */
+ public abstract boolean isFocusTraversable(JComboBox c);
+}
diff --git a/libjava/javax/swing/plaf/ComponentInputMapUIResource.java b/libjava/javax/swing/plaf/ComponentInputMapUIResource.java
index 376da1ada8c..40a70552ee3 100644
--- a/libjava/javax/swing/plaf/ComponentInputMapUIResource.java
+++ b/libjava/javax/swing/plaf/ComponentInputMapUIResource.java
@@ -1,5 +1,5 @@
/* ComponentInputMapUIResource.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,28 +37,34 @@ exception statement from your version. */
package javax.swing.plaf;
-// Imports
-import javax.swing.*;
+import javax.swing.ComponentInputMap;
+import javax.swing.JComponent;
+
/**
- * ComponentInputMapUIResource
- * @author Andrew Selkirk
- * @version 1.0
+ * A <code>ComponentInputMap</code> that implements the {@link UIResource}
+ * interface to indicate that it belongs to a pluggable
+ * LookAndFeel.
+ *
+ * @see javax.swing.ComponentInputMap
+ * @see javax.swing.InputMap
+ *
+ * @author Andrew Selkirk
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public class ComponentInputMapUIResource extends ComponentInputMap implements UIResource {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor ComponentInputMapUIResource
- * @param component TODO
- */
- public ComponentInputMapUIResource(JComponent component) {
- super(component);
- // TODO
- } // ComponentInputMapUIResource()
-
+public class ComponentInputMapUIResource
+ extends ComponentInputMap
+ implements UIResource
+{
+ /**
+ * Constructs a new <code>ComponentInputMapUIResource</code>.
+ *
+ * @param component the <code>JComponent</code> associated with
+ * this <code>InputMap</code>.
+ */
+ public ComponentInputMapUIResource(JComponent component)
+ {
+ super(component);
+ }
+}
-} // ComponentInputMapUIResource
diff --git a/libjava/javax/swing/plaf/ComponentUI.java b/libjava/javax/swing/plaf/ComponentUI.java
index dba15f71c4f..22c2f30fd7b 100644
--- a/libjava/javax/swing/plaf/ComponentUI.java
+++ b/libjava/javax/swing/plaf/ComponentUI.java
@@ -1,5 +1,5 @@
/* ComponentUI.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,89 +38,291 @@ exception statement from your version. */
package javax.swing.plaf;
-import java.awt.*;
-import javax.swing.border.*;
-import javax.swing.*;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import javax.accessibility.Accessible;
+import javax.swing.JComponent;
-import javax.accessibility.*;
+/**
+ * The abstract base class for all delegates that provide the
+ * pluggable look and feel for Swing components. User applications
+ * should not need to access this class; it is internal to Swing
+ * and the look-and-feel implementations.
+ *
+ * <p><img src="ComponentUI-1.png" width="700" height="550"
+ * alt="[UML diagram illustrating the architecture for pluggable
+ * look and feels]" />
+ *
+ * <p>Components such as {@link javax.swing.JSlider} do not directly
+ * implement operations related to the look and feel of the user
+ * interface, such as painting or layout. Instead, they use a delegate
+ * object for all such tasks. In the case of <code>JSlider</code>, the
+ * user interface would be provided by some concrete subclass of
+ * {@link javax.swing.plaf.SliderUI}.
+ *
+ * <p>Soon after its creation, a <code>ComponentUI</code> will be sent
+ * an {@link #installUI} message. The <code>ComponentUI</code> will
+ * react by setting properties such as the border or the background
+ * color of the <code>JComponent</code> for which it provides its
+ * services. Soon before the end of its lifecycle, the
+ * <code>ComponentUI</code> will receive an {@link #uninstallUI}
+ * message, at which time the <code>ComponentUI</code> is expected to
+ * undo any changes.
+ *
+ * <p>Note that the <code>ui</code> of a <code>JComponent</code>
+ * changes whenever the user switches between look and feels. For
+ * example, the <code>ui</code> property of a <code>JSlider</code>
+ * could change from an instance of <code>MetalSliderUI</code> to an
+ * instance of <code>FooSliderUI</code>. This switch can happen at any
+ * time, but it will always be performed from inside the Swing thread.
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
public abstract class ComponentUI
- implements UIResource // ??
{
- boolean contains(JComponent c, int x, int y)
- {
- return c.inside(x,y);
- }
+ /**
+ * Constructs a new UI delegate.
+ */
+ public ComponentUI()
+ {
+ }
+
+
+ /**
+ * Sets up the specified component so it conforms the the design
+ * guidelines of the implemented look and feel. When the look and
+ * feel changes, a <code>ComponentUI</code> delegate is created.
+ * The delegate object then receives an <code>installUI</code>
+ * message.
+ *
+ * <p>This method should perform the following tasks:
+ *
+ * <ul><li>Set visual properties such as borders, fonts, colors, or
+ * icons. However, no change should be performed for those
+ * properties whose values have been directly set by the client
+ * application. To allow the distinction, LookAndFeels are expected
+ * to use values that implement the {@link UIResource} marker
+ * interface, such as {@link BorderUIResource} or {@link
+ * ColorUIResource}.</li>
+ *
+ * <li>If necessary, install a {@link java.awt.LayoutManager}.</li>
+ *
+ * <li>Embed custom sub-components. For instance, the UI delegate
+ * for a {@link javax.swing.JSplitPane} might install a special
+ * component for the divider.</li>
+ *
+ * <li>Register event listeners.</li>
+ *
+ * <li>Set up properties related to keyborad navigation, such as
+ * mnemonics or focus traversal policies.</li></ul>
+ *
+ * @param c the component for which this delegate will provide
+ * services.
+ *
+ * @see #uninstallUI
+ * @see javax.swing.JComponent#setUI
+ * @see javax.swing.JComponent#updateUI
+ */
+ public void installUI(JComponent c)
+ {
+ // The default implementation does not change any properties.
+ }
- // this SHOULD thow an error:
- public static ComponentUI createUI(JComponent c)
- {
- Exception e = new Exception("createUI from ComponentUI should never be called");
- e.printStackTrace();
- System.exit(1);
- return null;
- }
- public Accessible getAccessibleChild(JComponent c, int i)
- {
- //Return the nth Accessible child of the object.
- return null;
- }
+ /**
+ * Puts the specified component into the state it had before
+ * {@link #installUI} was called.
+ *
+ * @param c the component for which this delegate has provided
+ * services.
+ *
+ * @see #installUI
+ * @see javax.swing.JComponent#setUI
+ * @see javax.swing.JComponent#updateUI
+ */
+ public void uninstallUI(JComponent c)
+ {
+ // The default implementation does not change any properties.
+ }
+
+
+ /**
+ * Paints the component according to the design guidelines
+ * of the look and feel. Most subclasses will want to override
+ * this method.
+ *
+ * @param g the graphics for painting.
+ *
+ * @param c the component for which this delegate performs
+ * services.
+ */
+ public void paint(Graphics g, JComponent c)
+ {
+ }
- public int getAccessibleChildrenCount(JComponent c)
- {
- //Returns the number of accessible children in the object.
- return 0;
- }
- public Dimension getMaximumSize(JComponent c)
+ /**
+ * Fills the specified component with its background color
+ * (unless the <code>opaque</code> property is <code>false</code>)
+ * before calling {@link #paint}.
+ *
+ * <p>It is unlikely that a subclass needs to override this method.
+ * The actual rendering should be performed by the {@link #paint}
+ * method.
+ *
+ * @param g the graphics for painting.
+ *
+ * @param c the component for which this delegate performs
+ * services.
+ *
+ * @see #paint
+ * @see javax.swing.JComponent#paintComponent
+ */
+ public void update(Graphics g, JComponent c)
+ {
+ if (c.isOpaque())
{
- return getPreferredSize(c);
+ g.setColor(c.getBackground());
+ g.fillRect(0, 0, c.getWidth(), c.getHeight());
}
+ paint(g, c);
+ }
+
+
+ /**
+ * Determines the preferred size of a component. The default
+ * implementation returns <code>null</code>, which means that
+ * <code>c</code>&#x2019;s layout manager should be asked to
+ * calculate the preferred size.
+ *
+ * @param c the component for which this delegate performs services.
+ *
+ * @return the preferred size, or <code>null</code> to indicate that
+ * <code>c</code>&#x2019;s layout manager should be asked
+ * for the preferred size.
+ */
+ public Dimension getPreferredSize(JComponent c)
+ {
+ return null;
+ }
+
+
+ /**
+ * Determines the minimum size of a component. The default
+ * implementation calls {@link #getPreferredSize}, but subclasses
+ * might want to override this.
+ *
+ * @param c the component for which this delegate performs services.
+ *
+ * @return the minimum size, or <code>null</code> to indicate that
+ * <code>c</code>&#x2019;s layout manager should be asked
+ * to calculate the minimum size.
+ */
+ public Dimension getMinimumSize(JComponent c)
+ {
+ return getPreferredSize(c);
+ }
- public Dimension getMinimumSize(JComponent c)
- {
- return getPreferredSize(c);
- }
- public Dimension getPreferredSize(JComponent c)
- {
- return null;
- }
+ /**
+ * Determines the maximum size of a component. The default
+ * implementation calls {@link #getPreferredSize}, but subclasses
+ * might want to override this.
+ *
+ * @param c the component for which this delegate performs services.
+ *
+ * @return the maximum size, or <code>null</code> to indicate that
+ * <code>c</code>&#x2019;s layout manager should be asked
+ * to calculate the maximum size.
+ */
+ public Dimension getMaximumSize(JComponent c)
+ {
+ return getPreferredSize(c);
+ }
- public void installUI(JComponent c)
- {
- String id = c.getUIClassID() + ".border";
-
- Border s = UIManager.getBorder( id );
-
- if (s != null)
- {
- c.setBorder( s );
- //System.out.println("OK-INSTALL: " + this + ", ID=" + id + ",B="+s);
- }
- else
- {
- ///System.out.println("FAIL-INSTALL: " + this + ", " + id);
- }
- }
- public void paint(Graphics g, JComponent c)
- {
- // System.out.println("UI-COMPONENT-> unimplemented paint: " + c + ", UI="+this);
- }
+ /**
+ * Determines whether a click into the component at a specified
+ * location is considered as having hit the component. The default
+ * implementation checks whether the point falls into the
+ * component&#x2019;s bounding rectangle. Some subclasses might want
+ * to override this, for example in the case of a rounded button.
+ *
+ * @param c the component for which this delegate performs services.
+ *
+ * @param x the x coordinate of the point, relative to the local
+ * coordinate system of the component. Zero would be be
+ * component&#x2019;s left edge, irrespective of the location
+ * inside its parent.
+ *
+ * @param y the y coordinate of the point, relative to the local
+ * coordinate system of the component. Zero would be be
+ * component&#x2019;s top edge, irrespective of the location
+ * inside its parent.
+ */
+ public boolean contains(JComponent c, int x, int y)
+ {
+ /* JComponent.contains calls the ui delegate for hit
+ * testing. Therefore, endless mutual recursion would result if we
+ * called c.contains(x, y) here.
+ *
+ * The previous Classpath implementation called the deprecated
+ * method java.awt.Component.inside. In the Sun implementation, it
+ * can be observed that inside, other than contains, does not call
+ * the ui delegate. But that inside() behaves different to
+ * contains() clearly is in violation of the method contract, and
+ * it is not something that a good implementation should rely upon
+ * -- even if Classpath ends up being forced to replicate this
+ * apparent bug of the Sun implementation.
+ */
+ return (x >= 0) && (x < c.getWidth())
+ && (y >= 0) && (y < c.getHeight());
+ }
+
+
+ /**
+ * Creates a delegate object for the specified component. Users
+ * should use the <code>createUI</code> method of a suitable
+ * subclass. The implementation of <code>ComponentUI</code>
+ * always throws an error.
+ *
+ * @param c the component for which a UI delegate is requested.
+ */
+ public static ComponentUI createUI(JComponent c)
+ {
+ throw new Error(
+ "javax.swing.plaf.ComponentUI does not implement createUI; call "
+ + "createUI on a subclass.");
+ }
+
- public void uninstallUI(JComponent c)
- {
- }
+ /**
+ * Counts the number of accessible children in the component. The
+ * default implementation delegates the inquiry to the {@link
+ * javax.accessibility.AccessibleContext} of <code>c</code>.
+ *
+ * @param c the component whose accessible children
+ * are to be counted.
+ */
+ public int getAccessibleChildrenCount(JComponent c)
+ {
+ return c.getAccessibleContext().getAccessibleChildrenCount();
+ }
- public void update(Graphics g, JComponent c) {
- if (c.isOpaque()) {
- g.setColor(c.getBackground());
- g.fillRect(0, 0, c.getWidth(),c.getHeight());
- }
- paint(g, c);
- }
-
-}
+ /**
+ * Returns the specified accessible child of the component. The
+ * default implementation delegates the inquiry to the {@link
+ * javax.accessibility.AccessibleContext} of <code>c</code>.
+ *
+ * @param i the index of the accessible child, starting at zero.
+ *
+ * @param c the component whose <code>i</code>-th accessible child
+ * is requested.
+ */
+ public Accessible getAccessibleChild(JComponent c, int i)
+ {
+ return c.getAccessibleContext().getAccessibleChild(i);
+ }
+}
diff --git a/libjava/javax/swing/plaf/DesktopIconUI.java b/libjava/javax/swing/plaf/DesktopIconUI.java
index 880fa43915c..dfe69cc637d 100644
--- a/libjava/javax/swing/plaf/DesktopIconUI.java
+++ b/libjava/javax/swing/plaf/DesktopIconUI.java
@@ -1,5 +1,5 @@
/* DesktopIconUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,22 +38,19 @@ exception statement from your version. */
package javax.swing.plaf;
/**
- * DesktopIconUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a desktop icon.
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class DesktopIconUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor DesktopIconUI
- */
- public DesktopIconUI() {
- // TODO
- } // DesktopIconUI()
-
-
-} // DesktopIconUI
+public abstract class DesktopIconUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>DesktopIconUI</code>.
+ */
+ public DesktopIconUI()
+ {
+ }
+}
diff --git a/libjava/javax/swing/plaf/DesktopPaneUI.java b/libjava/javax/swing/plaf/DesktopPaneUI.java
index 9cb278839fb..6943bf30f60 100644
--- a/libjava/javax/swing/plaf/DesktopPaneUI.java
+++ b/libjava/javax/swing/plaf/DesktopPaneUI.java
@@ -1,5 +1,5 @@
/* DesktopPaneUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,22 +38,22 @@ exception statement from your version. */
package javax.swing.plaf;
/**
- * DesktopPaneUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JDesktopPane</code>.
+ *
+ * @see javax.swing.JDesktopPane
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class DesktopPaneUI extends ComponentUI {
+public abstract class DesktopPaneUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>DesktopPaneUI</code>.
+ */
+ public DesktopPaneUI()
+ {
+ }
+}
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor DesktopPaneUI
- */
- public DesktopPaneUI() {
- // TODO
- } // DesktopPaneUI()
-
-
-} // DesktopPaneUI
diff --git a/libjava/javax/swing/plaf/DimensionUIResource.java b/libjava/javax/swing/plaf/DimensionUIResource.java
index 52ea7a912f6..06ec16670cd 100644
--- a/libjava/javax/swing/plaf/DimensionUIResource.java
+++ b/libjava/javax/swing/plaf/DimensionUIResource.java
@@ -1,5 +1,5 @@
/* DimensionUIResource.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,14 +37,32 @@ exception statement from your version. */
package javax.swing.plaf;
+
import java.awt.Dimension;
+
/**
- * STUBBED
+ * A Dimension that is marked as <code>UIResource</code>, which
+ * indicates that it has been installed by a pluggable
+ * LookAndFeel. Such dimensions are replaced when the LookAndFeel
+ * changes.
+ *
+ * @see java.awt.Dimension
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public class DimensionUIResource extends Dimension implements UIResource
+public class DimensionUIResource
+ extends Dimension
+ implements UIResource
{
- public DimensionUIResource(int w, int h)
+ /**
+ * Constructs a new DimensionUIResource, given its width and height.
+ *
+ * @param width the width in pixels.
+ * @param height the height in pixels.
+ */
+ public DimensionUIResource(int width, int height)
{
- super(w, h);
+ super(width, height);
}
-} // class DimensionUIResource
+}
diff --git a/libjava/javax/swing/plaf/FileChooserUI.java b/libjava/javax/swing/plaf/FileChooserUI.java
index 00595eb7c66..6031c4216b8 100644
--- a/libjava/javax/swing/plaf/FileChooserUI.java
+++ b/libjava/javax/swing/plaf/FileChooserUI.java
@@ -1,5 +1,5 @@
/* FileChooserUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,75 +37,100 @@ exception statement from your version. */
package javax.swing.plaf;
-// Imports
-import java.io.*;
-import javax.swing.*;
-import javax.swing.filechooser.*;
+import java.io.File;
+import javax.swing.JFileChooser;
import javax.swing.filechooser.FileFilter;
+import javax.swing.filechooser.FileView;
/**
- * FileChooserUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JFileChooser</code>.
+ *
+ * @see javax.swing.JFileChooser
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class FileChooserUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor FileChooserUI
- */
- public FileChooserUI() {
- // TODO
- } // FileChooserUI()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getAcceptAllFileFilter
- * @param chooser TODO
- * @returns FileFilter
- */
- public abstract FileFilter getAcceptAllFileFilter(JFileChooser chooser);
-
- /**
- * getFileView
- * @param chooser TODO
- * @returns FileView
- */
- public abstract FileView getFileView(JFileChooser chooser);
-
- /**
- * getApproveButtonText
- * @param chooser TODO
- * @returns String
- */
- public abstract String getApproveButtonText(JFileChooser chooser);
-
- /**
- * getDialogTitle
- * @param chooser TODO
- * @returns String
- */
- public abstract String getDialogTitle(JFileChooser chooser);
-
- /**
- * rescanCurrentDirectory
- * @param value0 TODO
- */
- public abstract void rescanCurrentDirectory(JFileChooser chooser);
-
- /**
- * ensureFileIsVisible
- * @param chooser TODO
- * @param file TODO
- */
- public abstract void ensureFileIsVisible(JFileChooser chooser, File file);
-
-
-} // FileChooserUI
+public abstract class FileChooserUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>FileChooserUI</code>.
+ */
+ public FileChooserUI()
+ {
+ }
+
+
+ /**
+ * Returns a <code>FileFilter</code> that accepts every file. While
+ * the filtering itself is not specific to any look and feel, the
+ * text returned by <code>FileFilter.getDescription()</code> need
+ * not be the same across all look and feels.
+ *
+ * @param chooser the <code>JFileChooser</code> for which
+ * a <code>FileFilter</code> is requested.
+ *
+ * @see javax.swing.JFileChooser#getAcceptAllFileFilter
+ * @see javax.swing.filechooser.FileFilter#getDescription
+ */
+ public abstract FileFilter getAcceptAllFileFilter(JFileChooser chooser);
+
+
+ /**
+ * Returns a view to a file, which is able to retrieve its name,
+ * icon, and other properties that are relevant for presenting
+ * the file to the user.
+ *
+ * @param chooser the <code>JFileChooser</code> for which
+ * a <code>FileFilter</code> is requested.
+ */
+ public abstract FileView getFileView(JFileChooser chooser);
+
+
+ /**
+ * Determines which text is appropriate for the approve button
+ * according to the design guidelines of the implemented
+ * look and feel.
+ *
+ * @param chooser the <code>JFileChooser</code> whose
+ * button text is requested.
+ *
+ * @see javax.swing.JFileChoose#getApproveButtonText
+ */
+ public abstract String getApproveButtonText(JFileChooser chooser);
+
+
+ /**
+ * Determines which text is appropriate for the title bar of a
+ * <code>JFileChooser</code> according to the design guidelines of
+ * the implemented look and feel.
+ *
+ * @param chooser the <code>JFileChooser</code> whose
+ * dialog title is requested.
+ *
+ * @see javax.swing.JFileChoose#getDialogtitle
+ */
+ public abstract String getDialogTitle(JFileChooser chooser);
+
+
+ /**
+ * Refreshes the currently displayed directory.
+ *
+ * @param chooser the <code>JFileChooser</code> whose
+ * dialog title needs re-scanning.
+ */
+ public abstract void rescanCurrentDirectory(JFileChooser chooser);
+
+
+ /**
+ * Ensures that a specified file is visible in the
+ * <code>JFileChooser</code>
+ *
+ * @param chooser the <code>JFileChooser</code> that
+ * should display the file <code>file</code>.
+ *
+ * @param file the file that needs to be made visible.
+ */
+ public abstract void ensureFileIsVisible(JFileChooser chooser, File file);
+}
diff --git a/libjava/javax/swing/plaf/FontUIResource.java b/libjava/javax/swing/plaf/FontUIResource.java
index e158ced7403..a4a45de724f 100644
--- a/libjava/javax/swing/plaf/FontUIResource.java
+++ b/libjava/javax/swing/plaf/FontUIResource.java
@@ -1,5 +1,5 @@
/* FontUIResource.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,18 +37,65 @@ exception statement from your version. */
package javax.swing.plaf;
+
import java.awt.Font;
+
+
/**
- * STUBBED
+ * A font that is marked as <code>UIResource</code>, which
+ * indicates that it has been installed by a pluggable
+ * LookAndFeel. Such dimensions are replaced when the LookAndFeel
+ * changes.
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public class FontUIResource extends Font implements UIResource
+public class FontUIResource
+ extends Font
+ implements UIResource
{
- public FontUIResource(Font f)
- {
- super(f.getName(), f.getStyle(), f.getSize());
- }
+ /**
+ * Constructs a new <code>FontUIResource</code> given
+ * the name, style and size of the font.
+ *
+ * @param name the name of the font. A number of
+ * &#x201c;logical&#x201d; names are supported by any Java
+ * implementation. These are
+ * <code>&#x201c;Dialog&#x201d;</code>,
+ * <code>&#x201c;DialogInput&#x201d;</code>,
+ * <code>&#x201c;Monospaced&#x201d;</code>,
+ * <code>&#x201c;Serif&#x201d;</code>, and
+ * <code>&#x201c;SansSerif&#x201d;</code>.
+ *
+ * @param style the style of the font, for instance {@link
+ * java.awt.Font#BOLD} or {@link java.awt.Font#PLAIN}.
+ *
+ * @param size the size of the font in typographic points, for
+ * instance 10, 12 or 13. Designers of LookAndFeels should be
+ * aware that some languages (like Japanese and Chinese) have
+ * glyphs that are too complex to be legible at small point
+ * sizes.
+ */
public FontUIResource(String name, int style, int size)
{
super(name, style, size);
}
-} // class FontUIResource
+
+
+ /**
+ * Constructs a new <code>FontUIResource</code> given
+ * an existing font.
+ *
+ * @param f the font that serves as a template.
+ */
+ public FontUIResource(Font f)
+ {
+ /* This implementation will get rid of many font properties,
+ * such as skewing, values of multiple master design axes,
+ * etc., unless they get encoded into the name. It probably
+ * is not a problem for LookAndFeels because user interfaces
+ * are usually not very advanced with respect to typography.
+ */
+ super(f.getName(), f.getStyle(), f.getSize());
+ }
+}
diff --git a/libjava/javax/swing/plaf/IconUIResource.java b/libjava/javax/swing/plaf/IconUIResource.java
index 2d948d7823d..ca1ee7dee10 100644
--- a/libjava/javax/swing/plaf/IconUIResource.java
+++ b/libjava/javax/swing/plaf/IconUIResource.java
@@ -1,5 +1,5 @@
/* IconUIResource.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,29 +37,86 @@ exception statement from your version. */
package javax.swing.plaf;
+
import java.awt.Component;
import java.awt.Graphics;
import java.io.Serializable;
import javax.swing.Icon;
+
+
/**
- * STUBBED
+ * An icon that is marked as <code>UIResource</code>, which
+ * indicates that it has been installed by a pluggable
+ * LookAndFeel. Such icons are replaced when the LookAndFeel
+ * changes.
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public class IconUIResource implements Icon, UIResource, Serializable
+public class IconUIResource
+ implements Icon, UIResource, Serializable
{
+ /**
+ * Verified using the <code>serialver</code> tool of Sun JDK 1.4.1_01
+ * on GNU/Linux 2.4.18.
+ */
static final long serialVersionUID = 3327049506004830542L;
+
+ /**
+ * The icon that is wrapped by this <code>IconUIResource</code>.
+ */
+ private Icon delegate;
+
+
+ /**
+ * Constructs a <code>IconUIResource</code> that wraps another
+ * icon. All messages are forwarded to the delegate icon.
+ *
+ * @param delegate the icon that is wrapped by this
+ * <code>IconUIResource</code>.
+ */
public IconUIResource(Icon delegate)
{
+ this.delegate = delegate;
}
+
+
+ /**
+ * Paints the icon by asking the delegate icon to paint itself.
+ *
+ * @param c the Component whose icon is being painted. Some icons
+ * use this argument to retrieve properties like the
+ * background color.
+ *
+ * @param g the graphics into which the icon will be painted.
+ *
+ * @param x the horizontal position of the icon.
+ *
+ * @param y the vertical position of the icon.
+ */
public void paintIcon(Component c, Graphics g, int x, int y)
{
+ delegate.paintIcon(c, g, x, y);
}
+
+
+ /**
+ * Returns the width of the icon in pixels. The implementation
+ * determines and returns the width of the delegate icon.
+ */
public int getIconWidth()
{
- return 0;
+ return delegate.getIconWidth();
}
+
+
+ /**
+ * Returns the height of the icon in pixels. The implementation
+ * determines and returns the height of the delegate icon.
+ */
public int getIconHeight()
{
- return 0;
+ return delegate.getIconHeight();
}
-} // class IconUIResource
+}
diff --git a/libjava/javax/swing/plaf/InputMapUIResource.java b/libjava/javax/swing/plaf/InputMapUIResource.java
index 4d6793bd0a8..f638dd7b8cd 100644
--- a/libjava/javax/swing/plaf/InputMapUIResource.java
+++ b/libjava/javax/swing/plaf/InputMapUIResource.java
@@ -1,5 +1,5 @@
/* InputMapUIResource.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,26 +37,27 @@ exception statement from your version. */
package javax.swing.plaf;
-// Imports
-import javax.swing.*;
+import javax.swing.InputMap;
+
/**
- * InputMapUIResource
- * @author Andrew Selkirk
- * @version 1.0
+ * An <code>InputMap</code> that is marked as <code>UIResource</code>,
+ * which indicates that it has been installed by a pluggable
+ * LookAndFeel. Such dimensions are replaced when the LookAndFeel
+ * changes.
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public class InputMapUIResource extends InputMap implements UIResource {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor InputMapUIResource
- */
- public InputMapUIResource() {
- // TODO
- } // InputMapUIResource()
-
+public class InputMapUIResource
+ extends InputMap
+ implements UIResource
+{
+ /**
+ * Constructs a new <code>InputMapUIResource</code>.
+ */
+ public InputMapUIResource()
+ {
+ }
+}
-} // InputMapUIResource
diff --git a/libjava/javax/swing/plaf/InsetsUIResource.java b/libjava/javax/swing/plaf/InsetsUIResource.java
index 7c989ab2ee0..ad2eb1b214b 100644
--- a/libjava/javax/swing/plaf/InsetsUIResource.java
+++ b/libjava/javax/swing/plaf/InsetsUIResource.java
@@ -1,5 +1,5 @@
/* InsetsUIResource.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,14 +37,41 @@ exception statement from your version. */
package javax.swing.plaf;
+
import java.awt.Insets;
+import java.io.Serializable;
+
+
/**
- * STUBBED
+ * An <code>Insets</code> that is marked as <code>UIResource</code>,
+ * which indicates that it has been installed by a pluggable
+ * LookAndFeel. Such insets are replaced when the LookAndFeel changes.
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public class InsetsUIResource extends Insets implements UIResource
+public class InsetsUIResource
+ extends Insets
+ implements Cloneable, UIResource, Serializable
{
+ /**
+ * Determined using the <code>serialver</code> tool
+ * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
+ */
+ static final long serialVersionUID = 5622110143266315421L;
+
+
+ /**
+ * Constructs a new <code>InsetsUIResource</code> given the
+ * inset at each edge.
+ *
+ * @param top the inset at the top, in pixels.
+ * @param left the inset at the left, in pixels.
+ * @param bottom the inset at the bottom, in pixels.
+ * @param right the inset at the right, in pixels.
+ */
public InsetsUIResource(int top, int left, int bottom, int right)
{
super(top, left, bottom, right);
}
-} // class InsetsUIResource
+}
diff --git a/libjava/javax/swing/plaf/InternalFrameUI.java b/libjava/javax/swing/plaf/InternalFrameUI.java
index 3019460c74a..69bfb6506e2 100644
--- a/libjava/javax/swing/plaf/InternalFrameUI.java
+++ b/libjava/javax/swing/plaf/InternalFrameUI.java
@@ -1,5 +1,5 @@
/* InternalFrameUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,23 +37,23 @@ exception statement from your version. */
package javax.swing.plaf;
+
/**
- * InternalFrameUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JInternalFrame</code>.
+ *
+ * @see javax.swing.JInternalFrame
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class InternalFrameUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor InternalFrameUI
- */
- public InternalFrameUI() {
- // TODO
- } // InternalFrameUI()
-
-
-} // InternalFrameUI
+public abstract class InternalFrameUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>InternalFrameUI</code>.
+ */
+ public InternalFrameUI()
+ {
+ }
+}
diff --git a/libjava/javax/swing/plaf/LabelUI.java b/libjava/javax/swing/plaf/LabelUI.java
index dc70ae284a8..bda4448b9fe 100644
--- a/libjava/javax/swing/plaf/LabelUI.java
+++ b/libjava/javax/swing/plaf/LabelUI.java
@@ -1,5 +1,5 @@
/* LabelUI.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,7 +38,22 @@ exception statement from your version. */
package javax.swing.plaf;
-
-public class LabelUI extends ComponentUI
+/**
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JLabel</code>.
+ *
+ * @see javax.swing.JLabel
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public abstract class LabelUI
+ extends ComponentUI
{
+ /**
+ * Constructs a new <code>LabelUI</code>.
+ */
+ public LabelUI()
+ {
+ }
}
diff --git a/libjava/javax/swing/plaf/ListUI.java b/libjava/javax/swing/plaf/ListUI.java
index be60eb4863b..71ec7704cc7 100644
--- a/libjava/javax/swing/plaf/ListUI.java
+++ b/libjava/javax/swing/plaf/ListUI.java
@@ -1,5 +1,5 @@
/* ListUI.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,7 +38,77 @@ exception statement from your version. */
package javax.swing.plaf;
+import java.awt.Point;
+import java.awt.Rectangle;
+import javax.swing.JList;
-public class ListUI extends ComponentUI
+
+/**
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JList</code>.
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public abstract class ListUI
+ extends ComponentUI
{
+ /**
+ * Constructs a new <code>ListUI</code>.
+ */
+ public ListUI()
+ {
+ }
+
+
+ /**
+ * Determines the cell index which is the closest to the specified
+ * location. The find out whether the returned cell actually
+ * contains the location, the caller should also use {@link
+ * #getCellBounds}.
+ *
+ * @param list the <code>JList</code> for which this delegate object
+ * provides the pluggable user interface.
+ *
+ * @param location a point in the <code>JList</code> coordinate
+ * system.
+ *
+ * @return the index of the closest cell, or -1 if the list model
+ * is empty.
+ */
+ public abstract int locationToIndex(JList index, Point location);
+
+
+ /**
+ * Determines the location of the specified cell.
+ *
+ * @param list the <code>JList</code> for which this delegate object
+ * provides the pluggable user interface.
+ *
+ * @param index the zero-based index of the cell whose location shall be
+ * determined.
+ *
+ * @return the position of the top left corner of the cell in the
+ * <code>JList</code> coordinate system, or <code>null</code>
+ * if <code>cell</code> does not designate a valid cell.
+ */
+ public abstract Point indexToLocation(JList list, int index);
+
+
+ /**
+ * Determines the bounding box of the rectangle spanned by
+ * two list indices.
+ *
+ * @param list the <code>JList</code> for which this delegate object
+ * provides the pluggable user interface.
+ *
+ * @param index1 the zero-based index of the first cell.
+ *
+ * @param index2 the zero-based index of the second cell.
+ *
+ * @return the spanned rectangle, or <code>null</code> if either
+ * <code>index1</code> or <code>index2</code> does not
+ * designate a valid cell.
+ */
+ public abstract Rectangle getCellBounds(JList list,
+ int index1, int index2);
}
diff --git a/libjava/javax/swing/plaf/MenuBarUI.java b/libjava/javax/swing/plaf/MenuBarUI.java
index 84c29d13ef5..fa350b66015 100644
--- a/libjava/javax/swing/plaf/MenuBarUI.java
+++ b/libjava/javax/swing/plaf/MenuBarUI.java
@@ -1,5 +1,5 @@
/* MenuBarUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,23 +37,23 @@ exception statement from your version. */
package javax.swing.plaf;
+
/**
- * MenuBarUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JMenuBar</code>.
+ *
+ * @see javax.swing.JMenuBar
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class MenuBarUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor MenuBarUI
- */
- public MenuBarUI() {
- // TODO
- } // MenuBarUI()
-
-
-} // MenuBarUI
+public abstract class MenuBarUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>MenuBarUI</code>.
+ */
+ public MenuBarUI()
+ {
+ }
+}
diff --git a/libjava/javax/swing/plaf/MenuItemUI.java b/libjava/javax/swing/plaf/MenuItemUI.java
index a9271219c83..c44d1f441a9 100644
--- a/libjava/javax/swing/plaf/MenuItemUI.java
+++ b/libjava/javax/swing/plaf/MenuItemUI.java
@@ -1,5 +1,5 @@
/* MenuItemUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,23 +37,23 @@ exception statement from your version. */
package javax.swing.plaf;
+
/**
- * MenuItemUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JMenuItem</code>.
+ *
+ * @see javax.swing.JMenuItem
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class MenuItemUI extends ButtonUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor MenuItemUI
- */
- public MenuItemUI() {
- // TODO
- } // MenuItemUI()
-
-
-} // MenuItemUI
+public abstract class MenuItemUI
+ extends ButtonUI
+{
+ /**
+ * Constructs a new <code>MenuItemUI</code>.
+ */
+ public MenuItemUI()
+ {
+ }
+}
diff --git a/libjava/javax/swing/plaf/OptionPaneUI.java b/libjava/javax/swing/plaf/OptionPaneUI.java
index 94de7943292..8a954537a74 100644
--- a/libjava/javax/swing/plaf/OptionPaneUI.java
+++ b/libjava/javax/swing/plaf/OptionPaneUI.java
@@ -1,5 +1,5 @@
/* OptionPaneUI.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,10 +35,41 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-
package javax.swing.plaf;
-import javax.accessibility.*;
-public class OptionPaneUI extends ComponentUI
+import javax.swing.JOptionPane;
+
+/**
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JOptionPane</code>.
+ *
+ * @see javax.swing.JOptionPane
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public abstract class OptionPaneUI
+ extends ComponentUI
{
+ /**
+ * Gives keyboard input focus to the component that represents
+ * the default value.
+ *
+ * @param pane the <code>JOptionPane</code> for which this delegate
+ * object provides the pluggable user interface.
+ */
+ public abstract void selectInitialValue(JOptionPane pane);
+
+
+ /**
+ * Determines whether the user has provided custom components
+ * for the options or the message.
+ *
+ * @param pane the <code>JOptionPane</code> for which this delegate
+ * object provides the pluggable user interface.
+ *
+ * @return <code>true</code> if the user has supplied any custom
+ * components; <code>false</code> if all components are
+ * provided by Swing or a LookAndFeel.
+ */
+ public abstract boolean containsCustomComponents(JOptionPane pane);
}
diff --git a/libjava/javax/swing/plaf/PanelUI.java b/libjava/javax/swing/plaf/PanelUI.java
index 8a418342e82..d39d2e54735 100644
--- a/libjava/javax/swing/plaf/PanelUI.java
+++ b/libjava/javax/swing/plaf/PanelUI.java
@@ -1,5 +1,5 @@
/* PanelUI.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,7 +38,21 @@ exception statement from your version. */
package javax.swing.plaf;
-
-public class PanelUI extends ComponentUI
+/**
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JPanel</code>.
+ *
+ * @see javax.swing.JPanel
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public abstract class PanelUI
+ extends ComponentUI
{
+ /**
+ * Constructs a new <code>PanelUI</code>.
+ */
+ public PanelUI()
+ {
+ }
}
diff --git a/libjava/javax/swing/plaf/PopupMenuUI.java b/libjava/javax/swing/plaf/PopupMenuUI.java
index d1faa78d146..1871b9b7985 100644
--- a/libjava/javax/swing/plaf/PopupMenuUI.java
+++ b/libjava/javax/swing/plaf/PopupMenuUI.java
@@ -1,5 +1,5 @@
/* PopupMenuUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,40 +37,80 @@ exception statement from your version. */
package javax.swing.plaf;
-// Imports
-import java.awt.event.*;
+import java.awt.event.MouseEvent;
+import javax.swing.JPopupMenu;
+import javax.swing.Popup;
+import javax.swing.PopupFactory;
+
/**
- * PopupMenuUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JPopupMenu</code>.
+ *
+ * @see javax.swing.JPopupMenu
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class PopupMenuUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor PopupMenuUI
- */
- public PopupMenuUI() {
- // TODO
- } // PopupMenuUI()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * isPopupTrigger
- * @param event TODO
- * @returns boolean
- */
- public boolean isPopupTrigger(MouseEvent event) {
- return false; // TODO
- } // isPopupTrigger()
-
-
-} // PopupMenuUI
+public abstract class PopupMenuUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>PopupMenuUI</code>.
+ */
+ public PopupMenuUI()
+ {
+ }
+
+
+ /**
+ * Tests whether or not a mouse event triggers a popup menu.
+ *
+ * <p>The default implementation calls
+ * <code>event.isPopupTrigger()</code>, which checks for the gesture
+ * that is common for the platform on which the application runs. If
+ * a look and feel wants to employ non-standard conventions for
+ * triggering a popup menu, it can override this method.
+ *
+ * @param event the event to check.
+ *
+ * @return <code>true</code> if the event triggers a popup menu;
+ * <code>false</code> otherwise.
+ *
+ * @since 1.3
+ */
+ public boolean isPopupTrigger(MouseEvent event)
+ {
+ return event.isPopupTrigger();
+ }
+
+
+ /**
+ * Creates a <code>Popup</code> for displaying the popup menu. The
+ * default implementation uses the {@link javax.swing.PopupFactory}
+ * for retrieving a suitable <code>Popup</code>, but subclasses
+ * might want to override this method if a LookAndFeel needs special
+ * Popups.
+ *
+ * @param popup the <code>JPopupMenu</code> for whose display
+ * a <code>Popup</code> is needed.
+ *
+ * @param x the horizontal position where the popup will be
+ * displayed.
+ *
+ * @param y the vertical position where the popup will be
+ * displayed.
+ *
+ * @return a <code>Popup</code> for showing and hiding
+ * the menu.
+ *
+ * @since 1.4
+ */
+ public Popup getPopup(JPopupMenu popup, int x, int y)
+ {
+ return PopupFactory.getSharedInstance().getPopup(
+ /* origin/owner of the popup */ popup.getInvoker(),
+ /* contents */ popup,
+ x, y);
+ }
+}
diff --git a/libjava/javax/swing/plaf/ProgressBarUI.java b/libjava/javax/swing/plaf/ProgressBarUI.java
index c5f6466e7ab..28ea6f3a97a 100644
--- a/libjava/javax/swing/plaf/ProgressBarUI.java
+++ b/libjava/javax/swing/plaf/ProgressBarUI.java
@@ -1,5 +1,5 @@
/* ProgressBarUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,23 +37,23 @@ exception statement from your version. */
package javax.swing.plaf;
+
/**
- * ProgressBarUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JProgressBar</code>.
+ *
+ * @see javax.swing.JProgressBar
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class ProgressBarUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor ProgressBarUI
- */
- public ProgressBarUI() {
- // TODO
- } // ProgressBarUI()
-
-
-} // ProgressBarUI
+public abstract class ProgressBarUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>ProgressBarUI</code>.
+ */
+ public ProgressBarUI()
+ {
+ }
+}
diff --git a/libjava/javax/swing/plaf/RootPaneUI.java b/libjava/javax/swing/plaf/RootPaneUI.java
index 53529fa6e89..0943c9882e4 100644
--- a/libjava/javax/swing/plaf/RootPaneUI.java
+++ b/libjava/javax/swing/plaf/RootPaneUI.java
@@ -1,5 +1,5 @@
/* RootPaneUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,22 +38,21 @@ exception statement from your version. */
package javax.swing.plaf;
/**
- * RootPaneUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JRootPane</code>.
+ *
+ * @see javax.swing.JRootPane
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class RootPaneUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor RootPaneUI
- */
- public RootPaneUI() {
- // TODO
- } // RootPaneUI()
-
-
-} // RootPaneUI
+public abstract class RootPaneUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>RootPaneUI</code>.
+ */
+ public RootPaneUI()
+ {
+ }
+}
diff --git a/libjava/javax/swing/plaf/ScrollBarUI.java b/libjava/javax/swing/plaf/ScrollBarUI.java
index 0d778f3daa4..37c0cf783cd 100644
--- a/libjava/javax/swing/plaf/ScrollBarUI.java
+++ b/libjava/javax/swing/plaf/ScrollBarUI.java
@@ -1,5 +1,5 @@
/* ScrollBarUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,22 +38,21 @@ exception statement from your version. */
package javax.swing.plaf;
/**
- * ScrollBarUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JScrollBar</code>.
+ *
+ * @see javax.swing.JScrollBar
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class ScrollBarUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor ScrollBarUI
- */
- public ScrollBarUI() {
- // TODO
- } // ScrollBarUI()
-
-
-} // ScrollBarUI
+public abstract class ScrollBarUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>ScrollBarUI</code>.
+ */
+ public ScrollBarUI()
+ {
+ }
+}
diff --git a/libjava/javax/swing/plaf/ScrollPaneUI.java b/libjava/javax/swing/plaf/ScrollPaneUI.java
index 3b36b08012b..7d0bb892ada 100644
--- a/libjava/javax/swing/plaf/ScrollPaneUI.java
+++ b/libjava/javax/swing/plaf/ScrollPaneUI.java
@@ -1,5 +1,5 @@
/* ScrollPaneUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,23 +37,23 @@ exception statement from your version. */
package javax.swing.plaf;
+
/**
- * ScrollPaneUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JScrollPane</code>.
+ *
+ * @see javax.swing.JScrollPane
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class ScrollPaneUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor ScrollPaneUI
- */
- public ScrollPaneUI() {
- // TODO
- } // ScrollPaneUI()
-
-
-} // ScrollPaneUI
+public abstract class ScrollPaneUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>ScrollPaneUI</code>.
+ */
+ public ScrollPaneUI()
+ {
+ }
+}
diff --git a/libjava/javax/swing/plaf/SeparatorUI.java b/libjava/javax/swing/plaf/SeparatorUI.java
index 23622a06286..03778b95d14 100644
--- a/libjava/javax/swing/plaf/SeparatorUI.java
+++ b/libjava/javax/swing/plaf/SeparatorUI.java
@@ -1,5 +1,5 @@
/* SeparatorUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,22 +38,21 @@ exception statement from your version. */
package javax.swing.plaf;
/**
- * SeparatorUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JSeparator</code>.
+ *
+ * @see javax.swing.JSeparator
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class SeparatorUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor SeparatorUI
- */
- public SeparatorUI() {
- // TODO
- } // SeparatorUI()
-
-
-} // SeparatorUI
+public abstract class SeparatorUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>SeparatorUI</code>.
+ */
+ public SeparatorUI()
+ {
+ }
+}
diff --git a/libjava/javax/swing/plaf/SliderUI.java b/libjava/javax/swing/plaf/SliderUI.java
index 59d51c10d51..2a839f802d6 100644
--- a/libjava/javax/swing/plaf/SliderUI.java
+++ b/libjava/javax/swing/plaf/SliderUI.java
@@ -1,5 +1,5 @@
/* SliderUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,23 +37,23 @@ exception statement from your version. */
package javax.swing.plaf;
+
/**
- * SliderUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JSlider</code>.
+ *
+ * @see javax.swing.JSlider
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class SliderUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor SliderUI
- */
- public SliderUI() {
- // TODO
- } // SliderUI()
-
-
-} // SliderUI
+public abstract class SliderUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>SliderUI</code>.
+ */
+ public SliderUI()
+ {
+ }
+}
diff --git a/libjava/javax/swing/plaf/SplitPaneUI.java b/libjava/javax/swing/plaf/SplitPaneUI.java
index 6448ba86653..020a54a626f 100644
--- a/libjava/javax/swing/plaf/SplitPaneUI.java
+++ b/libjava/javax/swing/plaf/SplitPaneUI.java
@@ -1,5 +1,5 @@
/* SplitPaneUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,75 +37,97 @@ exception statement from your version. */
package javax.swing.plaf;
-// Imports
-import java.awt.*;
-import javax.swing.*;
+
+import java.awt.Graphics;
+import javax.swing.JSplitPane;
+
/**
- * SplitPaneUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JSplitPane</code>.
+ *
+ * @see javax.swing.JSplitPane
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class SplitPaneUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor SplitPaneUI
- */
- public SplitPaneUI() {
- // TODO
- } // SplitPaneUI()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * resetToPreferredSizes
- * @param splitpane TODO
- */
- public abstract void resetToPreferredSizes(JSplitPane splitpane);
-
- /**
- * setDividerLocation
- * @param splitpane TODO
- * @param location TODO
- */
- public abstract void setDividerLocation(JSplitPane splitpane,
- int location);
-
- /**
- * getDividerLocation
- * @param splitpane TODO
- * @returns int
- */
- public abstract int getDividerLocation(JSplitPane splitpane);
-
- /**
- * getMinimumDividerLocation
- * @param splitpane TODO
- * @returns int
- */
- public abstract int getMinimumDividerLocation(JSplitPane splitpane);
-
- /**
- * getMaximumDividerLocation
- * @param splitpane TODO
- * @returns int
- */
- public abstract int getMaximumDividerLocation(JSplitPane splitpane);
-
- /**
- * finishedPaintingChildren
- * @param splitpane TODO
- * @param graphics TODO
- */
- public abstract void finishedPaintingChildren(JSplitPane splitpane,
- Graphics graphics);
-
-
-} // SplitPaneUI
+public abstract class SplitPaneUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>SplitPaneUI</code>.
+ */
+ public SplitPaneUI()
+ {
+ }
+
+
+ /**
+ * Moves the divider to the location which best respects
+ * the preferred sizes of the children.
+ *
+ * @param pane the <code>JSplitPane</code> for thich this
+ * delegate provides the look and feel.
+ */
+ public abstract void resetToPreferredSizes(JSplitPane pane);
+
+
+ /**
+ * Moves the divider to the specified location.
+ *
+ * @param pane the <code>JSplitPane</code> for thich this
+ * delegate provides the look and feel.
+ *
+ * @param location the new location of the divider.
+ */
+ public abstract void setDividerLocation(JSplitPane pane,
+ int location);
+
+
+ /**
+ * Determines the current location of the divider.
+ *
+ * @param pane the <code>JSplitPane</code> for thich this
+ * delegate provides the look and feel.
+ *
+ * @return the current location of the divider.
+ */
+ public abstract int getDividerLocation(JSplitPane pane);
+
+
+ /**
+ * Determines the minimum location of the divider.
+ *
+ * @param pane the <code>JSplitPane</code> for thich this
+ * delegate provides the look and feel.
+ *
+ * @return the leftmost (or topmost) possible location
+ * of the divider.
+ */
+ public abstract int getMinimumDividerLocation(JSplitPane pane);
+
+
+ /**
+ * Determines the maximum location of the divider.
+ *
+ * @param pane the <code>JSplitPane</code> for thich this
+ * delegate provides the look and feel.
+ *
+ * @return the bottommost (or rightmost) possible location
+ * of the divider.
+ */
+ public abstract int getMaximumDividerLocation(JSplitPane pane);
+
+
+ /**
+ * Called by the <code>JSplitPane</code> after it has finished
+ * painting its children.
+ *
+ * @param pane the <code>JSplitPane</code> for thich this
+ * delegate provides the look and feel.
+ *
+ * @param g the Graphics used for painting.
+ */
+ public abstract void finishedPaintingChildren(JSplitPane pane,
+ Graphics g);
+}
diff --git a/libjava/javax/swing/plaf/TabbedPaneUI.java b/libjava/javax/swing/plaf/TabbedPaneUI.java
index a9211c96705..20c36c30c21 100644
--- a/libjava/javax/swing/plaf/TabbedPaneUI.java
+++ b/libjava/javax/swing/plaf/TabbedPaneUI.java
@@ -1,5 +1,5 @@
/* TabbedPaneUI.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,24 +38,74 @@ exception statement from your version. */
package javax.swing.plaf;
-import java.awt.*;
-import javax.swing.*;
+import java.awt.Rectangle;
+import javax.swing.JTabbedPane;
-public class TabbedPaneUI extends ComponentUI
+
+/**
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JTabbedPane</code>.
+ *
+ * @see javax.swing.JTabbedPane
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public abstract class TabbedPaneUI
+ extends ComponentUI
{
- public Rectangle getTabBounds(JTabbedPane pane, int index)
- {
- return null;
- }
-
- public int getTabRunCount(JTabbedPane pane)
- {
- return 0;
- }
-
- public int tabForCoordinate(JTabbedPane pane, int x, int y)
- {
- return 0;
- }
+ /**
+ * Constructs a new <code>TabbedPaneUI</code>.
+ */
+ public TabbedPaneUI()
+ {
+ }
+
+
+ /**
+ * Determines which tab lies at a given position.
+ *
+ * @param pane the <code>JTabbedPane</code> for which this
+ * delegate object provides the user interface.
+ *
+ * @param x the horizontal position, where zero is the left
+ * edge of <code>pane</code>.
+ *
+ * @param y the vertical position, where zero is the top
+ * edge of <code>pane</code>.
+ *
+ * @return the zero-based index of the tab, or -1 if no
+ * tab is at the specified position.
+ */
+ public abstract int tabForCoordinate(JTabbedPane pane,
+ int x, int y);
+
+
+ /**
+ * Calculates the bounding box of a tab.
+ *
+ * @param pane the <code>JTabbedPane</code> for which this
+ * delegate object provides the user interface.
+ *
+ * @param index the index of the tab, which must be an integer
+ * in the range <code>[0 .. pane.getTabCount() - 1]</code>.
+ *
+ * @return the bounding box of the <code>index</code>-th tab,
+ * in the coordinate system of <code>pane</code>.
+ */
+ public abstract Rectangle getTabBounds(JTabbedPane pane, int index);
+
+
+ /**
+ * Determines how many runs are used to display tabs.
+ *
+ * @param pane the <code>JTabbedPane</code> for which this
+ * delegate object provides the user interface.
+ *
+ * @return the number of tab runs.
+ *
+ * @see javax.swing.JTabbedPane#getTabRunCount()
+ */
+ public abstract int getTabRunCount(JTabbedPane pane);
}
diff --git a/libjava/javax/swing/plaf/TableHeaderUI.java b/libjava/javax/swing/plaf/TableHeaderUI.java
index 4510be588ea..26bc9e29b5d 100644
--- a/libjava/javax/swing/plaf/TableHeaderUI.java
+++ b/libjava/javax/swing/plaf/TableHeaderUI.java
@@ -1,5 +1,5 @@
/* TableHeaderUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,23 +37,23 @@ exception statement from your version. */
package javax.swing.plaf;
+
/**
- * TableHeaderUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JTableHeader</code>.
+ *
+ * @see javax.swing.table.JTableHeader
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class TableHeaderUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor TableHeaderUI
- */
- public TableHeaderUI() {
- // TODO
- } // TableHeaderUI()
-
-
-} // TableHeaderUI
+public abstract class TableHeaderUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>TableHeaderUI</code>.
+ */
+ public TableHeaderUI()
+ {
+ }
+}
diff --git a/libjava/javax/swing/plaf/TableUI.java b/libjava/javax/swing/plaf/TableUI.java
index 473e04ebad4..7062b93cc12 100644
--- a/libjava/javax/swing/plaf/TableUI.java
+++ b/libjava/javax/swing/plaf/TableUI.java
@@ -1,5 +1,5 @@
/* TableUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,23 +37,23 @@ exception statement from your version. */
package javax.swing.plaf;
+
/**
- * TableUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JTable</code>.
+ *
+ * @see javax.swing.JTable
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class TableUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor TableUI
- */
- public TableUI() {
- // TODO
- } // TableUI()
-
-
-} // TableUI
+public abstract class TableUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>TableUI</code>.
+ */
+ public TableUI()
+ {
+ }
+}
diff --git a/libjava/javax/swing/plaf/TextUI.java b/libjava/javax/swing/plaf/TextUI.java
index abf5316d215..14f89d6006e 100644
--- a/libjava/javax/swing/plaf/TextUI.java
+++ b/libjava/javax/swing/plaf/TextUI.java
@@ -1,5 +1,5 @@
/* TextUI.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,27 +38,247 @@ exception statement from your version. */
package javax.swing.plaf;
-import javax.swing.text.*;
-import java.awt.*;
+import java.awt.Point;
+import java.awt.Rectangle;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.EditorKit;
+import javax.swing.text.JTextComponent;
+import javax.swing.text.Position;
+import javax.swing.text.View;
-public abstract class TextUI extends ComponentUI
+
+/**
+ * An abstract base class for delegates that provide the user
+ * interface for text editors.
+ *
+ * @see javax.swing.text.JTextComponent
+ *
+ * @author Ronald Veldema (rveldema@cs.vu.nl)
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public abstract class TextUI
+ extends ComponentUI
{
- public TextUI()
- {
- }
-
- public abstract void damageRange(JTextComponent t, int p0, int p1);
- public abstract void damageRange(JTextComponent t, int p0, int p1, Position.Bias firstBias, Position.Bias secondBias);
- public abstract EditorKit getEditorKit(JTextComponent t);
- public abstract int getNextVisualPositionFrom(JTextComponent t,
- int pos,
- Position.Bias b,
- int direction,
- Position.Bias[] biasRet);
- public abstract View getRootView(JTextComponent t);
- public abstract Rectangle modelToView(JTextComponent t, int pos);
- public abstract Rectangle modelToView(JTextComponent t, int pos, Position.Bias bias);
- public abstract int viewToModel(JTextComponent t, Point pt);
- public abstract int viewToModel(JTextComponent t, Point pt, Position.Bias[] biasReturn);
+ /**
+ * Constructs a new <code>TextUI</code>.
+ */
+ public TextUI()
+ {
+ }
+
+
+ /**
+ * Calculates the geometric extent of the character at the
+ * given offset.
+ *
+ * @param tc the <code>JTextComponent</code> for which this
+ * delegate object provides the user interface.
+ *
+ * @param pos the zero-based index of the character into the
+ * document model.
+ *
+ * @return the bounding box of the character at index
+ * <code>pos</code>, in view coordinates.
+ *
+ * @throws BadLocationException if <code>pos</code> does not
+ * designate a valid position in the document model.
+ *
+ * @see javax.swing.text.View#modelToView(int,
+ * javax.swing.text.Position.Bias, int,
+ * javax.swing.text.position.Bias, java.awt.Shape)
+ */
+ public abstract Rectangle modelToView(JTextComponent tc, int pos)
+ throws BadLocationException;
+
+
+ /**
+ * Calculates the geometric extent of the character at the
+ * given offset.
+ *
+ * @param tc the <code>JTextComponent</code> for which this
+ * delegate object provides the user interface.
+ *
+ * @param pos the zero-based index of the character into the
+ * document model.
+ *
+ * @param bias whether to take the character before or after the
+ * caret position indicated by <code>pos</code>. The value
+ * must be either {@link
+ * javax.swing.text.Position.Bias#Backward} or {@link
+ * javax.swing.text.Position.Bias#Forward}.
+ *
+ * @return the bounding box of the character at index
+ * <code>pos</code>, in view coordinates.
+ *
+ * @throws BadLocationException if <code>pos</code> does not
+ * designate a valid position in the document model.
+ *
+ * @see javax.swing.text.View#modelToView(int,
+ * javax.swing.text.Position.Bias, int,
+ * javax.swing.text.position.Bias, java.awt.Shape)
+ */
+ public abstract Rectangle modelToView(JTextComponent tc, int pos,
+ Position.Bias bias)
+ throws BadLocationException;
+
+
+ /**
+ * Finds the caret position which is closest to the specified visual
+ * location.
+ *
+ * @param tc the <code>JTextComponent</code> for which this
+ * delegate object provides the user interface.
+ *
+ * @param loc the position in view coordinates.
+ *
+ * @return the caret position which is closest to <code>loc</code>.
+ *
+ * @see #viewToModel(JTextComponent, Point, Position.Bias[])
+ */
+ public abstract int viewToModel(JTextComponent t, Point pt);
+
+
+ /**
+ * Finds the caret position which is closest to the specified visual
+ * location.
+ *
+ * @param tc the <code>JTextComponent</code> for which this
+ * delegate object provides the user interface.
+ *
+ * @param loc the position in view coordinates.
+ *
+ * @param outBias an array whose size must be at least one.
+ * After the call, <code>outBias[0]</code> will indicate
+ * whether <code>loc</code> is in the glyph before
+ * (<code>Position.Bias.Backward</code>) or after
+ * (<code>Position.Bias.Forward</code>) the returned
+ * caret position.
+ *
+ * @return the caret position which is closest to <code>loc</code>.
+ */
+ public abstract int viewToModel(JTextComponent tc, Point loc,
+ Position.Bias[] outBias);
+
+
+ /**
+ * Calculates the caret position that is visually next to the given
+ * position. This is useful to determine where to move the caret
+ * after the user has pressed an arrow key.
+ *
+ * @param tc the <code>JTextComponent</code> for which this
+ * delegate object provides the user interface.
+ *
+ * @param pos the current caret position, a zero-based index
+ * into the document model.
+ *
+ * @param bias whether to take the character before or after the
+ * caret position indicated by <code>pos</code>. The value
+ * must be either {@link
+ * javax.swing.text.Position.Bias#Backward} or {@link
+ * javax.swing.text.Position.Bias#Forward}.
+ *
+ * @param direction the visual direction. Pass
+ * {@link javax.swing.SwingConstants#WEST} for the left
+ * arrow key, {@link javax.swing.SwingConstants#EAST}
+ * for the right arrow key, {@link
+ * javax.swing.SwingConstants#NORTH} for the up arrow
+ * key, or {@link javax.swing.SwingConstants#SOUTH}
+ * for the down arrow key.
+ *
+ * @throws BadLocationException if <code>pos</code> does not
+ * designate a valid position in the document model.
+ *
+ * @throws IllegalArgumentException if <code>direction</code>
+ * is not one of <code>Position.Bias.Forward</code>
+ * or <code>Position.Biad.Backward</code>.
+ */
+ public abstract int getNextVisualPositionFrom(JTextComponent tc,
+ int pos,
+ Position.Bias bias,
+ int direction,
+ Position.Bias[] outBias)
+ throws BadLocationException;
+
+
+ /**
+ * Repaints a range of characters.
+ *
+ * @param tc the <code>JTextComponent</code> for which this
+ * delegate object provides the user interface.
+ *
+ * @param start the first character in the range that needs
+ * painting, indicated as an index into the document model.
+ *
+ * @param end the last character in the range that needs
+ * painting, indicated as an index into the document model.
+ * <code>end</code> must be greater than or equal to
+ * <code>start</code>.
+ */
+ public abstract void damageRange(JTextComponent tc, int start, int end);
+
+
+ /**
+ * Repaints a range of characters, also specifying the bias for the
+ * start and end of the range.
+ *
+ * @param tc the <code>JTextComponent</code> for which this
+ * delegate object provides the user interface.
+ *
+ * @param start the first character in the range that needs
+ * painting, indicated as an index into the document model.
+ *
+ * @param end the last character in the range that needs
+ * painting, indicated as an index into the document model.
+ * <code>end</code> must be greater than or equal to
+ * <code>start</code>.
+ */
+ public abstract void damageRange(JTextComponent tc,
+ int start, int end,
+ Position.Bias startBias,
+ Position.Bias endBias);
+
+
+ /**
+ * Retrieves the <code>EditorKit</code> managing policies and
+ * persistent state.
+ *
+ * @param tc the <code>JTextComponent</code> for which this
+ * delegate object provides the user interface.
+ *
+ * @return the <code>EditorKit</code> used by <code>tc</code>.
+ */
+ public abstract EditorKit getEditorKit(JTextComponent tc);
+
+
+ /**
+ * Retrieves the root of the view tree that visually presents
+ * the text.
+ *
+ * @param tc the <code>JTextComponent</code> for which this
+ * delegate object provides the user interface.
+ *
+ * @return the root <code>View</code> used by <code>tc</code>.
+ */
+ public abstract View getRootView(JTextComponent tc);
+
+
+ /**
+ * Returns a String for presenting a tool tip at the specified
+ * location.
+ *
+ * @param tc the <code>JTextComponent</code> for which this
+ * delegate object provides the user interface.
+ *
+ * @param loc the location for which the tool tip is requested.
+ *
+ * @return the text for the tool tip, or <code>null</code> to
+ * display no tool tip.
+ *
+ * @since 1.4
+ */
+ public String getToolTipText(JTextComponent tc, Point loc)
+ {
+ return null;
+ }
}
diff --git a/libjava/javax/swing/plaf/ToolBarUI.java b/libjava/javax/swing/plaf/ToolBarUI.java
index 80d0d1db317..18b27d3aebd 100644
--- a/libjava/javax/swing/plaf/ToolBarUI.java
+++ b/libjava/javax/swing/plaf/ToolBarUI.java
@@ -1,5 +1,5 @@
/* ToolBarUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,23 +37,23 @@ exception statement from your version. */
package javax.swing.plaf;
+
/**
- * ToolBarUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JToolBar</code>.
+ *
+ * @see javax.swing.JToolBar
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class ToolBarUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor ToolBarUI
- */
- public ToolBarUI() {
- // TODO
- } // ToolBarUI()
-
-
-} // ToolBarUI
+public abstract class ToolBarUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>ToolBarUI</code>.
+ */
+ public ToolBarUI()
+ {
+ }
+}
diff --git a/libjava/javax/swing/plaf/ToolTipUI.java b/libjava/javax/swing/plaf/ToolTipUI.java
index f325fd0f718..4f332a635e6 100644
--- a/libjava/javax/swing/plaf/ToolTipUI.java
+++ b/libjava/javax/swing/plaf/ToolTipUI.java
@@ -1,5 +1,5 @@
/* ToolTipUI.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,23 +37,23 @@ exception statement from your version. */
package javax.swing.plaf;
+
/**
- * ToolTipUI
- * @author Andrew Selkirk
- * @version 1.0
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JToolTip</code>.
+ *
+ * @see javax.swing.JToolTip
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public abstract class ToolTipUI extends ComponentUI {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor ToolTipUI
- */
- public ToolTipUI() {
- // TODO
- } // ToolTipUI()
-
-
-} // ToolTipUI
+public abstract class ToolTipUI
+ extends ComponentUI
+{
+ /**
+ * Constructs a new <code>ToolTipUI</code>.
+ */
+ public ToolTipUI()
+ {
+ }
+}
diff --git a/libjava/javax/swing/plaf/TreeUI.java b/libjava/javax/swing/plaf/TreeUI.java
index f5f884fca2a..59dca9d877f 100644
--- a/libjava/javax/swing/plaf/TreeUI.java
+++ b/libjava/javax/swing/plaf/TreeUI.java
@@ -1,5 +1,5 @@
/* TreeUI.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,7 +38,174 @@ exception statement from your version. */
package javax.swing.plaf;
+import java.awt.Rectangle;
+import javax.swing.JTree;
+import javax.swing.tree.TreePath;
-public class TreeUI extends ComponentUI
+
+/**
+ * An abstract base class for delegates that provide the user
+ * interface for <code>JTree</code>.
+ *
+ * @see javax.swing.JTree
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public abstract class TreeUI
+ extends ComponentUI
{
+ /**
+ * Constructs a new <code>TreeUI</code>.
+ */
+ public TreeUI()
+ {
+ }
+
+
+ /**
+ * Determines the geometric extent of the label that is
+ * drawn for a path.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ *
+ * @param path the path whose label extent is requested.
+ *
+ * @return a rectangle enclosing the label, or <code>null</code>
+ * if <code>path</code> contains invalid nodes.
+ */
+ public abstract Rectangle getPathBounds(JTree tree, TreePath path);
+
+
+ /**
+ * Creates a <code>TreePath</code> for the specified row.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ *
+ * @param row the index of the row, which should be a number
+ * in the range <code>[0, getRowCount(tree) - 1]</code>.
+ *
+ * @return a <code>TreePath</code> for the specified row, or
+ * <code>null</code> if <code>row</code> is outside
+ * the valid range.
+ */
+ public abstract TreePath getPathForRow(JTree tree, int row);
+
+
+ /**
+ * Determines in which row a <code>TreePath</code> is currently
+ * being displayed.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ *
+ * @param path the path for which the caller wants to know
+ * in which row it is being displayed.
+ *
+ * @return a number in the range <code>[0, getRowCount(tree)
+ * - 1]</code> if the path is currently on display;
+ * <code>-1</code> if the path is not shown to the
+ * user.
+ */
+ public abstract int getRowForPath(JTree tree, TreePath path);
+
+
+ /**
+ * Counts how many rows are currently displayed.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ *
+ * @return the number of visible rows.
+ */
+ public abstract int getRowCount(JTree tree);
+
+
+ /**
+ * Finds the path that is closest to the specified position.
+ *
+ * <p><img src="TreeUI-1.png" width="300" height="250"
+ * alt="[A screen shot of a JTree] />
+ *
+ * <p>As shown by the above illustration, the bounds of the
+ * closest path do not necessarily need to contain the passed
+ * location.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ *
+ * @param x the horizontal location, relative to the origin
+ * of <code>tree</code>.
+ *
+ * @param y the vertical location, relative to the origin
+ * of <code>tree</code>.
+ *
+ * @return the closest path, or <code>null</code> if the
+ * tree is currenlty not displaying any paths at all.
+ */
+ public abstract TreePath getClosestPathForLocation(JTree tree,
+ int x, int y);
+
+
+ /**
+ * Determines whether the user is currently editing a tree cell.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ *
+ * @see #getEditingPath
+ */
+ public abstract boolean isEditing(JTree tree);
+
+
+ /**
+ * Stops editing a tree cell, committing the entered value into the
+ * tree&#x2019;s model. If no editing session is active, or if the
+ * active editor does not agree to stopping, nothing happens. In
+ * some look and feels, this action happens when the user has
+ * pressed the enter key.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ *
+ * @return <code>false</code> if the editing still goes on because
+ * the cell editor has objected to stopping the session;
+ * <code>true</code> if editing has been stopped.
+ */
+ public abstract boolean stopEditing(JTree tree);
+
+
+ /**
+ * Cancels editing a tree cell, discarding any entered value.
+ * If no editing session is active, nothing happens. The cell
+ * editor is not given an opportunity to veto the canceling.
+ * In some look and feels, this action happens when the user has
+ * pressed the escape key.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ */
+ public abstract void cancelEditing(JTree tree);
+
+
+ /**
+ * Starts a session to edit a tree cell. If the cell editor
+ * rejects editing the cell, it will just be selected.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ *
+ * @param path the cell to edit.
+ */
+ public abstract void startEditingAtPath(JTree tree, TreePath path);
+
+
+ /**
+ * Retrieves the tree cell that is currently being edited.
+ *
+ * @return the currently edited path, or <code>null</code>
+ * if no editing session is currently active.
+ */
+ public abstract TreePath getEditingPath(JTree tree);
}
diff --git a/libjava/javax/swing/plaf/ViewportUI.java b/libjava/javax/swing/plaf/ViewportUI.java
index f9a8476936b..3b28920496c 100644
--- a/libjava/javax/swing/plaf/ViewportUI.java
+++ b/libjava/javax/swing/plaf/ViewportUI.java
@@ -1,5 +1,5 @@
/* ViewportUI.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,6 +39,22 @@ exception statement from your version. */
package javax.swing.plaf;
-public class ViewportUI extends ComponentUI
+/**
+ * An abstract base class for delegates that implement the pluggable
+ * look and feel for a <code>JViewport</code>.
+ *
+ * @see javax.swing.JViewport
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public abstract class ViewportUI
+ extends ComponentUI
{
+ /**
+ * Constructs a new <code>ViewportUI</code>.
+ */
+ public ViewportUI()
+ {
+ }
}
diff --git a/libjava/javax/swing/plaf/basic/BasicBorders.java b/libjava/javax/swing/plaf/basic/BasicBorders.java
index 3b2f2d128e1..8b8a8513fc3 100644
--- a/libjava/javax/swing/plaf/basic/BasicBorders.java
+++ b/libjava/javax/swing/plaf/basic/BasicBorders.java
@@ -1,5 +1,5 @@
/* BasicBorders.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,44 +37,1778 @@ exception statement from your version. */
package javax.swing.plaf.basic;
+
import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.Rectangle;
+import java.io.Serializable;
+import javax.swing.AbstractButton;
+import javax.swing.ButtonModel;
+import javax.swing.JButton;
+import javax.swing.JPopupMenu;
+import javax.swing.JSplitPane;
+import javax.swing.JToolBar;
+import javax.swing.UIDefaults;
+import javax.swing.UIManager;
+import javax.swing.border.AbstractBorder;
+import javax.swing.border.BevelBorder;
+import javax.swing.border.Border;
+import javax.swing.plaf.UIResource;
+import javax.swing.plaf.BorderUIResource;
+import javax.swing.text.JTextComponent;
+
+
/**
- * STUBBED
+ * Provides various borders for the Basic look and feel.
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public class BasicBorders
{
+ /**
+ * A MarginBorder that gets shared by multiple components.
+ * Created on demand by the private helper function {@link
+ * #getMarginBorder()}.
+ */
+ private static MarginBorder sharedMarginBorder;
+
+
+ /**
+ * Returns a border for drawing push buttons.
+ *
+ * <p>The colors of the border are retrieved from the
+ * <code>UIDefaults</code> of the currently active look and feel
+ * using the keys <code>&#x201c;Button.shadow&#x201d;</code>,
+ * <code>&#x201c;Button.darkShadow&#x201d;</code>,
+ * <code>&#x201c;Button.light&#x201d;</code>, and
+ * <code>&#x201c;Button.highlight&#x201d;</code>.
+ *
+ * <p><img src="BasicBorders.ButtonBorder-1.png" width="300"
+ * height="170" alt="[A screen shot of the returned border]" />
+ *
+ * @return a {@link
+ * javax.swing.plaf.BorderUIResource#CompoundBorderUIResource}
+ * whose outer border is a {@link #ButtonBorder} and whose
+ * inner border is a {@link #MarginBorder}.
+ */
+ public static Border getButtonBorder()
+ {
+ UIDefaults defaults;
+ Border outer;
+
+ defaults = UIManager.getLookAndFeelDefaults();
+
+ /* The keys for UIDefaults have been determined by writing a
+ * test program that dumps the UIDefaults to stdout; that program
+ * was run on a JDK 1.4.1_01 for GNU/Linux. Note that in the API,
+ * the key "light" is usually called "highlight", and "highlight"
+ * is usually called "lightHighlight".
+ */
+ outer = new ButtonBorder(defaults.getColor("Button.shadow"),
+ defaults.getColor("Button.darkShadow"),
+ defaults.getColor("Button.light"),
+ defaults.getColor("Button.highlight"));
+
+ /* While the inner border is shared between multiple buttons,
+ * we do not share the outer border because ButtonBorders store
+ * their border colors. We cannot guarantee that the colors
+ * (which come from UIDefaults) are unchanged between invocations
+ * of getButtonBorder. We could store the last colors, and share
+ * the button border if the colors are the same as in the last
+ * invocation, but it probably is not worth the effort.
+ */
+ return new BorderUIResource.CompoundBorderUIResource(
+ outer,
+ /* inner */ getMarginBorder());
+ }
+
+
+ /**
+ * Returns a border for drawing radio buttons.
+ *
+ * <p>The colors of the border are retrieved from the
+ * <code>UIDefaults</code> of the currently active look and feel
+ * using the keys <code>&#x201c;RadioButton.shadow&#x201d;</code>,
+ * <code>&#x201c;RadioButton.darkShadow&#x201d;</code>,
+ * <code>&#x201c;RadioButton.light&#x201d;</code>, and
+ * <code>&#x201c;RadioButton.highlight&#x201d;</code>.
+ *
+ * <p><img src="BasicBorders.RadioButtonBorder-1.png" width="300"
+ * height="135" alt="[A screen shot of the returned border]" />
+ *
+ * @return a {@link
+ * javax.swing.plaf.BorderUIResource#CompoundBorderUIResource}
+ * whose outer border is a {@link #RadioButtonBorder} and whose
+ * inner border is a {@link #MarginBorder}.
+ */
+ public static Border getRadioButtonBorder()
+ {
+ UIDefaults defaults;
+ Border outer;
+
+ defaults = UIManager.getLookAndFeelDefaults();
+
+ /* The keys for UIDefaults have been determined by writing a
+ * test program that dumps the UIDefaults to stdout; that program
+ * was run on a JDK 1.4.1_01 for GNU/Linux. Note that in the API,
+ * the key "light" is usually called "highlight", and "highlight"
+ * is usually called "lightHighlight".
+ */
+ outer = new RadioButtonBorder(
+ defaults.getColor("RadioButton.shadow"),
+ defaults.getColor("RadioButton.darkShadow"),
+ defaults.getColor("RadioButton.light"),
+ defaults.getColor("RadioButton.highlight"));
+
+ /* While the inner border is shared between multiple buttons, we
+ * do not share the outer border because RadioButtonBorders, being
+ * ButtonBorders, store their border colors. We cannot guarantee
+ * that the colors (which come from UIDefaults) are unchanged
+ * between invocations of getButtonBorder. We could store the last
+ * colors, and share the button border if the colors are the same
+ * as in the last invocation, but it probably is not worth the
+ * effort.
+ */
+ return new BorderUIResource.CompoundBorderUIResource(
+ outer,
+ /* inner */ getMarginBorder());
+ }
+
+
+ /**
+ * Returns a border for drawing toggle buttons.
+ *
+ * <p>The colors of the border are retrieved from the
+ * <code>UIDefaults</code> of the currently active look and feel
+ * using the keys <code>&#x201c;ToggleButton.shadow&#x201d;</code>,
+ * <code>&#x201c;ToggleButton.darkShadow&#x201d;</code>,
+ * <code>&#x201c;ToggleButton.light&#x201d;</code>, and
+ * <code>&#x201c;ToggleButton.highlight&#x201d;</code>.
+ *
+ * <p><img src="BasicBorders.ToggleButtonBorder-1.png" width="270"
+ * height="135" alt="[A screen shot of the returned border]" />
+ *
+ * @return a {@link
+ * javax.swing.plaf.BorderUIResource#CompoundBorderUIResource}
+ * whose outer border is a {@link #ToggleButtonBorder} and whose
+ * inner border is a {@link #MarginBorder}.
+ */
+ public static Border getToggleButtonBorder()
+ {
+ UIDefaults defaults;
+ Border outer;
+
+ defaults = UIManager.getLookAndFeelDefaults();
+
+ /* The keys for UIDefaults have been determined by writing a
+ * test program that dumps the UIDefaults to stdout; that program
+ * was run on a JDK 1.4.1_01 for GNU/Linux. Note that in the API,
+ * the key "light" is usually called "highlight", and "highlight"
+ * is usually called "lightHighlight".
+ */
+ outer = new ToggleButtonBorder(
+ defaults.getColor("ToggleButton.shadow"),
+ defaults.getColor("ToggleButton.darkShadow"),
+ defaults.getColor("ToggleButton.light"),
+ defaults.getColor("ToggleButton.highlight"));
+
+ /* While the inner border is shared between multiple buttons, we
+ * do not share the outer border because ToggleButtonBorders, being
+ * ButtonBorders, store their border colors. We cannot guarantee
+ * that the colors (which come from UIDefaults) are unchanged
+ * between invocations of getButtonBorder. We could store the last
+ * colors, and share the button border if the colors are the same
+ * as in the last invocation, but it probably is not worth the
+ * effort.
+ */
+ return new BorderUIResource.CompoundBorderUIResource(
+ outer,
+ /* inner */ getMarginBorder());
+ }
+
+
+ /**
+ * Returns a border for drawing a two-pixel thick separator line
+ * below menu bars.
+ *
+ * <p>The colors of the border are retrieved from the
+ * <code>UIDefaults</code> of the currently active look and feel
+ * using the keys <code>&#x201c;MenuBar.shadow&#x201d;</code> and
+ * <code>&#x201c;MenuBar.highlight&#x201d;</code>.
+ *
+ * <p><img src="BasicBorders.MenuBarBorder-1.png" width="500"
+ * height="140" alt="[A screen shot of a JMenuBar with this border]" />
+ *
+ * @return a {@link #MenuBarBorder}.
+ *
+ * @see javax.swing.JMenuBar
+ */
+ public static Border getMenuBarBorder()
+ {
+ UIDefaults defaults;
+
+ /* See comment in methods above for why this border is not shared. */
+ defaults = UIManager.getLookAndFeelDefaults();
+ return new MenuBarBorder(defaults.getColor("MenuBar.shadow"),
+ defaults.getColor("MenuBar.highlight"));
+ }
+
+
+ /**
+ * Returns a border for drawing a one-pixel thick border around
+ * split panes that are interrupted where the divider joins the
+ * border.
+ *
+ * <p>The colors of the border are retrieved from the
+ * <code>UIDefaults</code> of the currently active look and feel
+ * using the keys <code>&#x201c;SplitPane.darkShadow&#x201d;</code> and
+ * <code>&#x201c;SplitPane.highlight&#x201d;</code>.
+ *
+ * <p><img src="BasicBorders.SplitPaneBorder-1.png" width="520"
+ * height="200" alt="[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
+ *
+ * <p><img src="BasicBorders.SplitPaneBorder-2.png" width="520"
+ * height="200" alt="[A screen shot for JSplitPane.VERTICAL_SPLIT]" />
+ *
+ * @return a {@link #SplitPaneBorder}.
+ *
+ * @see javax.swing.JSplitPane
+ * @see #getSplitPaneDividerBorder()
+ */
+ public static Border getSplitPaneBorder()
+ {
+ UIDefaults defaults;
+
+ /* See comment in methods above for why this border is not shared. */
+ defaults = UIManager.getLookAndFeelDefaults();
+ return new SplitPaneBorder(defaults.getColor("SplitPane.highlight"),
+ defaults.getColor("SplitPane.darkShadow"));
+ }
+
+
+ /**
+ * Returns a border for drawing a one-pixel thick border around
+ * the divider of split panes.
+ *
+ * <p>The colors of the edges that are adjacent to the child components
+ * of the <code>JSplitPane</code> are retrieved from the
+ * <code>UIDefaults</code> of the currently active look and feel
+ * using the keys <code>&#x201c;SplitPane.darkShadow&#x201d;</code> and
+ * <code>&#x201c;SplitPane.highlight&#x201d;</code>. The color of the
+ * other two edges is the background color of the divider.
+ *
+ * <p><img src="BasicBorders.SplitPaneDividerBorder-1.png" width="520"
+ * height="200" alt="[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
+ *
+ * @return an instance of <code>SplitPaneDividerBorder</code>, which is
+ * not a public API class of this package.
+ *
+ * @see javax.swing.JSplitPane
+ * @see javax.swing.plaf.basic.BasicSplitPaneDivider
+ * @see #getSplitPaneBorder()
+ *
+ * @since 1.3
+ */
+ public static Border getSplitPaneDividerBorder()
+ {
+ UIDefaults defaults;
+
+ /* See comment in methods above for why this border is not shared. */
+ defaults = UIManager.getLookAndFeelDefaults();
+ return new SplitPaneDividerBorder(
+ defaults.getColor("SplitPane.highlight"),
+ defaults.getColor("SplitPane.darkShadow"));
+ }
+
+
+ /**
+ * Returns a border for drawing a border around a text field
+ * that makes the field appear as etched into the surface.
+ *
+ * <p>The colors of the border are retrieved from the
+ * <code>UIDefaults</code> of the currently active look and feel
+ * using the keys <code>&#x201c;TextField.shadow&#x201d;</code>,
+ * <code>&#x201c;TextField.darkShadow&#x201d;</code>,
+ * <code>&#x201c;TextField.light&#x201d;</code>, and
+ * <code>&#x201c;TextField.highlight&#x201d;</code>.
+ *
+ * <p><img src="BasicBorders.FieldBorder-1.png" width="500"
+ * height="200" alt="[A screen shot of a border returned by
+ * this method]" />
+ *
+ * @return an instance of
+ * {@link javax.swing.plaf.basic.BasicBorders$FieldBorder}.
+ *
+ * @see javax.swing.JTextField
+ * @see javax.swing.text.JTextComponent
+ */
+ public static Border getTextFieldBorder()
+ {
+ UIDefaults defaults;
+
+ /* See comment in methods above for why this border is not shared. */
+ defaults = UIManager.getLookAndFeelDefaults();
+ return new FieldBorder(
+ defaults.getColor("TextField.shadow"),
+ defaults.getColor("TextField.darkShadow"),
+ defaults.getColor("TextField.light"),
+ defaults.getColor("TextField.highlight"));
+ }
+
+
+ /**
+ * Returns a two-pixel thick, green
+ * <code>LineBorderUIResource</code>. This is so ugly that look and
+ * feels better use different borders for their progress bars, or
+ * they will look really terrible.
+ *
+ * <p><img src="BasicBorders-1.png" width="120" height="80"
+ * alt="[A screen shot of a border returned by this method]" />
+ */
+ public static Border getProgressBarBorder()
+ {
+ /* There does not seem to exist a way to parametrize the color
+ * or thickness of the border through UIDefaults.
+ */
+ return new BorderUIResource.LineBorderUIResource(Color.green, 2);
+ }
+
+
+ /**
+ * Returns a border that is composed of a raised bevel border and a
+ * one-pixel thick line border.
+ *
+ * <p><img src="BasicBorders-2.png" width="300" height="200"
+ * alt="[A screen shot of a border returned by this method]" />
+ *
+ * <p>The colors of the border are retrieved from the
+ * <code>UIDefaults</code> of the currently active look and feel
+ * using the keys <code>&#x201c;InternalFrame.borderShadow&#x201d;</code>,
+ * <code>&#x201c;InternalFrame.borderDarkShadow&#x201d;</code>,
+ * <code>&#x201c;InternalFrame.borderLight&#x201d;</code>,
+ * <code>&#x201c;InternalFrame.borderHighlight&#x201d;</code>, and
+ * (for the inner one-pixel thick line)
+ * <code>&#x201c;InternalFrame.borderColor&#x201d;</code>.
+ */
+ public static Border getInternalFrameBorder()
+ {
+ UIDefaults defaults;
+ Color shadow, darkShadow, highlight, lightHighlight, line;
+
+ /* See comment in methods above for why this border is not shared. */
+ defaults = UIManager.getLookAndFeelDefaults();
+
+ shadow = defaults.getColor("InternalFrame.borderShadow");
+ darkShadow = defaults.getColor("InternalFrame.borderDarkShadow");
+ highlight = defaults.getColor("InternalFrame.borderLight");
+ lightHighlight = defaults.getColor("InternalFrame.borderHighlight");
+ line = defaults.getColor("InternalFrame.borderColor");
+
+ return new BorderUIResource.CompoundBorderUIResource(
+ /* outer border */
+ new BorderUIResource.BevelBorderUIResource(
+ BevelBorder.RAISED,
+ (highlight != null) ? highlight : Color.lightGray,
+ (lightHighlight != null) ? lightHighlight : Color.white,
+ (darkShadow != null) ? darkShadow : Color.black,
+ (shadow != null) ? shadow : Color.gray),
+
+ /* inner border */
+ new BorderUIResource.LineBorderUIResource(
+ (line != null) ? line : Color.lightGray));
+ }
+
+
+ /**
+ * Returns a shared MarginBorder.
+ */
+ static Border getMarginBorder() // intentionally not public
+ {
+ /* Swing is not designed to be thread-safe, so there is no
+ * need to synchronize the access to the global variable.
+ */
+ if (sharedMarginBorder == null)
+ sharedMarginBorder = new MarginBorder();
+
+ return sharedMarginBorder;
+ }
+
+
+ /**
+ * A border whose appearance depends on the state of
+ * the enclosed button.
+ *
+ * <p><img src="BasicBorders.ButtonBorder-1.png" width="300"
+ * height="170" alt="[A screen shot of this border]" />
+ *
+ * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
public static class ButtonBorder
+ extends AbstractBorder
+ implements Serializable, UIResource
{
- } // class ButtonBorder
+ /**
+ * Determined using the <code>serialver</code> tool
+ * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
+ */
+ static final long serialVersionUID = -157053874580739687L;
+
+
+ /**
+ * The color for drawing the shaded parts of the border.
+ * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
+ */
+ protected Color shadow;
+
+
+ /**
+ * The color for drawing the dark shaded parts of the border.
+ * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
+ */
+ protected Color darkShadow;
+
+
+ /**
+ * The color for drawing the highlighted parts of the border.
+ * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
+ */
+ protected Color highlight;
+
+
+ /**
+ * The color for drawing the bright highlighted parts of the border.
+ * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
+ */
+ protected Color lightHighlight;
+
+
+ /**
+ * Constructs a new border for drawing a button in the Basic
+ * look and feel.
+ *
+ * @param shadow the shadow color.
+ * @param darkShadow a darker variant of the shadow color.
+ * @param highlight the highlight color.
+ * @param lightHighlight a brighter variant of the highlight color.
+ */
+ public ButtonBorder(Color shadow, Color darkShadow,
+ Color highlight, Color lightHighlight)
+ {
+ /* These colors usually come from the UIDefaults of the current
+ * look and feel. Use fallback values if the colors are not
+ * supplied. The API specification is silent about what
+ * behavior is expected for null colors, so users should not
+ * rely on this fallback (which is why it is not documented in
+ * the above Javadoc).
+ */
+ this.shadow = (shadow != null) ? shadow : Color.gray;
+ this.darkShadow = (darkShadow != null) ? darkShadow : Color.black;
+ this.highlight = (highlight != null) ? highlight : Color.lightGray;
+ this.lightHighlight = (lightHighlight != null)
+ ? lightHighlight
+ : Color.white;
+ }
+
+
+ /**
+ * Paints the ButtonBorder around a given component.
+ *
+ * @param c the component whose border is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ *
+ * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
+ */
+ public void paintBorder(Component c, Graphics g,
+ int x, int y, int width, int height)
+ {
+ ButtonModel bmodel = null;
+
+ if (c instanceof AbstractButton)
+ bmodel = ((AbstractButton) c).getModel();
+
+ BasicGraphicsUtils.drawBezel(
+ g, x, y, width, height,
+ /* pressed */ (bmodel != null)
+ && /* mouse button pressed */ bmodel.isPressed()
+ && /* mouse inside */ bmodel.isArmed(),
+ /* default */ (c instanceof JButton)
+ && ((JButton) c).isDefaultButton(),
+ shadow, darkShadow, highlight, lightHighlight);
+ }
+
+
+ /**
+ * Measures the width of this border.
+ *
+ * <p>Although the thickness of the actually painted border
+ * depends on the state of the enclosed component, this
+ * measurement always returns the same amount of pixels. Indeed,
+ * it would be rather confusing if a button was appearing to
+ * change its size depending on whether it is pressed or not.
+ *
+ * @param c the component whose border is to be measured.
+ *
+ * @return an Insets object whose <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ *
+ * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
+ */
+ public Insets getBorderInsets(Component c)
+ {
+ /* There is no obvious reason for overriding this method, but we
+ * try to have exactly the same API as the Sun reference
+ * implementation.
+ */
+ return getBorderInsets(c, null);
+ }
+
+
+ /**
+ * Measures the width of this border, storing the results into a
+ * pre-existing Insets object.
+ *
+ * <p>Although the thickness of the actually painted border
+ * depends on the state of the enclosed component, this
+ * measurement always returns the same amount of pixels. Indeed,
+ * it would be rather confusing if a button was appearing to
+ * change its size depending on whether it is pressed or not.
+ *
+ * @param insets an Insets object for holding the result values.
+ * After invoking this method, the <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ *
+ * @return the same object that was passed for <code>insets</code>.
+ *
+ * @see #getBorderInsets()
+ */
+ public Insets getBorderInsets(Component c, Insets insets)
+ {
+ /* The exact amount has been determined using a test program
+ * that was run on the Sun reference implementation. With
+ * Apple/Sun JDK 1.3.1 on MacOS X 10.1.5, the result is
+ * [3, 3, 3, 3]. With Sun JDK 1.4.1_01 on Linux/x86, the
+ * result is [2, 3, 3, 3]. We use the values from the 1.4.1_01
+ * release.
+ */
+ if (insets == null)
+ return new Insets(2, 3, 3, 3);
+
+ insets.top = 2;
+ insets.bottom = insets.left = insets.right = 3;
+ return insets;
+ }
+ }
+
+
+ /**
+ * A border that makes its enclosed component appear as lowered
+ * into the surface. Typically used for text fields.
+ *
+ * <p><img src="BasicBorders.FieldBorder-1.png" width="500"
+ * height="200" alt="[A screen shot of this border]" />
+ *
+ * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawEtchedRect
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
public static class FieldBorder
+ extends AbstractBorder
+ implements UIResource
{
+ /**
+ * Determined using the <code>serialver</code> tool
+ * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
+ */
+ static final long serialVersionUID = 949220756998454908L;
+
+
+ /**
+ * The color for drawing the outer half of the top and left
+ * edges.
+ */
+ protected Color shadow;
+
+
+ /**
+ * The color for drawing the inner half of the top and left
+ * edges.
+ */
+ protected Color darkShadow;
+
+
+ /**
+ * The color for drawing the inner half of the bottom and right
+ * edges.
+ */
+ protected Color highlight;
+
+
+ /**
+ * The color for drawing the outer half of the bottom and right
+ * edges.
+ */
+ protected Color lightHighlight;
+
+
+ /**
+ * Constructs a new border for drawing a text field in the Basic
+ * look and feel.
+ *
+ * @param shadow the color for drawing the outer half
+ * of the top and left edges.
+ *
+ * @param darkShadow the color for drawing the inner half
+ * of the top and left edges.
+ *
+ * @param highlight the color for drawing the inner half
+ * of the bottom and right edges.
+ *
+ * @param lightHighlight the color for drawing the outer half
+ * of the bottom and right edges.
+ */
public FieldBorder(Color shadow, Color darkShadow,
Color highlight, Color lightHighlight)
{
+ /* These colors usually come from the UIDefaults of the current
+ * look and feel. Use fallback values if the colors are not
+ * supplied. The API specification is silent about what
+ * behavior is expected for null colors, so users should not
+ * rely on this fallback (which is why it is not documented in
+ * the above Javadoc).
+ */
+ this.shadow = (shadow != null) ? shadow : Color.gray;
+ this.darkShadow = (darkShadow != null) ? darkShadow : Color.black;
+ this.highlight = (highlight != null) ? highlight : Color.lightGray;
+ this.lightHighlight = (lightHighlight != null)
+ ? lightHighlight : Color.white;
}
- } // class FieldBorder
+
+
+ /**
+ * Paints the FieldBorder around a given component.
+ *
+ * @param c the component whose border is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ *
+ * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawEtchedRect
+ */
+ public void paintBorder(Component c, Graphics g,
+ int x, int y, int width, int height)
+ {
+ BasicGraphicsUtils.drawEtchedRect(g, x, y, width, height,
+ shadow, darkShadow,
+ highlight, lightHighlight);
+ }
+
+
+ /**
+ * Measures the width of this border.
+ *
+ * @param c the component whose border is to be measured.
+ * If <code>c</code> is an instance of {@link
+ * javax.swing.text.JTextComponent}, its margin is
+ * added to the border size.
+ *
+ * @return an Insets object whose <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ *
+ * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
+ */
+ public Insets getBorderInsets(Component c)
+ {
+ return getBorderInsets(c, null);
+ }
+
+
+ /**
+ * Measures the width of this border, storing the results into a
+ * pre-existing Insets object.
+ *
+ * @param c the component whose border is to be measured.
+ * If <code>c</code> is an instance of {@link
+ * javax.swing.text.JTextComponent}, its margin is
+ * added to the border size.
+ *
+ * @param insets an Insets object for holding the result values.
+ * After invoking this method, the <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ *
+ * @return the same object that was passed for <code>insets</code>.
+ *
+ * @see #getBorderInsets()
+ */
+ public Insets getBorderInsets(Component c, Insets insets)
+ {
+ if (insets == null)
+ insets = new Insets(2, 2, 2, 2);
+ else
+ insets.top = insets.left = insets.bottom = insets.right = 2;
+
+ if (c instanceof JTextComponent)
+ {
+ Insets margin = ((JTextComponent) c).getMargin();
+ insets.top += margin.top;
+ insets.left += margin.left;
+ insets.bottom += margin.bottom;
+ insets.right += margin.right;
+ }
+
+ return insets;
+ }
+ }
+
+
+ /**
+ * An invisible, but spacing border whose margin is determined
+ * by calling the <code>getMargin()</code> method of the enclosed
+ * component. If the enclosed component has no such method,
+ * this border will not occupy any space.
+ *
+ * <p><img src="BasicBorders.MarginBorder-1.png" width="325"
+ * height="200" alt="[An illustration that shows how MarginBorder
+ * determines its borders]" />
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
public static class MarginBorder
+ extends AbstractBorder
+ implements Serializable, UIResource
{
- } // class MarginBorder
+ /**
+ * Determined using the <code>serialver</code> tool
+ * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
+ */
+ static final long serialVersionUID = -3035848353448896090L;
+
+
+ /**
+ * Constructs a new MarginBorder.
+ */
+ public MarginBorder()
+ {
+ }
+
+
+ /**
+ * Measures the width of this border.
+ *
+ * @param c the component whose border is to be measured.
+ *
+ * @return an Insets object whose <code>left</code>, <code>right</code>,
+ * <code>top</code> and <code>bottom</code> fields indicate the
+ * width of the border at the respective edge.
+ *
+ * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
+ */
+ public Insets getBorderInsets(Component c)
+ {
+ return getBorderInsets(c, new Insets(0, 0, 0, 0));
+ }
+
+
+ /**
+ * Determines the insets of this border by calling the
+ * <code>getMargin()</code> method of the enclosed component. The
+ * resulting margin will be stored into the the <code>left</code>,
+ * <code>right</code>, <code>top</code> and <code>bottom</code>
+ * fields of the passed <code>insets</code> parameter.
+ *
+ * <p>Unfortunately, <code>getMargin()</code> is not a method of
+ * {@link javax.swing.JComponent} or some other common superclass
+ * of things with margins. While reflection could be used to
+ * determine the existence of this method, this would be slow on
+ * many virtual machines. Therefore, the current implementation
+ * knows about {@link javax.swing.AbstractButton#getMargin()},
+ * {@link javax.swing.JPopupMenu#getMargin()}, {@link
+ * javax.swing.JToolBar#getMargin()}, and {@link
+ * javax.swing.text.JTextComponent}. If <code>c</code> is an
+ * instance of a known class, the respective
+ * <code>getMargin()</code> method is called to determine the
+ * correct margin. Otherwise, a zero-width margin is returned.
+ *
+ * @param c the component whose border is to be measured.
+ *
+ * @return the same object that was passed for <code>insets</code>,
+ * but with changed fields.
+ */
+ public Insets getBorderInsets(Component c, Insets insets)
+ {
+ Insets margin = null;
+
+ /* This is terrible object-oriented design. See the above Javadoc
+ * for an excuse.
+ */
+ if (c instanceof AbstractButton)
+ margin = ((AbstractButton) c).getMargin();
+ else if (c instanceof JPopupMenu)
+ margin = ((JPopupMenu) c).getMargin();
+ else if (c instanceof JToolBar)
+ margin = ((JToolBar) c).getMargin();
+ else if (c instanceof JTextComponent)
+ margin = ((JTextComponent) c).getMargin();
+
+ if (margin == null)
+ insets.top = insets.left = insets.bottom = insets.right = 0;
+ else
+ {
+ insets.top = margin.top;
+ insets.left = margin.left;
+ insets.bottom = margin.bottom;
+ insets.right = margin.right;
+ }
+
+ return insets;
+ }
+ }
+
+
+ /**
+ * A border for drawing a separator line below JMenuBar.
+ *
+ * <p><img src="BasicBorders.MenuBarBorder-1.png" width="500"
+ * height="140" alt="[A screen shot of a JMenuBar with this border]" />
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
public static class MenuBarBorder
+ extends AbstractBorder
+ implements UIResource
{
+ /**
+ * Determined using the <code>serialver</code> tool
+ * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
+ */
+ static final long serialVersionUID = -6909056571935227506L;
+
+
+ /**
+ * The shadow color, which is used for the upper line of the
+ * two-pixel thick bottom edge.
+ */
+ private Color shadow;
+
+
+ /**
+ * The highlight color, which is used for the lower line of the
+ * two-pixel thick bottom edge.
+ */
+ private Color highlight;
+
+
+ /**
+ * Constructs a new MenuBarBorder for drawing a JMenuBar in
+ * the Basic look and feel.
+ *
+ * <p><img src="BasicBorders.MenuBarBorder-1.png" width="500"
+ * height="140" alt="[A screen shot of a JMenuBar with this
+ * border]" />
+ *
+ * @param shadow the shadow color, which is used for the upper
+ * line of the two-pixel thick bottom edge.
+ *
+ * @param highlight the shadow color, which is used for the lower
+ * line of the two-pixel thick bottom edge.
+ */
public MenuBarBorder(Color shadow, Color highlight)
{
+ /* These colors usually come from the UIDefaults of the current
+ * look and feel. Use fallback values if the colors are not
+ * supplied. The API specification is silent about what
+ * behavior is expected for null colors, so users should not
+ * rely on this fallback (which is why it is not documented in
+ * the above Javadoc).
+ */
+ this.shadow = (shadow != null) ? shadow : Color.gray;
+ this.highlight = (highlight != null) ? highlight : Color.white;
+ }
+
+
+ /**
+ * Paints the MenuBarBorder around a given component.
+ *
+ * @param c the component whose border is to be painted, usually
+ * an instance of {@link javax.swing.JMenuBar}.
+ *
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ */
+ public void paintBorder(Component c, Graphics g,
+ int x, int y, int width, int height)
+ {
+ Color oldColor;
+
+ /* To understand this code, it might be helpful to look at the
+ * image "BasicBorders.MenuBarBorder-1.png" that is included
+ * with the JavaDoc. It is located in the "doc-files"
+ * subdirectory.
+ */
+ oldColor = g.getColor();
+ y = y + height - 2;
+ try
+ {
+ g.setColor(shadow);
+ g.drawLine(x, y, x + width - 2, y);
+ g.drawLine(x, y + 1, x, y + 1);
+ g.drawLine(x + width - 2, y + 1, x + width - 2, y + 1);
+
+ g.setColor(highlight);
+ g.drawLine(x + 1, y + 1, x + width - 3, y + 1);
+ g.drawLine(x + width - 1, y, x + width - 1, y + 1);
+ }
+ finally
+ {
+ g.setColor(oldColor);
+ }
+ }
+
+
+ /**
+ * Measures the width of this border.
+ *
+ * @param c the component whose border is to be measured.
+ *
+ * @return an Insets object whose <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ *
+ * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
+ */
+ public Insets getBorderInsets(Component c)
+ {
+ /* There is no obvious reason for overriding this method, but we
+ * try to have exactly the same API as the Sun reference
+ * implementation.
+ */
+ return getBorderInsets(c, null);
+ }
+
+
+ /**
+ * Measures the width of this border, storing the results into a
+ * pre-existing Insets object.
+ *
+ * @param insets an Insets object for holding the result values.
+ * After invoking this method, the <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ *
+ * @return the same object that was passed for <code>insets</code>.
+ *
+ * @see #getBorderInsets()
+ */
+ public Insets getBorderInsets(Component c, Insets insets)
+ {
+ /* The exact amount has been determined using a test program
+ * that was run on the Apple/Sun JDK 1.3.1 on MacOS X, and the
+ * Sun JDK 1.4.1_01 on GNU/Linux for x86. Both gave [0,0,2,0],
+ * which was expected from looking at the screen shot.
+ */
+ if (insets == null)
+ return new Insets(0, 0, 2, 0);
+
+ insets.left = insets.right = insets.top = 0;
+ insets.bottom = 2;
+ return insets;
}
- } // class MenuBarBorder
+ }
+
+
+ /**
+ * A border for drawing radio buttons in the Basic look and feel.
+ *
+ * <p><img src="BasicBorders.RadioButtonBorder-1.png" width="300"
+ * height="135" alt="[A screen shot of this border]" />
+ *
+ * <p>Note about the screen shot: Normally, the
+ * <code>borderPainted</code> property is <code>false</code> for
+ * JRadioButtons. For this screen shot, it has been set to
+ * <code>true</code> so the borders get drawn. Also, a
+ * concretization of the Basic look and would typically provide
+ * icons for the various states of radio buttons.
+ *
+ * <p>Note that the focus rectangle is invisible If the radio button
+ * is currently selected. While it might be debatable whether this
+ * makes a lot of sense, this behavior can be observed in the Sun
+ * reference implementation (in JDK 1.3.1 and 1.4.1). The Classpath
+ * implementation tries to exactly replicate the JDK appearance.
+ *
+ * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
public static class RadioButtonBorder
+ extends ButtonBorder
{
- } // class RadioButtonBorder
+ /**
+ * Determined using the <code>serialver</code> tool
+ * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
+ */
+ static final long serialVersionUID = 1596945751743747369L;
+
+
+ /**
+ * Constructs a new border for drawing a JRadioButton in
+ * the Basic look and feel.
+ *
+ * @param shadow the shadow color.
+ * @param darkShadow a darker variant of the shadow color.
+ * @param highlight the highlight color.
+ * @param lightHighlight a brighter variant of the highlight color.
+ */
+ public RadioButtonBorder(Color shadow, Color darkShadow,
+ Color highlight, Color lightHighlight)
+ {
+ /* The superclass ButtonBorder substitutes null arguments
+ * with fallback colors.
+ */
+ super(shadow, darkShadow, highlight, lightHighlight);
+ }
+
+
+ /**
+ * Paints the RadioButtonBorder around a given component.
+ *
+ * <p>The Sun implementation always seems to draw exactly
+ * the same border, irrespective of the state of the button.
+ * This is rather surprising, but GNU Classpath emulates the
+ * observable behavior.
+ *
+ * @param c the component whose border is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ *
+ * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
+ */
+ public void paintBorder(Component c, Graphics g,
+ int x, int y, int width, int height)
+ {
+ AbstractButton button = null;
+ ButtonModel bmodel = null;
+ boolean lowered = false;
+ boolean focused = false;
+
+ if (c instanceof AbstractButton)
+ {
+ button = (AbstractButton) c;
+ bmodel = button.getModel();
+ }
+
+ if (bmodel != null)
+ {
+ lowered = button.isSelected()
+ || (/* mouse inside */ bmodel.isArmed() && bmodel.isPressed());
+ focused = button.hasFocus() && button.isFocusPainted();
+ }
+
+ if (lowered)
+ BasicGraphicsUtils.drawLoweredBezel(g, x, y, width, height,
+ shadow, darkShadow,
+ highlight, lightHighlight);
+ else
+ BasicGraphicsUtils.drawBezel(g, x, y, width, height,
+ /* isPressed */ false,
+ /* isPefault */ focused,
+ shadow, darkShadow,
+ highlight, lightHighlight);
+ }
+
+
+ /**
+ * Measures the width of this border.
+ *
+ * @param c the component whose border is to be measured.
+ *
+ * @return an Insets object whose <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ *
+ * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
+ */
+ public Insets getBorderInsets(Component c)
+ {
+ /* There is no obvious reason for overriding this method, but we
+ * try to have exactly the same API as the Sun reference
+ * implementation.
+ */
+ return getBorderInsets(c, null);
+ }
+
+
+ /**
+ * Measures the width of this border, storing the results into a
+ * pre-existing Insets object.
+ *
+ * @param insets an Insets object for holding the result values.
+ * After invoking this method, the <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ *
+ * @return the same object that was passed for <code>insets</code>.
+ *
+ * @see #getBorderInsets()
+ */
+ public Insets getBorderInsets(Component c, Insets insets)
+ {
+ /* The exact amount has been determined using a test program
+ * that was run on the Apple/Sun JDK 1.3.1 on MacOS X, and the
+ * Sun JDK 1.4.1_01 on GNU/Linux for x86. Both gave [2,2,2,2].
+ */
+ if (insets == null)
+ return new Insets(2, 2, 2, 2);
+
+ insets.left = insets.right = insets.top = insets.bottom = 2;
+ return insets;
+ }
+ }
+
+
+ /**
+ * A one-pixel thick border for rollover buttons, for example in
+ * tool bars.
+ *
+ * @since 1.4
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
public static class RolloverButtonBorder
+ extends ButtonBorder
{
- } // class RolloverButtonBorder
+ /**
+ * Determined using the <code>serialver</code> tool
+ * of Sun JDK 1.4.1_01 on GNU/Linux 2.4.20 for x86.
+ */
+ static final long serialVersionUID = 1976364864896996846L;
+
+
+ /**
+ * Constructs a new border for drawing a roll-over button
+ * in the Basic look and feel.
+ *
+ * @param shadow the shadow color.
+ * @param darkShadow a darker variant of the shadow color.
+ * @param highlight the highlight color.
+ * @param lightHighlight a brighter variant of the highlight color.
+ */
+ public RolloverButtonBorder(Color shadow, Color darkShadow,
+ Color highlight, Color lightHighlight)
+ {
+ super(shadow, darkShadow, highlight, lightHighlight);
+ }
+
+
+ /**
+ * Paints the border around a rollover button. If <code>c</code>
+ * is not an {@link javax.swing.AbstractButton} whose model
+ * returns <code>true</code> for {@link
+ * javax.swing.ButtonModel#isRollver}, nothing gets painted at
+ * all.
+ *
+ * @param c the button whose border is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ */
+ public void paintBorder(Component c, Graphics g,
+ int x, int y, int width, int height)
+ {
+ ButtonModel bmodel = null;
+ boolean drawPressed;
+ Color oldColor = g.getColor();
+ int x2, y2;
+
+ if (c instanceof AbstractButton)
+ bmodel = ((AbstractButton) c).getModel();
+
+ /* Draw nothing if c is not a rollover button. */
+ if ((bmodel == null) || !bmodel.isRollover())
+ return;
+
+ /* Draw nothing if the mouse is pressed, but outside the button. */
+ if (bmodel.isPressed() && !bmodel.isArmed())
+ return;
+
+ drawPressed = bmodel.isSelected() || bmodel.isPressed();
+ x2 = x + width - 1;
+ y2 = y + height - 1;
+
+ try
+ {
+ g.setColor(drawPressed ? shadow : lightHighlight);
+ g.drawLine(x, y, x2 - 1, y); // top edge
+ g.drawLine(x, y + 1, x, y2 - 1); // left edge
+
+ g.setColor(drawPressed ? lightHighlight : shadow);
+ g.drawLine(x, y2, x2, y2); // bottom edge
+ g.drawLine(x2, y, x2, y2 - 1); // right edge
+ }
+ finally
+ {
+ g.setColor(oldColor);
+ }
+ }
+ }
+
+
+ /**
+ * A border for JSplitPanes in the Basic look and feel. The divider
+ * in the middle of the JSplitPane has its own border class, of which
+ * an instance can be obtained with {@link #getSplitPaneDividerBorder()}.
+ *
+ * <p><img src="BasicBorders.SplitPaneBorder-1.png" width="520"
+ * height="200" alt="[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
+ *
+ * <p><img src="BasicBorders.SplitPaneBorder-2.png" width="520"
+ * height="200" alt="[A screen shot for JSplitPane.VERTICAL_SPLIT]" />
+ *
+ * <p>In contrast to the other borders of the Basic look and feel,
+ * this class is not serializable. While this might be unintended,
+ * GNU Classpath follows the specification in order to be fully
+ * compatible with the Sun reference implementation.
+ *
+ * <p>In the Sun JDK, the bottom edge of the divider also gets
+ * painted if the orientation of the enclosed JSplitPane is
+ * <code>JSplitPane.VERTICAL_SPLIT</code> (at least in versions
+ * 1.3.1 and 1.4.1). GNU Classpath does not replicate this bug. A
+ * report has been filed with Sun (review ID 188773).
+ *
+ * <p>Note that the bottom left pixel of the border has a different
+ * color depending on the orientation of the enclosed JSplitPane.
+ * Although this is visually inconsistent, Classpath replicates the
+ * appearance of the Sun reference implementation. A bug report has
+ * been filed with Sun (review ID 188774).
+ *
+ * @see {@link #getSplitPaneBorder()}
+ * @see {@link #getSplitPaneDividerBorder()}
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
public static class SplitPaneBorder
+ implements Border, UIResource
{
+ /**
+ * Indicates that the top edge shall be not be painted
+ * by {@link #paintRect(java.awt.Graphics, int, int, int, int, int)}.
+ */
+ private static final int SUPPRESS_TOP = 1;
+
+
+ /**
+ * Indicates that the left edge shall be not be painted
+ * by {@link #paintRect(java.awt.Graphics, int, int, int, int, int)}.
+ */
+ private static final int SUPPRESS_LEFT = 2;
+
+
+ /**
+ * Indicates that the bottom edge shall be not be painted
+ * by {@link #paintRect(java.awt.Graphics, int, int, int, int, int)}.
+ */
+ private static final int SUPPRESS_BOTTOM = 4;
+
+
+ /**
+ * Indicates that the right edge shall be not be painted
+ * by {@link #paintRect(java.awt.Graphics, int, int, int, int, int)}.
+ */
+ private static final int SUPPRESS_RIGHT = 8;
+
+
+ /**
+ * The color for drawing the bottom and right edges of the border.
+ */
+ protected Color highlight;
+
+
+ /**
+ * The color for drawing the top and left edges of the border.
+ */
+ protected Color shadow;
+
+
+ /**
+ * Constructs a new border for drawing a JSplitPane in the Basic
+ * look and feel. The divider in the middle of the JSplitPane has
+ * its own border class, <code>SplitPaneDividerBorder</code>.
+ *
+ * @param shadow the shadow color.
+ * @param highlight the highlight color.
+ */
public SplitPaneBorder(Color highlight, Color shadow)
{
+ /* These colors usually come from the UIDefaults of the current
+ * look and feel. Use fallback values if the colors are not
+ * supplied. The API specification is silent about what
+ * behavior is expected for null colors, so users should not
+ * rely on this fallback (which is why it is not documented in
+ * the above Javadoc).
+ */
+ this.shadow = (shadow != null) ? shadow : Color.black;
+ this.highlight = (highlight != null) ? highlight : Color.white;
+ }
+
+
+ /**
+ * Paints the border around a <code>JSplitPane</code>.
+ *
+ * <p><img src="BasicBorders.SplitPaneBorder-1.png" width="520"
+ * height="200" alt="[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" />
+ *
+ * <p><img src="BasicBorders.SplitPaneBorder-2.png" width="520"
+ * height="200" alt="[A screen shot for JSplitPane.VERTICAL_SPLIT]" />
+ *
+ * @param c the <code>JSplitPane</code> whose border is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ */
+ public void paintBorder(Component c, Graphics g,
+ int x, int y, int width, int height)
+ {
+ JSplitPane splitPane;
+ Component content;
+
+ if (!(c instanceof JSplitPane))
+ return;
+
+ splitPane = (JSplitPane) c;
+ switch (splitPane.getOrientation())
+ {
+ case JSplitPane.HORIZONTAL_SPLIT:
+ if ((content = splitPane.getLeftComponent()) != null)
+ paintRect(g, SUPPRESS_RIGHT, true, x, y, content.getBounds());
+ if ((content = splitPane.getRightComponent()) != null)
+ paintRect(g, SUPPRESS_LEFT, true, x, y, content.getBounds());
+ break;
+
+ case JSplitPane.VERTICAL_SPLIT:
+ if ((content = splitPane.getTopComponent()) != null)
+ paintRect(g, SUPPRESS_BOTTOM, false, x, y, content.getBounds());
+ if ((content = splitPane.getBottomComponent()) != null)
+ paintRect(g, SUPPRESS_TOP, false, x, y, content.getBounds());
+ break;
+ }
}
- } // class SplitPaneBorder
+
+
+ /**
+ * Paints a border around a child of a <code>JSplitPane</code>,
+ * omitting some of the edges.
+ *
+ * @param g the graphics for painting.
+ *
+ * @param suppress a bit mask indicating the set of suppressed
+ * edges, for example <code>SUPPRESS_TOP | SUPPRESS_RIGHT</code>.
+ *
+ * @param x the x coordinate of the SplitPaneBorder.
+ *
+ * @param y the y coordinate of the SplitPaneBorder.
+ *
+ * @param shadeBottomLeftPixel <code>true</code> to paint the
+ * bottom left pixel in the shadow color,
+ * <code>false</code> for the highlight color. The Basic
+ * look and feel uses the highlight color for the bottom
+ * left pixel of the border of a JSplitPane whose
+ * orientation is VERTICAL_SPLIT, and the shadow color
+ * otherwise. While this might be a strange distinction,
+ * Classpath tries to look identical to the reference
+ * implementation. A bug report has been filed with Sun;
+ * its review ID is 188774. We currently replicate the
+ * Sun behavior.
+ *
+ * @param rect the bounds of the child of JSplitPane whose
+ * border is to be painted.
+ */
+ private void paintRect(Graphics g, int suppress,
+ boolean shadeBottomLeftPixel,
+ int x, int y,
+ Rectangle rect)
+ {
+ if (rect == null)
+ return;
+
+ /* On each edge, the border exceeds the enclosed child by one
+ * pixel. See the image "BasicBorders.SplitPaneBorder-1.png" in
+ * the directory "doc-files".
+ */
+ x += rect.x - 1;
+ y += rect.y - 1;
+ int right = x + rect.width + 1;
+ int bottom = y + rect.height + 1;
+
+ Color oldColor = g.getColor();
+ try
+ {
+ g.setColor(shadow);
+ if ((suppress & SUPPRESS_TOP) == 0)
+ g.drawLine(x, y, right, y);
+ if ((suppress & SUPPRESS_LEFT) == 0)
+ g.drawLine(x, y, x, bottom);
+ else
+ g.drawLine(x, bottom, x, bottom); // one pixel
+
+ g.setColor(highlight);
+ if ((suppress & SUPPRESS_BOTTOM) == 0)
+ g.drawLine(x + (shadeBottomLeftPixel ? 1 : 0), bottom, right, bottom);
+ else if (!shadeBottomLeftPixel)
+ g.drawLine(x, bottom, x, bottom); // one pixel
+
+ if ((suppress & SUPPRESS_RIGHT) == 0)
+ g.drawLine(right, y, right, bottom);
+ }
+ finally
+ {
+ g.setColor(oldColor);
+ }
+ }
+
+
+ /**
+ * Measures the width of this border.
+ *
+ * @param c the component whose border is to be measured, usually
+ * an instance of {@link javax.swing.JSplitPane}.
+ *
+ * @return an Insets object whose <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ */
+ public Insets getBorderInsets(Component c)
+ {
+ return new Insets(1, 1, 1, 1);
+ }
+
+
+ /**
+ * Determines whether this border fills every pixel in its area
+ * when painting.
+ *
+ * @return <code>false</code> because this border does not
+ * paint over the pixels where the divider joins
+ * the border.
+ */
+ public boolean isBorderOpaque()
+ {
+ /* Strangely, the Sun implementation (tested with JDK 1.3.1 and
+ * 1.4.1_01) seems to always return true. It could be a bug,
+ * but without knowing the details of their implementation, it is
+ * hard to decide.
+ */
+ return false;
+ }
+ }
+
+
+ /**
+ * A border for the divider inside a JSplitPane.
+ *
+ * <p><img src="BasicBorders.SplitPaneDividerBorder-1.png"
+ * width="520" height="200" alt="[A screen shot of this border]" />
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+ private static class SplitPaneDividerBorder
+ implements Border, UIResource, Serializable
+ {
+ /**
+ * The highlight color, which is drawn on the left or top edge
+ * depending on the orientation of the JSplitPanel.
+ */
+ protected Color highlight;
+
+
+ /**
+ * The highlight color, which is drawn on the right or bottom edge
+ * depending on the orientation of the JSplitPanel.
+ */
+ protected Color shadow;
+
+
+ /**
+ * Constructs a new border for drawing the divider of a JSplitPane
+ * in the Basic look and feel. The outer parts of the JSplitPane have
+ * their own border class, <code>SplitPaneBorder</code>.
+ *
+ * @param shadow the shadow color.
+ * @param highlight the highlight color.
+ */
+ public SplitPaneDividerBorder(Color highlight, Color shadow)
+ {
+ this.highlight = (highlight != null) ? highlight : Color.white;
+ this.shadow = (shadow != null) ? shadow : Color.black;
+ }
+
+
+ /**
+ * Paints the border around the divider of a <code>JSplitPane</code>.
+ *
+ * <p><img src="BasicBorders.SplitPaneDividerBorder-1.png" width="520"
+ * height="200" alt="[A picture that shows which pixels get painted
+ * in what color]" />
+ *
+ * @param c the <code>JSplitPane</code> whose divider&#x2019;s border
+ * is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ */
+ public void paintBorder(Component c, Graphics g,
+ int x, int y, int width, int height)
+ {
+ Color oldColor, dcol;
+ int x2, y2;
+ JSplitPane sp;
+
+ sp = getSplitPane(c);
+ if (sp == null)
+ return;
+
+ x2 = x + width - 1;
+ y2 = y + height - 1;
+ oldColor = g.getColor();
+ dcol = c.getBackground();
+ try
+ {
+ switch (sp.getOrientation())
+ {
+ case JSplitPane.HORIZONTAL_SPLIT:
+ g.setColor(dcol);
+ g.drawLine(x + 1, y, x2 - 1, y);
+ g.drawLine(x + 1, y2, x2 - 1, y2);
+ g.setColor(sp.getLeftComponent() != null ? highlight : dcol);
+ g.drawLine(x, y, x, y2);
+ g.setColor(sp.getRightComponent() != null ? shadow : dcol);
+ g.drawLine(x2, y, x2, y2);
+ break;
+
+ case JSplitPane.VERTICAL_SPLIT:
+ g.setColor(dcol);
+ g.drawLine(x, y + 1, x, y2 - 1);
+ g.drawLine(x2, y + 1, x2, y2 - 1);
+ g.setColor(sp.getTopComponent() != null ? highlight : dcol);
+ g.drawLine(x, y, x2, y);
+ g.setColor(sp.getBottomComponent() != null ? shadow : dcol);
+ g.drawLine(x, y2, x2, y2);
+ break;
+ }
+ }
+ finally
+ {
+ g.setColor(oldColor);
+ }
+ }
+
+
+ /**
+ * Measures the width of this border.
+ *
+ * @param c the component whose border is to be measured, usually
+ * an instance of {@link javax.swing.JSplitPane}.
+ *
+ * @return an Insets object whose <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ */
+ public Insets getBorderInsets(Component c)
+ {
+ return new Insets(1, 1, 1, 1);
+ }
+
+
+ /**
+ * Determines whether this border fills every pixel in its area
+ * when painting.
+ *
+ * @return <code>true</code> if both highlight and shadow
+ * color are fully opaque.
+ */
+ public boolean isBorderOpaque()
+ {
+ return (highlight.getAlpha() == 255) && (shadow.getAlpha() == 255);
+ }
+
+
+ /**
+ * Determines the JSplitPane whose divider is being painted.
+ *
+ * @param c an instance of BasicSplitPaneDivider.
+ *
+ * @return a <code>JSplitPane</code>, or <code>null</code> if
+ * <code>c</code> is not an instance of {@link
+ * javax.swing.plaf.basic.BasicSplitPaneDivider}.
+ */
+ private JSplitPane getSplitPane(Component c)
+ {
+ if (c instanceof BasicSplitPaneDivider)
+ return (((BasicSplitPaneDivider) c).getBasicSplitPaneUI())
+ .getSplitPane();
+ else
+ return null;
+ }
+ }
+
+
+ /**
+ * A border for toggle buttons in the Basic look and feel.
+ *
+ * <p><img src="BasicBorders.ToggleButtonBorder-1.png" width="270"
+ * height="135" alt="[A screen shot of this border]" />
+ *
+ * <p>The Sun implementation always seems to draw exactly
+ * the same border, irrespective of the state of the button.
+ * This is rather surprising, but GNU Classpath emulates the
+ * observable behavior.
+ *
+ * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
public static class ToggleButtonBorder
+ extends ButtonBorder
{
- } // class ToggleButtonBorder
-} // class BasicBorders
+ /**
+ * Determined using the <code>serialver</code> tool
+ * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5.
+ */
+ static final long serialVersionUID = -3528666548001058394L;
+
+
+ /**
+ * Constructs a new border for drawing a JToggleButton in
+ * the Basic look and feel.
+ *
+ * @param shadow the shadow color.
+ * @param darkShadow a darker variant of the shadow color.
+ * @param highlight the highlight color.
+ * @param lightHighlight a brighter variant of the highlight color.
+ */
+ public ToggleButtonBorder(Color shadow, Color darkShadow,
+ Color highlight, Color lightHighlight)
+ {
+ /* The superclass ButtonBorder substitutes null arguments
+ * with fallback colors.
+ */
+ super(shadow, darkShadow, highlight, lightHighlight);
+ }
+
+
+ /**
+ * Paints the ToggleButtonBorder around a given component.
+ *
+ * <p>The Sun implementation always seems to draw exactly
+ * the same border, irrespective of the state of the button.
+ * This is rather surprising, but GNU Classpath emulates the
+ * observable behavior.
+ *
+ * @param c the component whose border is to be painted.
+ * @param g the graphics for painting.
+ * @param x the horizontal position for painting the border.
+ * @param y the vertical position for painting the border.
+ * @param width the width of the available area for painting the border.
+ * @param height the height of the available area for painting the border.
+ *
+ * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel
+ */
+ public void paintBorder(Component c, Graphics g,
+ int x, int y, int width, int height)
+ {
+ /* The author of this code tried various variants for setting
+ * the state of the enclosed JToggleButton, but it seems that
+ * the drawn border is always identical. Weird, because this
+ * means that the user does not see whether the JToggleButton
+ * is selected or not.
+ */
+ BasicGraphicsUtils.drawBezel(g, x, y, width, height,
+ /* pressed */ false,
+ /* default */ false,
+ shadow, darkShadow,
+ highlight, lightHighlight);
+ }
+
+
+ /**
+ * Measures the width of this border.
+ *
+ * @param c the component whose border is to be measured.
+ *
+ * @return an Insets object whose <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ *
+ * @see #getBorderInsets(java.awt.Component, java.awt.Insets)
+ */
+ public Insets getBorderInsets(Component c)
+ {
+ /* There is no obvious reason for overriding this method, but we
+ * try to have exactly the same API as the Sun reference
+ * implementation.
+ */
+ return getBorderInsets(c, null);
+ }
+
+
+ /**
+ * Measures the width of this border, storing the results into a
+ * pre-existing Insets object.
+ *
+ * @param insets an Insets object for holding the result values.
+ * After invoking this method, the <code>left</code>,
+ * <code>right</code>, <code>top</code> and
+ * <code>bottom</code> fields indicate the width of the
+ * border at the respective edge.
+ *
+ * @return the same object that was passed for <code>insets</code>.
+ *
+ * @see #getBorderInsets()
+ */
+ public Insets getBorderInsets(Component c, Insets insets)
+ {
+ /* The exact amount has been determined using a test program
+ * that was run on the Apple/Sun JDK 1.3.1 on MacOS X, and the
+ * Sun JDK 1.4.1_01 on GNU/Linux for x86. Both gave [2,2,2,2].
+ */
+ if (insets == null)
+ return new Insets(2, 2, 2, 2);
+
+ insets.left = insets.right = insets.top = insets.bottom = 2;
+ return insets;
+ }
+ }
+}
diff --git a/libjava/javax/swing/plaf/basic/BasicButtonUI.java b/libjava/javax/swing/plaf/basic/BasicButtonUI.java
index 3f67c512874..d901e7ddeb7 100644
--- a/libjava/javax/swing/plaf/basic/BasicButtonUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicButtonUI.java
@@ -74,14 +74,7 @@ public class BasicButtonUI extends ButtonUI
public Dimension getPreferredSize(JComponent c)
{
AbstractButton b = (AbstractButton)c;
- Dimension d = BasicGraphicsUtils.getPreferredSize(b,
- gap,
- b.getText(),
- b.getIcon(),
- b.getVerticalAlignment(),
- b.getHorizontalAlignment(),
- b.getHorizontalTextPosition(),
- b.getVerticalTextPosition());
+ Dimension d = BasicGraphicsUtils.getPreferredButtonSize(b, gap);
// System.out.println("^^^^^^^^^^^^^^^^^^^^^^ BASIC-PREF="+d + ",T="+b.text);
return d;
}
@@ -99,7 +92,7 @@ public class BasicButtonUI extends ButtonUI
g.setFont(f);
- FontMetrics fm = SwingUtilities.getFontMetrics(f);
+ FontMetrics fm = g.getFontMetrics(f);
Insets i = c.getInsets();
@@ -198,7 +191,7 @@ public class BasicButtonUI extends ButtonUI
g.setFont(f);
- FontMetrics fm = SwingUtilities.getFontMetrics(f);
+ FontMetrics fm = g.getFontMetrics(f);
g.setColor(c.isEnabled() ? textColor : disabledTextColor);
diff --git a/libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java b/libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java
index 25fb0180b2a..54a9c69862e 100644
--- a/libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java
@@ -57,15 +57,7 @@ public class BasicCheckBoxUI extends BasicRadioButtonUI
public Dimension getPreferredSize(JComponent c)
{
AbstractButton b = (AbstractButton)c;
- Dimension d = BasicGraphicsUtils.getPreferredSize(b,
- gap,
- b.getText(),
- b.getIcon(),
- b.getVerticalAlignment(),
- b.getHorizontalAlignment(),
- b.getHorizontalTextPosition(),
- b.getVerticalTextPosition());
-
+ Dimension d = BasicGraphicsUtils.getPreferredButtonSize(b, gap);
//System.out.println("^^^^^^^^^^^^^^^^^^^^^^ BASIC-PREF="+d + ",T="+b.text);
return d;
}
diff --git a/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java b/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java
index 55e9728567a..a7b64111f53 100644
--- a/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java
+++ b/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java
@@ -1,5 +1,5 @@
/* BasicGraphicsUtils.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,81 +35,602 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-
package javax.swing.plaf.basic;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Insets;
+import java.awt.Rectangle;
+
+import java.awt.font.FontRenderContext;
+import java.awt.font.LineMetrics;
+import java.awt.font.TextLayout;
-import java.awt.*;
-import javax.swing.*;
+import java.awt.geom.Rectangle2D;
+import javax.swing.AbstractButton;
+import javax.swing.SwingUtilities;
+
+/**
+ * A utility class providing commonly used drawing and measurement
+ * routines.
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
public class BasicGraphicsUtils
-{
- public static Dimension getPreferredSize(JComponent b,
- int gap,
- String text,
- Icon icon,
- int va,
- int ha,
- int htp,
- int vtp)
+{
+ /**
+ * Constructor. It is utterly unclear why this class should
+ * be constructable, but this is what the API specification
+ * says.
+ */
+ public BasicGraphicsUtils()
+ {
+ }
+
+
+ /**
+ * Draws a rectangle that appears etched into the surface, given
+ * four colors that are used for drawing.
+ *
+ * <p><img src="BasicGraphicsUtils-1.png" width="360"
+ * height="200" alt="[An illustration that shows which pixels
+ * get painted in what color]" />
+ *
+ * @param g the graphics into which the rectangle is drawn.
+ * @param x the x coordinate of the rectangle.
+ * @param y the y coordinate of the rectangle.
+ * @param width the width of the rectangle in pixels.
+ * @param height the height of the rectangle in pixels.
+ *
+ * @param shadow the color that will be used for painting
+ * the outer side of the top and left edges.
+ *
+ * @param darkShadow the color that will be used for painting
+ * the inner side of the top and left edges.
+ *
+ * @param highlight the color that will be used for painting
+ * the inner side of the bottom and right edges.
+ *
+ * @param lightHighlight the color that will be used for painting
+ * the outer side of the bottom and right edges.
+ *
+ * @see #getEtchedInsets()
+ * @see javax.swing.border.EtchedBorder
+ */
+ public static void drawEtchedRect(Graphics g,
+ int x, int y, int width, int height,
+ Color shadow, Color darkShadow,
+ Color highlight, Color lightHighlight)
+ {
+ Color oldColor;
+ int x2, y2;
+
+ oldColor = g.getColor();
+ x2 = x + width - 1;
+ y2 = y + height - 1;
+
+ try
{
- JComponent c = b;
- // this is a staight copy from BasicButtonUI.paint()
- //
- Rectangle tr = new Rectangle();
- Rectangle ir = new Rectangle();
- Rectangle vr = new Rectangle();
-
- Font f = c.getFont();
-
- FontMetrics fm = SwingUtilities.getFontMetrics(f);
-
- Insets i = c.getInsets();
-
- vr.x = i.left;
- vr.y = i.top;
- vr.width = b.getWidth() - (i.right + i.left);
- vr.height = b.getHeight() - (i.bottom + i.top);
-
- // System.out.println(" VIEW-RECT-BUTTON="+vr+", insets="+i);
-
- String tt = SwingUtilities.layoutCompoundLabel(b,
- fm,
- text,
- icon,
- va,
- ha,
- vtp,
- htp,
- vr,
- ir,
- tr,
- gap);
-
- Rectangle r = ir.union(tr);
-
- Insets insets = b.getInsets();
- r.width += insets.left + insets.right;
- r.height += insets.top + insets.bottom;
-
- // System.out.println("COMPUTED SIZE FOR PREF_SIZE="+r);
-
- return r.getSize();
+ /* To understand this code, it might be helpful to look at the
+ * image "BasicGraphicsUtils-1.png" that is included with the
+ * JavaDoc. The file is located in the "doc-files" subdirectory.
+ *
+ * (x2, y2) is the coordinate of the most right and bottom pixel
+ * to be painted.
+ */
+ g.setColor(shadow);
+ g.drawLine(x, y, x2 - 1, y); // top, outer
+ g.drawLine(x, y + 1, x, y2 - 1); // left, outer
+
+ g.setColor(darkShadow);
+ g.drawLine(x + 1, y + 1, x2 - 2, y + 1); // top, inner
+ g.drawLine(x + 1, y + 2, x + 1, y2 - 2); // left, inner
+
+ g.setColor(highlight);
+ g.drawLine(x + 1, y2 - 1, x2 - 1, y2 - 1); // bottom, inner
+ g.drawLine(x2 - 1, y + 1, x2 - 1, y2 - 2); // right, inner
+
+ g.setColor(lightHighlight);
+ g.drawLine(x, y2, x2, y2); // bottom, outer
+ g.drawLine(x2, y, x2, y2 - 1); // right, outer
+ }
+ finally
+ {
+ g.setColor(oldColor);
}
+ }
+
+
+ /**
+ * Determines the width of the border that gets painted by
+ * {@link #drawEtchedRect}.
+ *
+ * @return an <code>Insets</code> object whose <code>top</code>,
+ * <code>left</code>, <code>bottom</code> and
+ * <code>right</code> field contain the border width at the
+ * respective edge in pixels.
+ */
+ public static Insets getEtchedInsets()
+ {
+ return new Insets(2, 2, 2, 2);
+ }
+
+
+ /**
+ * Draws a rectangle that appears etched into the surface, given
+ * two colors that are used for drawing.
+ *
+ * <p><img src="BasicGraphicsUtils-2.png" width="360"
+ * height="200" alt="[An illustration that shows which pixels
+ * get painted in what color]" />
+ *
+ * @param g the graphics into which the rectangle is drawn.
+ * @param x the x coordinate of the rectangle.
+ * @param y the y coordinate of the rectangle.
+ * @param width the width of the rectangle in pixels.
+ * @param height the height of the rectangle in pixels.
+ *
+ * @param shadow the color that will be used for painting the outer
+ * side of the top and left edges, and for the inner side of
+ * the bottom and right ones.
+ *
+ * @param highlight the color that will be used for painting the
+ * inner side of the top and left edges, and for the outer
+ * side of the bottom and right ones.
+ *
+ * @see #getGrooveInsets()
+ * @see javax.swing.border.EtchedBorder
+ */
+ public static void drawGroove(Graphics g,
+ int x, int y, int width, int height,
+ Color shadow, Color highlight)
+ {
+ /* To understand this, it might be helpful to look at the image
+ * "BasicGraphicsUtils-2.png" that is included with the JavaDoc,
+ * and to compare it with "BasicGraphicsUtils-1.png" which shows
+ * the pixels painted by drawEtchedRect. These image files are
+ * located in the "doc-files" subdirectory.
+ */
+ drawEtchedRect(g, x, y, width, height,
+ /* outer topLeft */ shadow,
+ /* inner topLeft */ highlight,
+ /* inner bottomRight */ shadow,
+ /* outer bottomRight */ highlight);
+ }
+
- public static void drawString(Graphics g,
- String text,
- int underlinedChar,
- int x,
- int y)
+ /**
+ * Determines the width of the border that gets painted by
+ * {@link #drawGroove}.
+ *
+ * @return an <code>Insets</code> object whose <code>top</code>,
+ * <code>left</code>, <code>bottom</code> and
+ * <code>right</code> field contain the border width at the
+ * respective edge in pixels.
+ */
+ public static Insets getGrooveInsets()
+ {
+ return new Insets(2, 2, 2, 2);
+ }
+
+
+ /**
+ * Draws a border that is suitable for buttons of the Basic look and
+ * feel.
+ *
+ * <p><img src="BasicGraphicsUtils-3.png" width="500"
+ * height="300" alt="[An illustration that shows which pixels
+ * get painted in what color]" />
+ *
+ * @param g the graphics into which the rectangle is drawn.
+ * @param x the x coordinate of the rectangle.
+ * @param y the y coordinate of the rectangle.
+ * @param width the width of the rectangle in pixels.
+ * @param height the height of the rectangle in pixels.
+ *
+ * @param isPressed <code>true</code> to draw the button border
+ * with a pressed-in appearance; <code>false</code> for
+ * normal (unpressed) appearance.
+ *
+ * @param isDefault <code>true</code> to draw the border with
+ * the appearance it has when hitting the enter key in a
+ * dialog will simulate a click to this button;
+ * <code>false</code> for normal appearance.
+ *
+ * @param shadow the shadow color.
+ * @param darkShadow a darker variant of the shadow color.
+ * @param highlight the highlight color.
+ * @param lightHighlight a brighter variant of the highlight color.
+ */
+ public static void drawBezel(Graphics g,
+ int x, int y, int width, int height,
+ boolean isPressed, boolean isDefault,
+ Color shadow, Color darkShadow,
+ Color highlight, Color lightHighlight)
+ {
+ Color oldColor = g.getColor();
+
+ /* To understand this, it might be helpful to look at the image
+ * "BasicGraphicsUtils-3.png" that is included with the JavaDoc,
+ * and to compare it with "BasicGraphicsUtils-1.png" which shows
+ * the pixels painted by drawEtchedRect. These image files are
+ * located in the "doc-files" subdirectory.
+ */
+ try
{
- g.drawString(text, x, y);
+ if ((isPressed == false) && (isDefault == false))
+ {
+ drawEtchedRect(g, x, y, width, height,
+ lightHighlight, highlight,
+ shadow, darkShadow);
+ }
+
+ if ((isPressed == true) && (isDefault == false))
+ {
+ g.setColor(shadow);
+ g.drawRect(x + 1, y + 1, width - 2, height - 2);
+ }
+
+ if ((isPressed == false) && (isDefault == true))
+ {
+ g.setColor(darkShadow);
+ g.drawRect(x, y, width - 1, height - 1);
+ drawEtchedRect(g, x + 1, y + 1, width - 2, height - 2,
+ lightHighlight, highlight,
+ shadow, darkShadow);
+ }
+
+ if ((isPressed == true) && (isDefault == true))
+ {
+ g.setColor(darkShadow);
+ g.drawRect(x, y, width - 1, height - 1);
+ g.setColor(shadow);
+ g.drawRect(x + 1, y + 1, width - 3, height - 3);
+ }
}
-}
+ finally
+ {
+ g.setColor(oldColor);
+ }
+ }
+
+
+ /**
+ * Draws a rectangle that appears lowered into the surface, given
+ * four colors that are used for drawing.
+ *
+ * <p><img src="BasicGraphicsUtils-4.png" width="360"
+ * height="200" alt="[An illustration that shows which pixels
+ * get painted in what color]" />
+ *
+ * <p><strong>Compatibility with the Sun reference
+ * implementation:</strong> The Sun reference implementation seems
+ * to ignore the <code>x</code> and <code>y</code> arguments, at
+ * least in JDK 1.3.1 and 1.4.1_01. The method always draws the
+ * rectangular area at location (0, 0). A bug report has been filed
+ * with Sun; its &#x201c;bug ID&#x201d; is 4880003. The GNU Classpath
+ * implementation behaves correctly, thus not replicating this bug.
+ *
+ * @param g the graphics into which the rectangle is drawn.
+ * @param x the x coordinate of the rectangle.
+ * @param y the y coordinate of the rectangle.
+ * @param width the width of the rectangle in pixels.
+ * @param height the height of the rectangle in pixels.
+ *
+ * @param shadow the color that will be used for painting
+ * the inner side of the top and left edges.
+ *
+ * @param darkShadow the color that will be used for painting
+ * the outer side of the top and left edges.
+ *
+ * @param highlight the color that will be used for painting
+ * the inner side of the bottom and right edges.
+ *
+ * @param lightHighlight the color that will be used for painting
+ * the outer side of the bottom and right edges.
+ */
+ public static void drawLoweredBezel(Graphics g,
+ int x, int y, int width, int height,
+ Color shadow, Color darkShadow,
+ Color highlight, Color lightHighlight)
+ {
+ /* Like drawEtchedRect, but swapping darkShadow and shadow.
+ *
+ * To understand this, it might be helpful to look at the image
+ * "BasicGraphicsUtils-4.png" that is included with the JavaDoc,
+ * and to compare it with "BasicGraphicsUtils-1.png" which shows
+ * the pixels painted by drawEtchedRect. These image files are
+ * located in the "doc-files" subdirectory.
+ */
+ drawEtchedRect(g, x, y, width, height,
+ darkShadow, shadow,
+ highlight, lightHighlight);
+ }
+
+
+ /**
+ * Draws a String at the given location, underlining the first
+ * occurence of a specified character. The algorithm for determining
+ * the underlined position is not sensitive to case. If the
+ * character is not part of <code>text</code>, the text will be
+ * drawn without underlining. Drawing is performed in the current
+ * color and font of <code>g</code>.
+ *
+ * <p><img src="BasicGraphicsUtils-5.png" width="500"
+ * height="100" alt="[An illustration showing how to use the
+ * method]" />
+ *
+ * @param g the graphics into which the String is drawn.
+ *
+ * @param text the String to draw.
+ *
+ * @param underlinedChar the character whose first occurence in
+ * <code>text</code> will be underlined. It is not clear
+ * why the API specification declares this argument to be
+ * of type <code>int</code> instead of <code>char</code>.
+ * While this would allow to pass Unicode characters outside
+ * Basic Multilingual Plane 0 (U+0000 .. U+FFFE), at least
+ * the GNU Classpath implementation does not underline
+ * anything if <code>underlinedChar</code> is outside
+ * the range of <code>char</code>.
+ *
+ * @param x the x coordinate of the text, as it would be passed to
+ * {@link java.awt.Graphics#drawString(java.lang.String,
+ * int, int)}.
+ *
+ * @param y the y coordinate of the text, as it would be passed to
+ * {@link java.awt.Graphics#drawString(java.lang.String,
+ * int, int)}.
+ */
+ public static void drawString(Graphics g, String text,
+ int underlinedChar, int x, int y)
+ {
+ int index = -1;
+
+ /* It is intentional that lower case is used. In some languages,
+ * the set of lowercase characters is larger than the set of
+ * uppercase ones. Therefore, it is good practice to use lowercase
+ * for such comparisons (which really means that the author of this
+ * code can vaguely remember having read some Unicode techreport
+ * with this recommendation, but is too lazy to look for the URL).
+ */
+ if ((underlinedChar >= 0) || (underlinedChar <= 0xffff))
+ index = text.toLowerCase().indexOf(
+ Character.toLowerCase((char) underlinedChar));
+
+ drawStringUnderlineCharAt(g, text, index, x, y);
+ }
+ /**
+ * Draws a String at the given location, underlining the character
+ * at the specified index. Drawing is performed in the current color
+ * and font of <code>g</code>.
+ *
+ * <p><img src="BasicGraphicsUtils-5.png" width="500"
+ * height="100" alt="[An illustration showing how to use the
+ * method]" />
+ *
+ * @param g the graphics into which the String is drawn.
+ *
+ * @param text the String to draw.
+ *
+ * @param underlinedIndex the index of the underlined character in
+ * <code>text</code>. If <code>underlinedIndex</code> falls
+ * outside the range <code>[0, text.length() - 1]</code>, the
+ * text will be drawn without underlining anything.
+ *
+ * @param x the x coordinate of the text, as it would be passed to
+ * {@link java.awt.Graphics#drawString(java.lang.String,
+ * int, int)}.
+ *
+ * @param y the y coordinate of the text, as it would be passed to
+ * {@link java.awt.Graphics#drawString(java.lang.String,
+ * int, int)}.
+ *
+ * @since 1.4
+ */
+ public static void drawStringUnderlineCharAt(Graphics g, String text,
+ int underlinedIndex,
+ int x, int y)
+ {
+ Graphics2D g2;
+ Rectangle2D.Double underline;
+ FontRenderContext frc;
+ FontMetrics fmet;
+ LineMetrics lineMetrics;
+ Font font;
+ TextLayout layout;
+ double underlineX1, underlineX2;
+ boolean drawUnderline;
+ int textLength;
+ textLength = text.length();
+ if (textLength == 0)
+ return;
+ drawUnderline = (underlinedIndex >= 0) && (underlinedIndex < textLength);
+ if (!(g instanceof Graphics2D))
+ {
+ /* Fall-back. This is likely to produce garbage for any text
+ * containing right-to-left (Hebrew or Arabic) characters, even
+ * if the underlined character is left-to-right.
+ */
+ g.drawString(text, x, y);
+ if (drawUnderline)
+ {
+ fmet = g.getFontMetrics();
+ g.fillRect(
+ /* x */ x + fmet.stringWidth(text.substring(0, underlinedIndex)),
+ /* y */ y + fmet.getDescent() - 1,
+ /* width */ fmet.charWidth(text.charAt(underlinedIndex)),
+ /* height */ 1);
+ }
+
+ return;
+ }
+ g2 = (Graphics2D) g;
+ font = g2.getFont();
+ frc = g2.getFontRenderContext();
+ lineMetrics = font.getLineMetrics(text, frc);
+ layout = new TextLayout(text, font, frc);
+
+ /* Draw the text. */
+ layout.draw(g2, x, y);
+ if (!drawUnderline)
+ return;
+
+ underlineX1 = x + layout.getLogicalHighlightShape(
+ underlinedIndex, underlinedIndex).getBounds2D().getX();
+ underlineX2 = x + layout.getLogicalHighlightShape(
+ underlinedIndex + 1, underlinedIndex + 1).getBounds2D().getX();
+
+ underline = new Rectangle2D.Double();
+ if (underlineX1 < underlineX2)
+ {
+ underline.x = underlineX1;
+ underline.width = underlineX2 - underlineX1;
+ }
+ else
+ {
+ underline.x = underlineX2;
+ underline.width = underlineX1 - underlineX2;
+ }
+
+
+ underline.height = lineMetrics.getUnderlineThickness();
+ underline.y = lineMetrics.getUnderlineOffset();
+ if (underline.y == 0)
+ {
+ /* Some fonts do not specify an underline offset, although they
+ * actually should do so. In that case, the result of calling
+ * lineMetrics.getUnderlineOffset() will be zero. Since it would
+ * look very ugly if the underline was be positioned immediately
+ * below the baseline, we check for this and move the underline
+ * below the descent, as shown in the following ASCII picture:
+ *
+ * ##### ##### #
+ * # # # #
+ * # # # #
+ * # # # #
+ * ##### ###### ---- baseline (0)
+ * #
+ * #
+ * ------------------###----------- lineMetrics.getDescent()
+ */
+ underline.y = lineMetrics.getDescent();
+ }
+
+ underline.y += y;
+ g2.fill(underline);
+ }
+
+
+ /**
+ * Draws a rectangle, simulating a dotted stroke by painting only
+ * every second pixel along the one-pixel thick edge. The color of
+ * those pixels is the current color of the Graphics <code>g</code>.
+ * Any other pixels are left unchanged.
+ *
+ * <p><img src="BasicGraphicsUtils-7.png" width="360"
+ * height="200" alt="[An illustration that shows which pixels
+ * get painted]" />
+ *
+ * @param g the graphics into which the rectangle is drawn.
+ * @param x the x coordinate of the rectangle.
+ * @param y the y coordinate of the rectangle.
+ * @param width the width of the rectangle in pixels.
+ * @param height the height of the rectangle in pixels.
+ */
+ public static void drawDashedRect(Graphics g,
+ int x, int y, int width, int height)
+ {
+ int right = x + width - 1;
+ int bottom = y + height - 1;
+
+ /* Draw the top and bottom edge of the dotted rectangle. */
+ for (int i = x; i <= right; i += 2)
+ {
+ g.drawLine(i, y, i, y);
+ g.drawLine(i, bottom, i, bottom);
+ }
+
+ /* Draw the left and right edge of the dotted rectangle. */
+ for (int i = y; i <= bottom; i += 2)
+ {
+ g.drawLine(x, i, x, i);
+ g.drawLine(right, i, right, i);
+ }
+ }
+
+
+ /**
+ * Determines the preferred width and height of an AbstractButton,
+ * given the gap between the button&#x2019;s text and icon.
+ *
+ * @param b the button whose preferred size is determined.
+ *
+ * @param textIconGap the gap between the button&#x2019;s text and
+ * icon.
+ *
+ * @return a <code>Dimension</code> object whose <code>width</code>
+ * and <code>height</code> fields indicate the preferred
+ * extent in pixels.
+ *
+ * @see javax.swing.SwingUtilities#layoutCompoundLabel
+ */
+ public static Dimension getPreferredButtonSize(AbstractButton b,
+ int textIconGap)
+ {
+ Rectangle contentRect;
+ Rectangle viewRect;
+ Rectangle iconRect = new Rectangle();
+ Rectangle textRect = new Rectangle();
+ Insets insets = b.getInsets();
+
+ /* For determining the ideal size, do not assume a size restriction. */
+ viewRect = new Rectangle(0, 0,
+ /* width */ Integer.MAX_VALUE,
+ /* height */ Integer.MAX_VALUE);
+
+ /* java.awt.Toolkit.getFontMetrics is deprecated. However, it
+ * seems not obvious how to get to the correct FontMetrics object
+ * otherwise. The real problem probably is that the method
+ * javax.swing.SwingUtilities.layoutCompundLabel should take a
+ * LineMetrics, not a FontMetrics argument. But fixing this that
+ * would change the public API.
+ */
+ SwingUtilities.layoutCompoundLabel(
+ b, // for the component orientation
+ b.getToolkit().getFontMetrics(b.getFont()), // see comment above
+ b.getText(),
+ b.getIcon(),
+ b.getVerticalAlignment(),
+ b.getHorizontalAlignment(),
+ b.getVerticalTextPosition(),
+ b.getHorizontalTextPosition(),
+ viewRect, iconRect, textRect,
+ textIconGap);
+
+
+ /* +------------------------+ +------------------------+
+ * | | | |
+ * | ICON | | CONTENTCONTENTCONTENT |
+ * | TEXTTEXTTEXT | --> | CONTENTCONTENTCONTENT |
+ * | TEXTTEXTTEXT | | CONTENTCONTENTCONTENT |
+ * +------------------------+ +------------------------+
+ */
+ contentRect = textRect.union(iconRect);
+
+ return new Dimension(insets.left + contentRect.width + insets.right,
+ insets.top + contentRect.height + insets.bottom);
+ }
+}
diff --git a/libjava/javax/swing/plaf/basic/BasicLabelUI.java b/libjava/javax/swing/plaf/basic/BasicLabelUI.java
index 82623a6d3f0..0adad4dafa5 100644
--- a/libjava/javax/swing/plaf/basic/BasicLabelUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicLabelUI.java
@@ -65,6 +65,10 @@ public class BasicLabelUI extends LabelUI
public Dimension getPreferredSize(JComponent c)
{
JLabel b = (JLabel)c;
+ /*
+ We cannot use this method because it is not part of the
+ official Swing API.
+
Dimension d = BasicGraphicsUtils.getPreferredSize(b,
gap,
b.getText(),
@@ -74,7 +78,8 @@ public class BasicLabelUI extends LabelUI
b.getHorizontalTextPosition(),
b.getVerticalTextPosition());
System.out.println("JLABEL->^^^^^^^^^^^^^^^^^^^^^^ BASIC-PREF="+d + ",T="+b.getText());
- return d;
+ */
+ return new Dimension(100, 30);
}
@@ -90,7 +95,7 @@ public class BasicLabelUI extends LabelUI
g.setFont(f);
- FontMetrics fm = SwingUtilities.getFontMetrics(f);
+ FontMetrics fm = g.getFontMetrics(f);
Insets i = c.getInsets();
diff --git a/libjava/javax/swing/plaf/basic/BasicListUI.java b/libjava/javax/swing/plaf/basic/BasicListUI.java
index 24c40727155..fd4f095cc9b 100644
--- a/libjava/javax/swing/plaf/basic/BasicListUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicListUI.java
@@ -159,12 +159,19 @@ public class BasicListUI extends ListUI
a.y += dim.height + gap_between_cells;
}
}
-}
-
-
-
-
-
+ public int locationToIndex(JList list, Point location)
+ {
+ throw new Error ("Not implemented");
+ }
+ public Point indexToLocation(JList list, int index)
+ {
+ throw new Error ("Not implemented");
+ }
+ public Rectangle getCellBounds(JList list, int index1, int index2)
+ {
+ throw new Error ("Not implemented");
+ }
+}
diff --git a/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java b/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java
index c2bd0ae257c..5df1157cc07 100644
--- a/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java
@@ -139,4 +139,14 @@ public class BasicOptionPaneUI extends OptionPaneUI
return d2;
}
+
+ public void selectInitialValue(JOptionPane op)
+ {
+ throw new Error ("Not implemented");
+ }
+
+ public boolean containsCustomComponents(JOptionPane op)
+ {
+ throw new Error ("Not implemented");
+ }
}
diff --git a/libjava/javax/swing/plaf/basic/BasicRadioButtonUI.java b/libjava/javax/swing/plaf/basic/BasicRadioButtonUI.java
index 0f7f6a0faf1..bcc730c48f1 100644
--- a/libjava/javax/swing/plaf/basic/BasicRadioButtonUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicRadioButtonUI.java
@@ -60,14 +60,7 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI
public Dimension getPreferredSize(JComponent c)
{
AbstractButton b = (AbstractButton)c;
- Dimension d = BasicGraphicsUtils.getPreferredSize(b,
- gap,
- b.getText(),
- b.getIcon(),
- b.getVerticalAlignment(),
- b.getHorizontalAlignment(),
- b.getHorizontalTextPosition(),
- b.getVerticalTextPosition());
+ Dimension d = BasicGraphicsUtils.getPreferredButtonSize(b, gap);
// and add a little something for the circles:
diff --git a/libjava/javax/swing/plaf/basic/BasicTextUI.java b/libjava/javax/swing/plaf/basic/BasicTextUI.java
index 66af1b65d50..0930610a3a9 100644
--- a/libjava/javax/swing/plaf/basic/BasicTextUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTextUI.java
@@ -1,5 +1,5 @@
/* BasicTextUI.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,10 +46,16 @@ import javax.swing.*;
public class BasicTextUI extends TextUI
{
int gap = 3;
- View view = new RootView();
+ View view = null; // was: new RootView();
Color textColor, disabledTextColor, normalBackgroundColor;
EditorKit kit = new DefaultEditorKit();
+ /* *****************************************************************
+ * This View is way too incomplete to be of any use. To avoid errors
+ * when compiling with the Sun JDK, it has been commented out.
+ * -- Sascha Brawer (brawer@dandelis.ch)
+ *
+ * (begin of commented out section)
class RootView extends View
{
RootView()
@@ -68,6 +74,8 @@ public class BasicTextUI extends TextUI
}
}
}
+ * (end of commented out section)
+ *************************************************************** */
public BasicTextUI()
{
@@ -128,6 +136,7 @@ public class BasicTextUI extends TextUI
Position.Bias b,
int direction,
Position.Bias[] biasRet)
+ throws BadLocationException
{
return 0;
}
@@ -138,11 +147,13 @@ public class BasicTextUI extends TextUI
}
public Rectangle modelToView(JTextComponent t, int pos)
+ throws BadLocationException
{
return modelToView(t, pos, null);
}
public Rectangle modelToView(JTextComponent t, int pos, Position.Bias bias)
+ throws BadLocationException
{
return null;
}
diff --git a/libjava/javax/swing/plaf/basic/BasicToggleButtonUI.java b/libjava/javax/swing/plaf/basic/BasicToggleButtonUI.java
index 4b9260e8d8f..441c60696d5 100644
--- a/libjava/javax/swing/plaf/basic/BasicToggleButtonUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicToggleButtonUI.java
@@ -58,14 +58,7 @@ public class BasicToggleButtonUI extends BasicButtonUI
public Dimension getPreferredSize(JComponent c)
{
AbstractButton b = (AbstractButton)c;
- Dimension d = BasicGraphicsUtils.getPreferredSize(b,
- gap,
- b.getText(),
- b.getIcon(),
- b.getVerticalAlignment(),
- b.getHorizontalAlignment(),
- b.getHorizontalTextPosition(),
- b.getVerticalTextPosition());
+ Dimension d = BasicGraphicsUtils.getPreferredButtonSize(b, gap);
//System.out.println("^^^^^^^^^^^^^^^^^^^^^^ BASIC-PREF="+d + ",T="+b.text);
return d;
diff --git a/libjava/javax/swing/plaf/basic/BasicTreeUI.java b/libjava/javax/swing/plaf/basic/BasicTreeUI.java
index 17ba4b56e61..d9af1010ba7 100644
--- a/libjava/javax/swing/plaf/basic/BasicTreeUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTreeUI.java
@@ -1,5 +1,5 @@
/* BasicTreeUI.java
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,8 +38,199 @@ exception statement from your version. */
package javax.swing.plaf.basic;
-import javax.swing.plaf.*;
+import java.awt.Rectangle;
+import javax.swing.JTree;
+import javax.swing.plaf.TreeUI;
+import javax.swing.tree.TreePath;
-public class BasicTreeUI extends TreeUI
+
+/**
+ * A delegate providing the user interface for <code>JTree</code>
+ * according to the Basic look and feel. The current implementation
+ * of GNU Classpath does really work; it is just a stub that allows
+ * compiling the code.
+ *
+ * @see javax.swing.JTree
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ */
+public class BasicTreeUI
+ extends TreeUI
{
+ /**
+ * Determines the geometric extent of the label that is
+ * drawn for a path.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ *
+ * @param path the path whose label extent is requested.
+ *
+ * @return a rectangle enclosing the label, or <code>null</code>
+ * if <code>path</code> contains invalid nodes.
+ */
+ public Rectangle getPathBounds(JTree tree, TreePath path)
+ {
+ return null; // FIXME: not implemented
+ }
+
+
+ /**
+ * Creates a <code>TreePath</code> for the specified row.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ *
+ * @param row the index of the row, which should be a number
+ * in the range <code>[0, getRowCount(tree) - 1]</code>.
+ *
+ * @return a <code>TreePath</code> for the specified row, or
+ * <code>null</code> if <code>row</code> is outside
+ * the valid range.
+ */
+ public TreePath getPathForRow(JTree tree, int row)
+ {
+ return null; // FIXME: not implemented
+ }
+
+
+ /**
+ * Determines in which row a <code>TreePath</code> is currently
+ * being displayed.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ *
+ * @param path the path for which the caller wants to know
+ * in which row it is being displayed.
+ *
+ * @return a number in the range <code>[0, getRowCount(tree)
+ * - 1]</code> if the path is currently on display;
+ * <code>-1</code> if the path is not shown to the
+ * user.
+ */
+ public int getRowForPath(JTree tree, TreePath path)
+ {
+ return -1; // FIXME: not implemented
+ }
+
+
+ /**
+ * Counts how many rows are currently displayed.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ *
+ * @return the number of visible rows.
+ */
+ public int getRowCount(JTree tree)
+ {
+ return 0; // FIXME: not implemented
+ }
+
+
+ /**
+ * Finds the path that is closest to the specified position.
+ *
+ * <p><img src="../TreeUI-1.png" width="300" height="250"
+ * alt="[A screen shot of a JTree] />
+ *
+ * <p>As shown by the above illustration, the bounds of the
+ * closest path do not necessarily need to contain the passed
+ * location.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ *
+ * @param x the horizontal location, relative to the origin
+ * of <code>tree</code>.
+ *
+ * @param y the vertical location, relative to the origin
+ * of <code>tree</code>.
+ *
+ * @return the closest path, or <code>null</code> if the
+ * tree is currenlty not displaying any paths at all.
+ */
+ public TreePath getClosestPathForLocation(JTree tree,
+ int x, int y)
+ {
+ return null; // FIXME: not implemented
+ }
+
+
+ /**
+ * Determines whether the user is currently editing a tree cell.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ *
+ * @see #getEditingPath
+ */
+ public boolean isEditing(JTree tree)
+ {
+ return false; // FIXME: not implemented
+ }
+
+
+ /**
+ * Stops editing a tree cell, committing the entered value into the
+ * tree&#x2019;s model. If no editing session is active, or if the
+ * active editor does not agree to stopping, nothing happens. In
+ * some look and feels, this action happens when the user has
+ * pressed the enter key.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ *
+ * @return <code>false</code> if the editing still goes on because
+ * the cell editor has objected to stopping the session;
+ * <code>true</code> if editing has been stopped.
+ */
+ public boolean stopEditing(JTree tree)
+ {
+ return true; // FIXME: not implemented
+ }
+
+
+ /**
+ * Cancels editing a tree cell, discarding any entered value.
+ * If no editing session is active, nothing happens. The cell
+ * editor is not given an opportunity to veto the canceling.
+ * In some look and feels, this action happens when the user has
+ * pressed the escape key.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ */
+ public void cancelEditing(JTree tree)
+ {
+ // FIXME: not implemented
+ }
+
+
+ /**
+ * Starts a session to edit a tree cell. If the cell editor
+ * rejects editing the cell, it will just be selected.
+ *
+ * @param tree the <code>JTree</code> for which this delegate
+ * object provides the user interface.
+ *
+ * @param path the cell to edit.
+ */
+ public void startEditingAtPath(JTree tree, TreePath path)
+ {
+ // FIXME: not implemented
+ }
+
+
+ /**
+ * Retrieves the tree cell that is currently being edited.
+ *
+ * @return the currently edited path, or <code>null</code>
+ * if no editing session is currently active.
+ */
+ public TreePath getEditingPath(JTree tree)
+ {
+ return null; // FIXME: not implemented
+ }
}
diff --git a/libjava/javax/swing/text/JTextComponent.java b/libjava/javax/swing/text/JTextComponent.java
index a747e99ac89..e53b20f2f70 100644
--- a/libjava/javax/swing/text/JTextComponent.java
+++ b/libjava/javax/swing/text/JTextComponent.java
@@ -41,6 +41,7 @@ import java.awt.AWTEvent;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Image;
+import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.Point;
import javax.accessibility.Accessible;
@@ -384,6 +385,12 @@ public abstract class JTextComponent extends JComponent
return null;
}
+ public Insets getMargin()
+ {
+ // FIXME: Not implemented.
+ return null;
+ }
+
public void setText(String text)
{
getDocument().remove(0,doc.getLength());
diff --git a/libjava/jni.cc b/libjava/jni.cc
index 68aeb5d6bc1..81ef0f7d36a 100644
--- a/libjava/jni.cc
+++ b/libjava/jni.cc
@@ -35,11 +35,13 @@ details. */
#include <java/lang/reflect/Method.h>
#include <java/lang/reflect/Modifier.h>
#include <java/lang/OutOfMemoryError.h>
-#include <java/util/IdentityHashMap.h>
#include <java/lang/Integer.h>
#include <java/lang/ThreadGroup.h>
#include <java/lang/Thread.h>
#include <java/lang/IllegalAccessError.h>
+#include <java/nio/DirectByteBufferImpl.h>
+#include <java/util/IdentityHashMap.h>
+#include <gnu/gcj/RawData.h>
#include <gcj/method.h>
#include <gcj/field.h>
@@ -1720,24 +1722,28 @@ void
// Direct byte buffers.
static jobject
-(JNICALL _Jv_JNI_NewDirectByteBuffer) (JNIEnv *, void *, jlong)
+(JNICALL _Jv_JNI_NewDirectByteBuffer) (JNIEnv *, void *address, jlong length)
{
- // For now we don't support this.
- return NULL;
+ using namespace gnu::gcj;
+ using namespace java::nio;
+ return new DirectByteBufferImpl (reinterpret_cast<RawData *> (address),
+ length);
}
static void *
-(JNICALL _Jv_JNI_GetDirectBufferAddress) (JNIEnv *, jobject)
+(JNICALL _Jv_JNI_GetDirectBufferAddress) (JNIEnv *, jobject buffer)
{
- // For now we don't support this.
- return NULL;
+ using namespace java::nio;
+ DirectByteBufferImpl* bb = static_cast<DirectByteBufferImpl *> (buffer);
+ return reinterpret_cast<void *> (bb->address);
}
static jlong
-(JNICALL _Jv_JNI_GetDirectBufferCapacity) (JNIEnv *, jobject)
+(JNICALL _Jv_JNI_GetDirectBufferCapacity) (JNIEnv *, jobject buffer)
{
- // For now we don't support this.
- return -1;
+ using namespace java::nio;
+ DirectByteBufferImpl* bb = static_cast<DirectByteBufferImpl *> (buffer);
+ return bb->capacity();
}
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 115828554c2..a3a842b0544 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,435 @@
+2003-06-27 Krister Walfridsson <cato@df.lth.se>
+
+ * config/os/bsd/netbsd/ctype_noninline.h
+ (_C_ctype_): Declare.
+ (ctype<char>::classic_table): Return _C_ctype_ + 1.
+ (ctype<char>::ctype): Use classic_table.
+
+2003-06-27 Paolo Carlini <pcarlini@unitus.it>
+ Nathan C. Myers <ncm-nospam@cantrip.org>
+
+ PR libstdc++/9178
+ * include/bits/fstream.tcc (_M_underflow): Properly estimate
+ the worst-case number of external bytes for a given get area.
+ * testsuite/27_io/basic_filebuf/underflow/wchar_t/9178.cc: New.
+
+2003-06-27 Paolo Carlini <pcarlini@unitus.it>
+ Petur Runolfsson <peturr02@ru.is>
+
+ PR libstdc++/11305
+ * include/bits/fstream.tcc (overflow): Properly estimate the
+ worst-case number of external bytes for a given put area
+ (by using codecvt::max_length()).
+ * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-1: New.
+ * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-2: New.
+ * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-3: New.
+ * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-4: New.
+
+2003-06-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * config/linker-map.gnu: Remove ; after __numpunct_cache.
+
+2003-06-26 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/ios_base.h (ios_base::_M_getloc): Return reference
+ to the imbued locale.
+ * include/bits/locale_facets.tcc (num_put::_M_convert_int): Use
+ _M_getloc.
+ (num_put::_M_convert_float): Use.
+
+2003-06-26 Benjamin Kosnik <bkoz@redhat.com>
+ Jerry Quinn <jlquinn@optonline.net>
+
+ * config/linker-map.gnu: Add __numpunct_cache.
+ * config/locale/gnu/numeric_members.cc
+ (numpunct::_M_initialize_numpunct): Account for _M_data, fill in
+ all elements for "C" locale.
+ (numpunct::~numpunct): Delete _M_data.
+ * config/locale/generic/numeric_members.cc: Same.
+ * include/bits/basic_ios.tcc
+ (basic_ios::init): Remove __locale_cache bits.
+ (basic_ios::_M_cache_locale): Same.
+ * include/bits/ios_base.h: Same. Tweaks.
+ * include/bits/locale_classes.h: Tweaks. Reorder classes.
+ (__use_cache): Make friends with _Impl, locale.
+ (_Impl::_M_caches): Add.
+ (_Impl::_M_install_cache): Add.
+ * include/bits/locale_facets.h (__numpunct_cache): New.
+ (numpunct): Encapsulate data members in __numpunct_cache member,
+ _M_data. Adjust virtuals.
+ (numpunct::numpunct): New ctor for the same.
+ (__locale_cache_base): Remove.
+ (__locale_cache): Remove.
+ * include/bits/locale_facets.tcc (__use_cache): New function,
+ specializations.
+ (num_put::_M_convert_int, _M_convert_float, do_put): Use it.
+ * src/globals.cc: Add cache_vec, numpunct_cache_c, numpunct_cache_w.
+ * src/ios.cc (ios_base::ios_base): Remove __locale_cache.
+ * src/locale-inst.cc: Same. Add __numpunct_cache.
+ * src/locale.cc: Tweak inlines.
+ (__use_cache): Define specializations.
+ * src/localename.cc: Use global bits.
+ (_Impl::~Impl): Deal with __numpunct_cache destruction.
+ (_Impl::_Impl): Same. Pre-cache standard numpunct facets.
+ (_Impl::_M_init_facet): Take into account __numpunct_cache.
+ * testsuite/27_io/ios_base/cons/assign_neg.cc: Update line numbers.
+ * testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
+
+2003-06-26 Nathan C. Myers <ncm-nospam@cantrip.org>
+ Paolo Carlini <pcarlini@unitus.it>
+
+ * testsuite/performance/filebuf_copy.cc: New, testing char
+ by char file copy.
+
+2003-06-26 Paolo Carlini <pcarlini@unitus.it>
+ Nathan C. Myers <ncm-nospam@cantrip.org>
+
+ * include/bits/fstream.tcc (_M_underflow): When the actual
+ end of file is reached, set 'uncommitted' mode to allow a
+ next write without an intervening seek (see C++98 27.8.1.1,2
+ and C89 7.9.5.3).
+ * testsuite/27_io/basic_filebuf/underflow/char/2.cc: New.
+
+2003-06-25 Nathan C. Myers <ncm-nospam@cantrip.org>
+
+ * include/bits/streambuf.tcc (sbumpc, sputbackc, sungetc,
+ sputc): Move inline, from here...
+ * include/std/std_streambuf.h: ... to here.
+
+ * include/std/std_streambuf.h (snextc, sbumpc, sgetc,
+ sputbackc, sungetc, sputc): Use __builtin_expect.
+
+2003-06-24 Phil Edwards <pme@gcc.gnu.org>
+
+ * docs/doxygen/mainpage.html: Use a useful title.
+
+2003-06-24 Benjamin Kosnik <bkoz@redhat.com>
+
+ * docs/html/documentation.html: Remove assignment info.
+ * docs/html/17_intro/contribute.html: Edits.
+ * docs/html/17_intro/libstdc++-assign.tx: Remove.
+
+ * docs/html/test.html: Update.
+
+ * README: Update.
+
+2003-06-24 Benjamin Kosnik <bkoz@redhat.com>
+ Ulrich Drepper <drepper@redhat.com>
+
+ * testsuite/testsuite_performance.h: Tweak mallinfo.
+
+2003-06-24 Paolo Carlini <pcarlini@unitus.it>
+ Nathan C. Myers <ncm-nospam@cantrip.org>
+
+ * include/std/std_fstream.h (_M_filepos): Remove.
+ (_M_reading, _M_writing): New, encode the various I/O modes:
+ 'read', 'write' and 'uncommitted'.
+ (sync): If there is something to flush, do it, then go to
+ 'uncommitted' mode.
+ * include/bits/fstream.tcc (_M_set_buffer): Overhaul to deal
+ with three different cases: __off > 0 (upon underflow),
+ __off == 0 (upon overflow), __off == -1 (upon open, setbuf,
+ seekoff/pos).
+ (_M_underflow): Don't call overflow, set _M_reading to true
+ on success, tweak.
+ (pbackfail): Set _M_reading to true on pback creation, tweak.
+ (overflow): Don't seek, deal with overflow in 'uncommitted' mode,
+ set _M_writing to true on success, tweak.
+ (seekoff): Simplify, set _M_reading, _M_writing to false, call
+ _M_set_buffer(-1) ('uncommitted').
+ (open, close, setbuf): Set _M_reading, _M_writing to false and
+ call _M_set_buffer(-1), tweak.
+ (basic_filebuf): Don't set _M_buf_unified.
+ (_M_destroy_internal_buffer): Don't call setg and setp.
+ * include/ext/stdio_filebuf.h (stdio_filebuf): Use _M_reading,
+ _M_writing and _M_set_buffer(-1).
+ * include/std/std_streambuf.h (_M_move_out_cur, _M_move_in_cur,
+ _M_out_lim, _M_buf_unified): Remove.
+ (basic_streambuf): Don't set _M_out_lim and _M_buf_unified.
+ (setp): Don't set _M_out_lim.
+ * testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc: Fix for
+ the new logic ('read', 'write' and 'uncommitted' modes): e.g.,
+ upon open the mode is 'uncommitted' and therefore the put area
+ pointers are null.
+ * testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/seekoff/char/3-io.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/seekpos/char/3-io.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/setbuf/char/1.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/snextc/char/1-io.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/snextc/char/1-out.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/sputc/char/1-io.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/sputc/char/1-out.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/sputc/char/9701-2.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/sputn/char/1-io.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/sputn/char/1-out.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/sputn/char/9701-1.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc: Ditto.
+
+ * include/bits/fstream.tcc (showmanyc): Use only the
+ documented derivation interface to basic_streambuf (gptr(),
+ setg(), etc.) to work right with user specializations.
+ * include/bits/streambuf.tcc (sbumpc, sputbackc, sungetc,
+ sputc, xsgetn, xsputn, __copy_streambufs): Likewise.
+ * include/std/std_streambuf.h (in_avail, sgetc, uflow, stossc):
+ Likewise.
+ * include/std/std_fstream.h (_M_create_pback, _M_destroy_pback,
+ xsgetn): Likewise.
+
+2003-06-23 Loren J. Rittle <ljrittle@acm.org>
+
+ * configure.host (freebsd*): Set abi_baseline_pair.
+ * config/abi/i386-freebsd4/baseline_symbols.txt: Update from 3.2
+ (at or near first release) to 3.3.
+ * config/abi/i386-freebsd5/baseline_symbols.txt: New file.
+ * config/abi/alpha-freebsd5/baseline_symbols.txt: New file.
+ * config/abi/sparc-freebsd5/baseline_symbols.txt: New file.
+
+ * include/ext/mt_allocator.h: Portability.
+ * testsuite/testsuite_performance.h: Likewise.
+
+2003-06-23 Benjamin Kosnik <bkoz@redhat.com>
+
+ * docs/html/17_intro/libstdc++-assign.txt: Update address.
+
+ * testsuite/performance/ifstream_getline.cc: Fix.
+
+2003-06-23 Doug Gregor <dgregor@apple.com>
+
+ * include/bits/boost_concept_check.h: Don't use _D or _R for type
+ names.
+
+2003-06-22 Paolo Carlini <pcarlini@unitus.it>
+ Nathan C. Myers <ncm-nospam@cantrip.org>
+
+ * include/std/std_streambuf.h (_M_move_out_cur): _M_out_lim
+ is now used only for filebuf, when _M_buf_unified is true.
+ epgtr() plays the role of _M_out_lim but it's only updated
+ upon overflow, underflow, uflow, seekoff/pos.
+ * include/bits/sstream.tcc (_M_underflow): New, implements
+ stringbuf::underflow and uflow.
+ (seekoff, seekpos): Tweak, use _M_update_egptr.
+ * include/std/std_sstream.h (str): Rewrote, deal correctly
+ with the new logic, in particular, when pptr() > egptr().
+ (_M_sync): When __testout && !__testin set all the get area
+ pointers to the current string end.
+ (_M_update_egptr): New, internal function updating egptr()
+ to the actual string end.
+ (_M_underflow): New, declare.
+ (underflow): Dispatch to _M_underflow(false).
+ (uflow): Dispatch to _M_underflow(true).
+
+ * include/bits/sstream.tcc (pbackfail, overflow, seekoff,
+ seekpos): Use only the documented derivation interface to
+ basic_streambuf (gptr(), setg(), etc.) to work right with
+ user specializations.
+ * include/std/std_sstream.h (str, _M_sync): Likewise.
+
+2003-06-20 Doug Gregor <dgregor@apple.com>
+
+ * testsuite/20_util/auto_ptr.cc: Don't dereference NULL auto_ptr
+ * testsuite/21_strings/basic_string/replace/char/4.cc: Don't
+ dereference end iterator.
+ * testsuite/21_strings/basic_string/replace/wchar_t/4.cc: Same.
+ * testsuite/22_locale/ctype/narrow/char/1.cc: Don't subscript with
+ index equal to the length of a string.
+ * testsuite/22_locale/ctype/narrow/char/2.cc: Same.
+ * testsuite/22_locale/ctype/narrow/wchar_t/1.cc: Same.
+ * testsuite/22_locale/ctype/narrow/wchar_t/2.cc: Same.
+ * testsuite/22_locale/ctype/widen/char/1.cc: Same.
+ * testsuite/22_locale/ctype/widen/wchar_t/1.cc: Same.
+ * testsuite/23_containers/list_modifiers.cc: Don't dereference
+ singular reverse iterator.
+ * testsuite/23_containers/vector_bool.cc: Don't increment singular
+ iterator.
+ * testsuite/24_iterators/rel_ops.cc: Don't compare singular iterator.
+
+2003-06-20 Doug Gregor <dgregor@apple.com>
+
+ * include/bits/basic_string.h (basic_string::replace): Dispatch
+ _InputIterator version based on _Is_integer.
+ * include/bits/basic_string.tcc (basic_string::replace):
+ Renamed replace(iterator, iterator, size_type, _CharT) to
+ _M_replace_aux.
+ * testsuite/21_strings/basic_string/assign/char/1.cc (test01):
+ Test basic_string::assign(_InputIterator, _InputIterator),
+ which calls basic_string::replace(iterator, iterator,
+ _Input_iterator, _InputIterator).
+
+2003-06-20 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/testsuite_performance.h (resource_counter): Don't use
+ mallinfo at the moment.
+
+2003-06-20 Matthias Klose <doko@debian.org>
+
+ * configure.host: Set try_cpu to target_cpu for existing
+ baseline files.
+
+2003-06-19 Andreas Jaeger <aj@suse.de>
+
+ * testsuite/Makefile.am (extract_symvers): Revert accidental
+ change.
+ * testsuite/Makefile.in: Regenerate.
+
+ * configure.in: Pass MULTISUBDIR to testsuite/Makefile.
+ * configure: Regenerated.
+
+2003-06-19 Paolo Carlini <pcarlini@unitus.it>
+
+ * include/std/std_sstream.h (_M_sync): Make non virtual.
+
+2003-06-18 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/testsuite_performance.h (time_counter): New.
+ (resource_counter): New.
+ (report_performance): New.
+ (start_counters): New.
+ (stop_counters): New.
+ (clear_counters): New.
+ * testsuite/performance/allocator.cc: Instrument.
+ * testsuite/performance/cout_insert_int.cc: Same.
+ * testsuite/performance/complex_norm.cc: Same.
+ * testsuite/performance/filebuf_sputc.cc: New.
+ * testsuite/performance/fstream_seek_write.cc: Same.
+ * testsuite/performance/ifstream_getline.cc: Same.
+ * testsuite/performance/map_create_fill.cc: Same.
+ * testsuite/performance/ofstream_insert_float.cc: Same.
+ * testsuite/performance/ofstream_insert_int.cc: Same.
+ * testsuite/performance/string_append.cc: Convert.
+ * scripts/check_performance: New.
+ * testsuite/Makefile.am (check-performance): New.
+ (CLEANFILES): Add.
+
+2003-06-18 Paolo Carlini <pcarlini@unitus.it>
+ Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/std/std_sstream.h (setbuf): Check __n >= 0.
+ * include/bits/fstream.tcc (setbuf): Tweak.
+
+2003-06-18 Paolo Carlini <pcarlini@unitus.it>
+
+ * include/bits/sstream.tcc (seekoff): We can't seek beyond
+ _M_out_lim, therefore _M_move_out_cur boils down to simply
+ updating _M_out_cur.
+ (seekpos): Likewise, clean up.
+
+2003-06-18 Nathan C. Myers <ncm-nospam@cantrip.org>
+ Paolo Carlini <pcarlini@unitus.it>
+
+ * include/bits/fstream.tcc (setbuf): Allow (__s, 1) too,
+ simply equivalent to the unbuffered case (0, 0) as far as
+ _M_buf_size is concerned.
+
+2003-06-18 Andreas Jaeger <aj@suse.de>
+
+ * testsuite/Makefile.am (new-abi-baseline): Create baseline
+ directory.
+ (baseline_file): Use baseline_dir.
+ (baseline_dir): New.
+ (mkinstalldirs): New.
+
+ * acinclude.m4: Rename baseline_file to baseline_dir, strip
+ filename from baseline_dir.
+
+ * testsuite/Makefile.in: Regenerated.
+ * Makefile.in: Regenerated.
+ * aclocal.m4: Regenerated.
+ * configure: Regenerated.
+
+2003-06-17 Benjamin Kosnik <bkoz@redhat.com>
+
+ * configure.in: Missed check_survey bit.
+ * configure: Regenerated.
+
+2003-06-17 Benjamin Kosnik <bkoz@redhat.com>
+
+ * scripts: New.
+ * config/abi/extract_symvers: Move to...
+ * scripts/extract_symvers: ...here.
+ * mkcheck.in: Move to..
+ * scripts/check_survey.in: ...here.
+ * testsuite_flags.in: Move to..
+ * scripts/testsuite_flags.in: ...here.
+ * configure.in: Change check and testsuite_flags locations.
+ * configure: Regenerate.
+ * testsuite/Makefile.am (current_symbols.txt): Change location.
+ * testsuite/Makefile.in: Regenerate.
+ * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init): Modify
+ location of testsuite_flags.
+ * Makefile.am (check-script): Move..
+ (check-script-install): Move...
+ * testsuite/Makefile.am: ... here.
+ * testsuite/Makefile.in: Regenerate.
+ * Makefile.in: Regenerate.
+
+2003-06-17 Benjamin Kosnik <bkoz@redhat.com>
+
+ * config/abi/i486-linux-gnu/baseline_symbols.txt: Update to 3.3.0.
+
+2003-06-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ * Makefile.am (check-abi): Move...
+ (new-abi-baseline): Move...
+ * testsuite/Makefile.am: ...here.
+ (new-abi-baseline): Conditionalize.
+ (check-abi): Conditionalize.
+ (check-abi-verbose): New.
+ * Makefile.in: Regenerate.
+ * testsuite/Makefile.in: Regenerate.
+ * configure.in: Consolidate testsuite configure bits.
+ * acinclude.m4 (GLIBCPP_CONFIGURE_TESTSUITE): Same.
+ * configure: Regenerate.
+ * aclocal.m4: Regenerate.
+ * testsuite/abi_check.cc: Add --check-verbose.
+ Only output detailed information if --check-verbose.
+
+2003-06-16 Andreas Jaeger <aj@suse.de>
+
+ * testsuite/abi_check.cc: Create summary report.
+
+2003-06-16 Paolo Carlini <pcarlini@unitus.it>
+
+ * testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc: Fix
+ for systems with BUFSIZ != 8192.
+ * testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc: Ditto.
+ * testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc:
+ Minor tweaks.
+
+2003-06-16 Andreas Jaeger <aj@suse.de>
+
+ * acinclude.m4 (GLIBCPP_CONFIGURE_TESTSUITE): Make
+ check-abi multilib aware.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2003-06-16 Benjamin Kosnik <bkoz@redhat.com>
+ Andreas Jaeger <aj@suse.de>
+
+ * configure.host: Set x86_64 abi_baseline pair correctly.
+
+2003-06-16 Paolo Carlini <pcarlini@unitus.it>
+
+ * testsuite/27_io/basic_filebuf/sungetc/char/1.cc: Split and
+ fix for missing seeks between gets and puts into...
+ * testsuite/27_io/basic_filebuf/sungetc/char/1-in.cc: New.
+ * testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc: New.
+ * testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc: New.
+ * testsuite/27_io/basic_filebuf/sungetc/char/2-in.cc: New.
+ * testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc: New.
+ * testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc: New.
+
+2003-06-15 Richard Henderson <rth@redhat.com>
+
+ * config/linker-map.gnu: Export virtual function thunks for
+ 64-bit systems too.
+
2003-06-13 Benjamin Kosnik <bkoz@redhat.com>
* config/abi/i686-pc-linux-gnu: To..
@@ -10,6 +442,8 @@
* config/abi/x86_64-linux-gnu: ...this.
* config/abi/i386-unknown-freebsd4: To...
* config/abi/i386-freebsd4: ...this.
+ * config/linker-map.gnu: Cleanups, move libsupc++ bits into
+ CXXABI.
* configure.host: abi_baseline_triplet to abi_baseline_pair.
Simplify cpu bits so that abi_baseline_pair can use the same
cpu configuration.
@@ -38,21 +472,21 @@
2003-06-13 Nathan C. Myers <ncm-nospam@cantrip.org>
Avoid multi-processor bus contention on increment/decrement-and-
- test of the reference count in the empty-string object, by comparing
+ test of the reference count in the empty-string object, by comparing
addresses first, and never touching the reference count of the empty-
- string object.
+ string object.
* include/bits/basic_string.h:
(_S_empty_rep_storage): Move into basic_string<>::_Rep for use by its
members.
- (_Rep::_S_empty_rep()): New accessor.
+ (_Rep::_S_empty_rep()): New accessor.
(_Rep::_M_length, _Rep::_M_capacity, _Rep::_M_references): Move to
a base class _Rep_base.
(_Rep::_M_dispose, _Rep::_M_refcopy): Check for the empty string.
(basic_string()): Change to use _M_refdata() in place of _M_refcopy(),
since no longer must increment its refcount.
* include/bits/basic_string.tcc:
- (_Rep::_M_destroy, _M_leak_hard): Check for the empty string and
- return immediately. The former might be unnecessary. The latter
+ (_Rep::_M_destroy, _M_leak_hard): Check for the empty string and
+ return immediately. The former might be unnecessary. The latter
prevents begin() and end() from cloning it unnecessarily.
(_S_construct(_InIterator, _InIterator, const _Alloc&,
input_iterator_tag), _S_construct(_InIterator, _InIterator,
@@ -62,14 +496,14 @@
This is necessary here because _M_mutate is sometimes called with
all-zero arguments; in all other uses of _M_is_shared, the test comes
out right anyhow.
-
+
2003-06-12 Benjamin Kosnik <bkoz@redhat.com>
* src/allocator-inst.cc: Explicitly instantiate.
* include/ext/pool_allocator.h: Inhibit implicit instantiations.
Tweaks.
* config/linker-map.gnu: Add __pool_alloc bits. Tweaks.
-
+
2003-06-11 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4 (GLIBCPP_ENABLE_CSTDIO): Simplify.
@@ -79,15 +513,15 @@
* configure.in: Same.
* configure: Regenerate.
* config/io/basic_file_libio.cc: Remove.
- * config/io/basic_file_libio.h: Remove.
+ * config/io/basic_file_libio.h: Remove.
* config/io/c_io_libio_codecvt.c: Remove.
- * config/io/c_io_libio.h: Remove.
+ * config/io/c_io_libio.h: Remove.
* libio/*: Remove.
* src/Makefile.am: Same.
* src/Makefile.in: Regenerate.
- * docs/html/configopts.html: Edits.
+ * docs/html/configopts.html: Edits.
* docs/html/explanations.html: Edits.
-
+
2003-06-11 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/stl_alloc.h (__debug_alloc): Move out.
@@ -100,7 +534,7 @@
* include/bits/stl_tree.h: Modify include.
* include/std/std_memory.h: Same.
* include/ext/rope: Same.
- * include/ext/slist: Same.
+ * include/ext/slist: Same.
* include/std/std_vector.h: Same.
* include/std/std_stack.h: Same.
* include/std/std_queue.h: Same.
@@ -108,11 +542,11 @@
* include/std/std_deque.h: Same.
* include/backward/alloc.h: Same.
* include/ext/debug_allocator.h: New.
- * include/ext/malloc_allocator.h: New.
- * include/ext/pool_allocator.h: New.
+ * include/ext/malloc_allocator.h: New.
+ * include/ext/pool_allocator.h: New.
* include/ext/new_allocator.h: New.
* include/bits/pthread_allocimpl.h: Remove.
- * include/bits/stl_pthread_alloc.h: Remove.
+ * include/bits/stl_pthread_alloc.h: Remove.
* include/Makefile.am (ext_headers): Add.
* include/Makefile.in: Regenerate.
* src/stl-inst.cc: Use __gnu_cxx namespace.
@@ -123,10 +557,10 @@
* config/linker-map.gnu: Remove __pool_alloc bits.
* testsuite/ext/headers.cc: Add.
* testsuite/ext/allocators.cc: Fixup.
-
+
2003-06-11 Stefan Olsson <stefan@snon.net>
Ola Rönnerup <fnolis@home.se>
-
+
* include/Makefile.am (ext_headers): Add.
* include/Makefile.in: Regenerate.
* include/ext/mt_allocator.h: New file.
@@ -251,7 +685,7 @@
2003-06-05 Benjamin Kosnik <bkoz@redhat.com>
- PR libstdc++/9024
+ PR libstdc++/9024
* include/bits/fstream.tcc (_M_underflow): Fix for unbuffered.
* include/bits/stl_algobase.h: Tweak.
* include/std/std_fstream.h: Move _M_buf_size to...
@@ -306,7 +740,7 @@
* testsuite/27_io/basic_filebuf/sputn/char/2-out.cc: New.
* testsuite/data/sgetc.txt: New.
* testsuite/data/sgetn.txt: New.
-
+
2003-06-05 Paolo Carlini <pcarlini@unitus.it>
PR libstdc++/11095
@@ -365,7 +799,7 @@
asm case to asm.
* config/cpu/i486/atomicity.h (__exchange_and_add): Likewise.
(__atomic_add): likewise.
-
+
2003-06-02 Paolo Carlini <pcarlini@unitus.it>
* include/bits/sstream.tcc (pbackfail): Minor clean up and
@@ -467,7 +901,7 @@
(basic_filebuf::overflow): ...this.
* testsuite/27_io/basic_filebuf/sputn/char/9339.cc: New.
* testsuite/27_io/basic_filebuf/sputc/char/2.cc: Unbuffered.
-
+
2003-05-24 Nathanael Nerode <neroden@gcc.gnu.org>
* libsupc++/Makefile.am, libsupc++/cxxabi.h, libsupc++/del_op.cc,
@@ -496,7 +930,7 @@
* aclocal.m4: Regenerate.
* configure.target: Same. Rename to...
* configure.host: This.
-
+
2003-05-22 Paolo Carlini <pcarlini@unitus.it>
* include/std/std_fstream.h (_S_pback_size): Remove definition.
@@ -589,12 +1023,12 @@
* testsuite/performance/string_append.cc: New.
* testsuite/lib/libstdc++-v3-dg.exp (v3-compute-tests): Filter
performance tests.
-
+
2003-05-20 Gabriel Dos Reis <gdr@integrable-solutions.net>
PR libstdc++/10689
* include/std/std_complex.h (pow): Tidy.
-
+
2003-05-19 Paolo Carlini <pcarlini@unitus.it>
* testsuite/27_io/basic_filebuf/close/char/4.cc: New file, testing
@@ -641,7 +1075,7 @@
excess errors dg marker, use dg-errors instead.
* testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
* testsuite/20_util/auto_ptr_neg.cc: Same.
-
+
2003-05-12 Benjamin Kosnik <bkoz@redhat.com>
* include/std/std_fstream.h (basic_filebuf::_M_codecvt): Add
@@ -656,11 +1090,11 @@
(basic_filebuf::imbue): Use it, tweaks.
* include/bits/localefwd.h (__check_facet): New.
* include/bits/locale_classes.h: Tweaks.
- * include/bits/locale_facets.tcc: Tweaks.
+ * include/bits/locale_facets.tcc: Tweaks.
* include/bits/basic_ios.h (basic_ios::_M_check_facet): Remove.
_M_fctype to _M_ctype, _M_fnumput to _M_num_put, _M_fnumget to
_M_num_get. Change _M_check_facet to __check_facet. Tweaks.
- * include/bits/basic_ios.tcc: Same.
+ * include/bits/basic_ios.tcc: Same.
* include/bits/istream.tcc: Same.
* include/bits/ostream.tcc: Same.
* include/std/std_streambuf.h: Same.
@@ -670,7 +1104,7 @@
* testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc: New.
* testsuite/27_io/basic_filebuf/imbue/wchar_t/3.cc: New.
* testsuite/27_io/basic_filebuf/imbue/wchar_t/9322.cc: New.
-
+
2003-05-12 Paolo Carlini <pcarlini@unitus.it>
* testsuite/27_io/basic_filebuf/sgetc/char/1.cc: Remove
@@ -732,7 +1166,7 @@
* include/bits/cpp_type_traits.h (__are_same<>): New traits.
(__enable_if): Likewise.
* testsuite/26_numerics/cmath/overloads.C: New test.
-
+
2003-05-10 Petur Runolfsson <peturr02@ru.is>
PR libstdc++/9027
@@ -770,7 +1204,7 @@
* include/bits/fstream.tcc: Same.
* src/fstream.cc: Same.
* testsuite/27_io/basic_filebuf/sgetn/char/1.cc (test05): Tidy.
-
+
2003-05-10 Petur Runolfsson <peturr02@ru.is>
PR libstdc++/9520
@@ -782,7 +1216,7 @@
* include/Makefile.in: Regenerate.
* include/bits/ios_base.h (Init::_S_create_buffers,
Init::_S_destroy_buffers): Remove declarations.
- * src/globals.cc (buf_cout_sync, buf_cin_sync, buf_cerr_sync,
+ * src/globals.cc (buf_cout_sync, buf_cin_sync, buf_cerr_sync,
buf_wcout_sync, buf_wcin_sync, buf_wcerr_sync): Define.
* src/ios.cc (Init::_S_create_buffers,
Init::_S_destroy_buffers): Remove.
@@ -856,10 +1290,10 @@
(__cxa_call_unexpected): Remove foreign exception fixmes.
2003-05-07 Benjamin Kosnik <bkoz@redhat.com>
-
+
* testsuite/27_io/ios_base/cons: New.
* testsuite/27_io/ios_base/cons/assign_neg.cc: New.
- * testsuite/27_io/ios_base/cons/copy_neg.cc: New.
+ * testsuite/27_io/ios_base/cons/copy_neg.cc: New.
2003-05-07 Paolo Carlini <pcarlini@unitus.it>
@@ -884,7 +1318,7 @@
to clean up.
2003-05-06 Benjamin Kosnik <bkoz@redhat.com>
-
+
* include/bits/stl_algo.h: Enums as _S_.
* include/bits/stl_tree.h: Same.
* include/bits/stl_bvector.h: Same.
@@ -892,12 +1326,12 @@
* include/bits/stl_alloc.h: Same.
* include/ext/stl_hashtable.h: Same.
* src/ios.cc: And here.
-
- * include/std/std_sstream.h: Replace _M_really_sync to _M_sync.
+
+ * include/std/std_sstream.h: Replace _M_really_sync to _M_sync.
* include/bits/sstream.tcc: Same.
* include/bits/basic_ios.h: Correct spacing for '< ctype'.
-
+
* include/bits/locale_facets.tcc: Replace __temp to __tmp.
* include/bits/locale_facets.h (__num_base): Remove protected.
@@ -905,9 +1339,9 @@
(_S_format_int): Remove.
* include/bits/locale_facets.tcc: Same.
* src/locale.cc: Same.
-
+
* include/std/std_sstream.h (stringbuf::str): Tweak formatting.
-
+
2003-05-06 Phil Edwards <pme@gcc.gnu.org>
* docs/html/faq/index.html (3.10): Add note about mips atomicity.h.
@@ -998,7 +1432,7 @@
* testsuite/abi_check.cc (check_version): Update known versions.
Check added symbols for version_name != base version. Add missing
symbols to incompatible list.
-
+
2003-05-01 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4 (GLIBCPP_EXPORT_FLAGS): Remove -Winline.
@@ -1092,7 +1526,7 @@
* config/locale/ieee_1003.1-2001/codecvt_specializations.h: Same.
* testsuite/testsuite_hooks.cc (__gnu_cxx_test): Modify.
-
+
2003-04-28 Paolo Carlini <pcarlini@unitus.it>
* include/std/std_streambuf.h (_M_buf_size): is currently
@@ -1126,7 +1560,7 @@
* po/Makefile.in, config.h.in, configure: Regenerate.
2003-04-28 Petur Runolfsson <peturr02@ru.is>
-
+
PR libstdc++/9523
* include/bits/ios_base.h (Init::_S_ios_create,
Init::_S_ios_destroy): Remove declarations.
@@ -1148,12 +1582,12 @@
2003-04-28 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/27_io/objects/char/8.cc: New test.
-
+
2003-04-28 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/22_locale/codecvt/unicode/char.cc: Remove bom usage.
* testsuite/22_locale/codecvt/unicode/wchar_t.cc: Same.
-
+
2003-04-27 Benjamin Kosnik <bkoz@redhat.com>
* include/std/std_fstream.h (basic_filebuf): _M_pback_destroy to
@@ -1167,7 +1601,7 @@
* include/bits/streambuf.tcc: Same.
* include/bits/fstream.tcc: Same.
* include/bits/sstream.tcc: Same.
-
+
2003-04-27 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/locale_classes.h (locale::_Impl): Change _M_names
@@ -1182,7 +1616,7 @@
* src/localename.cc: Use them.
(locale::_Impl::~_Impl): Destroy _M_names.
(locale::_Impl::_Impl): Create _M_names.
-
+
2003-04-27 Andreas Schwab <schwab@suse.de>
* config/locale/ieee_1003.1-2001/codecvt_specializations.h
@@ -1200,7 +1634,7 @@
replace(size_type, size_type, const _CharT*, size_type)):
Move from here to...
* include/bits/basic_string.tcc: ...here.
-
+
2003-04-26 Paolo Carlini <pcarlini@unitus.it>
* include/bits/fstream.tcc (pbackfail): Shorten a bit (10 lines)
@@ -1215,19 +1649,19 @@
* include/std/std_sstream.h (setbuf): don't set _M_buf_size,
in basic_stringbuf it's unused.
-
+
* include/std/std_sstream.h (underflow): consistently use
_M_in_cur, not gptr().
2003-04-25 Ranjit Mathew <rmathew@hotmail.com>
Phil Edwards <pme@gcc.gnu.org>
-
+
* testsuite_flags.in: Guard against the possibility
of having "xgcc" as a part of a folder name in the
path to the GCC build folder.
* testsuite/Makefile.am: Likewise.
* testsuite/Makefile.in: Regenerated.
-
+
2003-04-25 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/10132
@@ -1236,27 +1670,27 @@
(basic_filebuf::close): Same.
(basic_filebuf::_M_pback_destroy): Same.
(basic_filebuf::_M_destroy_internal_buffer): Same.
- (basic_filebuf): Remove __res_type typedef.
+ (basic_filebuf): Remove __res_type typedef.
* src/fstream.cc: Same.
* include/bits/fstream.tcc
(basic_filebuf::_M_convert_to_external): Simplify.
(basic_filebuf::seekoff): Use has_facet before use_facet.
(basic_filebuf::close): Add exception specification of throw().
* testsuite/27_io/basic_filebuf/cons: New.
- * testsuite/27_io/basic_filebuf/cons/wchar_t: New.
- * testsuite/27_io/basic_filebuf/cons/wchar_t/10132-1.cc: New.
+ * testsuite/27_io/basic_filebuf/cons/wchar_t: New.
+ * testsuite/27_io/basic_filebuf/cons/wchar_t/10132-1.cc: New.
* testsuite/27_io/basic_filebuf/seekoff/10132-2.cc: New.
* testsuite/27_io/basic_filebuf/seekpos/10132-3.cc: New.
2003-04-25 Benjamin Kosnik <bkoz@redhat.com>
-
+
* include/bits/locale_classes.h
(locale::_S_extra_categories_size): Remove.
* src/locale.cc: Remove _S_extra_categories_size.
* src/localename.cc: Same.
* config/locale/gnu/c_locale.cc: Same.
* config/locale/generic/c_locale.cc: Same.
-
+
2003-04-24 Richard Sandiford <rsandifo@redhat.com>
* src/localename.cc (__gnu_cxx::facet_vec): Correct types.
@@ -1306,9 +1740,9 @@
* configure.in: Move GLIBCPP_CHECK_PCH before native/cross conditions.
* configure: Regenerated.
-
+
2003-04-23 Benjamin Kosnik <bkoz@redhat.com>
-
+
* config/locale/generic/c_locale.h (__convert_from_v): Use
attribute unused.
@@ -1506,7 +1940,7 @@
* testsuite/thread/pthread4.cc: Same.
* testsuite/thread/pthread5.cc: Same.
* testsuite/thread/pthread6.cc: Same.
-
+
2003-04-15 Loren J. Rittle <ljrittle@acm.org>
libstdc++/7680
@@ -1524,12 +1958,12 @@
* testsuite/26_numerics/c_math_dynamic.cc: New file.
2003-04-14 Andreas Tobler <toa@pop.agri.ch>
- Benjamin Kosnik <bkoz@redhat.com>
+ Benjamin Kosnik <bkoz@redhat.com>
* config/os/generic/ctype_inline.h: Fix.
-
+
2003-04-14 Benjamin Kosnik <bkoz@redhat.com>
-
+
* testsuite/testsuite_hooks.h
(__gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher):
Change to try_named_locale.
@@ -1674,9 +2108,9 @@
* testsuite/27_io/basic_ostream/inserters_arithmetic/char/2.cc: Same.
* testsuite/27_io/basic_streambuf/imbue/char/9322.cc: Same.
* testsuite/27_io/basic_stringbuf/imbue/char/9322.cc: Same.
-
+
2003-04-14 Andreas Tobler <toa@pop.agri.ch>
-
+
* configure.target (_cpu_incdir_fullpath): Solaris 2.9 uses
solaris includes, not generic.
@@ -1720,7 +2154,7 @@
Remove _M_buf_size_opt, use directly _M_buf_size instead.
* include/bits/fstream.tcc
(basic_filebuf::_M_allocate_internal_buffer, setbuf): Remove
- references to _M_buf_size_opt.
+ references to _M_buf_size_opt.
* include/bits/sstream.tcc (basic_stringbuf::overflow): Likewise.
* include/bits/streambuf.tcc (__copy_streambufs): Likewise, rename
__bufsize to __in_avail and __size_opt to __buf_size.
@@ -1763,12 +2197,12 @@
* testsuite/22_locale/locale/cons/3.cc: Split.
* testsuite/22_locale/locale/cons/7222-c.cc: New.
- * testsuite/22_locale/locale/cons/7222-env.cc: New.
+ * testsuite/22_locale/locale/cons/7222-env.cc: New.
Check before trying to create a locale from the environment.
* testsuite/27_io/ios_base/state/1.cc (test02): Use "C" locale.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc:
Adjust includes.
-
+
2003-04-11 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/22_locale/ctype/is/char/3.cc (test03): Use the classic
@@ -1780,7 +2214,7 @@
instantiation for AIX.
* testsuite/27_io/basic_ostream/sentry/char/3983-fstream.cc: Same.
* testsuite/25_algorithms/min_max.cc: Same.
-
+
2003-04-10 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* basic_file_stdio.cc (__basic_file<char>::close): Don't flush stream
@@ -2154,13 +2588,13 @@
* include/std/std_streambuf.h (basic_streambuf::setp): Set
_M_out_lim.
-
+
* include/std/std_sstream.h (basic_strinbuf::str): Zero length
output string shouldn't core.
(basic_stringbuf::_M_really_sync): Add base argument. Remove rturn
type.
* include/bits/sstream.tcc: Adjust _M_really_sync bits here.
-
+
* include/bits/istream.tcc (basic_istream::putback): Set gcount to
zero.
@@ -2168,13 +2602,13 @@
* testsuite/data: New directory.
* testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init): Modify
- to copy files from the testsuite data directory.
+ to copy files from the testsuite data directory.
(libstdc++-v3-list-sourcefiles): Add another test list filter, for
testfiles containing _xin, which now means this is an interactive
test and should be run with the interactive dejagnu hooks.
* testsuite/Makefile.am: Remove testsuite_* files.
* testsuite/Makefile.in: Regenerate.
-
+
2003-04-09 Zack Weinberg <zack@codesourcery.com>
* docs/html/install.html: Document complete list of locales
@@ -2961,7 +3395,7 @@
(basic_streambuf()): Initialize _M_out_lim too.
* testsuite/27_io/filebuf_virtuals.cc (test10): Trivial tweak.
* testsuite/27_io/filebuf_virtuals.cc (test11): Add.
- * testsuite/27_io/stringbuf_virtuals.cc (test09): Add.
+ * testsuite/27_io/stringbuf_virtuals.cc (test09): Add.
2003-02-24 Benjamin Kosnik <bkoz@redhat.com>
diff --git a/libstdc++-v3/Makefile.am b/libstdc++-v3/Makefile.am
index d17784bdea3..2467ce3d7b8 100644
--- a/libstdc++-v3/Makefile.am
+++ b/libstdc++-v3/Makefile.am
@@ -31,41 +31,6 @@ mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
PWD = $${PWDCMD-pwd}
-# These two special 'check-script' rules use the bash script 'mkcheck'
-# to do testing. This script is not as portable as the dejagnu test
-# harness, and is thus off by default. It does produce interesting
-# output however, including various performance analysis items like
-# compile time, execution time, and binary size.
-check-script: $(top_builddir)/mkcheck
- -(chmod + $(top_builddir)/mkcheck; \
- cd testsuite; \
- @glibcpp_builddir@/mkcheck 0)
-
-check-script-install: $(top_builddir)/mkcheck
- -(chmod + $(top_builddir)/mkcheck; \
- cd testsuite; \
- @glibcpp_builddir@/mkcheck 1)
-
-# Use 'new-abi-baseline' to create an initial symbol file. Then run
-# 'check-abi' to test for changes against that file.
-baseline_file = @baseline_file@
-check-abi: $(top_builddir)/testsuite/abi_check
- -@(cd testsuite; \
- @glibcpp_srcdir@/config/abi/extract_symvers \
- ../src/.libs/libstdc++.so \
- ./current_symbols.txt && \
- ./abi_check --check ./current_symbols.txt ${baseline_file})
-
-new-abi-baseline:
- -@(output=${baseline_file}; \
- if test -f $${output}; then \
- output=$${output}.new; \
- t=`echo $${output} | sed 's=.*config/abi/=='`; \
- echo "Baseline file already exists, writing to $${t} instead."; \
- fi; \
- @glibcpp_srcdir@/config/abi/extract_symvers \
- src/.libs/libstdc++.so $${output})
-
# These rules are messy, but are hella worth it.
doxygen:
-(srcdir=`cd ${top_srcdir}; ${PWD}`; \
diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in
index 37efa7c29fc..1df7b1a3a5e 100644
--- a/libstdc++-v3/Makefile.in
+++ b/libstdc++-v3/Makefile.in
@@ -121,6 +121,7 @@ USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
+baseline_dir = @baseline_dir@
check_msgfmt = @check_msgfmt@
enable_shared = @enable_shared@
enable_static = @enable_static@
@@ -150,10 +151,6 @@ mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
PWD = $${PWDCMD-pwd}
-# Use 'new-abi-baseline' to create an initial symbol file. Then run
-# 'check-abi' to test for changes against that file.
-baseline_file = @baseline_file@
-
# Multilib support.
MAKEOVERRIDES =
@@ -213,10 +210,9 @@ AM_MAKEFLAGS = \
FLAGS_TO_PASS = $(AM_MAKEFLAGS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = mkcheck testsuite_flags
+CONFIG_CLEAN_FILES =
DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \
-acconfig.h acinclude.m4 aclocal.m4 config.h.in configure configure.in \
-mkcheck.in testsuite_flags.in
+acconfig.h acinclude.m4 aclocal.m4 config.h.in configure configure.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
@@ -267,10 +263,6 @@ distclean-hdr:
-rm -f config.h
maintainer-clean-hdr:
-mkcheck: $(top_builddir)/config.status mkcheck.in
- cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
-testsuite_flags: $(top_builddir)/config.status testsuite_flags.in
- cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
@@ -482,37 +474,6 @@ distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
-# These two special 'check-script' rules use the bash script 'mkcheck'
-# to do testing. This script is not as portable as the dejagnu test
-# harness, and is thus off by default. It does produce interesting
-# output however, including various performance analysis items like
-# compile time, execution time, and binary size.
-check-script: $(top_builddir)/mkcheck
- -(chmod + $(top_builddir)/mkcheck; \
- cd testsuite; \
- @glibcpp_builddir@/mkcheck 0)
-
-check-script-install: $(top_builddir)/mkcheck
- -(chmod + $(top_builddir)/mkcheck; \
- cd testsuite; \
- @glibcpp_builddir@/mkcheck 1)
-check-abi: $(top_builddir)/testsuite/abi_check
- -@(cd testsuite; \
- @glibcpp_srcdir@/config/abi/extract_symvers \
- ../src/.libs/libstdc++.so \
- ./current_symbols.txt && \
- ./abi_check --check ./current_symbols.txt ${baseline_file})
-
-new-abi-baseline:
- -@(output=${baseline_file}; \
- if test -f $${output}; then \
- output=$${output}.new; \
- t=`echo $${output} | sed 's=.*config/abi/=='`; \
- echo "Baseline file already exists, writing to $${t} instead."; \
- fi; \
- @glibcpp_srcdir@/config/abi/extract_symvers \
- src/.libs/libstdc++.so $${output})
-
# These rules are messy, but are hella worth it.
doxygen:
-(srcdir=`cd ${top_srcdir}; ${PWD}`; \
diff --git a/libstdc++-v3/README b/libstdc++-v3/README
index 67c390e981d..b3e860ceaf1 100644
--- a/libstdc++-v3/README
+++ b/libstdc++-v3/README
@@ -54,11 +54,15 @@ It has subdirectories:
Headers that define extensions to the standard library. No
standard header refers to any of them.
+ scripts
+ Scripts that are used during the configure, build, make, or test
+ process.
+
src
Files that are used in constructing the library, but are not
installed.
- testsuites/[thread, 17_* to 27_*]
+ testsuites/[backward, demangle, ext, performance, thread, 17_* to 27_*]
Test programs are here, and may be used to begin to exercise the
library. Support for "make check" and "make check-install" is
complete, and runs through all the subdirectories here when this
@@ -72,17 +76,14 @@ Other subdirectories contain variant versions of certain files
that are meant to be copied or linked by the configure script.
Currently these are:
+ config/abi
config/cpu
- config/os
config/io
config/locale
+ config/os
In addition, three subdirectories are convenience libraries:
- libio
- Contains the subset of the GNU libio library needed for
- C++. Currently not used.
-
libmath
Support routines needed for C++ math. Only needed if the
underlying "C" implementation is non-existent, in particular
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index f7844912aa6..c34d93d5721 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -209,7 +209,7 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
#glibcpp_pch_comp=no
#enable_cheaders=c
#c_compatibility=no
- enable_abi_check=no
+ #enable_abi_check=no
#enable_symvers=no
# Find platform-specific directories containing configuration info. In
@@ -2049,20 +2049,33 @@ dnl the testsuite_hooks.h header.
dnl
dnl GLIBCPP_CONFIGURE_TESTSUITE [no args]
AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
- GLIBCPP_CHECK_SETRLIMIT
- # Look for setenv, so that extended locale tests can be performed.
- GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
+ if test x"$GLIBCPP_IS_CROSS_COMPILING" = xfalse; then
+ # Do checks for memory limit functions.
+ GLIBCPP_CHECK_SETRLIMIT
+
+ # Look for setenv, so that extended locale tests can be performed.
+ GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
+ fi
# Export file names for ABI checking.
- baseline_file="${glibcpp_srcdir}/config/abi/${abi_baseline_pair}/baseline_symbols.txt"
- AC_SUBST(baseline_file)
+ baseline_dir="${glibcpp_srcdir}/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
+ AC_SUBST(baseline_dir)
- dnl XXX move to configure.host?
- case "$target" in
- *-*-cygwin* ) enable_abi_check=no ;;
- * ) enable_abi_check=yes ;;
- esac
+ # Determine if checking the ABI is desirable.
+ if test x$enable_symvers = xno; then
+ enable_abi_check=no
+ else
+ case "$host" in
+ *-*-cygwin*)
+ enable_abi_check=no ;;
+ *)
+ enable_abi_check=yes ;;
+ esac
+ fi
+
+ AM_CONDITIONAL(GLIBCPP_TEST_WCHAR_T, test "$enable_wchar_t" = yes)
+ AM_CONDITIONAL(GLIBCPP_TEST_ABI, test "$enable_abi_check" = yes)
])
diff --git a/libstdc++-v3/aclocal.m4 b/libstdc++-v3/aclocal.m4
index 4e255d0abba..00c2796b314 100644
--- a/libstdc++-v3/aclocal.m4
+++ b/libstdc++-v3/aclocal.m4
@@ -221,7 +221,7 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
#glibcpp_pch_comp=no
#enable_cheaders=c
#c_compatibility=no
- enable_abi_check=no
+ #enable_abi_check=no
#enable_symvers=no
# Find platform-specific directories containing configuration info. In
@@ -2061,20 +2061,33 @@ dnl the testsuite_hooks.h header.
dnl
dnl GLIBCPP_CONFIGURE_TESTSUITE [no args]
AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
- GLIBCPP_CHECK_SETRLIMIT
- # Look for setenv, so that extended locale tests can be performed.
- GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
+ if test x"$GLIBCPP_IS_CROSS_COMPILING" = xfalse; then
+ # Do checks for memory limit functions.
+ GLIBCPP_CHECK_SETRLIMIT
+
+ # Look for setenv, so that extended locale tests can be performed.
+ GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
+ fi
# Export file names for ABI checking.
- baseline_file="${glibcpp_srcdir}/config/abi/${abi_baseline_pair}/baseline_symbols.txt"
- AC_SUBST(baseline_file)
+ baseline_dir="${glibcpp_srcdir}/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
+ AC_SUBST(baseline_dir)
- dnl XXX move to configure.host?
- case "$target" in
- *-*-cygwin* ) enable_abi_check=no ;;
- * ) enable_abi_check=yes ;;
- esac
+ # Determine if checking the ABI is desirable.
+ if test x$enable_symvers = xno; then
+ enable_abi_check=no
+ else
+ case "$host" in
+ *-*-cygwin*)
+ enable_abi_check=no ;;
+ *)
+ enable_abi_check=yes ;;
+ esac
+ fi
+
+ AM_CONDITIONAL(GLIBCPP_TEST_WCHAR_T, test "$enable_wchar_t" = yes)
+ AM_CONDITIONAL(GLIBCPP_TEST_ABI, test "$enable_abi_check" = yes)
])
diff --git a/libstdc++-v3/config/abi/extract_symvers b/libstdc++-v3/config/abi/extract_symvers
deleted file mode 100755
index e7b6645900b..00000000000
--- a/libstdc++-v3/config/abi/extract_symvers
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2002 Free Software Foundation, Inc.
-#
-# This file is part of the GNU ISO C++ Library. This library is free
-# software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This library 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 this library; see the file COPYING. If not, write to the Free
-# Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-# USA.
-#
-# As a special exception, you may use this file as part of a free software
-# library without restriction. Specifically, if other files instantiate
-# templates or use macros or inline functions from this file, or you compile
-# this file and link it with other files to produce an executable, this
-# file does not by itself cause the resulting executable to be covered by
-# the GNU General Public License. This exception does not however
-# invalidate any other reasons why the executable file might be covered by
-# the GNU General Public License.
-
-
-if test ${#} -lt 2 || test $1 = '--help'; then
- echo "Usage: extract_symvers shared_lib output_file" 1>&2
- exit 1
-fi
-
-lib=$1
-output=$2
-
-# GNU binutils, somewhere after version 2.11.2, requires -W/--wide to avoid
-# default line truncation. -W is not supported and truncation did not occur
-# by default before that point.
-readelf="readelf --symbols"
-if readelf --help | grep -- --wide > /dev/null; then
- readelf="$readelf --wide"
-fi
-
-# This avoids weird sorting problems later.
-export LC_ALL=C
-
-tmp=extract.$$
-
-${readelf} ${lib} | sed '/\.dynsym/,/^$/p;d' | egrep -v ' (LOCAL|UND) ' |\
-awk '{ if ($4 == "FUNC" || $4 == "NOTYPE")
- printf "%s:%s\n", $4, $8;
- else if ($4 == "OBJECT")
- printf "%s:%s:%s\n", $4, $3, $8;
- }' | sort | uniq > $tmp 2>&1
-# else printf "Huh? What is %s?\n", $8;
-
-
-# I think we'll be doing some more with this file, but for now, dump.
-mv $tmp $output
-
-exit 0
diff --git a/libstdc++-v3/config/abi/i386-freebsd4/baseline_symbols.txt b/libstdc++-v3/config/abi/i386-freebsd4/baseline_symbols.txt
index c5b8fa0a739..5372a28e3bd 100644
--- a/libstdc++-v3/config/abi/i386-freebsd4/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/i386-freebsd4/baseline_symbols.txt
@@ -184,11 +184,17 @@ FUNC:_ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE6do_getES3_S3_
FUNC:_ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE6do_getES3_S3_RSt8ios_baseRSt12_Ios_IostateRt@@GLIBCPP_3.2
FUNC:_ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE6do_getES3_S3_RSt8ios_baseRSt12_Ios_IostateRx@@GLIBCPP_3.2
FUNC:_ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE6do_getES3_S3_RSt8ios_baseRSt12_Ios_IostateRy@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE12_M_group_intERKSscRSt8ios_basePcS9_Ri@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE12_M_widen_intES3_RSt8ios_basecPci@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIlEES3_S3_RSt8ios_basecT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIlEES3_S3_RSt8ios_basecccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intImEES3_S3_RSt8ios_basecT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intImEES3_S3_RSt8ios_basecccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIxEES3_S3_RSt8ios_basecT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIxEES3_S3_RSt8ios_basecccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIyEES3_S3_RSt8ios_basecT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIyEES3_S3_RSt8ios_basecccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_group_floatERKSscPKcPcS9_Ri@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_widen_floatES3_RSt8ios_basecPci@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE16_M_convert_floatIdEES3_S3_RSt8ios_baseccT_@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE16_M_convert_floatIeEES3_S3_RSt8ios_baseccT_@@GLIBCPP_3.2
@@ -200,6 +206,7 @@ FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE3putES3_RSt8io
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE3putES3_RSt8ios_basecm@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE3putES3_RSt8ios_basecx@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE3putES3_RSt8ios_basecy@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6_M_padEciRSt8ios_basePcPKcRi@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecPKv@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecb@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecd@@GLIBCPP_3.2
@@ -547,6 +554,7 @@ FUNC:_ZNSt11range_errorD0Ev@@GLIBCPP_3.2
FUNC:_ZNSt11range_errorD1Ev@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE12_M_open_modeESt13_Ios_OpenmodeRiS2_Pc@@GLIBCPP_3.2
+FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4syncEv@@GLIBCPP_3.2
@@ -1077,6 +1085,7 @@ FUNC:_ZStlsIdcSt11char_traitsIcEERSt13basic_ostreamIT0_T1_ES6_RKSt7complexIT_E@@
FUNC:_ZStlsIecSt11char_traitsIcEERSt13basic_ostreamIT0_T1_ES6_RKSt7complexIT_E@@GLIBCPP_3.2
FUNC:_ZStlsIfcSt11char_traitsIcEERSt13basic_ostreamIT0_T1_ES6_RKSt7complexIT_E@@GLIBCPP_3.2
FUNC:_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_@@GLIBCPP_3.2
+FUNC:_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_S8_@@GLIBCPP_3.2.1
FUNC:_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ES3_RKS6_@@GLIBCPP_3.2
FUNC:_ZStrsISt11char_traitsIcEERSt13basic_istreamIcT_ES5_Pa@@GLIBCPP_3.2
FUNC:_ZStrsISt11char_traitsIcEERSt13basic_istreamIcT_ES5_Ph@@GLIBCPP_3.2
@@ -1163,6 +1172,9 @@ FUNC:__cxa_end_catch@@CXXABI_1.2
FUNC:__cxa_free_exception@@CXXABI_1.2
FUNC:__cxa_get_globals@@CXXABI_1.2
FUNC:__cxa_get_globals_fast@@CXXABI_1.2
+FUNC:__cxa_guard_abort@@CXXABI_1.2.1
+FUNC:__cxa_guard_acquire@@CXXABI_1.2.1
+FUNC:__cxa_guard_release@@CXXABI_1.2.1
FUNC:__cxa_pure_virtual@@CXXABI_1.2
FUNC:__cxa_rethrow@@CXXABI_1.2
FUNC:__cxa_throw@@CXXABI_1.2
@@ -1178,8 +1190,28 @@ FUNC:__cxa_vec_new3@@CXXABI_1.2
FUNC:__cxa_vec_new@@CXXABI_1.2
FUNC:__dynamic_cast@@CXXABI_1.2
FUNC:__gxx_personality_v0@@CXXABI_1.2
+FUNC:__signbit@@GLIBCPP_3.2.1
+FUNC:__signbitf@@GLIBCPP_3.2.1
+FUNC:atan2l@@GLIBCPP_3.2.1
+FUNC:coshl@@GLIBCPP_3.2.1
+FUNC:cosl@@GLIBCPP_3.2.1
+FUNC:expl@@GLIBCPP_3.2.1
+FUNC:hypotl@@GLIBCPP_3.2.1
+FUNC:log10l@@GLIBCPP_3.2.1
+FUNC:logl@@GLIBCPP_3.2.1
+FUNC:nan@@GLIBCPP_3.2.1
+FUNC:powl@@GLIBCPP_3.2.1
+FUNC:sinhl@@GLIBCPP_3.2.1
+FUNC:sinl@@GLIBCPP_3.2.1
+FUNC:sqrtl@@GLIBCPP_3.2.1
+FUNC:tanhl@@GLIBCPP_3.2.1
+FUNC:tanl@@GLIBCPP_3.2.1
OBJECT:0:CXXABI_1.2
+OBJECT:0:CXXABI_1.2.1
OBJECT:0:GLIBCPP_3.2
+OBJECT:0:GLIBCPP_3.2.1
+OBJECT:0:GLIBCPP_3.2.2
+OBJECT:0:GLIBCPP_3.2.3
OBJECT:12:_ZNSt6locale5_Impl11_S_id_ctypeE@@GLIBCPP_3.2
OBJECT:12:_ZSt9collate_c@@GLIBCPP_3.2
OBJECT:12:_ZTIN10__cxxabiv116__enum_type_infoE@@GLIBCPP_3.2
@@ -1685,6 +1717,8 @@ OBJECT:49:_ZTSN9__gnu_cxx13stdio_filebufIcSt11char_traitsIcEEE@@GLIBCPP_3.2
OBJECT:49:_ZTSSt18basic_stringstreamIcSt11char_traitsIcESaIcEE@@GLIBCPP_3.2
OBJECT:4:_ZNSs4_Rep11_S_max_sizeE@@GLIBCPP_3.2
OBJECT:4:_ZNSs4nposE@@GLIBCPP_3.2
+OBJECT:4:_ZNSt10__num_base11_S_atoms_inE@@GLIBCPP_3.2.3
+OBJECT:4:_ZNSt10__num_base12_S_atoms_outE@@GLIBCPP_3.2.3
OBJECT:4:_ZNSt10ctype_base5alnumE@@GLIBCPP_3.2
OBJECT:4:_ZNSt10ctype_base5alphaE@@GLIBCPP_3.2
OBJECT:4:_ZNSt10ctype_base5cntrlE@@GLIBCPP_3.2
@@ -1846,6 +1880,7 @@ OBJECT:4:_ZNSt21__numeric_limits_base5radixE@@GLIBCPP_3.2
OBJECT:4:_ZNSt21__numeric_limits_base6digitsE@@GLIBCPP_3.2
OBJECT:4:_ZNSt21__numeric_limits_base8digits10E@@GLIBCPP_3.2
OBJECT:4:_ZNSt24__default_alloc_templateILb1ELi0EE11_S_end_freeE@@GLIBCPP_3.2
+OBJECT:4:_ZNSt24__default_alloc_templateILb1ELi0EE12_S_force_newE@@GLIBCPP_3.2.2
OBJECT:4:_ZNSt24__default_alloc_templateILb1ELi0EE12_S_heap_sizeE@@GLIBCPP_3.2
OBJECT:4:_ZNSt24__default_alloc_templateILb1ELi0EE13_S_start_freeE@@GLIBCPP_3.2
OBJECT:4:_ZNSt24__default_alloc_templateILb1ELi0EE22_S_node_allocator_lockE@@GLIBCPP_3.2
diff --git a/libstdc++-v3/config/abi/i486-linux-gnu/baseline_symbols.txt b/libstdc++-v3/config/abi/i486-linux-gnu/baseline_symbols.txt
index be8fc9b94d1..018ef0ea4a2 100644
--- a/libstdc++-v3/config/abi/i486-linux-gnu/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/i486-linux-gnu/baseline_symbols.txt
@@ -27,6 +27,9 @@ FUNC:__cxa_end_catch@@CXXABI_1.2
FUNC:__cxa_free_exception@@CXXABI_1.2
FUNC:__cxa_get_globals@@CXXABI_1.2
FUNC:__cxa_get_globals_fast@@CXXABI_1.2
+FUNC:__cxa_guard_abort@@CXXABI_1.2.1
+FUNC:__cxa_guard_acquire@@CXXABI_1.2.1
+FUNC:__cxa_guard_release@@CXXABI_1.2.1
FUNC:__cxa_pure_virtual@@CXXABI_1.2
FUNC:__cxa_rethrow@@CXXABI_1.2
FUNC:__cxa_throw@@CXXABI_1.2
@@ -405,11 +408,17 @@ FUNC:_ZNKSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE6do_getES3_S3_
FUNC:_ZNKSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE6do_getES3_S3_RSt8ios_baseRSt12_Ios_IostateRt@@GLIBCPP_3.2
FUNC:_ZNKSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE6do_getES3_S3_RSt8ios_baseRSt12_Ios_IostateRx@@GLIBCPP_3.2
FUNC:_ZNKSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE6do_getES3_S3_RSt8ios_baseRSt12_Ios_IostateRy@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE12_M_group_intERKSscRSt8ios_basePcS9_Ri@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE12_M_widen_intES3_RSt8ios_basecPci@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIlEES3_S3_RSt8ios_basecccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIlEES3_S3_RSt8ios_basecT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intImEES3_S3_RSt8ios_basecccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intImEES3_S3_RSt8ios_basecT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIxEES3_S3_RSt8ios_basecccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIxEES3_S3_RSt8ios_basecT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIyEES3_S3_RSt8ios_basecccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_convert_intIyEES3_S3_RSt8ios_basecT_@@GLIBCPP_3.2.3
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_group_floatERKSscPKcPcS9_Ri@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE14_M_widen_floatES3_RSt8ios_basecPci@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE16_M_convert_floatIdEES3_S3_RSt8ios_baseccT_@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE16_M_convert_floatIeEES3_S3_RSt8ios_baseccT_@@GLIBCPP_3.2
@@ -429,12 +438,19 @@ FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecPKv@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecx@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecy@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6_M_padEciRSt8ios_basePcPKcRi@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE9_M_insertES3_RSt8ios_basecPKci@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE12_M_group_intERKSswRSt8ios_basePwS9_Ri@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE12_M_widen_intES3_RSt8ios_basewPci@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intIlEES3_S3_RSt8ios_basewccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intIlEES3_S3_RSt8ios_basewT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intImEES3_S3_RSt8ios_basewccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intImEES3_S3_RSt8ios_basewT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intIxEES3_S3_RSt8ios_basewccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intIxEES3_S3_RSt8ios_basewT_@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intIyEES3_S3_RSt8ios_basewccT_@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_convert_intIyEES3_S3_RSt8ios_basewT_@@GLIBCPP_3.2.3
+FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_group_floatERKSswPKwPwS9_Ri@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE14_M_widen_floatES3_RSt8ios_basewPci@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE16_M_convert_floatIdEES3_S3_RSt8ios_basewcT_@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE16_M_convert_floatIeEES3_S3_RSt8ios_basewcT_@@GLIBCPP_3.2
@@ -454,6 +470,7 @@ FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewPKv@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewx@@GLIBCPP_3.2
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6do_putES3_RSt8ios_basewy@@GLIBCPP_3.2
+FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE6_M_padEwiRSt8ios_basePwPKwRi@@GLIBCPP_3.2.3
FUNC:_ZNKSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE9_M_insertES3_RSt8ios_basewPKwi@@GLIBCPP_3.2
FUNC:_ZNKSt8ios_base7failure4whatEv@@GLIBCPP_3.2
FUNC:_ZNKSt8messagesIcE18_M_convert_to_charERKSs@@GLIBCPP_3.2
@@ -983,6 +1000,7 @@ FUNC:_ZNSt11__timepunctIwED1Ev@@GLIBCPP_3.2
FUNC:_ZNSt11__timepunctIwED2Ev@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE10sys_ungetcEi@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE12_M_open_modeESt13_Ios_OpenmodeRiS2_Pc@@GLIBCPP_3.2
+FUNC:_ZNSt12__basic_fileIcE16showmanyc_helperEv@@GLIBCPP_3.2.3
FUNC:_ZNSt12__basic_fileIcE2fdEv@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei@@GLIBCPP_3.2
FUNC:_ZNSt12__basic_fileIcE4syncEv@@GLIBCPP_3.2
@@ -1909,8 +1927,10 @@ FUNC:_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_St8_Setbase@@GLIBCPP
FUNC:_ZStlsIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_St8_SetfillIS3_E@@GLIBCPP_3.2
FUNC:_ZStlsIwSt11char_traitsIwESaIwEERSt13basic_ostreamIT_T0_ES7_RKSbIS4_S5_T1_E@@GLIBCPP_3.2
FUNC:_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_@@GLIBCPP_3.2
+FUNC:_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_S8_@@GLIBCPP_3.2.1
FUNC:_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ES3_RKS6_@@GLIBCPP_3.2
FUNC:_ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_EPKS3_RKS6_@@GLIBCPP_3.2
+FUNC:_ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_ERKS6_S8_@@GLIBCPP_3.2.1
FUNC:_ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_ES3_RKS6_@@GLIBCPP_3.2
FUNC:_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_@@GLIBCPP_3.2
FUNC:_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_@@GLIBCPP_3.2
@@ -1997,7 +2017,11 @@ FUNC:_ZTv0_n12_NSt19basic_ostringstreamIwSt11char_traitsIwESaIwEED1Ev@@GLIBCPP_3
FUNC:_ZTv0_n12_NSt9strstreamD0Ev@@GLIBCPP_3.2
FUNC:_ZTv0_n12_NSt9strstreamD1Ev@@GLIBCPP_3.2
OBJECT:0:CXXABI_1.2
+OBJECT:0:CXXABI_1.2.1
OBJECT:0:GLIBCPP_3.2
+OBJECT:0:GLIBCPP_3.2.1
+OBJECT:0:GLIBCPP_3.2.2
+OBJECT:0:GLIBCPP_3.2.3
OBJECT:112:_ZSt9facet_vec@@GLIBCPP_3.2
OBJECT:12:_ZNSt6locale5_Impl13_S_id_collateE@@GLIBCPP_3.2
OBJECT:12:_ZNSt6locale5_Impl14_S_id_messagesE@@GLIBCPP_3.2
@@ -2656,6 +2680,8 @@ OBJECT:4:_ZNSt10moneypunctIcLb0EE2idE@@GLIBCPP_3.2
OBJECT:4:_ZNSt10moneypunctIcLb1EE2idE@@GLIBCPP_3.2
OBJECT:4:_ZNSt10moneypunctIwLb0EE2idE@@GLIBCPP_3.2
OBJECT:4:_ZNSt10moneypunctIwLb1EE2idE@@GLIBCPP_3.2
+OBJECT:4:_ZNSt10__num_base11_S_atoms_inE@@GLIBCPP_3.2.3
+OBJECT:4:_ZNSt10__num_base12_S_atoms_outE@@GLIBCPP_3.2.3
OBJECT:4:_ZNSt11__timepunctIcE2idE@@GLIBCPP_3.2
OBJECT:4:_ZNSt11__timepunctIwE2idE@@GLIBCPP_3.2
OBJECT:4:_ZNSt14numeric_limitsIaE10has_denormE@@GLIBCPP_3.2
@@ -2814,6 +2840,7 @@ OBJECT:4:_ZNSt21__numeric_limits_base5radixE@@GLIBCPP_3.2
OBJECT:4:_ZNSt21__numeric_limits_base6digitsE@@GLIBCPP_3.2
OBJECT:4:_ZNSt21__numeric_limits_base8digits10E@@GLIBCPP_3.2
OBJECT:4:_ZNSt24__default_alloc_templateILb1ELi0EE11_S_end_freeE@@GLIBCPP_3.2
+OBJECT:4:_ZNSt24__default_alloc_templateILb1ELi0EE12_S_force_newE@@GLIBCPP_3.2.2
OBJECT:4:_ZNSt24__default_alloc_templateILb1ELi0EE12_S_heap_sizeE@@GLIBCPP_3.2
OBJECT:4:_ZNSt24__default_alloc_templateILb1ELi0EE13_S_start_freeE@@GLIBCPP_3.2
OBJECT:4:_ZNSt5ctypeIcE10table_sizeE@@GLIBCPP_3.2
diff --git a/libstdc++-v3/config/linker-map.gnu b/libstdc++-v3/config/linker-map.gnu
index 2245cd24f45..7cacdd90dbd 100644
--- a/libstdc++-v3/config/linker-map.gnu
+++ b/libstdc++-v3/config/linker-map.gnu
@@ -55,7 +55,8 @@ GLIBCPP_3.4 {
std::__num_base::_S_format_float*;
std::__num_base::_S_format_int*;
std::__num_base::_S_atoms_in;
- std::__num_base::_S_atoms_out
+ std::__num_base::_S_atoms_out;
+ std::__numpunct_cache*
};
# Names not in an 'extern' block are mangled names.
@@ -115,7 +116,9 @@ GLIBCPP_3.4 {
# virtual function thunks
_ZThn8_NS*;
+ _ZThn16_NS*;
_ZTv0_n12_NS*;
+ _ZTv0_n24_NS*;
# std::__convert_to_v
_ZSt14__convert_to_v*;
diff --git a/libstdc++-v3/config/locale/generic/numeric_members.cc b/libstdc++-v3/config/locale/generic/numeric_members.cc
index f942e0415b0..320f0ff4ba1 100644
--- a/libstdc++-v3/config/locale/generic/numeric_members.cc
+++ b/libstdc++-v3/config/locale/generic/numeric_members.cc
@@ -1,6 +1,6 @@
// std::numpunct implementation details, generic version -*- C++ -*-
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -42,16 +42,30 @@ namespace std
numpunct<char>::_M_initialize_numpunct(__c_locale)
{
// "C" locale
- _M_decimal_point = '.';
- _M_thousands_sep = ',';
- _M_grouping = "";
- _M_truename = "true";
- _M_falsename = "false";
+ if (!_M_data)
+ _M_data = new __numpunct_cache<char>;
+
+ _M_data->_M_grouping = "";
+ _M_data->_M_use_grouping = false;
+
+ _M_data->_M_decimal_point = '.';
+ _M_data->_M_thousands_sep = ',';
+
+ for (size_t i = 0; i < __num_base::_S_oend; ++i)
+ _M_data->_M_atoms_out[i] = __num_base::_S_atoms_out[i];
+ _M_data->_M_atoms_out[__num_base::_S_oend] = wchar_t();
+
+ for (size_t i = 0; i < __num_base::_S_iend; ++i)
+ _M_data->_M_atoms_in[i] = __num_base::_S_atoms_in[i];
+ _M_data->_M_atoms_in[__num_base::_S_iend] = wchar_t();
+
+ _M_data->_M_truename = "true";
+ _M_data->_M_falsename = "false";
}
template<>
numpunct<char>::~numpunct()
- { }
+ { delete _M_data; }
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
@@ -59,15 +73,37 @@ namespace std
numpunct<wchar_t>::_M_initialize_numpunct(__c_locale)
{
// "C" locale
- _M_decimal_point = L'.';
- _M_thousands_sep = L',';
- _M_grouping = "";
- _M_truename = L"true";
- _M_falsename = L"false";
+ if (!_M_data)
+ _M_data = new __numpunct_cache<wchar_t>;
+
+ _M_data->_M_grouping = "";
+ _M_data->_M_use_grouping = false;
+
+ _M_data->_M_decimal_point = L'.';
+ _M_data->_M_thousands_sep = L',';
+
+ // Use ctype::widen code without the facet...
+ unsigned char uc;
+ for (size_t i = 0; i < __num_base::_S_oend; ++i)
+ {
+ uc = static_cast<unsigned char>(__num_base::_S_atoms_out[i]);
+ _M_data->_M_atoms_out[i] = btowc(uc);
+ }
+ _M_data->_M_atoms_out[__num_base::_S_oend] = wchar_t();
+
+ for (size_t i = 0; i < __num_base::_S_iend; ++i)
+ {
+ uc = static_cast<unsigned char>(__num_base::_S_atoms_in[i]);
+ _M_data->_M_atoms_in[i] = btowc(uc);
+ }
+ _M_data->_M_atoms_in[__num_base::_S_iend] = wchar_t();
+
+ _M_data->_M_truename = L"true";
+ _M_data->_M_falsename = L"false";
}
template<>
numpunct<wchar_t>::~numpunct()
- { }
+ { delete _M_data; }
#endif
}
diff --git a/libstdc++-v3/config/locale/gnu/numeric_members.cc b/libstdc++-v3/config/locale/gnu/numeric_members.cc
index 5b666ebe608..dd8c76b38f3 100644
--- a/libstdc++-v3/config/locale/gnu/numeric_members.cc
+++ b/libstdc++-v3/config/locale/gnu/numeric_members.cc
@@ -1,6 +1,6 @@
// std::numpunct implementation details, GNU version -*- C++ -*-
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -42,70 +42,112 @@ namespace std
void
numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
{
+ if (!_M_data)
+ _M_data = new __numpunct_cache<char>;
+
if (!__cloc)
{
// "C" locale
- _M_decimal_point = '.';
- _M_thousands_sep = ',';
- _M_grouping = "";
+ _M_data->_M_grouping = "";
+ _M_data->_M_use_grouping = false;
+
+ _M_data->_M_decimal_point = '.';
+ _M_data->_M_thousands_sep = ',';
+
+ for (size_t i = 0; i < __num_base::_S_oend; ++i)
+ _M_data->_M_atoms_out[i] = __num_base::_S_atoms_out[i];
+ _M_data->_M_atoms_out[__num_base::_S_oend] = wchar_t();
+
+ for (size_t i = 0; i < __num_base::_S_iend; ++i)
+ _M_data->_M_atoms_in[i] = __num_base::_S_atoms_in[i];
+ _M_data->_M_atoms_in[__num_base::_S_iend] = wchar_t();
}
else
{
// Named locale.
- _M_decimal_point = *(__nl_langinfo_l(RADIXCHAR, __cloc));
- _M_thousands_sep = *(__nl_langinfo_l(THOUSEP, __cloc));
- // Check for NUL, which implies no grouping.
- if (_M_thousands_sep == '\0')
- _M_grouping = "";
+ _M_data->_M_decimal_point = *(__nl_langinfo_l(RADIXCHAR, __cloc));
+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSEP, __cloc));
+
+ // Check for NULL, which implies no grouping.
+ if (_M_data->_M_thousands_sep == '\0')
+ _M_data->_M_grouping = "";
else
- _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
}
// NB: There is no way to extact this info from posix locales.
// _M_truename = __nl_langinfo_l(YESSTR, __cloc);
- _M_truename = "true";
+ _M_data->_M_truename = "true";
// _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
- _M_falsename = "false";
+ _M_data->_M_falsename = "false";
}
template<>
numpunct<char>::~numpunct()
- { }
+ { delete _M_data; }
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
void
numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
{
+ if (!_M_data)
+ _M_data = new __numpunct_cache<wchar_t>;
+
if (!__cloc)
{
// "C" locale
- _M_decimal_point = L'.';
- _M_thousands_sep = L',';
- _M_grouping = "";
+ _M_data->_M_grouping = "";
+ _M_data->_M_use_grouping = false;
+
+ _M_data->_M_decimal_point = L'.';
+ _M_data->_M_thousands_sep = L',';
+
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+ __c_locale __old = __uselocale(_S_c_locale);
+#endif
+ // Use ctype::widen code without the facet...
+ unsigned char uc;
+ for (size_t i = 0; i < __num_base::_S_oend; ++i)
+ {
+ uc = static_cast<unsigned char>(__num_base::_S_atoms_out[i]);
+ _M_data->_M_atoms_out[i] = btowc(uc);
+ }
+ _M_data->_M_atoms_out[__num_base::_S_oend] = wchar_t();
+
+ for (size_t i = 0; i < __num_base::_S_iend; ++i)
+ {
+ uc = static_cast<unsigned char>(__num_base::_S_atoms_in[i]);
+ _M_data->_M_atoms_in[i] = btowc(uc);
+ }
+ _M_data->_M_atoms_in[__num_base::_S_iend] = wchar_t();
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+ __uselocale(__old);
+#endif
}
else
{
// Named locale.
union __s_and_w { const char *__s; unsigned int __w; } __u;
__u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
- _M_decimal_point = static_cast<wchar_t>(__u.__w);
+ _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
__u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
- _M_thousands_sep = static_cast<wchar_t>(__u.__w);
- if (_M_thousands_sep == L'\0')
- _M_grouping = "";
+ _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
+
+ if (_M_data->_M_thousands_sep == L'\0')
+ _M_data->_M_grouping = "";
else
- _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
}
// NB: There is no way to extact this info from posix locales.
// _M_truename = __nl_langinfo_l(YESSTR, __cloc);
- _M_truename = L"true";
+ _M_data->_M_truename = L"true";
// _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
- _M_falsename = L"false";
+ _M_data->_M_falsename = L"false";
}
template<>
numpunct<wchar_t>::~numpunct()
- { }
+ { delete _M_data; }
#endif
}
diff --git a/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h b/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h
index 80138cb3ec8..578e0a42e31 100644
--- a/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h
+++ b/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h
@@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
-// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -32,20 +32,24 @@
//
// Information as gleaned from /usr/include/ctype.h
-
+
+ extern "C" const u_int8_t _C_ctype_[];
+
const ctype_base::mask*
ctype<char>::classic_table() throw()
- { return 0; }
+ { return _C_ctype_ + 1; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
- _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _ctype_ + 1)
+ _M_toupper(NULL), _M_tolower(NULL),
+ _M_table(__table ? __table : classic_table())
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
- _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _ctype_ + 1)
+ _M_toupper(NULL), _M_tolower(NULL),
+ _M_table(__table ? __table : classic_table())
{ }
char
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 3c97728eb76..31151919530 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -1504,7 +1504,7 @@ ac_exeext=$EXEEXT
#glibcpp_pch_comp=no
#enable_cheaders=c
#c_compatibility=no
- enable_abi_check=no
+ #enable_abi_check=no
#enable_symvers=no
# Find platform-specific directories containing configuration info. In
@@ -23161,26 +23161,160 @@ EOF
fi
+fi
- # Establish limits on memory usage during 'make check'
-
-
+# This depends on GLIBCPP_CHECK_LINKER_FEATURES, but without it assumes no.
+# Check whether --enable-symvers or --disable-symvers was given.
+if test "${enable_symvers+set}" = set; then
+ enableval="$enable_symvers"
+ case "$enableval" in
+ yes) enable_symvers=yes ;;
+ no) enable_symvers=no ;;
+ # other names here, just as sanity checks
+ #gnu|sun|etcetera) enable_symvers=$enableval ;;
+ gnu) enable_symvers=$enableval ;;
+ *) { echo "configure: error: Unknown argument to enable/disable symvers" 1>&2; exit 1; } ;;
+ esac
+else
+ enable_symvers=yes
+fi
+
+# If we never went through the GLIBCPP_CHECK_LINKER_FEATURES macro, then we
+# don't know enough about $LD to do tricks...
+if test x$enable_shared = xno ||
+ test "x$LD" = x ||
+ test x$glibcpp_gnu_ld_version = x; then
+ enable_symvers=no
+fi
+
+# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
+if test $enable_symvers != no; then
+ echo $ac_n "checking for shared libgcc""... $ac_c" 1>&6
+echo "configure:23194: checking for shared libgcc" >&5
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=' -lgcc_s'
+ cat > conftest.$ac_ext <<EOF
+#line 23198 "configure"
+#include "confdefs.h"
+
+int main() {
+return 0
+; return 0; }
+EOF
+if { (eval echo configure:23205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ glibcpp_shared_libgcc=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ glibcpp_shared_libgcc=no
+fi
+rm -f conftest*
+ CFLAGS="$ac_save_CFLAGS"
+ echo "$ac_t""$glibcpp_shared_libgcc" 1>&6
+fi
+
+# For GNU ld, we need at least this version. It's 2.12 in the same format
+# as the tested-for version. See GLIBCPP_CHECK_LINKER_FEATURES for more.
+glibcpp_min_gnu_ld_version=21200
+
+# Check to see if unspecified "yes" value can win, given results
+# above.
+if test $enable_symvers = yes ; then
+ if test $with_gnu_ld = yes &&
+ test $glibcpp_shared_libgcc = yes ;
+ then
+ if test $glibcpp_gnu_ld_version -ge $glibcpp_min_gnu_ld_version ; then
+ enable_symvers=gnu
+ else
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS='-shared -Wl,--version-script,conftest.map'
+ enable_symvers=no
+
+ echo 'FOO { global: f[a-z]o; local: *; };' > conftest.map
+
+ cat > conftest.$ac_ext <<EOF
+#line 23240 "configure"
+#include "confdefs.h"
+int foo;
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:23247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ enable_symvers=gnu
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+ if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+ else
+ # this is the suspicious part
+ CFLAGS=''
+ fi
+ rm -f conftest.map
+ fi
+ else
+ # just fail for now
+ enable_symvers=no
+ fi
+fi
+
+case $enable_symvers in
+ no)
+ SYMVER_MAP=config/linker-map.dummy
+ ;;
+ gnu)
+ SYMVER_MAP=config/linker-map.gnu
+ cat >> confdefs.h <<\EOF
+#define _GLIBCPP_SYMVER 1
+EOF
+
+ ;;
+esac
+
+
+
+
+if test $enable_symvers != no; then
+ GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE=
+ GLIBCPP_BUILD_VERSIONED_SHLIB_FALSE='#'
+else
+ GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE='#'
+ GLIBCPP_BUILD_VERSIONED_SHLIB_FALSE=
+fi
+echo $ac_n "checking versioning on shared library symbols""... $ac_c" 1>&6
+echo "configure:23293: checking versioning on shared library symbols" >&5
+echo "$ac_t""$enable_symvers" 1>&6
+
+
+# This depends on GLIBCPP_ENABLE_SYMVERS and GLIBCPP_IS_CROSS_COMPILING.
+
+
+ if test x"$GLIBCPP_IS_CROSS_COMPILING" = xfalse; then
+ # Do checks for memory limit functions.
+
setrlimit_have_headers=yes
for ac_hdr in unistd.h sys/time.h sys/resource.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:23174: checking for $ac_hdr" >&5
+echo "configure:23308: 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 23179 "configure"
+#line 23313 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:23184: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:23318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -23213,7 +23347,7 @@ done
# Can't do these in a loop, else the resulting syntax is wrong.
cat > conftest.$ac_ext <<EOF
-#line 23217 "configure"
+#line 23351 "configure"
#include "confdefs.h"
#include <unistd.h>
#include <sys/time.h>
@@ -23223,7 +23357,7 @@ int main() {
int f = RLIMIT_DATA ;
; return 0; }
EOF
-if { (eval echo configure:23227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_mresult=1
else
@@ -23240,7 +23374,7 @@ EOF
cat > conftest.$ac_ext <<EOF
-#line 23244 "configure"
+#line 23378 "configure"
#include "confdefs.h"
#include <unistd.h>
#include <sys/time.h>
@@ -23250,7 +23384,7 @@ int main() {
int f = RLIMIT_RSS ;
; return 0; }
EOF
-if { (eval echo configure:23254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_mresult=1
else
@@ -23267,7 +23401,7 @@ EOF
cat > conftest.$ac_ext <<EOF
-#line 23271 "configure"
+#line 23405 "configure"
#include "confdefs.h"
#include <unistd.h>
#include <sys/time.h>
@@ -23277,7 +23411,7 @@ int main() {
int f = RLIMIT_VMEM ;
; return 0; }
EOF
-if { (eval echo configure:23281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_mresult=1
else
@@ -23294,7 +23428,7 @@ EOF
cat > conftest.$ac_ext <<EOF
-#line 23298 "configure"
+#line 23432 "configure"
#include "confdefs.h"
#include <unistd.h>
#include <sys/time.h>
@@ -23304,7 +23438,7 @@ int main() {
int f = RLIMIT_AS ;
; return 0; }
EOF
-if { (eval echo configure:23308: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_mresult=1
else
@@ -23326,7 +23460,7 @@ EOF
else
cat > conftest.$ac_ext <<EOF
-#line 23330 "configure"
+#line 23464 "configure"
#include "confdefs.h"
#include <unistd.h>
#include <sys/time.h>
@@ -23336,7 +23470,7 @@ int main() {
struct rlimit r; setrlimit(0, &r);
; return 0; }
EOF
-if { (eval echo configure:23340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23474: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_setrlimit=yes
else
@@ -23352,7 +23486,7 @@ fi
fi
echo $ac_n "checking for testsuite memory limit support""... $ac_c" 1>&6
-echo "configure:23356: checking for testsuite memory limit support" >&5
+echo "configure:23490: checking for testsuite memory limit support" >&5
if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
ac_mem_limits=yes
cat >> confdefs.h <<\EOF
@@ -23365,10 +23499,10 @@ EOF
echo "$ac_t""$ac_mem_limits" 1>&6
- # Look for setenv, so that extended locale tests can be performed.
-
+ # Look for setenv, so that extended locale tests can be performed.
+
echo $ac_n "checking for setenv declaration""... $ac_c" 1>&6
-echo "configure:23372: checking for setenv declaration" >&5
+echo "configure:23506: checking for setenv declaration" >&5
if test x${glibcpp_cv_func_setenv_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_setenv_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -23383,14 +23517,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes
cross_compiling=$ac_cv_prog_cxx_cross
cat > conftest.$ac_ext <<EOF
-#line 23387 "configure"
+#line 23521 "configure"
#include "confdefs.h"
#include <stdlib.h>
int main() {
setenv(0, 0, 0);
; return 0; }
EOF
-if { (eval echo configure:23394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23528: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_setenv_use=yes
else
@@ -23416,12 +23550,12 @@ fi
for ac_func in setenv
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:23420: checking for $ac_func" >&5
+echo "configure:23554: 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 23425 "configure"
+#line 23559 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -23444,7 +23578,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:23448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:23582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -23470,146 +23604,42 @@ done
fi
+ fi
# Export file names for ABI checking.
- baseline_file="${glibcpp_srcdir}/config/abi/${abi_baseline_pair}/baseline_symbols.txt"
+ baseline_dir="${glibcpp_srcdir}/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
- case "$target" in
- *-*-cygwin* ) enable_abi_check=no ;;
- * ) enable_abi_check=yes ;;
- esac
-
-fi
-
-# This depends on the possibly-skipped linker test above.
-# Check whether --enable-symvers or --disable-symvers was given.
-if test "${enable_symvers+set}" = set; then
- enableval="$enable_symvers"
- case "$enableval" in
- yes) enable_symvers=yes ;;
- no) enable_symvers=no ;;
- # other names here, just as sanity checks
- #gnu|sun|etcetera) enable_symvers=$enableval ;;
- gnu) enable_symvers=$enableval ;;
- *) { echo "configure: error: Unknown argument to enable/disable symvers" 1>&2; exit 1; } ;;
- esac
-else
- enable_symvers=yes
-fi
-
-# If we never went through the GLIBCPP_CHECK_LINKER_FEATURES macro, then we
-# don't know enough about $LD to do tricks...
-if test x$enable_shared = xno ||
- test "x$LD" = x ||
- test x$glibcpp_gnu_ld_version = x; then
- enable_symvers=no
-fi
-
-# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
-if test $enable_symvers != no; then
- echo $ac_n "checking for shared libgcc""... $ac_c" 1>&6
-echo "configure:23513: checking for shared libgcc" >&5
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=' -lgcc_s'
- cat > conftest.$ac_ext <<EOF
-#line 23517 "configure"
-#include "confdefs.h"
-
-int main() {
-return 0
-; return 0; }
-EOF
-if { (eval echo configure:23524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- glibcpp_shared_libgcc=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcpp_shared_libgcc=no
-fi
-rm -f conftest*
- CFLAGS="$ac_save_CFLAGS"
- echo "$ac_t""$glibcpp_shared_libgcc" 1>&6
-fi
-
-# For GNU ld, we need at least this version. It's 2.12 in the same format
-# as the tested-for version. See GLIBCPP_CHECK_LINKER_FEATURES for more.
-glibcpp_min_gnu_ld_version=21200
-
-# Check to see if unspecified "yes" value can win, given results
-# above.
-if test $enable_symvers = yes ; then
- if test $with_gnu_ld = yes &&
- test $glibcpp_shared_libgcc = yes ;
- then
- if test $glibcpp_gnu_ld_version -ge $glibcpp_min_gnu_ld_version ; then
- enable_symvers=gnu
- else
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS='-shared -Wl,--version-script,conftest.map'
- enable_symvers=no
-
- echo 'FOO { global: f[a-z]o; local: *; };' > conftest.map
-
- cat > conftest.$ac_ext <<EOF
-#line 23559 "configure"
-#include "confdefs.h"
-int foo;
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:23566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- enable_symvers=gnu
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- else
- # this is the suspicious part
- CFLAGS=''
- fi
- rm -f conftest.map
- fi
+ # Determine if checking the ABI is desirable.
+ if test x$enable_symvers = xno; then
+ enable_abi_check=no
else
- # just fail for now
- enable_symvers=no
+ case "$host" in
+ *-*-cygwin*)
+ enable_abi_check=no ;;
+ *)
+ enable_abi_check=yes ;;
+ esac
fi
-fi
-
-case $enable_symvers in
- no)
- SYMVER_MAP=config/linker-map.dummy
- ;;
- gnu)
- SYMVER_MAP=config/linker-map.gnu
- cat >> confdefs.h <<\EOF
-#define _GLIBCPP_SYMVER 1
-EOF
-
- ;;
-esac
-
+
+if test "$enable_wchar_t" = yes; then
+ GLIBCPP_TEST_WCHAR_T_TRUE=
+ GLIBCPP_TEST_WCHAR_T_FALSE='#'
+else
+ GLIBCPP_TEST_WCHAR_T_TRUE='#'
+ GLIBCPP_TEST_WCHAR_T_FALSE=
+fi
+
-if test $enable_symvers != no; then
- GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE=
- GLIBCPP_BUILD_VERSIONED_SHLIB_FALSE='#'
+if test "$enable_abi_check" = yes; then
+ GLIBCPP_TEST_ABI_TRUE=
+ GLIBCPP_TEST_ABI_FALSE='#'
else
- GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE='#'
- GLIBCPP_BUILD_VERSIONED_SHLIB_FALSE=
+ GLIBCPP_TEST_ABI_TRUE='#'
+ GLIBCPP_TEST_ABI_FALSE=
fi
-echo $ac_n "checking versioning on shared library symbols""... $ac_c" 1>&6
-echo "configure:23612: checking versioning on shared library symbols" >&5
-echo "$ac_t""$enable_symvers" 1>&6
# Propagate the target-specific source directories through the build chain.
@@ -23620,7 +23650,7 @@ ATOMICITY_INC_SRCDIR=config/${ATOMICITYH}
-# Set up cross-compile flags and all AM_CONDITIONALs.
+# Determine cross-compile flags and all AM_CONDITIONALs.
@@ -23640,24 +23670,6 @@ else
GLIBCPP_BUILD_LIBMATH_TRUE='#'
GLIBCPP_BUILD_LIBMATH_FALSE=
fi
-
-
-if test "$enable_wchar_t" = yes; then
- GLIBCPP_TEST_WCHAR_T_TRUE=
- GLIBCPP_TEST_WCHAR_T_FALSE='#'
-else
- GLIBCPP_TEST_WCHAR_T_TRUE='#'
- GLIBCPP_TEST_WCHAR_T_FALSE=
-fi
-
-
-if test "$enable_abi_check" = yes; then
- GLIBCPP_BUILD_ABI_CHECK_TRUE=
- GLIBCPP_BUILD_ABI_CHECK_FALSE='#'
-else
- GLIBCPP_BUILD_ABI_CHECK_TRUE='#'
- GLIBCPP_BUILD_ABI_CHECK_FALSE=
-fi
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
@@ -23723,7 +23735,7 @@ glibcpp_prefixdir=${prefix}
# Process the option --with-gxx-include-dir=<path to include-files directory>
echo $ac_n "checking for --with-gxx-include-dir""... $ac_c" 1>&6
-echo "configure:23727: checking for --with-gxx-include-dir" >&5
+echo "configure:23739: checking for --with-gxx-include-dir" >&5
# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
if test "${with_gxx_include_dir+set}" = set; then
withval="$with_gxx_include_dir"
@@ -23747,7 +23759,7 @@ echo "$ac_t""$gxx_include_dir" 1>&6
# Process the option "--enable-version-specific-runtime-libs"
echo $ac_n "checking for --enable-version-specific-runtime-libs""... $ac_c" 1>&6
-echo "configure:23751: checking for --enable-version-specific-runtime-libs" >&5
+echo "configure:23763: checking for --enable-version-specific-runtime-libs" >&5
# Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given.
if test "${enable_version_specific_runtime_libs+set}" = set; then
enableval="$enable_version_specific_runtime_libs"
@@ -23798,7 +23810,7 @@ if test x"$glibcpp_toolexecdir" = x"no"; then
fi
echo $ac_n "checking for install location""... $ac_c" 1>&6
-echo "configure:23802: checking for install location" >&5
+echo "configure:23814: checking for install location" >&5
echo "$ac_t""$gxx_include_dir" 1>&6
@@ -23956,7 +23968,7 @@ ac_given_INSTALL="$INSTALL"
trap 'rm -fr `echo "Makefile \
include/Makefile src/Makefile \
libmath/Makefile libsupc++/Makefile \
-po/Makefile testsuite/Makefile mkcheck testsuite_flags config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+po/Makefile testsuite/Makefile scripts/check_survey scripts/testsuite_flags config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@@ -24080,10 +24092,14 @@ s%@SECTION_LDFLAGS@%$SECTION_LDFLAGS%g
s%@OPT_LDFLAGS@%$OPT_LDFLAGS%g
s%@LIBMATHOBJS@%$LIBMATHOBJS%g
s%@WERROR@%$WERROR%g
-s%@baseline_file@%$baseline_file%g
s%@SYMVER_MAP@%$SYMVER_MAP%g
s%@GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE@%$GLIBCPP_BUILD_VERSIONED_SHLIB_TRUE%g
s%@GLIBCPP_BUILD_VERSIONED_SHLIB_FALSE@%$GLIBCPP_BUILD_VERSIONED_SHLIB_FALSE%g
+s%@baseline_dir@%$baseline_dir%g
+s%@GLIBCPP_TEST_WCHAR_T_TRUE@%$GLIBCPP_TEST_WCHAR_T_TRUE%g
+s%@GLIBCPP_TEST_WCHAR_T_FALSE@%$GLIBCPP_TEST_WCHAR_T_FALSE%g
+s%@GLIBCPP_TEST_ABI_TRUE@%$GLIBCPP_TEST_ABI_TRUE%g
+s%@GLIBCPP_TEST_ABI_FALSE@%$GLIBCPP_TEST_ABI_FALSE%g
s%@OS_INC_SRCDIR@%$OS_INC_SRCDIR%g
s%@ATOMICITY_INC_SRCDIR@%$ATOMICITY_INC_SRCDIR%g
s%@GLIBCPP_IS_CROSS_COMPILING@%$GLIBCPP_IS_CROSS_COMPILING%g
@@ -24091,10 +24107,6 @@ s%@CANADIAN_TRUE@%$CANADIAN_TRUE%g
s%@CANADIAN_FALSE@%$CANADIAN_FALSE%g
s%@GLIBCPP_BUILD_LIBMATH_TRUE@%$GLIBCPP_BUILD_LIBMATH_TRUE%g
s%@GLIBCPP_BUILD_LIBMATH_FALSE@%$GLIBCPP_BUILD_LIBMATH_FALSE%g
-s%@GLIBCPP_TEST_WCHAR_T_TRUE@%$GLIBCPP_TEST_WCHAR_T_TRUE%g
-s%@GLIBCPP_TEST_WCHAR_T_FALSE@%$GLIBCPP_TEST_WCHAR_T_FALSE%g
-s%@GLIBCPP_BUILD_ABI_CHECK_TRUE@%$GLIBCPP_BUILD_ABI_CHECK_TRUE%g
-s%@GLIBCPP_BUILD_ABI_CHECK_FALSE@%$GLIBCPP_BUILD_ABI_CHECK_FALSE%g
s%@glibcpp_prefixdir@%$glibcpp_prefixdir%g
s%@gxx_include_dir@%$gxx_include_dir%g
s%@glibcpp_toolexecdir@%$glibcpp_toolexecdir%g
@@ -24150,7 +24162,7 @@ cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"Makefile \
include/Makefile src/Makefile \
libmath/Makefile libsupc++/Makefile \
-po/Makefile testsuite/Makefile mkcheck testsuite_flags"}
+po/Makefile testsuite/Makefile scripts/check_survey scripts/testsuite_flags"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
@@ -24355,10 +24367,15 @@ test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
;;
esac
+ case $CONFIG_FILES in
+ *testsuite/Makefile*)
+ grep '^MULTISUBDIR =' Makefile >> testsuite/Makefile
+ ;;
+ esac
fi
fi
- chmod +x mkcheck
- chmod +x testsuite_flags
+ chmod +x scripts/check_survey
+ chmod +x scripts/testsuite_flags
exit 0
EOF
chmod +x $CONFIG_STATUS
diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
index 98c0b606f61..5dd5a74f66e 100644
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -58,9 +58,6 @@ c_compatibility=no
# Set any CPU-dependent bits.
# Here we override defaults and catch more general cases due to naming
# conventions (e.g., chip_name* to catch all variants).
-if test -d ${glibcpp_srcdir}/config/cpu/${host_cpu}; then
- try_cpu=${host_cpu}
-fi
# THIS TABLE IS SORTED. KEEP IT THAT WAY.
case "${host_cpu}" in
@@ -93,27 +90,20 @@ case "${host_cpu}" in
try_cpu=sparc
;;
*)
- try_cpu=generic
+ if test -d ${glibcpp_srcdir}/config/cpu/${host_cpu}; then
+ try_cpu=${host_cpu}
+ else
+ try_cpu=generic
+ fi
;;
esac
-
-# Now look for the file(s) usually tied to a CPU model, and make default
-# choices for those if they haven't been explicitly set already.
-cpu_include_dir="cpu/${try_cpu}"
+# Now look for the file(s) usually tied to a CPU model, and make
+# default choices for those if they haven't been explicitly set
+# already.
+cpu_include_dir="cpu/${try_cpu}"
ATOMICITYH=$cpu_include_dir
-
-
-# Check whether ABI baseline file exists, if not try to guess name.
abi_baseline_pair=${try_cpu}-${host_os}
-try_baseline_file=config/abi/${abi_baseline_pair}/baseline_symbols.txt
-if test ! -e ${glibcpp_srcdir}/${try_baseline_file} ; then
- case "${host}" in
- i*86-*-freebsd4*)
- abi_baseline_pair="i386-freebsd4"
- ;;
- esac
-fi
# Set any OS-dependent bits.
@@ -199,4 +189,19 @@ case "${host}" in
mips*-*-linux*)
ATOMICITYH="cpu/mips"
;;
+ x86_64-*-linux*)
+ abi_baseline_pair="x86_64-linux-gnu"
+ ;;
+ alpha*-*-freebsd5*)
+ abi_baseline_pair="alpha-freebsd5"
+ ;;
+ i*86-*-freebsd4*)
+ abi_baseline_pair="i386-freebsd4"
+ ;;
+ i*86-*-freebsd5*)
+ abi_baseline_pair="i386-freebsd5"
+ ;;
+ sparc*-*-freebsd5*)
+ abi_baseline_pair="sparc-freebsd5"
+ ;;
esac
diff --git a/libstdc++-v3/configure.in b/libstdc++-v3/configure.in
index c5fa8fcac3f..b838a503256 100644
--- a/libstdc++-v3/configure.in
+++ b/libstdc++-v3/configure.in
@@ -431,14 +431,14 @@ else
])
AC_FUNC_MMAP
-
- # Establish limits on memory usage during 'make check'
- GLIBCPP_CONFIGURE_TESTSUITE
fi
-# This depends on the possibly-skipped linker test above.
+# This depends on GLIBCPP_CHECK_LINKER_FEATURES, but without it assumes no.
GLIBCPP_ENABLE_SYMVERS([yes])
+# This depends on GLIBCPP_ENABLE_SYMVERS and GLIBCPP_IS_CROSS_COMPILING.
+GLIBCPP_CONFIGURE_TESTSUITE
+
# Propagate the target-specific source directories through the build chain.
# (Nothing currently uses cpu_include_dir directly; only ATOMICITYH
# uses it, and it only gets used in this file.)
@@ -447,15 +447,11 @@ ATOMICITY_INC_SRCDIR=config/${ATOMICITYH}
AC_SUBST(OS_INC_SRCDIR)
AC_SUBST(ATOMICITY_INC_SRCDIR)
-# Set up cross-compile flags and all AM_CONDITIONALs.
+# Determine cross-compile flags and all AM_CONDITIONALs.
AC_SUBST(GLIBCPP_IS_CROSS_COMPILING)
AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
dnl from GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT:
AM_CONDITIONAL(GLIBCPP_BUILD_LIBMATH, test "$need_libmath" = yes)
-dnl from GLIBCPP_CHECK_WCHAR_T_SUPPORT:
-AM_CONDITIONAL(GLIBCPP_TEST_WCHAR_T, test "$enable_wchar_t" = yes)
-dnl from GLIBCPP_CONFIGURE_TESTSUITE:
-AM_CONDITIONAL(GLIBCPP_BUILD_ABI_CHECK, test "$enable_abi_check" = yes)
AC_CACHE_SAVE
@@ -481,15 +477,15 @@ fi
AC_SUBST(LIBSUPCXX_PICFLAGS)
# Generate the various Makefiles, include files, and scripts.
-# NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
-# and libsupc++/Makefile.am so that multilib installs will end up
-# installed in the correct place. To work around this not being passed
-# down from config-ml.in -> top_srcdir/Makefile.am ->
+# NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am,
+# libsupc++/Makefile.am and testsuite/Makefile.am so that multilib installs
+# will end up installed in the correct place. To work around this not being
+# passed # down from config-ml.in -> top_srcdir/Makefile.am ->
# top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
AC_OUTPUT(Makefile \
include/Makefile src/Makefile \
libmath/Makefile libsupc++/Makefile \
-po/Makefile testsuite/Makefile mkcheck testsuite_flags,
+po/Makefile testsuite/Makefile scripts/check_survey scripts/testsuite_flags,
[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
if test -n "$CONFIG_FILES"; then
if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then
@@ -510,10 +506,15 @@ po/Makefile testsuite/Makefile mkcheck testsuite_flags,
grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
;;
esac
+ case $CONFIG_FILES in
+ *testsuite/Makefile*)
+ grep '^MULTISUBDIR =' Makefile >> testsuite/Makefile
+ ;;
+ esac
fi
fi
- chmod +x mkcheck
- chmod +x testsuite_flags],
+ chmod +x scripts/check_survey
+ chmod +x scripts/testsuite_flags],
srcdir=${srcdir}
host=${host}
target=${target}
@@ -531,7 +532,8 @@ dnl In autoconf 2.5x, AC_OUTPUT is replaced by three AC_ macros:
dnl AC_CONFIG_FILES(Makefile \
dnl include/Makefile src/Makefile \
dnl libmath/Makefile libsupc++/Makefile \
-dnl po/Makefile testsuite/Makefile mkcheck testsuite_flags)
+dnl po/Makefile testsuite/Makefile \
+dnl scripts/check_survey scripts/testsuite_flags)
dnl AC_CONFIG_COMMANDS([default],
dnl [if test -n "$CONFIG_FILES"; then
dnl # Ony modify Makefiles that are just being created.
@@ -550,9 +552,14 @@ dnl *libsupc++/Makefile*)
dnl grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
dnl ;;
dnl esac
+dnl case $CONFIG_FILES in
+dnl *testsuite/Makefile*)
+dnl grep '^MULTISUBDIR =' Makefile >> testsuite/Makefile
+dnl ;;
+dnl esac
dnl fi
-dnl chmod +x mkcheck
-dnl chmod +x testsuite_flags
+dnl chmod +x scripts/check_survey
+dnl chmod +x scripts/testsuite_flags
dnl ],
dnl srcdir=${srcdir}
dnl host=${host}
diff --git a/libstdc++-v3/docs/doxygen/mainpage.html b/libstdc++-v3/docs/doxygen/mainpage.html
index 9f9b55448b9..e0998fc0320 100644
--- a/libstdc++-v3/docs/doxygen/mainpage.html
+++ b/libstdc++-v3/docs/doxygen/mainpage.html
@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>Main Page</title>
+<title>libstdc++-v3 Source: Main Index</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
diff --git a/libstdc++-v3/docs/html/17_intro/contribute.html b/libstdc++-v3/docs/html/17_intro/contribute.html
index 17bc65f4ed0..3219f16da0e 100644
--- a/libstdc++-v3/docs/html/17_intro/contribute.html
+++ b/libstdc++-v3/docs/html/17_intro/contribute.html
@@ -11,8 +11,10 @@
<!-- #include virtual="/include/header-subpages.html"-->
<body>
<h2>How to contribute</h2>
-<p>
-The Standard C++ Library v3, or libstc++-2.90.x, follows an open development model. Active contributors are assigned maintainer-ship responsibility, and given write access to the CVS repository. First time submitors and all other potential contributors should follow this procedure:
+<p> The Standard C++ Library v3, follows an open development
+model. Active contributors are assigned maintainer-ship
+responsibility, and given write access to the CVS repository. First
+time contributors should follow this procedure:
</p>
<hr />
@@ -33,9 +35,8 @@ and their web-site is right
<a href="http://webstore.ansi.org/ansidocstore/product.asp?sku=ISO%2FIEC+14882%2D1998">buy the standard on-line.)</a>
</li>
-<li> The library working group bugs, and known defects, can be obtained at these web sites:
+<li> The library working group bugs, and known defects, can be obtained here:
<a href="http://www.dkuug.dk/jtc1/sc22/wg21/">http://www.dkuug.dk/jtc1/sc22/wg21 </a>
- and <a href="http://www.comeaucomputing.com/iso/">http://www.comeaucomputing.com/iso/</a>
</li>
<li> The newsgroup dedicated to standardization issues is comp.std.c++: this FAQ for this group is quite useful and can be found <a href="http://reality.sgi.com/austern_mti/std-c++/faq.html"> here </a>.
@@ -60,11 +61,31 @@ and their web-site is right
Small changes can be accepted without a copyright assignment form on
file. New code and additions to the library need completed copyright
assignment form on file at the FSF. Note: your employer may be required
-to fill out appropriate disclaimer forms as well. Here is the <a href="libstdc++-assign.txt"> form. </a>
+to fill out appropriate disclaimer forms as well.
+</p>
+
+<p> Historically, the libstdc++ assignment form added the following question:
+</p>
-Please contact <a href="mailto:benjamin@cygnus.com">Benjamin
+<code>[Which Belgian comic book character is better, Tintin or
+Asterix, and why?]</code>
+
+<p>
+While not strictly necessary, humoring the maintainers and answering
+this question would be appreciated.
+</p>
+
+<p>
+For more information about getting a copyright assignment, please see
+<a href=http://www.gnu.org/prep/maintain_4.html#SEC4=> Legal Issues</a>
+</p>
+
+<p>
+Please contact <a href="mailto:bkoz+assign@redhat.com">Benjamin
Kosnik</a> if you are confused about the assignment or have general
-licensing questions.
+licensing questions. When requesting an assignment form from <a
+HREF="mailto:assign@gnu.org">assign@gnu.org</a>, please cc
+the above libstdc++ maintainer so that progress can be monitored.
</p>
@@ -82,7 +103,7 @@ response from the maintainers) it would have all of these pieces:
<li> A description of the bug and how your patch fixes this bug. For
new features a description of the feature and your implementation. </li>
- <li> A ChangeLog entry as plaintext; see the various ChangeLog files
+ <li> A ChangeLog entry as plain text; see the various ChangeLog files
for format and content. If using you are using emacs as your editor,
simply position the insertion point at the beginning of your change
and hit CX-4a to bring up the appropriate ChangeLog
@@ -98,7 +119,7 @@ response from the maintainers) it would have all of these pieces:
<li> When you have all these pieces, bundle them up in a mail message
and send it to libstdc++@gcc.gnu.org. All patches and related
-discussion should be sent to the libstdc++ mailinglist. </li>
+discussion should be sent to the libstdc++ mailing list. </li>
</ul>
diff --git a/libstdc++-v3/docs/html/17_intro/libstdc++-assign.txt b/libstdc++-v3/docs/html/17_intro/libstdc++-assign.txt
deleted file mode 100644
index b70be688bca..00000000000
--- a/libstdc++-v3/docs/html/17_intro/libstdc++-assign.txt
+++ /dev/null
@@ -1,129 +0,0 @@
-The way to assign copyright to the Free Software Foundation is to sign
-an assignment contract. This is what legally makes the Free Software
-Foundation the copyright holder so that we can register the copyright
-on the new version. I'm assuming that you wrote these changes
-yourself; if other people wrote parts, we may need papers from them.
-
-If you are employed to do programming (even at a university), or have
-made an agreement with your employer or school saying it owns programs
-you write, then you and we need a signed piece of paper from your
-employer disclaiming rights to the program.
-
-The disclaimer should be signed by a vice president or general manager
-of the company. If you can't get at them, anyone else authorized to
-license software produced there will do. Here is a sample wording:
-
- Digital Stimulation Corporation hereby disclaims all copyright interest
- in the changes and enhancements made by Hugh Heffner to the program
- "libstdc++", also including any future revisions of these changes and
- enhancements.
-
- Digital Stimulation Corporation affirms that it has no other
- intellectual property interest that would undermine this release, or
- the use of the Program, and will do nothing to undermine it in the
- future.
-
- <signature of Ty Coon>, 1 April 1987
- Ty Coon, President of Vice, Digital Stimulation Corp.
-
-(If your employer says they do have an intellectual property claim
-that could conflict with the use of the program, then please put me in
-touch with a suitable representative of the company, so that we can
-negotiate what to do about it.)
-
-IMPORTANT: When you talk to your employer, *no matter what
-instructions they have given you*, don't fail to show them the sample
-disclaimer above, or a disclaimer with the details filled in for your
-specific case. Companies are usually willing to sign a disclaimer
-without any fuss. If you make your request less specific, you may
-open Pandora's box and cause a long and unnecessary delay.
-
-Below is the assignment contract that we usually use. You need
-to print it out, sign it, and snail it to:
-
-Richard Stallman
-545 Tech Sq rm 425
-Cambridge, MA 02139
-USA
-
-Please try to print the whole first page below on a single piece of
-paper. If it doesn't fit on one printed page, put it on two sides of
-a single piece of paper.
-
-Don't forget to put down the date when you sign! Spell out the month
-name--don't use a number for the month. Dates using a number for the
-month are ambiguous; 2/8/95 means one thing in the US and another in
-Europe.
-
-Snail a copy of the employer's disclaimer as well.
-
-Please send me email about what you decide to do. If you have any
-questions, or would like something to be changed, ask bkoz@gnu.org via
-email.
- ASSIGNMENT
-
- For good and valuable consideration, receipt of which I
-acknowledge, I, [your name here], hereby transfer to the Free Software
-Foundation, Inc. (the "Foundation") my entire right, title, and
-interest (including all rights under copyright) in my changes and
-enhancements to the libstdc++ library, subject to the conditions
-below. These changes and enhancements are herein called the "Work".
-The work hereby assigned shall also include any future revisions of
-these changes and enhancements hereafter made by me.
-
- Upon thirty days' prior written notice, the "Foundation" agrees to
-grant me non-exclusive rights to use the Work (i.e. my changes and
-enhancements, not the program which I enhanced) as I see fit; (and
-the "Foundation"'s rights shall otherwise continue unchanged).
-
- I hereby agree that if I have or acquire hereafter any patent or
-interface copyright or other intellectual property interest dominating
-the program enhanced by the Work (or use of that program), such
-dominating interest will not be used to undermine the effect of this
-assignment, i.e. the "Foundation" and the general public will be
-licensed to use, in that program and its derivative works, without
-royalty or limitation, the subject matter of the dominating interest.
-This license provision will be binding on my heirs, assignees, or
-other successors to the dominating interest, as well as on me.
-
- I hereby represent and warrant that I am the sole copyright holder
-for the Work and that I have the right and power to enter into this
-contract. I hereby indemnify and hold harmless the "Foundation", its
-officers, employees, and agents against any and all claims, actions or
-damages (including attorney's reasonable fees) asserted by or paid to
-any party on account of a breach or alleged breach of the foregoing
-warranty. I make no other express or implied warranty (including
-without limitation, in this disclaimer of warranty, any warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE).
-
-Agreed: [signature] Date [Write the month with LETTERS]:
-
-
-For the "Foundation",
-Richard Stallman, head dude in charge
-
-Please do not delete the control-l character before this line.
-Please print this as a separate page.
-
-Please email a copy of the information on this page to
-fsf-records@gnu.ai.mit.edu, and cc bkoz@gnu.org, if you can, so that
-our clerk doesn't have to type it in. Use your full name as the
-subject line.
-
-[For the copyright registration, what country are you a citizen of?
-What year were you born?]
-
-
-[Please write your email address here.]
-
-
-[Please write your snail address here, so we can snail a copy back to you.]
-
-
-
-[Which files have you changed so far, and which new files have you written
-so far?]
-
-
-[Which Belgian comic book character is better, Tintin or Asterix, and why?]
-
diff --git a/libstdc++-v3/docs/html/documentation.html b/libstdc++-v3/docs/html/documentation.html
index 68f79f7f3c4..2e9a811873b 100644
--- a/libstdc++-v3/docs/html/documentation.html
+++ b/libstdc++-v3/docs/html/documentation.html
@@ -239,7 +239,6 @@
<h2><a name="5">Contributor-Specific Information</a></h2>
<ul>
<li><a href="17_intro/contribute.html">Contributor checklist</a></li>
- <li><a href="17_intro/libstdc++-assign.txt">Copyright assignment form for libstdc++-v3</a></li>
<li><a href="http://gcc.gnu.org/cvswrite.html">Getting CVS write access
(look for &quot;Write after approval&quot;)</a></li>
<li><a href="17_intro/BADNAMES">BADNAMES</a>
diff --git a/libstdc++-v3/docs/html/test.html b/libstdc++-v3/docs/html/test.html
index 42d7d763bb8..4d2dc536dc3 100644
--- a/libstdc++-v3/docs/html/test.html
+++ b/libstdc++-v3/docs/html/test.html
@@ -189,8 +189,7 @@ cat 27_io/objects/char/3_xin.in | a.out
specific file name. This indicates a test that is used to
analyze runtime performance, for performance regression testing,
or for other optimization related analysis. At the moment, these
- test cases are not run by default, and instead assumed to be run
- manually.
+ test cases are not run by default.
</p>
</li>
</ul>
@@ -252,6 +251,19 @@ cat 27_io/objects/char/3_xin.in | a.out
<p></p>
</li>
<li>
+ <em>testsuite_performance.h</em>
+ <p>
+ A number of class abstractions for performance counters, and
+ reporting functions including:
+ </p>
+ <ul>
+ <li>time_counter</li>
+ <li>resource_counter</li>
+ <li>report_performance</li>
+ </ul>
+ <p></p>
+ </li>
+ <li>
<em>printnow.c</em>
<p>
A cross-platform timer for use in one of the older harnesses
@@ -476,7 +488,7 @@ make check-target-libstdc++-v3 RUNTESTFLAGS="--target_board=arm-sim"
<p> In addition, there are some testing options that are mostly of
interest to library maintainers and system integrators. As such,
these tests may not work on all cpu and host combinations, and must
- be executed in the <em>libbuilddir</em> directory. These options
+ be executed in the <em>libbuilddir/testsuite</em> directory. These options
include, but are not necessarily limited to, the following:
</p>
@@ -508,7 +520,17 @@ make check-target-libstdc++-v3 RUNTESTFLAGS="--target_board=arm-sim"
<pre>
make check-abi</pre>
<p>The library ABI can be tested. This involves testing the shared
- library against an ABI-defining previous version.</p>
+ library against an ABI-defining previous version. </p>
+
+ <pre>
+ make check-performance</pre>
+ <p>This rule runs through the <em>testsuite_files_performance</em>
+ test cases and collects information for performance analysis and
+ can be used to spot performance regressions. Various timing
+ information is collected, as well as number of hard page faults,
+ and memory used. This is not run by default, and the implementation
+ is in flux.
+</p>
<p>
We are interested in any strange failures of the
diff --git a/libstdc++-v3/include/bits/basic_ios.tcc b/libstdc++-v3/include/bits/basic_ios.tcc
index cf2701effb2..54f34b599e5 100644
--- a/libstdc++-v3/include/bits/basic_ios.tcc
+++ b/libstdc++-v3/include/bits/basic_ios.tcc
@@ -138,12 +138,7 @@ namespace std
ios_base::_M_init();
// Cache locale data and specific facets used by iostreams.
- if (!_M_locale_cache.get())
- {
- typedef __locale_cache<_CharT> __cache_t;
- this->_M_locale_cache = auto_ptr<__locale_cache_base>(static_cast<__locale_cache_base*>(new __cache_t));
- _M_cache_locale(_M_ios_locale);
- }
+ _M_cache_locale(_M_ios_locale);
// NB: The 27.4.4.1 Postconditions Table specifies requirements
// after basic_ios::init() has been called. As part of this,
@@ -176,7 +171,6 @@ namespace std
_M_num_put = &use_facet<__numput_type>(__loc);
if (__builtin_expect(has_facet<__numget_type>(__loc), true))
_M_num_get = &use_facet<__numget_type>(__loc);
- static_cast<__locale_cache<_CharT>&>(_M_cache())._M_init(__loc);
}
// Inhibit implicit instantiations for required instantiations,
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index c843b75efd5..7942c7635e2 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -625,14 +625,15 @@ namespace std
{ return this->replace(__i1, __i2, __s, traits_type::length(__s)); }
basic_string&
- replace(iterator __i1, iterator __i2, size_type __n, _CharT __c);
+ replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
+ { return _M_replace_aux(__i1, __i2, __n, __c); }
template<class _InputIterator>
basic_string&
replace(iterator __i1, iterator __i2,
_InputIterator __k1, _InputIterator __k2)
- { return _M_replace(__i1, __i2, __k1, __k2,
- typename iterator_traits<_InputIterator>::iterator_category()); }
+ { typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
+ return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral()); }
// Specializations for the common case of pointer and iterator:
// useful to avoid the overhead of temporary buffering in _M_replace.
@@ -659,6 +660,25 @@ namespace std
}
private:
+ template<class _Integer>
+ basic_string&
+ _M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n,
+ _Integer __val, __true_type)
+ { return _M_replace_aux(__i1, __i2, __n, __val); }
+
+ template<class _InputIterator>
+ basic_string&
+ _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
+ _InputIterator __k2, __false_type)
+ {
+ typedef typename iterator_traits<_InputIterator>::iterator_category
+ _Category;
+ return _M_replace(__i1, __i2, __k1, __k2, _Category());
+ }
+
+ basic_string&
+ _M_replace_aux(iterator __i1, iterator __i2, size_type __n2, _CharT __c);
+
template<class _InputIterator>
basic_string&
_M_replace(iterator __i1, iterator __i2, _InputIterator __k1,
diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc
index 9b836035219..a9496c0244a 100644
--- a/libstdc++-v3/include/bits/basic_string.tcc
+++ b/libstdc++-v3/include/bits/basic_string.tcc
@@ -621,6 +621,22 @@ namespace std
// else nothing (in particular, avoid calling _M_mutate() unnecessarily.)
}
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ _M_replace_aux(iterator __i1, iterator __i2, size_type __n2, _CharT __c)
+ {
+ size_type __n1 = __i2 - __i1;
+ size_type __off1 = __i1 - _M_ibegin();
+ if (max_size() - (this->size() - __n1) <= __n2)
+ __throw_length_error("basic_string::replace");
+ _M_mutate (__off1, __n1, __n2);
+ // Invalidated __i1, __i2
+ if (__n2)
+ traits_type::assign(_M_data() + __off1, __n2, __c);
+ return *this;
+ }
+
// This is the general replace helper, which currently gets instantiated both
// for input iterators and reverse iterators. It buffers internally and then
// calls _M_replace_safe.
@@ -761,22 +777,6 @@ namespace std
}
template<typename _CharT, typename _Traits, typename _Alloc>
- basic_string<_CharT, _Traits, _Alloc>&
- basic_string<_CharT, _Traits, _Alloc>::
- replace(iterator __i1, iterator __i2, size_type __n2, _CharT __c)
- {
- const size_type __n1 = __i2 - __i1;
- const size_type __off1 = __i1 - _M_ibegin();
- if (max_size() - (this->size() - __n1) <= __n2)
- __throw_length_error("basic_string::replace");
- _M_mutate (__off1, __n1, __n2);
- // Invalidated __i1, __i2
- if (__n2)
- traits_type::assign(_M_data() + __off1, __n2, __c);
- return *this;
- }
-
- template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
copy(_CharT* __s, size_type __n, size_type __pos) const
diff --git a/libstdc++-v3/include/bits/boost_concept_check.h b/libstdc++-v3/include/bits/boost_concept_check.h
index d91c2e88e3c..a6a94a214ed 100644
--- a/libstdc++-v3/include/bits/boost_concept_check.h
+++ b/libstdc++-v3/include/bits/boost_concept_check.h
@@ -412,9 +412,9 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
void __constraints() {
__function_requires< _TrivialIteratorConcept<_Tp> >();
// require iterator_traits typedef's
- typedef typename std::iterator_traits<_Tp>::difference_type _D;
-// __function_requires< _SignedIntegerConcept<_D> >();
- typedef typename std::iterator_traits<_Tp>::reference _R;
+ typedef typename std::iterator_traits<_Tp>::difference_type _Diff;
+// __function_requires< _SignedIntegerConcept<_Diff> >();
+ typedef typename std::iterator_traits<_Tp>::reference _Ref;
typedef typename std::iterator_traits<_Tp>::pointer _Pt;
typedef typename std::iterator_traits<_Tp>::iterator_category _Cat;
__function_requires< _ConvertibleConcept<
@@ -447,8 +447,8 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
__function_requires< _ConvertibleConcept<
typename std::iterator_traits<_Tp>::iterator_category,
std::forward_iterator_tag> >();
- typedef typename std::iterator_traits<_Tp>::reference _R;
- _R __r _IsUnused = *__i;
+ typedef typename std::iterator_traits<_Tp>::reference _Ref;
+ _Ref __r _IsUnused = *__i;
}
_Tp __i;
};
@@ -498,8 +498,8 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
__function_requires< _ConvertibleConcept<
typename std::iterator_traits<_Tp>::iterator_category,
std::random_access_iterator_tag> >();
- // ??? We don't use _R, are we just checking for "referenceability"?
- typedef typename std::iterator_traits<_Tp>::reference _R;
+ // ??? We don't use _Ref, are we just checking for "referenceability"?
+ typedef typename std::iterator_traits<_Tp>::reference _Ref;
__i += __n; // require assignment addition operator
__i = __i + __n; __i = __n + __i; // require addition with difference type
@@ -828,7 +828,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
typedef typename _SimpleAssociativeContainer::key_type _Key_type;
typedef typename _SimpleAssociativeContainer::value_type _Value_type;
typedef typename _Aux_require_same<_Key_type, _Value_type>::_Type
- _Requqired;
+ _Required;
}
};
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index d9168508d0a..7debb8f1b34 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -35,7 +35,7 @@
#include <bits/os_defines.h>
// The current version of the C++ library in compressed ISO date format.
-#define __GLIBCPP__ 20030615
+#define __GLIBCPP__ 20030627
// This is necessary until GCC supports separate template compilation.
#define _GLIBCPP_NO_TEMPLATE_EXPORT 1
diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc
index 908cc7567af..3d6fb96e296 100644
--- a/libstdc++-v3/include/bits/fstream.tcc
+++ b/libstdc++-v3/include/bits/fstream.tcc
@@ -63,8 +63,6 @@ namespace std
delete [] this->_M_buf;
this->_M_buf = NULL;
_M_buf_allocated = false;
- this->setg(NULL, NULL, NULL);
- this->setp(NULL, NULL);
}
}
@@ -73,10 +71,10 @@ namespace std
basic_filebuf() : __streambuf_type(), _M_file(&_M_lock),
_M_state_cur(__state_type()), _M_state_beg(__state_type()),
_M_buf(NULL), _M_buf_size(BUFSIZ), _M_buf_allocated(false),
- _M_last_overflowed(false), _M_filepos(0), _M_pback_cur_save(0),
- _M_pback_end_save(0), _M_pback_init(false), _M_codecvt(0)
+ _M_reading(false), _M_writing(false), _M_last_overflowed(false),
+ _M_pback_cur_save(0), _M_pback_end_save(0), _M_pback_init(false),
+ _M_codecvt(0)
{
- this->_M_buf_unified = true;
if (has_facet<__codecvt_type>(this->_M_buf_locale))
_M_codecvt = &use_facet<__codecvt_type>(this->_M_buf_locale);
}
@@ -95,8 +93,10 @@ namespace std
_M_allocate_internal_buffer();
this->_M_mode = __mode;
- // Setup initial position of buffer.
- _M_set_buffer(0);
+ // Setup initial buffer to 'uncommitted' mode.
+ _M_reading = false;
+ _M_writing = false;
+ _M_set_buffer(-1);
if ((__mode & ios_base::ate)
&& this->seekoff(0, ios_base::end, __mode) < 0)
@@ -120,9 +120,7 @@ namespace std
bool __testfail = false;
try
{
- const bool __testput = this->_M_out_beg < this->_M_out_lim;
-
- if (__testput
+ if (this->pbase() < this->pptr()
&& traits_type::eq_int_type(this->overflow(),
traits_type::eof()))
__testfail = true;
@@ -144,6 +142,9 @@ namespace std
this->_M_mode = ios_base::openmode(0);
this->_M_pback_init = false;
_M_destroy_internal_buffer();
+ _M_reading = false;
+ _M_writing = false;
+ _M_set_buffer(-1);
if (!_M_file.close())
__testfail = true;
@@ -167,7 +168,7 @@ namespace std
{
// For a stateful encoding (-1) the pending sequence might be just
// shift and unshift prefixes with no actual character.
- __ret = this->_M_in_end - this->_M_in_cur;
+ __ret = this->egptr() - this->gptr();
if (__check_facet(_M_codecvt).encoding() >= 0)
__ret += _M_file.showmanyc() / _M_codecvt->max_length();
}
@@ -185,26 +186,21 @@ namespace std
const bool __testin = this->_M_mode & ios_base::in;
const bool __testout = this->_M_mode & ios_base::out;
- if (__testin)
+ if (__testin && !_M_writing)
{
// Check for pback madness, and if so swich back to the
// normal buffers and jet outta here before expensive
// fileops happen...
_M_destroy_pback();
- if (this->_M_in_cur < this->_M_in_end)
+ if (this->gptr() < this->egptr())
{
- __ret = traits_type::to_int_type(*this->_M_in_cur);
+ __ret = traits_type::to_int_type(*this->gptr());
if (__bump)
- _M_move_in_cur(1);
+ this->gbump(1);
return __ret;
}
- // Sync internal and external buffers.
- if (__testout && this->_M_out_beg < this->_M_out_lim
- && traits_type::eq_int_type(this->overflow(), __ret))
- return __ret;
-
// Get and convert input sequence.
const size_t __buflen = this->_M_buf_size > 1
? this->_M_buf_size - 1 : 1;
@@ -212,25 +208,28 @@ namespace std
streamsize __ilen = 0;
if (__check_facet(_M_codecvt).always_noconv())
{
- __elen = _M_file.xsgetn(reinterpret_cast<char*>(this->_M_in_beg), __buflen);
+ __elen = _M_file.xsgetn(reinterpret_cast<char*>(this->eback()), __buflen);
__ilen = __elen;
}
else
{
- char* __buf = static_cast<char*>(__builtin_alloca(__buflen));
- __elen = _M_file.xsgetn(__buf, __buflen);
-
- const char* __eend;
+ // Worst-case number of external bytes.
+ // XXX Not done encoding() == -1.
+ const streamsize __blen = __buflen * _M_codecvt->max_length();
+ char* __buf = static_cast<char*>(__builtin_alloca(__blen));
+ __elen = _M_file.xsgetn(__buf, __blen);
+
+ const char* __eend;
char_type* __iend;
codecvt_base::result __r;
__r = _M_codecvt->in(_M_state_cur, __buf, __buf + __elen,
- __eend, this->_M_in_beg,
- this->_M_in_beg + __buflen, __iend);
- if (__r == codecvt_base::ok)
- __ilen = __iend - this->_M_in_beg;
+ __eend, this->eback(),
+ this->eback() + __buflen, __iend);
+ if (__r == codecvt_base::ok || __r == codecvt_base::partial)
+ __ilen = __iend - this->eback();
else if (__r == codecvt_base::noconv)
{
- traits_type::copy(this->_M_in_beg,
+ traits_type::copy(this->eback(),
reinterpret_cast<char_type*>(__buf),
__elen);
__ilen = __elen;
@@ -246,10 +245,19 @@ namespace std
if (__ilen > 0)
{
_M_set_buffer(__ilen);
- __ret = traits_type::to_int_type(*this->_M_in_cur);
+ _M_reading = true;
+ __ret = traits_type::to_int_type(*this->gptr());
if (__bump)
- _M_move_in_cur(1);
- }
+ this->gbump(1);
+ }
+ else if (__elen == 0)
+ {
+ // If the actual end of file is reached, set 'uncommitted'
+ // mode, thus allowing an immediate write without an
+ // intervening seek.
+ _M_set_buffer(-1);
+ _M_reading = false;
+ }
}
_M_last_overflowed = false;
return __ret;
@@ -263,7 +271,7 @@ namespace std
int_type __ret = traits_type::eof();
const bool __testin = this->_M_mode & ios_base::in;
- if (__testin)
+ if (__testin && !_M_writing)
{
// Remember whether the pback buffer is active, otherwise below
// we may try to store in it a second char (libstdc++/9761).
@@ -271,10 +279,10 @@ namespace std
const bool __testeof = traits_type::eq_int_type(__i, __ret);
int_type __tmp;
- if (this->_M_in_beg < this->_M_in_cur)
+ if (this->eback() < this->gptr())
{
- _M_move_in_cur(-1);
- __tmp = traits_type::to_int_type(*this->_M_in_cur);
+ this->gbump(-1);
+ __tmp = traits_type::to_int_type(*this->gptr());
}
else if (this->seekoff(-1, ios_base::cur) >= 0)
{
@@ -301,7 +309,8 @@ namespace std
else if (!__testpb)
{
_M_create_pback();
- *this->_M_in_cur = traits_type::to_char_type(__i);
+ _M_reading = true;
+ *this->gptr() = traits_type::to_char_type(__i);
__ret = __i;
}
}
@@ -318,37 +327,50 @@ namespace std
const bool __testeof = traits_type::eq_int_type(__c, __ret);
const bool __testout = this->_M_mode & ios_base::out;
- if (__testout)
+ if (__testout && !_M_reading)
{
- if (this->_M_out_beg < this->_M_out_lim)
+ if (this->pbase() < this->pptr())
{
- // Need to restore current position. The position of the
- // external byte sequence (_M_file) corresponds to
- // _M_filepos, and we need to move it to _M_out_beg for
- // the write.
- if (_M_filepos != this->_M_out_beg)
- _M_file.seekoff(this->_M_out_beg - _M_filepos, ios_base::cur);
-
// If appropriate, append the overflow char.
if (!__testeof)
- *this->_M_out_lim++ = traits_type::to_char_type(__c);
+ {
+ *this->pptr() = traits_type::to_char_type(__c);
+ this->pbump(1);
+ }
// Convert pending sequence to external representation,
// output.
- if (_M_convert_to_external(this->_M_out_beg,
- this->_M_out_lim - this->_M_out_beg)
+ if (_M_convert_to_external(this->pbase(),
+ this->pptr() - this->pbase())
&& (!__testeof || (__testeof && !_M_file.sync())))
{
_M_set_buffer(0);
__ret = traits_type::not_eof(__c);
}
}
+ else if (this->_M_buf_size > 1)
+ {
+ // Overflow in 'uncommitted' mode: set _M_writing, set
+ // the buffer to the initial 'write' mode, and put __c
+ // into the buffer.
+ _M_set_buffer(0);
+ _M_writing = true;
+ if (!__testeof)
+ {
+ *this->pptr() = traits_type::to_char_type(__c);
+ this->pbump(1);
+ }
+ __ret = traits_type::not_eof(__c);
+ }
else
{
// Unbuffered.
char_type __conv = traits_type::to_char_type(__c);
if (__testeof || _M_convert_to_external(&__conv, 1))
- __ret = traits_type::not_eof(__c);
+ {
+ _M_writing = true;
+ __ret = traits_type::not_eof(__c);
+ }
}
}
_M_last_overflowed = true;
@@ -372,11 +394,10 @@ namespace std
else
{
// Worst-case number of external bytes needed.
- int __ext_multiplier = _M_codecvt->encoding();
- if (__ext_multiplier == -1 || __ext_multiplier == 0)
- __ext_multiplier = sizeof(char_type);
- streamsize __blen = __ilen * __ext_multiplier;
+ // XXX Not done encoding() == -1.
+ streamsize __blen = __ilen * _M_codecvt->max_length();
char* __buf = static_cast<char*>(__builtin_alloca(__blen));
+
char* __bend;
const char_type* __iend;
codecvt_base::result __r;
@@ -393,7 +414,7 @@ namespace std
}
else
{
- // Result == error .
+ // Result == error.
__blen = 0;
}
@@ -407,7 +428,7 @@ namespace std
if (__r == codecvt_base::partial)
{
const char_type* __iresume = __iend;
- streamsize __rlen = this->_M_out_lim - __iend;
+ streamsize __rlen = this->pptr() - __iend;
__r = _M_codecvt->out(_M_state_cur, __iresume,
__iresume + __rlen, __iend, __buf,
__buf + __blen, __bend);
@@ -429,15 +450,16 @@ namespace std
{
if (!this->is_open() && __s == 0 && __n == 0)
this->_M_buf_size = 1;
- else if (__s && __n > 1)
+ else if (__s && __n > 0)
{
// This is implementation-defined behavior, and assumes that
- // an external char_type array of length (__s + __n) exists
- // and has been pre-allocated. If this is not the case,
- // things will quickly blow up. The length argument __n must
- // be greater than 1 because __n - 1 positions will be used
- // for the get and put areas, and 1 position is needed to
- // host the overflow char of a full put area.
+ // an external char_type array of length __n exists and has
+ // been pre-allocated. If this is not the case, things will
+ // quickly blow up. When __n > 1, __n - 1 positions will be
+ // used for the get area, __n - 1 for the put area and 1
+ // position to host the overflow char of a full put area.
+ // When __n == 1, 1 position will be used for the get area
+ // and 0 for the put area, as in the unbuffered case above.
// Step 1: Destroy the current internal array.
_M_destroy_internal_buffer();
@@ -445,7 +467,9 @@ namespace std
// Step 2: Use the external array.
this->_M_buf = __s;
this->_M_buf_size = __n;
- _M_set_buffer(0);
+ _M_reading = false;
+ _M_writing = false;
+ _M_set_buffer(-1);
}
_M_last_overflowed = false;
return this;
@@ -472,41 +496,26 @@ namespace std
// Ditch any pback buffers to avoid confusion.
_M_destroy_pback();
- if (__way != ios_base::cur || __off != 0)
- {
- // Sync the internal and external streams.
- const bool __testget = this->_M_in_beg < this->_M_in_end;
- const bool __testput = this->_M_out_beg < this->_M_out_lim;
- off_type __computed_off = __width * __off;
-
- if (__testput || _M_last_overflowed)
- {
- // Part one: update the output sequence.
- this->sync();
-
- // Part two: output unshift sequence.
- _M_output_unshift();
- }
- else if (__testget && __way == ios_base::cur)
- __computed_off += this->_M_in_cur - _M_filepos;
-
- // Return pos_type(off_type(-1)) in case of failure.
- __ret = _M_file.seekoff(__computed_off, __way, __mode);
- _M_set_buffer(0);
- }
- else
+ // Sync the internal and external streams.
+ off_type __computed_off = __width * __off;
+
+ if (this->pbase() < this->pptr()
+ || _M_last_overflowed)
{
- // NB: Need to do this in case _M_file in indeterminate
- // state, ie _M_file._offset == -1
- pos_type __tmp = _M_file.seekoff(__off, ios_base::cur, __mode);
- if (__tmp >= 0)
- {
- // Seek successful.
- __ret = __tmp;
- __ret += std::max(this->_M_out_cur, this->_M_in_cur)
- - _M_filepos;
- }
+ // Part one: update the output sequence.
+ this->sync();
+
+ // Part two: output unshift sequence.
+ _M_output_unshift();
}
+ else if (_M_reading && __way == ios_base::cur)
+ __computed_off += this->gptr() - this->egptr();
+
+ // Return pos_type(off_type(-1)) in case of failure.
+ __ret = _M_file.seekoff(__computed_off, __way, __mode);
+ _M_reading = false;
+ _M_writing = false;
+ _M_set_buffer(-1);
}
_M_last_overflowed = false;
return __ret;
diff --git a/libstdc++-v3/include/bits/ios_base.h b/libstdc++-v3/include/bits/ios_base.h
index 37a02a43ddd..ef2f57ab0f8 100644
--- a/libstdc++-v3/include/bits/ios_base.h
+++ b/libstdc++-v3/include/bits/ios_base.h
@@ -146,8 +146,6 @@ namespace std
enum _Ios_Seekdir { _S_ios_seekdir_end = 1L << 16 };
- class __locale_cache_base;
-
// 27.4.2 Class ios_base
/**
* @brief The very top of the I/O class hierarchy.
@@ -212,47 +210,65 @@ namespace std
* - floatfield
*/
typedef _Ios_Fmtflags fmtflags;
+
/// Insert/extract @c bool in alphabetic rather than numeric format.
static const fmtflags boolalpha = fmtflags(__ios_flags::_S_boolalpha);
+
/// Converts integer input or generates integer output in decimal base.
static const fmtflags dec = fmtflags(__ios_flags::_S_dec);
+
/// Generate floating-point output in fixed-point notation.
static const fmtflags fixed = fmtflags(__ios_flags::_S_fixed);
+
/// Converts integer input or generates integer output in hexadecimal base.
static const fmtflags hex = fmtflags(__ios_flags::_S_hex);
+
/// Adds fill characters at a designated internal point in certain
/// generated output, or identical to @c right if no such point is
/// designated.
static const fmtflags internal = fmtflags(__ios_flags::_S_internal);
+
/// Adds fill characters on the right (final positions) of certain
/// generated output. (I.e., the thing you print is flush left.)
static const fmtflags left = fmtflags(__ios_flags::_S_left);
+
/// Converts integer input or generates integer output in octal base.
static const fmtflags oct = fmtflags(__ios_flags::_S_oct);
+
/// Adds fill characters on the left (initial positions) of certain
/// generated output. (I.e., the thing you print is flush right.)
static const fmtflags right = fmtflags(__ios_flags::_S_right);
+
/// Generates floating-point output in scientific notation.
static const fmtflags scientific = fmtflags(__ios_flags::_S_scientific);
+
/// Generates a prefix indicating the numeric base of generated integer
/// output.
static const fmtflags showbase = fmtflags(__ios_flags::_S_showbase);
+
/// Generates a decimal-point character unconditionally in generated
/// floating-point output.
static const fmtflags showpoint = fmtflags(__ios_flags::_S_showpoint);
+
/// Generates a + sign in non-negative generated numeric output.
static const fmtflags showpos = fmtflags(__ios_flags::_S_showpos);
+
/// Skips leading white space before certain input operations.
static const fmtflags skipws = fmtflags(__ios_flags::_S_skipws);
+
/// Flushes output after each output operation.
static const fmtflags unitbuf = fmtflags(__ios_flags::_S_unitbuf);
+
/// Replaces certain lowercase letters with their uppercase equivalents
/// in generated output.
static const fmtflags uppercase = fmtflags(__ios_flags::_S_uppercase);
+
/// A mask of left|right|internal. Useful for the 2-arg form of @c setf.
static const fmtflags adjustfield = fmtflags(__ios_flags::_S_adjustfield);
+
/// A mask of dec|oct|hex. Useful for the 2-arg form of @c setf.
static const fmtflags basefield = fmtflags(__ios_flags::_S_basefield);
+
/// A mask of scientific|fixed. Useful for the 2-arg form of @c setf.
static const fmtflags floatfield = fmtflags(__ios_flags::_S_floatfield);
@@ -269,15 +285,19 @@ namespace std
* - goodbit
*/
typedef _Ios_Iostate iostate;
+
/// Indicates a loss of integrity in an input or output sequence (such
/// as an irrecoverable read error from a file).
static const iostate badbit = iostate(__ios_flags::_S_badbit);
+
/// Indicates that an input operation reached the end of an input sequence.
static const iostate eofbit = iostate(__ios_flags::_S_eofbit);
+
/// Indicates that an input operation failed to read the expected
/// characters, or that an output operation failed to generate the
/// desired characters.
static const iostate failbit = iostate(__ios_flags::_S_failbit);
+
/// Indicates all is well.
static const iostate goodbit = iostate(0);
@@ -296,19 +316,25 @@ namespace std
* - trunc
*/
typedef _Ios_Openmode openmode;
+
/// Seek to end before each write.
static const openmode app = openmode(__ios_flags::_S_app);
+
/// Open and seek to end immediately after opening.
static const openmode ate = openmode(__ios_flags::_S_ate);
+
/// Perform input and output in binary mode (as opposed to text mode).
/// This is probably not what you think it is; see
/// http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#3 and
/// http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#7 for more.
static const openmode binary = openmode(__ios_flags::_S_bin);
+
/// Open for input. Default for @c ifstream and fstream.
static const openmode in = openmode(__ios_flags::_S_in);
+
/// Open for output. Default for @c ofstream and fstream.
static const openmode out = openmode(__ios_flags::_S_out);
+
/// Open for input. Default for @c ofstream.
static const openmode trunc = openmode(__ios_flags::_S_trunc);
@@ -323,10 +349,13 @@ namespace std
* - end, equivalent to @c SEEK_END in the C standard library.
*/
typedef _Ios_Seekdir seekdir;
+
/// Request a seek relative to the beginning of the stream.
static const seekdir beg = seekdir(0);
+
/// Request a seek relative to the current position within the sequence.
static const seekdir cur = seekdir(SEEK_CUR);
+
/// Request a seek relative to the current end of the sequence.
static const seekdir end = seekdir(SEEK_END);
@@ -432,10 +461,6 @@ namespace std
// Members for locale and locale caching.
locale _M_ios_locale;
- // Cache of locale and facet data.
- // Cast this to __locale_cache<_CharT>*
- auto_ptr<__locale_cache_base> _M_locale_cache;
-
void
_M_init();
@@ -604,7 +629,7 @@ namespace std
/**
* @brief Locale access
- * @return The locale currently in effect.
+ * @return A copy of the current locale.
*
* If @c imbue(loc) has previously been called, then this function
* returns @c loc. Otherwise, it returns a copy of @c std::locale(),
@@ -613,6 +638,16 @@ namespace std
inline locale
getloc() const { return _M_ios_locale; }
+ /**
+ * @brief Locale access
+ * @return A reference to the current locale.
+ *
+ * Like getloc above, but returns a reference instead of
+ * generating a copy.
+ */
+ inline const locale&
+ _M_getloc() const { return _M_ios_locale; }
+
// [27.4.2.5] ios_base storage functions
/**
* @doctodo
@@ -642,11 +677,6 @@ namespace std
return __word._M_pword;
}
- // Access to the cache. Not safe to call until basic_ios::_M_init() has
- // happened.
- __locale_cache_base&
- _M_cache() { return *_M_locale_cache; }
-
// Destructor
/**
* Destroys local storage and
diff --git a/libstdc++-v3/include/bits/locale_classes.h b/libstdc++-v3/include/bits/locale_classes.h
index e7210f821fe..cfc11493216 100644
--- a/libstdc++-v3/include/bits/locale_classes.h
+++ b/libstdc++-v3/include/bits/locale_classes.h
@@ -71,7 +71,11 @@ namespace std
template<typename _Facet>
friend const _Facet&
use_facet(const locale&);
-
+
+ template<typename _Cache>
+ friend const _Cache&
+ __use_cache(const locale& __loc);
+
// Category values:
// NB: Order must match _S_facet_categories definition in locale.cc
static const category none = 0;
@@ -141,6 +145,12 @@ namespace std
// Current global locale
static _Impl* _S_global;
+ // Names of underlying locale categories.
+ // NB: locale::global() has to know how to modify all the
+ // underlying categories, not just the ones required by the C++
+ // standard.
+ static const char** _S_categories;
+
// Number of standard categories. For C++, these categories are
// collate, ctype, monetary, numeric, time, and messages. These
// directly correspond to ISO C99 macros LC_COLLATE, LC_CTYPE,
@@ -153,12 +163,6 @@ namespace std
// and LC_IDENTIFICATION.
static const size_t _S_categories_size = 6 + _GLIBCPP_NUM_CATEGORIES;
- // Names of underlying locale categories.
- // NB: locale::global() has to know how to modify all the
- // underlying categories, not just the ones required by the C++
- // standard.
- static const char** _S_categories;
-
explicit
locale(_Impl*) throw();
@@ -177,7 +181,107 @@ namespace std
};
- // Implementation object for locale
+ // 22.1.1.1.2 Class locale::facet
+ class locale::facet
+ {
+ private:
+ friend class locale;
+ friend class locale::_Impl;
+
+ mutable _Atomic_word _M_references;
+
+ protected:
+ // Contains data from the underlying "C" library for the classic locale.
+ static __c_locale _S_c_locale;
+
+ // String literal for the name of the classic locale.
+ static char _S_c_name[2];
+
+ explicit
+ facet(size_t __refs = 0) throw() : _M_references(__refs ? 1 : 0)
+ { }
+
+ virtual
+ ~facet();
+
+ static void
+ _S_create_c_locale(__c_locale& __cloc, const char* __s,
+ __c_locale __old = 0);
+
+ static __c_locale
+ _S_clone_c_locale(__c_locale& __cloc);
+
+ static void
+ _S_destroy_c_locale(__c_locale& __cloc);
+
+ private:
+ inline void
+ _M_add_reference() const throw()
+ { __atomic_add(&_M_references, 1); }
+
+ inline void
+ _M_remove_reference() const throw()
+ {
+ if (__exchange_and_add(&_M_references, -1) == 1)
+ {
+ try
+ { delete this; }
+ catch (...)
+ { }
+ }
+ }
+
+ facet(const facet&); // Not defined.
+
+ void
+ operator=(const facet&); // Not defined.
+ };
+
+
+ // 22.1.1.1.3 Class locale::id
+ class locale::id
+ {
+ private:
+ friend class locale;
+ friend class locale::_Impl;
+
+ template<typename _Facet>
+ friend const _Facet&
+ use_facet(const locale&);
+
+ template<typename _Facet>
+ friend bool
+ has_facet(const locale&) throw ();
+
+ // NB: There is no accessor for _M_index because it may be used
+ // before the constructor is run; the effect of calling a member
+ // function (even an inline) would be undefined.
+ mutable size_t _M_index;
+
+ // Last id number assigned.
+ static _Atomic_word _S_highwater;
+
+ void
+ operator=(const id&); // Not defined.
+
+ id(const id&); // Not defined.
+
+ public:
+ // NB: This class is always a static data member, and thus can be
+ // counted on to be zero-initialized.
+ id() { }
+
+ inline size_t
+ _M_id() const
+ {
+ if (!_M_index)
+ _M_index = 1 + __exchange_and_add(&_S_highwater, 1);
+ return _M_index - 1;
+ }
+ };
+
+
+ // Implementation object for locale.
class locale::_Impl
{
public:
@@ -186,18 +290,23 @@ namespace std
friend class locale::facet;
template<typename _Facet>
+ friend bool
+ has_facet(const locale&) throw();
+
+ template<typename _Facet>
friend const _Facet&
use_facet(const locale&);
- template<typename _Facet>
- friend bool
- has_facet(const locale&) throw();
+ template<typename _Cache>
+ friend const _Cache&
+ __use_cache(const locale& __loc);
private:
// Data Members.
_Atomic_word _M_references;
const facet** _M_facets;
size_t _M_facets_size;
+ const facet** _M_caches;
char** _M_names;
static const locale::id* const _S_id_ctype[];
static const locale::id* const _S_id_numeric[];
@@ -258,7 +367,14 @@ namespace std
template<typename _Facet>
inline void
_M_init_facet(_Facet* __facet)
- { _M_install_facet(&_Facet::id, __facet); }
+ { _M_install_facet(&_Facet::id, __facet); }
+
+ void
+ _M_install_cache(const facet* __cache, size_t __index)
+ {
+ __cache->_M_add_reference();
+ _M_caches[__index] = __cache;
+ }
};
template<typename _Facet>
@@ -274,93 +390,6 @@ namespace std
_M_impl->_M_names[__i] = __new;
}
}
-
-
- // 22.1.1.1.2 Class locale::facet
- class locale::facet
- {
- private:
- friend class locale;
- friend class locale::_Impl;
-
- mutable _Atomic_word _M_references;
-
- protected:
- // Contains data from the underlying "C" library for the classic locale.
- static __c_locale _S_c_locale;
-
- // String literal for the name of the classic locale.
- static char _S_c_name[2];
-
- explicit
- facet(size_t __refs = 0) throw();
-
- virtual
- ~facet();
-
- static void
- _S_create_c_locale(__c_locale& __cloc, const char* __s,
- __c_locale __old = 0);
-
- static __c_locale
- _S_clone_c_locale(__c_locale& __cloc);
-
- static void
- _S_destroy_c_locale(__c_locale& __cloc);
-
- private:
- void
- _M_add_reference() const throw();
-
- void
- _M_remove_reference() const throw();
-
- facet(const facet&); // Not defined.
-
- void
- operator=(const facet&); // Not defined.
- };
-
-
- // 22.1.1.1.3 Class locale::id
- class locale::id
- {
- private:
- friend class locale;
- friend class locale::_Impl;
- template<typename _Facet>
- friend const _Facet&
- use_facet(const locale&);
- template<typename _Facet>
- friend bool
- has_facet(const locale&) throw ();
-
- // NB: There is no accessor for _M_index because it may be used
- // before the constructor is run; the effect of calling a member
- // function (even an inline) would be undefined.
- mutable size_t _M_index;
-
- // Last id number assigned.
- static _Atomic_word _S_highwater;
-
- void
- operator=(const id&); // Not defined.
-
- id(const id&); // Not defined.
-
- public:
- // NB: This class is always a static data member, and thus can be
- // counted on to be zero-initialized.
- id();
-
- inline size_t
- _M_id() const
- {
- if (!_M_index)
- _M_index = 1 + __exchange_and_add(&_S_highwater, 1);
- return _M_index - 1;
- }
- };
} // namespace std
#endif
diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h
index a0060e8d591..72141f1983e 100644
--- a/libstdc++-v3/include/bits/locale_facets.h
+++ b/libstdc++-v3/include/bits/locale_facets.h
@@ -574,6 +574,96 @@ namespace std
_S_format_float(const ios_base& __io, char* __fptr, char __mod);
};
+ template<typename _CharT>
+ struct __numpunct_cache : public locale::facet
+ {
+ // Types:
+ typedef _CharT char_type;
+
+ const char* _M_grouping;
+ bool _M_use_grouping;
+ const char_type* _M_truename;
+ const char_type* _M_falsename;
+ char_type _M_decimal_point;
+ char_type _M_thousands_sep;
+
+ // A list of valid numeric literals for output: in the standard
+ // "C" locale, this is "-+xX0123456789abcdef0123456789ABCDEF".
+ // This array contains the chars after having been passed
+ // through the current locale's ctype<_CharT>.widen().
+ _CharT _M_atoms_out[__num_base::_S_oend + 1];
+
+ // A list of valid numeric literals for output: in the standard
+ // "C" locale, this is "0123456789eEabcdfABCDF"
+ // This array contains the chars after having been passed
+ // through the current locale's ctype<_CharT>.widen().
+ _CharT _M_atoms_in[__num_base::_S_iend + 1];
+
+ bool _M_allocated;
+
+ __numpunct_cache(size_t __refs = 0) : locale::facet(__refs),
+ _M_grouping(NULL), _M_use_grouping(false), _M_truename(NULL),
+ _M_falsename(NULL), _M_decimal_point(char_type()),
+ _M_thousands_sep(char_type()), _M_allocated(false)
+ { }
+
+ ~__numpunct_cache();
+
+ void
+ _M_cache(const locale& __loc);
+ };
+
+ template<typename _CharT>
+ void
+ __numpunct_cache<_CharT>::_M_cache(const locale& __loc)
+ {
+ const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
+ string __grouping = __np.grouping();
+ char* __group = new char[__grouping.length() + 1];
+ __grouping.copy(__group, __grouping.length());
+ __group[__grouping.length()] = _CharT();
+ _M_grouping = __group;
+
+ _M_use_grouping = __grouping.length() != 0 && __grouping.data()[0] != 0;
+
+ typedef basic_string<_CharT> __string_type;
+
+ __string_type __true = __np.truename();
+ _CharT* __truename = new _CharT[__true.length() + 1];
+ __true.copy(__truename, __true.length());
+ __truename[__true.length()] = _CharT();
+ _M_truename = __truename;
+
+ __string_type __false = __np.falsename();
+ _CharT* __falsename = new _CharT[__false.length() + 1];
+ __false.copy(__falsename, __false.length());
+ __falsename[__false.length()] = _CharT();
+ _M_falsename = __falsename;
+
+ _M_decimal_point = __np.decimal_point();
+ _M_thousands_sep = __np.thousands_sep();
+
+ const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
+ __ct.widen(__num_base::_S_atoms_out,
+ __num_base::_S_atoms_out + __num_base::_S_oend, _M_atoms_out);
+ _M_atoms_out[__num_base::_S_oend] = _CharT();
+ __ct.widen(__num_base::_S_atoms_in,
+ __num_base::_S_atoms_in + __num_base::_S_iend, _M_atoms_in);
+ _M_atoms_in[__num_base::_S_iend] = _CharT();
+
+ _M_allocated = true;
+ }
+
+ template<typename _CharT>
+ __numpunct_cache<_CharT>::~__numpunct_cache()
+ {
+ if (_M_allocated)
+ {
+ delete [] _M_grouping;
+ delete [] _M_truename;
+ delete [] _M_falsename;
+ }
+ }
template<typename _CharT>
class numpunct : public locale::facet
@@ -582,23 +672,26 @@ namespace std
// Types:
typedef _CharT char_type;
typedef basic_string<_CharT> string_type;
+ typedef __numpunct_cache<_CharT> __cache_type;
+
+ protected:
+ __cache_type* _M_data;
+ public:
static locale::id id;
- private:
- char_type _M_decimal_point;
- char_type _M_thousands_sep;
- const char* _M_grouping;
- const char_type* _M_truename;
- const char_type* _M_falsename;
+ explicit
+ numpunct(size_t __refs = 0) : facet(__refs), _M_data(NULL)
+ { _M_initialize_numpunct(); }
- public:
explicit
- numpunct(size_t __refs = 0) : locale::facet(__refs)
+ numpunct(__cache_type* __cache, size_t __refs = 0)
+ : facet(__refs), _M_data(__cache)
{ _M_initialize_numpunct(); }
explicit
- numpunct(__c_locale __cloc, size_t __refs = 0) : locale::facet(__refs)
+ numpunct(__c_locale __cloc, size_t __refs = 0)
+ : locale::facet(__refs), _M_data(NULL)
{ _M_initialize_numpunct(__cloc); }
char_type
@@ -627,23 +720,23 @@ namespace std
virtual char_type
do_decimal_point() const
- { return _M_decimal_point; }
+ { return _M_data->_M_decimal_point; }
virtual char_type
do_thousands_sep() const
- { return _M_thousands_sep; }
+ { return _M_data->_M_thousands_sep; }
virtual string
do_grouping() const
- { return _M_grouping; }
+ { return _M_data->_M_grouping; }
virtual string_type
do_truename() const
- { return _M_truename; }
+ { return _M_data->_M_truename; }
virtual string_type
do_falsename() const
- { return _M_falsename; }
+ { return _M_data->_M_falsename; }
// For use at construction time only.
void
@@ -1928,75 +2021,6 @@ namespace std
inline _CharT
tolower(_CharT __c, const locale& __loc)
{ return use_facet<ctype<_CharT> >(__loc).tolower(__c); }
-
-
- // __locale_cache holds the information extracted from the
- // numpunct<> and moneypunct<> facets in a form optimized for
- // parsing and formatting. It is stored as an
- // auto_ptr<__locale_cache_base> member of ios_base and directly
- // accessed via a casting to the derived __locale_cache<_CharT> in
- // parameterized facets.
- // The intent twofold: to avoid the costs of creating a locale
- // object and to avoid calling the virtual functions in a locale's
- // facet to look up data.
- class __locale_cache_base
- {
- public:
- virtual
- ~__locale_cache_base() { }
- };
-
- template<typename _CharT>
- class __locale_cache : public __locale_cache_base
- {
- // Types:
- typedef _CharT char_type;
- typedef char_traits<_CharT> traits_type;
- typedef basic_string<_CharT> string_type;
-
- public:
- // Data Members:
-
- // A list of valid numeric literals: for the standard "C"
- // locale, this is "-+xX0123456789abcdef0123456789ABCDEF". This
- // array contains the chars after having been passed through the
- // current locale's ctype<_CharT>.widen().
- _CharT _M_literals[__num_base::_S_oend];
-
- // The sign used to separate decimal values: for standard US
- // locales, this would usually be: "." Abstracted from
- // numpunct::decimal_point().
- _CharT _M_decimal_point;
-
- // The sign used to separate groups of digits into smaller
- // strings that the eye can parse with less difficulty: for
- // standard US locales, this would usually be: "," Abstracted
- // from numpunct::thousands_sep().
- _CharT _M_thousands_sep;
-
- // However the US's "false" and "true" are translated. From
- // numpunct::truename() and numpunct::falsename(), respectively.
- string_type _M_truename;
- string_type _M_falsename;
-
- // If we are checking groupings. This should be equivalent to
- // numpunct::groupings().size() != 0
- bool _M_use_grouping;
-
- // If we are using numpunct's groupings, this is the current
- // grouping string in effect (from numpunct::grouping()).
- string _M_grouping;
-
- __locale_cache() : _M_use_grouping(false)
- { };
-
- __locale_cache&
- operator=(const __locale_cache& __lc);
-
- // Make sure the cache is built before the first use.
- void
- _M_init(const locale&);
- };
} // namespace std
#endif
diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc
index 624018285d8..5081591c1cb 100644
--- a/libstdc++-v3/include/bits/locale_facets.tcc
+++ b/libstdc++-v3/include/bits/locale_facets.tcc
@@ -86,6 +86,21 @@ namespace std
return static_cast<const _Facet&>(*__facets[__i]);
}
+ // Routine to access a cache for the facet. If the cache didn't
+ // exist before, it gets constructed on the fly.
+ template<typename _Facet>
+ const _Facet&
+ __use_cache(const locale& __loc);
+
+ template<>
+ const __numpunct_cache<char>&
+ __use_cache(const locale& __loc);
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+ template<>
+ const __numpunct_cache<wchar_t>&
+ __use_cache(const locale& __loc);
+#endif
// Stage 1: Determine a conversion specifier.
template<typename _CharT, typename _InIter>
@@ -768,11 +783,12 @@ namespace std
_M_convert_int(_OutIter __s, ios_base& __io, _CharT __fill,
_ValueT __v) const
{
- typedef __locale_cache<_CharT> __cache_type;
- __cache_type& __lc = static_cast<__cache_type&>(__io._M_cache());
- _CharT* __lit = __lc._M_literals;
+ typedef typename numpunct<_CharT>::__cache_type __cache_type;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type& __lc = __use_cache<__cache_type>(__loc);
+ const _CharT* __lit = __lc._M_atoms_out;
- // Long enough to hold hex, dec, and octal representations.
+ // Long enough to hold hex, dec, and octal representations.
int __ilen = 4 * sizeof(_ValueT);
_CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
* __ilen));
@@ -872,8 +888,9 @@ namespace std
else if (__prec < static_cast<streamsize>(0))
__prec = static_cast<streamsize>(6);
- typedef __locale_cache<_CharT> __cache_type;
- __cache_type& __lc = static_cast<__cache_type&>(__io._M_cache());
+ typedef typename numpunct<_CharT>::__cache_type __cache_type;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type& __lc = __use_cache<__cache_type>(__loc);
// [22.2.2.2.2] Stage 1, numeric conversion to character.
int __len;
@@ -918,7 +935,6 @@ namespace std
// [22.2.2.2.2] Stage 2, convert to char_type, using correct
// numpunct.decimal_point() values for '.' and adding grouping.
- const locale __loc = __io.getloc();
const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
_CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
@@ -974,8 +990,10 @@ namespace std
}
else
{
- typedef __locale_cache<_CharT> __cache_type;
- __cache_type& __lc = static_cast<__cache_type&>(__io._M_cache());
+ typedef typename numpunct<_CharT>::__cache_type __cache_type;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type& __lc = __use_cache<__cache_type>(__loc);
+
typedef basic_string<_CharT> __string_type;
__string_type __name;
if (__v)
@@ -2273,31 +2291,6 @@ namespace std
return __s;
}
- // Generic definition, locale cache initialization.
- template<typename _CharT>
- void
- __locale_cache<_CharT>::_M_init(const locale& __loc)
- {
- if (__builtin_expect(has_facet<numpunct<_CharT> >(__loc), true))
- {
- const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
- _M_falsename = __np.falsename();
- _M_truename = __np.truename();
- _M_thousands_sep = __np.thousands_sep();
- _M_decimal_point = __np.decimal_point();
- _M_grouping = __np.grouping();
- _M_use_grouping = _M_grouping.size() != 0
- && _M_grouping.data()[0] != 0;
- }
- if (__builtin_expect(has_facet<ctype<_CharT> >(__loc), true))
- {
- const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
- __ct.widen(__num_base::_S_atoms_out,
- __num_base::_S_atoms_out + __num_base::_S_oend,
- _M_literals);
- }
- }
-
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
diff --git a/libstdc++-v3/include/bits/sstream.tcc b/libstdc++-v3/include/bits/sstream.tcc
index 49a5aa0106e..f5b4c578071 100644
--- a/libstdc++-v3/include/bits/sstream.tcc
+++ b/libstdc++-v3/include/bits/sstream.tcc
@@ -49,11 +49,11 @@ namespace std
int_type __ret = traits_type::eof();
const bool __testeof = traits_type::eq_int_type(__c, __ret);
- if (this->_M_in_beg < this->_M_in_cur)
+ if (this->eback() < this->gptr())
{
const bool __testeq = traits_type::eq(traits_type::to_char_type(__c),
- this->_M_in_cur[-1]);
- --this->_M_in_cur;
+ this->gptr()[-1]);
+ this->gbump(-1);
// Try to put back __c into input sequence in one of three ways.
// Order these tests done in is unspecified by the standard.
@@ -63,7 +63,7 @@ namespace std
__ret = traits_type::not_eof(__c);
else
{
- *this->_M_in_cur = traits_type::to_char_type(__c);
+ *this->gptr() = traits_type::to_char_type(__c);
__ret = __c;
}
}
@@ -88,9 +88,9 @@ namespace std
// experimental value (pronounced "arbitrary" in some of the
// hipper english-speaking countries), and can be changed to
// suit particular needs.
- __size_type __len = std::max(__size_type(_M_string.capacity() + 1),
- __size_type(512));
- const bool __testput = this->_M_out_cur < this->_M_out_end;
+ const __size_type __len = std::max(__size_type(_M_string.capacity() + 1),
+ __size_type(512));
+ const bool __testput = this->pptr() < this->epptr();
if (__builtin_expect(!__testput && __len > _M_string.max_size(), false))
return traits_type::eof();
@@ -103,19 +103,38 @@ namespace std
// growth policy builtin into basic_string.
__string_type __tmp;
__tmp.reserve(__len);
- __tmp.assign(_M_string.data(),
- this->_M_out_end - this->_M_out_beg);
+ __tmp.assign(_M_string.data(), this->epptr() - this->pbase());
_M_string.swap(__tmp);
- // Just to be sure...
- _M_string.reserve(__len);
_M_sync(const_cast<char_type*>(_M_string.data()),
- this->_M_in_cur - this->_M_in_beg,
- this->_M_out_cur - this->_M_out_beg);
+ this->gptr() - this->eback(),
+ this->pptr() - this->pbase());
}
return this->sputc(traits_type::to_char_type(__c));
}
template <class _CharT, class _Traits, class _Alloc>
+ typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
+ basic_stringbuf<_CharT, _Traits, _Alloc>::
+ _M_underflow(bool __bump)
+ {
+ int_type __ret = traits_type::eof();
+ const bool __testin = this->_M_mode & ios_base::in;
+ if (__testin)
+ {
+ // Update egptr() to match the actual string end.
+ _M_update_egptr();
+
+ if (this->gptr() < this->egptr())
+ {
+ __ret = traits_type::to_int_type(*this->gptr());
+ if (__bump)
+ this->gbump(1);
+ }
+ }
+ return __ret;
+ }
+
+ template <class _CharT, class _Traits, class _Alloc>
typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
basic_stringbuf<_CharT, _Traits, _Alloc>::
seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode)
@@ -129,35 +148,32 @@ namespace std
if (_M_string.capacity() && (__testin || __testout || __testboth))
{
- char_type* __beg = __testin ? this->_M_in_beg : this->_M_out_beg;
+ char_type* __beg = __testin ? this->eback() : this->pbase();
+
+ _M_update_egptr();
off_type __newoffi = 0;
off_type __newoffo = 0;
if (__way == ios_base::cur)
{
- __newoffi = this->_M_in_cur - __beg;
- __newoffo = this->_M_out_cur - __beg;
+ __newoffi = this->gptr() - __beg;
+ __newoffo = this->pptr() - __beg;
}
else if (__way == ios_base::end)
- {
- __newoffi = this->_M_in_end - __beg;
- // Due to the resolution of DR169, ios_base::end
- // is this->_M_out_lim, not _M_out_end.
- __newoffo = this->_M_out_lim - __beg;
- }
+ __newoffo = __newoffi = this->egptr() - __beg;
if ((__testin || __testboth)
&& __newoffi + __off >= 0
- && this->_M_in_end - __beg >= __newoffi + __off)
+ && this->egptr() - __beg >= __newoffi + __off)
{
- this->_M_in_cur = __beg + __newoffi + __off;
+ this->gbump((__beg + __newoffi + __off) - this->gptr());
__ret = pos_type(__newoffi);
}
if ((__testout || __testboth)
&& __newoffo + __off >= 0
- && this->_M_out_lim - __beg >= __newoffo + __off)
+ && this->egptr() - __beg >= __newoffo + __off)
{
- _M_move_out_cur(__newoffo + __off - (this->_M_out_cur - __beg));
+ this->pbump((__beg + __newoffo + __off) - this->pptr());
__ret = pos_type(__newoffo);
}
}
@@ -174,34 +190,20 @@ namespace std
if (_M_string.capacity())
{
off_type __pos = __sp; // Use streamoff operator to do conversion.
- char_type* __beg = NULL;
- char_type* __end = NULL;
const bool __testin = (ios_base::in & this->_M_mode & __mode) != 0;
const bool __testout = (ios_base::out & this->_M_mode & __mode) != 0;
+ char_type* __beg = __testin ? this->eback() : this->pbase();
- // NB: Ordered.
- bool __testposi = false;
- bool __testposo = false;
- if (__testin)
- {
- __beg = this->_M_in_beg;
- __end = this->_M_in_end;
- if (0 <= __pos && __pos <= __end - __beg)
- __testposi = true;
- }
- if (__testout)
- {
- __beg = this->_M_out_beg;
- __end = this->_M_out_lim;
- if (0 <= __pos && __pos <= __end - __beg)
- __testposo = true;
- }
- if (__testposi || __testposo)
+ _M_update_egptr();
+
+ const bool __testpos = 0 <= __pos
+ && __pos <= this->egptr() - __beg;
+ if ((__testin || __testout) && __testpos)
{
- if (__testposi)
- this->_M_in_cur = this->_M_in_beg + __pos;
- if (__testposo)
- _M_move_out_cur((__pos) - (this->_M_out_cur - __beg));
+ if (__testin)
+ this->gbump((__beg + __pos) - this->gptr());
+ if (__testout)
+ this->pbump((__beg + __pos) - this->pptr());
__ret = pos_type(off_type(__pos));
}
}
diff --git a/libstdc++-v3/include/bits/streambuf.tcc b/libstdc++-v3/include/bits/streambuf.tcc
index f6a96e85581..a16169ad5ef 100644
--- a/libstdc++-v3/include/bits/streambuf.tcc
+++ b/libstdc++-v3/include/bits/streambuf.tcc
@@ -40,72 +40,6 @@
namespace std
{
template<typename _CharT, typename _Traits>
- typename basic_streambuf<_CharT, _Traits>::int_type
- basic_streambuf<_CharT, _Traits>::
- sbumpc()
- {
- int_type __ret;
- if (_M_in_cur < _M_in_end)
- {
- __ret = traits_type::to_int_type(*this->_M_in_cur);
- _M_move_in_cur(1);
- }
- else
- __ret = this->uflow();
- return __ret;
- }
-
- template<typename _CharT, typename _Traits>
- typename basic_streambuf<_CharT, _Traits>::int_type
- basic_streambuf<_CharT, _Traits>::
- sputbackc(char_type __c)
- {
- int_type __ret;
- const bool __testpos = _M_in_beg < _M_in_cur;
- if (!__testpos || !traits_type::eq(__c, this->_M_in_cur[-1]))
- __ret = this->pbackfail(traits_type::to_int_type(__c));
- else
- {
- _M_move_in_cur(-1);
- __ret = traits_type::to_int_type(*this->_M_in_cur);
- }
- return __ret;
- }
-
- template<typename _CharT, typename _Traits>
- typename basic_streambuf<_CharT, _Traits>::int_type
- basic_streambuf<_CharT, _Traits>::
- sungetc()
- {
- int_type __ret;
- if (_M_in_beg < _M_in_cur)
- {
- _M_move_in_cur(-1);
- __ret = traits_type::to_int_type(*_M_in_cur);
- }
- else
- __ret = this->pbackfail();
- return __ret;
- }
-
- template<typename _CharT, typename _Traits>
- typename basic_streambuf<_CharT, _Traits>::int_type
- basic_streambuf<_CharT, _Traits>::
- sputc(char_type __c)
- {
- int_type __ret;
- if (_M_out_cur < _M_out_end)
- {
- *_M_out_cur = __c;
- _M_move_out_cur(1);
- __ret = traits_type::to_int_type(__c);
- }
- else
- __ret = this->overflow(traits_type::to_int_type(__c));
- return __ret;
- }
-
- template<typename _CharT, typename _Traits>
streamsize
basic_streambuf<_CharT, _Traits>::
xsgetn(char_type* __s, streamsize __n)
@@ -113,15 +47,15 @@ namespace std
streamsize __ret = 0;
while (__ret < __n)
{
- const size_t __buf_len = _M_in_end - _M_in_cur;
+ const size_t __buf_len = this->egptr() - this->gptr();
if (__buf_len)
{
const size_t __remaining = __n - __ret;
const size_t __len = std::min(__buf_len, __remaining);
- traits_type::copy(__s, _M_in_cur, __len);
+ traits_type::copy(__s, this->gptr(), __len);
__ret += __len;
__s += __len;
- _M_move_in_cur(__len);
+ this->gbump(__len);
}
if (__ret < __n)
@@ -147,15 +81,15 @@ namespace std
streamsize __ret = 0;
while (__ret < __n)
{
- const size_t __buf_len = _M_out_end - _M_out_cur;
+ const size_t __buf_len = this->epptr() - this->pptr();
if (__buf_len)
{
const size_t __remaining = __n - __ret;
const size_t __len = std::min(__buf_len, __remaining);
- traits_type::copy(_M_out_cur, __s, __len);
+ traits_type::copy(this->pptr(), __s, __len);
__ret += __len;
__s += __len;
- _M_move_out_cur(__len);
+ this->pbump(__len);
}
if (__ret < __n)
@@ -189,12 +123,12 @@ namespace std
typename _Traits::int_type __c = __sbin->sgetc();
while (!_Traits::eq_int_type(__c, _Traits::eof()))
{
- const size_t __n = __sbin->_M_in_end - __sbin->_M_in_cur;
+ const size_t __n = __sbin->egptr() - __sbin->gptr();
if (__n > 1)
{
- const size_t __wrote = __sbout->sputn(__sbin->_M_in_cur,
+ const size_t __wrote = __sbout->sputn(__sbin->gptr(),
__n);
- __sbin->_M_move_in_cur(__wrote);
+ __sbin->gbump(__wrote);
__ret += __wrote;
if (__wrote < __n)
break;
diff --git a/libstdc++-v3/include/ext/mt_allocator.h b/libstdc++-v3/include/ext/mt_allocator.h
index 1e95b55f467..cd3b273ad91 100644
--- a/libstdc++-v3/include/ext/mt_allocator.h
+++ b/libstdc++-v3/include/ext/mt_allocator.h
@@ -613,13 +613,15 @@ namespace __gnu_cxx
if (!_S_bin[bin].mutex)
__throw_bad_alloc();
- /*
- * This is not only ugly - it's extremly non-portable!
- * However gthr.h does not currently provide a
- * __gthread_mutex_init() call. The correct solution to
- * this problem needs to be discussed.
- */
- pthread_mutex_init(_S_bin[bin].mutex, NULL);
+#ifdef __GTHREAD_MUTEX_INIT
+ {
+ // Do not copy a POSIX/gthr mutex once in use.
+ __gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT;
+ *_S_bin[bin].mutex = __tmp;
+ }
+#else
+ { __GTHREAD_MUTEX_INIT_FUNCTION (_S_bin[bin].mutex); }
+#endif
#endif
for (size_t thread = 0; thread <= _S_max_threads; thread++)
diff --git a/libstdc++-v3/include/ext/stdio_filebuf.h b/libstdc++-v3/include/ext/stdio_filebuf.h
index 43ef34dec72..574a62b8160 100644
--- a/libstdc++-v3/include/ext/stdio_filebuf.h
+++ b/libstdc++-v3/include/ext/stdio_filebuf.h
@@ -127,7 +127,9 @@ namespace __gnu_cxx
this->_M_mode = __mode;
this->_M_buf_size = __size;
_M_allocate_internal_buffer();
- _M_set_buffer(0);
+ this->_M_reading = false;
+ this->_M_writing = false;
+ _M_set_buffer(-1);
}
}
@@ -142,7 +144,9 @@ namespace __gnu_cxx
this->_M_mode = __mode;
this->_M_buf_size = __size;
_M_allocate_internal_buffer();
- _M_set_buffer(0);
+ this->_M_reading = false;
+ this->_M_writing = false;
+ _M_set_buffer(-1);
}
}
} // namespace __gnu_cxx
diff --git a/libstdc++-v3/include/std/std_fstream.h b/libstdc++-v3/include/std/std_fstream.h
index 7cc0dbd8e1f..605fad22b3e 100644
--- a/libstdc++-v3/include/std/std_fstream.h
+++ b/libstdc++-v3/include/std/std_fstream.h
@@ -137,19 +137,18 @@ namespace std
* @endif
*/
bool _M_buf_allocated;
-
+
+ // _M_reading == false && _M_writing == false for 'uncommitted' mode;
+ // _M_reading == true for 'read' mode;
+ // _M_writing == true for 'write' mode;
+ //
+ // NB: _M_reading == true && _M_writing == true is unused.
+ bool _M_reading;
+ bool _M_writing;
+
// XXX Needed?
bool _M_last_overflowed;
- // The position in the buffer corresponding to the external file
- // pointer.
- /**
- * @if maint
- * @doctodo
- * @endif
- */
- char_type* _M_filepos;
-
//@{
/**
* @if maint
@@ -175,8 +174,8 @@ namespace std
{
if (!_M_pback_init)
{
- _M_pback_cur_save = this->_M_in_cur;
- _M_pback_end_save = this->_M_in_end;
+ _M_pback_cur_save = this->gptr();
+ _M_pback_end_save = this->egptr();
this->setg(&_M_pback, &_M_pback, &_M_pback + 1);
_M_pback_init = true;
}
@@ -191,7 +190,7 @@ namespace std
if (_M_pback_init)
{
// Length _M_in_cur moved in the pback buffer.
- _M_pback_cur_save += this->_M_in_cur != this->_M_in_beg;
+ _M_pback_cur_save += this->gptr() != this->eback();
this->setg(this->_M_buf, _M_pback_cur_save, _M_pback_end_save);
_M_pback_init = false;
}
@@ -365,23 +364,23 @@ namespace std
sync()
{
int __ret = 0;
- const bool __testput = this->_M_out_beg < this->_M_out_lim;
// Make sure that the internal buffer resyncs its idea of
// the file position with the external file.
- if (__testput)
+ // NB: _M_file.sync() will be called within.
+ if (this->pbase() < this->pptr())
{
- // Need to restore current position after the write.
- const off_type __off = this->_M_out_cur - this->_M_out_lim;
-
- // _M_file.sync() will be called within.
- if (traits_type::eq_int_type(this->overflow(), traits_type::eof()))
+ int_type __tmp = this->overflow();
+ if (traits_type::eq_int_type(__tmp, traits_type::eof()))
__ret = -1;
- else if (__off)
- _M_file.seekoff(__off, ios_base::cur);
+ else
+ {
+ _M_set_buffer(-1);
+ _M_reading = false;
+ _M_writing = false;
+ }
}
- else
- _M_file.sync();
+
_M_last_overflowed = false;
return __ret;
}
@@ -398,9 +397,10 @@ namespace std
streamsize __ret = 0;
if (this->_M_pback_init)
{
- if (__n && this->_M_in_cur == this->_M_in_beg)
+ if (__n && this->gptr() == this->eback())
{
- *__s++ = *this->_M_in_cur++;
+ *__s++ = *this->gptr();
+ this->gbump(1);
__ret = 1;
}
_M_destroy_pback();
@@ -427,10 +427,13 @@ namespace std
_M_output_unshift();
// This function sets the pointers of the internal buffer, both get
- // and put areas. Typically, __off == _M_in_end - _M_in_beg upon
- // _M_underflow; __off == 0 upon overflow, seekoff, open, setbuf.
+ // and put areas. Typically:
+ //
+ // __off == egptr() - eback() upon underflow/uflow ('read' mode);
+ // __off == 0 upon overflow ('write' mode);
+ // __off == -1 upon open, setbuf, seekoff/pos ('uncommitted' mode).
//
- // NB: _M_out_end - _M_out_beg == _M_buf_size - 1, since _M_buf_size
+ // NB: epptr() - pbase() == _M_buf_size - 1, since _M_buf_size
// reflects the actual allocated memory and the last cell is reserved
// for the overflow char of a full put area.
void
@@ -439,14 +442,15 @@ namespace std
const bool __testin = this->_M_mode & ios_base::in;
const bool __testout = this->_M_mode & ios_base::out;
- if (__testin)
+ if (__testin && __off > 0)
this->setg(this->_M_buf, this->_M_buf, this->_M_buf + __off);
- if (__testout && this->_M_buf_size > 1)
- {
- this->setp(this->_M_buf, this->_M_buf + this->_M_buf_size - 1);
- this->_M_out_lim += __off;
- }
- _M_filepos = this->_M_buf + __off;
+ else
+ this->setg(this->_M_buf, this->_M_buf, this->_M_buf);
+
+ if (__testout && __off == 0 && this->_M_buf_size > 1 )
+ this->setp(this->_M_buf, this->_M_buf + this->_M_buf_size - 1);
+ else
+ this->setp(NULL, NULL);
}
};
diff --git a/libstdc++-v3/include/std/std_sstream.h b/libstdc++-v3/include/std/std_sstream.h
index ca7b1e5484b..687e26ad07e 100644
--- a/libstdc++-v3/include/std/std_sstream.h
+++ b/libstdc++-v3/include/std/std_sstream.h
@@ -133,11 +133,17 @@ namespace std
__string_type
str() const
{
- __string_type __ret = _M_string;
const bool __testout = this->_M_mode & ios_base::out;
- if (__testout && this->_M_out_beg < this->_M_out_lim)
- __ret = __string_type(this->_M_out_beg, this->_M_out_lim);
- return __ret;
+ if (__testout)
+ {
+ // The current egptr() may not be the actual string end.
+ if (this->pptr() > this->egptr())
+ return __string_type(this->pbase(), this->pptr());
+ else
+ return __string_type(this->pbase(), this->egptr());
+ }
+ else
+ return _M_string;
}
/**
@@ -173,18 +179,18 @@ namespace std
_M_sync(const_cast<char_type*>(_M_string.data()), 0, __len);
}
- // Overridden virtual functions:
+ int_type
+ _M_underflow(bool __bump);
+
// [documentation is inherited]
virtual int_type
underflow()
- {
- int_type __ret;
- if (this->_M_in_cur < this->_M_in_end)
- __ret = traits_type::to_int_type(*this->_M_in_cur);
- else
- __ret = traits_type::eof();
- return __ret;
- }
+ { return _M_underflow(false); }
+
+ // [documentation is inherited]
+ virtual int_type
+ uflow()
+ { return _M_underflow(true); }
// [documentation is inherited]
virtual int_type
@@ -208,12 +214,12 @@ namespace std
virtual __streambuf_type*
setbuf(char_type* __s, streamsize __n)
{
- if (__s && __n)
+ if (__s && __n >= 0)
{
// This is implementation-defined behavior, and assumes
- // that an external char_type array of length (__s + __n)
- // exists and has been pre-allocated. If this is not the
- // case, things will quickly blow up.
+ // that an external char_type array of length __n exists
+ // and has been pre-allocated. If this is not the case,
+ // things will quickly blow up.
// Step 1: Destroy the current internal array.
_M_string = __string_type(__s, __n);
@@ -245,23 +251,42 @@ namespace std
* @doctodo
* @endif
*/
- virtual void
+ void
_M_sync(char_type* __base, __size_type __i, __size_type __o)
{
const bool __testin = this->_M_mode & ios_base::in;
const bool __testout = this->_M_mode & ios_base::out;
- __size_type __len = _M_string.size();
+ const __size_type __len = _M_string.size();
if (__testin)
this->setg(__base, __base + __i, __base + __len);
if (__testout)
{
this->setp(__base, __base + _M_string.capacity());
- // _M_out_lim points to the string end.
- this->_M_out_lim += __len;
- this->_M_out_cur += __o;
+ this->pbump(__o);
+ // We need a pointer to the string end anyway, even when
+ // !__testin: in that case, however, for the correct
+ // functioning of the streambuf inlines all the get area
+ // pointers must be identical.
+ if (!__testin)
+ this->setg(__base + __len, __base + __len, __base + __len);
}
}
+
+ // Internal function for correctly updating egptr() to the actual
+ // string end.
+ void
+ _M_update_egptr()
+ {
+ const bool __testin = this->_M_mode & ios_base::in;
+ const bool __testout = this->_M_mode & ios_base::out;
+
+ if (__testout && this->pptr() > this->egptr())
+ if (__testin)
+ this->setg(this->eback(), this->gptr(), this->pptr());
+ else
+ this->setg(this->pptr(), this->pptr(), this->pptr());
+ }
};
diff --git a/libstdc++-v3/include/std/std_streambuf.h b/libstdc++-v3/include/std/std_streambuf.h
index 20928078d9d..bf6aa428280 100644
--- a/libstdc++-v3/include/std/std_streambuf.h
+++ b/libstdc++-v3/include/std/std_streambuf.h
@@ -176,25 +176,6 @@ namespace std
char_type* _M_out_cur; // Current put area.
char_type* _M_out_end; // End of put area.
- //@{
- /**
- * @if maint
- * setp (and _M_set_buffer(0) in basic_filebuf) set it equal to
- * _M_out_beg, then at each put operation it may be moved
- * forward (toward _M_out_end) by _M_move_out_cur.
- * @endif
- */
- char_type* _M_out_lim; // End limit of used put area.
- //@}
-
- /**
- * @if maint
- * True iff _M_in_* and _M_out_* buffers should always point to
- * the same place. True for fstreams, false for sstreams.
- * @endif
- */
- bool _M_buf_unified;
-
/**
* @if maint
* Place to stash in || out || in | out settings for current streambuf.
@@ -216,48 +197,11 @@ namespace std
*/
fpos<__state_type> _M_pos;
- // Correctly sets the _M_in_cur pointer, and bumps the
- // _M_out_cur pointer as well if necessary.
- void
- _M_move_in_cur(off_type __n) // argument needs to be +-
- {
- const bool __testout = _M_out_cur;
- _M_in_cur += __n;
- if (__testout && _M_buf_unified)
- _M_out_cur += __n;
- }
-
- // Correctly sets the _M_out_cur pointer, and bumps the
- // appropriate _M_out_lim and _M_in_end pointers as well. Necessary
- // for the un-tied stringbufs, in in|out mode.
- // Invariant:
- // __n + _M_out_[cur, lim] <= _M_out_end
- // Assuming all _M_out_[beg, cur, lim] pointers are operating on
- // the same range:
- // _M_out_beg <= _M_*_ <= _M_out_end
- void
- _M_move_out_cur(off_type __n) // argument needs to be +-
- {
- const bool __testin = _M_in_cur;
-
- _M_out_cur += __n;
- if (__testin && _M_buf_unified)
- _M_in_cur += __n;
- if (_M_out_cur > _M_out_lim)
- {
- _M_out_lim = _M_out_cur;
- // NB: in | out buffers drag the _M_in_end pointer along...
- if (__testin)
- _M_in_end += __n;
- }
- }
-
public:
/// Destructor deallocates no buffer space.
virtual
~basic_streambuf()
{
- _M_buf_unified = false;
_M_mode = ios_base::openmode(0);
}
@@ -328,7 +272,7 @@ namespace std
streamsize
in_avail()
{
- const streamsize __ret = _M_in_end - _M_in_cur;
+ const streamsize __ret = this->egptr() - this->gptr();
return __ret ? __ret : this->showmanyc();
}
@@ -343,7 +287,8 @@ namespace std
snextc()
{
int_type __ret = traits_type::eof();
- if (!traits_type::eq_int_type(this->sbumpc(), __ret))
+ if (__builtin_expect(!traits_type::eq_int_type(this->sbumpc(),
+ __ret), true))
__ret = this->sgetc();
return __ret;
}
@@ -357,7 +302,18 @@ namespace std
* @c uflow().
*/
int_type
- sbumpc();
+ sbumpc()
+ {
+ int_type __ret;
+ if (__builtin_expect(this->gptr() < this->egptr(), true))
+ {
+ __ret = traits_type::to_int_type(*this->gptr());
+ this->gbump(1);
+ }
+ else
+ __ret = this->uflow();
+ return __ret;
+ }
/**
* @brief Getting the next character.
@@ -371,8 +327,8 @@ namespace std
sgetc()
{
int_type __ret;
- if (_M_in_cur < _M_in_end)
- __ret = traits_type::to_int_type(*this->_M_in_cur);
+ if (__builtin_expect(this->gptr() < this->egptr(), true))
+ __ret = traits_type::to_int_type(*this->gptr());
else
__ret = this->underflow();
return __ret;
@@ -401,7 +357,20 @@ namespace std
* fetched from the input stream will be @a c.
*/
int_type
- sputbackc(char_type __c);
+ sputbackc(char_type __c)
+ {
+ int_type __ret;
+ const bool __testpos = this->eback() < this->gptr();
+ if (__builtin_expect(!__testpos ||
+ !traits_type::eq(__c, this->gptr()[-1]), false))
+ __ret = this->pbackfail(traits_type::to_int_type(__c));
+ else
+ {
+ this->gbump(-1);
+ __ret = traits_type::to_int_type(*this->gptr());
+ }
+ return __ret;
+ }
/**
* @brief Moving backwards in the input stream.
@@ -413,7 +382,18 @@ namespace std
* "gotten".
*/
int_type
- sungetc();
+ sungetc()
+ {
+ int_type __ret;
+ if (__builtin_expect(this->eback() < this->gptr(), true))
+ {
+ this->gbump(-1);
+ __ret = traits_type::to_int_type(*this->gptr());
+ }
+ else
+ __ret = this->pbackfail();
+ return __ret;
+ }
// [27.5.2.2.5] put area
/**
@@ -429,7 +409,19 @@ namespace std
* position is not available, returns @c overflow(c).
*/
int_type
- sputc(char_type __c);
+ sputc(char_type __c)
+ {
+ int_type __ret;
+ if (__builtin_expect(this->pptr() < this->epptr(), true))
+ {
+ *this->pptr() = __c;
+ this->pbump(1);
+ __ret = traits_type::to_int_type(__c);
+ }
+ else
+ __ret = this->overflow(traits_type::to_int_type(__c));
+ return __ret;
+ }
/**
* @brief Entry point for all single-character output functions.
@@ -459,7 +451,6 @@ namespace std
basic_streambuf()
: _M_in_beg(0), _M_in_cur(0), _M_in_end(0),
_M_out_beg(0), _M_out_cur(0), _M_out_end(0),
- _M_out_lim(0), _M_buf_unified(false),
_M_mode(ios_base::openmode(0)),_M_buf_locale(locale())
{ }
@@ -551,7 +542,7 @@ namespace std
void
setp(char_type* __pbeg, char_type* __pend)
{
- _M_out_beg = _M_out_cur = _M_out_lim = __pbeg;
+ _M_out_beg = _M_out_cur = __pbeg;
_M_out_end = __pend;
}
@@ -701,10 +692,10 @@ namespace std
int_type __ret = traits_type::eof();
const bool __testeof = traits_type::eq_int_type(this->underflow(),
__ret);
- if (!__testeof && _M_in_cur < _M_in_end)
+ if (!__testeof && this->gptr() < this->egptr())
{
- __ret = traits_type::to_int_type(*_M_in_cur);
- ++_M_in_cur;
+ __ret = traits_type::to_int_type(*this->gptr());
+ this->gbump(1);
}
return __ret;
}
@@ -784,8 +775,8 @@ namespace std
void
stossc()
{
- if (_M_in_cur < _M_in_end)
- ++_M_in_cur;
+ if (this->gptr() < this->egptr())
+ this->gbump(1);
else
this->uflow();
}
diff --git a/libstdc++-v3/mkcheck.in b/libstdc++-v3/mkcheck.in
deleted file mode 100755
index 377321cac43..00000000000
--- a/libstdc++-v3/mkcheck.in
+++ /dev/null
@@ -1,452 +0,0 @@
-#!/usr/bin/env bash
-
-# Script to do automated testing and data collection for various test
-# files, so that we don't have to do this by hand on every test file.
-# It attempts to collect some diagnostic info about size and speed that
-# should be useful in the future as the library gets tuned for size
-# and speed. In addition, it tests static and shared linkage, iff each
-# has been enabled.
-
-# Invocation
-# mkcheck [01]
-
-# 1: variables
-#
-# WHICH determines if you are
-# (0) testing the build binary and headers, or
-# (1) testing the installed binary and headers, or
-WHICH=$1
-if [ "$WHICH"x = 0x ]; then
- echo "running mkcheck"
- echo "$0: testing the build directory"
-elif [ "$WHICH"x = 1x ]; then
- echo "running mkcheck"
- echo "$0: testing the install directory"
-else
- echo 'Usage: mkcheck 0 /* test the build directory */'
- echo ' mkcheck 1 /* test the install directory */'
- exit 1;
-fi
-
-# Now that we've successfully translated the numerical option into
-# a symbolic one, we can safely ignore it.
-shift
-
-# This has been true all along. Found out about it the hard way...
-case $BASH_VERSION in
- 1*) echo 'You need bash 2.x to run mkcheck. Exiting.'; exit 1 ;;
- *) ;; # ??
-esac
-
-BUILD_DIR=@glibcpp_builddir@
-SRC_DIR=@glibcpp_srcdir@
-PREFIX_DIR=@glibcpp_prefixdir@
-if [ "$WHICH"x = 0x ]; then
- CXX=`$BUILD_DIR/testsuite_flags --build-cxx`
- INCLUDES=`$BUILD_DIR/testsuite_flags --build-includes`
-else
- CXX=`$BUILD_DIR/testsuite_flags --install-cxx`
- INCLUDES=`$BUILD_DIR/testsuite_flags --install-includes`
-fi
-CXXFLAGS=`$BUILD_DIR/testsuite_flags --cxxflags`
-LIBTOOL="$BUILD_DIR/libtool"
-LTEXE="$LIBTOOL --mode=execute"
-#LTCXX="$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $INCLUDES"
-LTCXX="$CXX $CXXFLAGS $INCLUDES"
-
-# specific libtool flag(s) to use shared libraries, if any
-SH_FLAG="-Wl,--rpath -Wl,$BUILD_DIR/../../gcc -Wl,--rpath -Wl,$BUILD_DIR/src/.libs"
-
-# specific libtool flag(s) to use static libraries, if any
-ST_FLAG="-static"
-#ST_FLAG="-all-static"
-
-# Set up the testing directory, which should be in a directory called
-# "testsuite" in the root level of the build directory.
-TEST_DIR="$BUILD_DIR/testsuite"
-# help libtool keep quiet
-if [ ! -d ${TEST_DIR}/.libs ]; then
- mkdir $TEST_DIR/.libs
-fi
-
-# the name of the file that will collect and hold all this useful data:
-RESULTS_FILE="$TEST_DIR/$(date +%Y%m%d)-mkcheck.txt"
-
-# the name of the log file that will append compiler diagnostics:
-LOG_FILE="$TEST_DIR/$(date +%Y%m%d)-mkchecklog.txt"
-
-# the names of the specific test files to be run
-TESTS_FILE="$TEST_DIR/$(date +%Y%m%d)-mkcheckfiles.txt"
-
-
-#
-# 2: clean, make files, append general test info
-#
-
-# Remove old executables.
-rm -rf "$TEST_DIR"/*exe
-rm -rf "$TEST_DIR"/compile.out
-
-# Remove old core files (which now get left in cwd, not $TEST_DIR).
-rm -rf ./*core*
-
-if [ -f $RESULTS_FILE ]; then
- rm $RESULTS_FILE
-fi
-if [ -f $LOG_FILE ]; then
- rm $LOG_FILE
-fi
-
-# Make a list of the files we're going to run, or use an old one if it exists.
-if [ ! -f "$TESTS_FILE" ]; then
- if [ -f "$TEST_DIR/testsuite_files" ]; then
- cp $TEST_DIR/testsuite_files $TESTS_FILE
- else
- echo "making file $TESTS_FILE"
- for LONG_NAME in $SRC_DIR/testsuite/*/*.cc
- do
- DIR_NAME=$(dirname $LONG_NAME)
- SHORT_NAME="`basename $DIR_NAME`/`basename $LONG_NAME`"
- echo "$SHORT_NAME" >> $TESTS_FILE
- done
- fi
-fi
-
-# Nasty solution to replace GNU date(1)'s %s time_t output function.
-TIMER_COMMAND=$TEST_DIR/printnow.exe
-if [ ! -x "$TIMER_COMMAND" ]; then
- echo "making utility $TIMER_COMMAND"
- gcc -o "$TIMER_COMMAND" "$SRC_DIR/testsuite/printnow.c"
- strip "$TIMER_COMMAND"
-fi
-
-# Copy over the data files for filebufs
-cp $SRC_DIR/testsuite/27_io/*.txt $TEST_DIR
-cp $SRC_DIR/testsuite/27_io/*.tst $TEST_DIR
-chmod u+w $TEST_DIR/*.txt
-chmod u+w $TEST_DIR/*.tst
-
-# Emit useful info about compiler and platform
-echo "host: $(uname -mrsv)" >> $RESULTS_FILE
-echo "compiler: $($CXX -v 2>&1)" >> $RESULTS_FILE
-echo "compiler flags: $CXXFLAGS" >> $RESULTS_FILE
-echo "date: $(date +%Y%m%d)" >> $RESULTS_FILE
-echo "" >> $RESULTS_FILE
-
-explanation='+: pass, -b: build failure, -r: run failure, x: disabled'
-printf "%s\n %s\n" 'p == pass/fail execution test' "$explanation" \
- >> $RESULTS_FILE
-echo "ctime == time to compile and link" >> $RESULTS_FILE
-echo "etime == time for executable to run" >> $RESULTS_FILE
-echo "text == size of the executable text section" >> $RESULTS_FILE
-echo "data == size of the executable data section" >> $RESULTS_FILE
-echo "total == size of the executable" >> $RESULTS_FILE
-echo "" >> $RESULTS_FILE
-
-echo "p" | awk '{printf("%s ", $1)}' >> $RESULTS_FILE
-echo "ctime" "etime" | awk '{printf("%s\t%s\t", $1, $2)}' >> $RESULTS_FILE
-echo "text" "data" | awk '{printf("%s\t%s\t", $1, $2)}' >> $RESULTS_FILE
-echo "total" "name" | awk '{printf("%s\t%s\t", $1, $2)}' >> $RESULTS_FILE
-echo "" >> $RESULTS_FILE
-
-# Counters. These could be members of an array, but they'd all have to
-# become individuals anyhow if we ever change this script to super-portable sh.
-shared_pass=0
-shared_fail=0
-static_pass=0
-static_fail=0
-
-
-#
-# 2.5: support functions
-#
-
-# Figure out how to extract size information from binaries. We take
-# the text of the value we want as an argument, and leave the size in
-# the appropriate variable.
-#
-# We discover what kind of size(1) we are using *once* and build a shell
-# function named 'size_command' to wrap it. (The "function" keyword is
-# redundant here, but helps me read it, so there.) Previously we were
-# re-discovering the size(1) arguments three times for each test; sloooow.
-#
-# It is VERY IMPORTANT not to compare these numbers across platforms.
-# Different size(1)'s extract section information differently. For
-# example, using the native Sun size(1) and GNU size(1) built for Suns
-# on the exact same binary will give very different numbers, due to all
-# the variance in command-line options and arbitrary names of ELF sections.
-#
-# and suddenly we go to 2-space indentations...
-setup_size_command()
-{
- if size --version 2> /dev/null | grep -c GNU > /dev/null;
- then # Then we're using a GNU size(1) built for this platform.
- # We lose .rodata and .data1 and who knows what else... kludge.
- function size_command()
- {
- case $1 in
- TEXT) TEXT=$(size -B $EXENAME | tail -1 | awk '{print $1}') ;;
- DATA) DATA=$(size -B $EXENAME | tail -1 | awk '{print $2}') ;;
- SIZE) SIZE=$(size -B $EXENAME | tail -1 | awk '{print $4}') ;;
- esac
- }
- else
- # Not using GNU size; check for platform. These numbers seem to match
- # up to text/data/total, although their meanings seem to be different.
- # THIS TABLE IS SORTED. KEEP IT THAT WAY.
- case @host_os@ in
- *aix*)
- function size_command()
- {
- case $1 in
- TEXT) TEXT=$(size -X32_64 $EXENAME | awk '{print $2}') ;;
- DATA) DATA=$(size -X32_64 $EXENAME | awk '{print $4}') ;;
- SIZE) SIZE=$(size -X32_64 $EXENAME | awk '{print $12}') ;;
- esac
- }
- ;;
- *hpux*)
- function size_command()
- {
- case $1 in
- TEXT) TEXT=$(size $EXENAME | awk '{print $1}') ;;
- DATA) DATA=$(size $EXENAME | awk '{print $3}') ;;
- SIZE) SIZE=$(size $EXENAME | awk '{print $7}') ;;
- esac
- }
- ;;
- *irix*)
- function size_command()
- {
- case $1 in
- TEXT) TEXT=$(size -4 $EXENAME | awk '{print $1}') ;;
- DATA) DATA=$(size -4 $EXENAME | awk '{print $3}') ;;
- SIZE) SIZE=$(size -4 $EXENAME | awk '{print $7}') ;;
- esac
- }
- ;;
- *solaris*)
- function size_command()
- {
- case $1 in
- TEXT) TEXT=$(size $EXENAME | awk '{print $1}') ;;
- DATA) DATA=$(size $EXENAME | awk '{print $3}') ;;
- SIZE) SIZE=$(size $EXENAME | awk '{print $7}') ;;
- esac
- }
- ;;
- *)
- echo ' * Warning! Skipping section sizes!' 1>&2
- function size_command()
- {
- case $1 in
- TEXT) TEXT=0 ;;
- DATA) DATA=0 ;;
- SIZE) SIZE=0 ;;
- esac
- }
- ;;
- esac
- fi
-}
-
-# Test for file output
-test_for_output()
-{
- # This checks for emitted output files, which is useful when
- # testing file-related output. The rules for this working are as
- # follows: the emitted file must have the ".txt" extension, and be
- # based on the actual *.cc file's name. For example, 27/filbuf.cc
- # currently outputs files named 27/filebuf-2.txt and 27/filebuf-3.txt.
- # Also, the first emitted file must be in the form $NAME-1.txt.
- # The control file must follow the same constraints, but have a
- # ".tst" extension. Thus, you have 27/filebuf-2.tst, etc.
-
- # NAME contains the source name, like 27/filebuf.cc
- # From that NAME, we want to generate some possible names, using
- # ls on MATCH, a pattern description generated with sed.
-
- # this is the name of the resulting diff file, if any
- DIFF_FILE="`echo $TEST_NAME | sed 's/cc$/diff/'`"
- # construct wildcard names, ie for $NAME=filebuf.cc, makes "filebuf*.tst"
- DATA_FILES="`echo $TEST_NAME | sed 's/\.cc/\*\.tst/g'`"
- # make sure there is at least one, then go
- ST_E="`echo $TEST_NAME | sed 's/\.cc/\-1\.tst/g'`"
- if [ -f $ST_E ]; then
- # list of actual files that match the wildcard above, ie
- # "filebuf-1.tst"
- ST_MATCH_LIST="`ls $DATA_FILES`"
- for i in $ST_MATCH_LIST; do
- # ST_OUT_FILE is generated in the build directory.
- PRE_NAME2="$TEST_DIR/`basename $i`"
- ST_OUT_FILE="`echo $PRE_NAME2 | sed 's/tst$/txt/'`"
- diff $ST_OUT_FILE $i > $DIFF_FILE
- if [ -s $DIFF_FILE ]; then
- RESULT="-r"
- else
- RESULT="+"
- fi
- rm $DIFF_FILE
- done
- else
- # the file does no output, and didn't abnormally
- # terminate, so assume passed.
- RESULT="+"
- fi
-}
-
-
-#
-# 3: compile, link, execute, time
-#
-# Abstract out the common code for compiling, linking, executing and printing.
-test_file()
-{
- # NB: S_FLAG has to be last argument because it may be null, and
- # error checking hasn't been invented yet.
- NAME=$1
- EXENAME=$2
- S_FLAG=$3
-
- SRC_NAME="$SRC_DIR/testsuite/$1"
- TEST_NAME="$TEST_DIR/`basename $NAME`"
-
- # This would be deliciously easy if GNU date's %s were always around.
- # There are three ways to do this: 1) use the builtin 'time' like we
- # do later; then getting compiler errors into LOG_FILE is a nightmare.
- # 2) Grab the output of a formatted date(1) and do the math; harder
- # and harder as we try compiling at, say, top of the hour; we would
- # eventually have to calculate time_t anyhow. Or 3) just grab two
- # time_t's (no more overhead than grabbing two date(1)'s).
- our_libs="-L$TEST_DIR -lv3test"
- compiler_invocation="$LTCXX $S_FLAG $SRC_NAME -o $EXENAME $our_libs"
- echo $compiler_invocation >> compile.out 2>&1
- COMP_TIME_START=$($TIMER_COMMAND)
- $compiler_invocation >> compile.out 2>&1
- COMP_TIME_END=$($TIMER_COMMAND)
-
- if [ $COMP_TIME_START -lt $COMP_TIME_END ]; then
- C_TIME=$[ $COMP_TIME_END - $COMP_TIME_START ]
- else
- C_TIME="0"
- fi
-
- if [ -f $EXENAME ]; then
-# rm compile.out
- size_command TEXT
- size_command DATA
- size_command SIZE
-
- # Actually run the executable and time it. Note that output
- # printed by the executable will be lost and cannot be redirected,
- # because we need to capture the output of 'time'. Bummer.
- TIMEFORMAT='timemark %R'
- E_TIME_TEXT="$(exec 2>&1; time $LTEXE $EXENAME)"
- E_ABNORMAL_TERMINATION=$?
-
- if [ "$E_ABNORMAL_TERMINATION" -ne 0 ]; then
- RESULT='-r'
- E_TIME="0"
- rm -f ./*core
- # sometimes you want to save all core files for review:
- #mv ./core $EXENAME.core
- # sometimes the OS allows you to name core files yourself:
- #mv ./*core $EXENAME.core
- #mv ./core* $EXENAME.core
- else
- test_for_output
- # XXX This doesn't always result in a number.
- # E_TIME="$(echo $E_TIME_TEXT | awk '{print $2}')"
- E_TIME="0"
- fi
-
- # sometimes you want to save all failing exe files for review:
- if [ "$RESULT" = '+' ]; then
- rm "$EXENAME"
- fi
- else
- # the file did not compile/link.
- printf "\n" >> $LOG_FILE
- `cat compile.out >> $LOG_FILE`
- rm compile.out
- RESULT="-b"
- TEXT="0"
- DATA="0"
- SIZE="0"
- fi
-
- # update the counters
- if test "$RESULT" = "+" ; then
- if test x"$S_FLAG" = x"$ST_FLAG"; then
- static_pass=`expr $static_pass + 1`
- else
- shared_pass=`expr $shared_pass + 1`
- fi
- else
- if test x"$S_FLAG" = x"$ST_FLAG"; then
- static_fail=`expr $static_fail + 1`
- else
- shared_fail=`expr $shared_fail + 1`
- fi
- fi
-
- printf "%s\t" "$RESULT"
- printf "%-2s %d\t%.3f\t%s\t%s\t%s\t%s %s\n" \
- "$RESULT" $C_TIME $E_TIME $TEXT $DATA $SIZE $NAME >> $RESULTS_FILE
-}
-
-setup_size_command
-echo ""
-echo "Detailed test results in .${RESULTS_FILE/$BUILD_DIR}"
-echo $explanation
-echo "------------------------------------------------------------------------"
-printf "static\tshared\ttest\n"
-echo "------------------------------------------------------------------------"
-
-TEST_TIME_START=$($TIMER_COMMAND)
-for NAME in `cat $TESTS_FILE`
-do
- PRE_NAME="$TEST_DIR/`basename $NAME`"
- ST_NAME="`echo $PRE_NAME | sed 's/cc$/st-exe/'`"
- SH_NAME="`echo $PRE_NAME | sed 's/cc$/sh-exe/'`"
-
- if test @enable_static@ = yes; then
- test_file $NAME $ST_NAME "$ST_FLAG"
- else
- printf "x\t"
- printf "static skipped\n" >> $RESULTS_FILE
- fi
- if test @enable_shared@ = yes; then
- test_file $NAME $SH_NAME "$SH_FLAG"
- else
- printf "x\t"
- printf "shared skipped\n" >> $RESULTS_FILE
- fi
- printf "%s\n" "$NAME"
-
- echo "" >> $RESULTS_FILE
-done
-TEST_TIME_END=$($TIMER_COMMAND)
-
-
-#
-# 4: summary
-#
-# grep can count faster than we can...
-total_failures=`expr ${shared_fail} + ${static_fail}`
-total_successes=`expr ${shared_pass} + ${static_pass}`
-resultstext="pass/fail results: ${static_pass}/${static_fail} static + ${shared_pass}/${shared_fail} shared = ${total_successes}/${total_failures} total"
-if [ $total_failures -eq 0 ]; then
- resultstext="${resultstext}, WIN WIN"
-fi
-sed -e "/^date:/a\\
-$resultstext" $RESULTS_FILE > ${RESULTS_FILE}.tmp
-mv ${RESULTS_FILE}.tmp $RESULTS_FILE
-
-if [ $TEST_TIME_START -lt $TEST_TIME_END ]; then
- TEST_TIME=$[ $TEST_TIME_END - $TEST_TIME_START ]
- echo "testrun == $TEST_TIME seconds"
- echo "testrun == $TEST_TIME seconds" >> $RESULTS_FILE
-fi
-
-exit 0
diff --git a/libstdc++-v3/src/globals.cc b/libstdc++-v3/src/globals.cc
index a0220f1cd8e..6793a9b5da1 100644
--- a/libstdc++-v3/src/globals.cc
+++ b/libstdc++-v3/src/globals.cc
@@ -127,6 +127,10 @@ namespace __gnu_cxx
__attribute__ ((aligned(__alignof__(locale::facet*))));
fake_facet_vec facet_vec[_GLIBCPP_NUM_FACETS];
+ typedef char fake_cache_vec[sizeof(locale::facet*)]
+ __attribute__ ((aligned(__alignof__(locale::facet*))));
+ fake_cache_vec cache_vec[_GLIBCPP_NUM_FACETS];
+
typedef char fake_ctype_c[sizeof(std::ctype<char>)]
__attribute__ ((aligned(__alignof__(std::ctype<char>))));
fake_ctype_c ctype_c;
@@ -235,6 +239,17 @@ namespace __gnu_cxx
fake_messages_w messages_w;
#endif
+ // Storage for C locale caches
+ typedef char fake_locale_cache_c[sizeof(std::__numpunct_cache<char>)]
+ __attribute__ ((aligned(__alignof__(std::__numpunct_cache<char>))));
+ fake_locale_cache_c numpunct_cache_c;
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+ typedef char fake_locale_cache_w[sizeof(std::__numpunct_cache<wchar_t>)]
+ __attribute__ ((aligned(__alignof__(std::__numpunct_cache<wchar_t>))));
+ fake_locale_cache_w numpunct_cache_w;
+#endif
+
// Globals for once-only runtime initialization of mutex objects. This
// allows static initialization of these objects on systems that need a
// function call to initialize a mutex. For example, see stl_threads.h.
diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc
index ee4fd24cc54..ee969b5d9c7 100644
--- a/libstdc++-v3/src/ios.cc
+++ b/libstdc++-v3/src/ios.cc
@@ -297,8 +297,8 @@ namespace std
return __old;
}
- ios_base::ios_base() : _M_callbacks(0), _M_word_size(_S_local_word_size),
- _M_word(_M_local_word), _M_locale_cache(0)
+ ios_base::ios_base()
+ : _M_callbacks(0), _M_word_size(_S_local_word_size), _M_word(_M_local_word)
{
// Do nothing: basic_ios::init() does it.
// NB: _M_callbacks and _M_word must be zero for non-initialized
diff --git a/libstdc++-v3/src/locale-inst.cc b/libstdc++-v3/src/locale-inst.cc
index 73b028df1be..0936102a916 100644
--- a/libstdc++-v3/src/locale-inst.cc
+++ b/libstdc++-v3/src/locale-inst.cc
@@ -45,7 +45,6 @@ namespace std
template class moneypunct_byname<char, true>;
template class money_get<char, istreambuf_iterator<char> >;
template class money_put<char, ostreambuf_iterator<char> >;
- template class __locale_cache<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class moneypunct<wchar_t, false>;
@@ -54,11 +53,11 @@ namespace std
template class moneypunct_byname<wchar_t, true>;
template class money_get<wchar_t, istreambuf_iterator<wchar_t> >;
template class money_put<wchar_t, ostreambuf_iterator<wchar_t> >;
- template class __locale_cache<wchar_t>;
#endif
// numpunct, numpunct_byname, num_get, and num_put
template class numpunct<char>;
+ template struct __numpunct_cache<char>;
template class numpunct_byname<char>;
template class num_get<char, istreambuf_iterator<char> >;
template class num_put<char, ostreambuf_iterator<char> >;
@@ -102,6 +101,7 @@ namespace std
#ifdef _GLIBCPP_USE_WCHAR_T
template class numpunct<wchar_t>;
+ template struct __numpunct_cache<wchar_t>;
template class numpunct_byname<wchar_t>;
template class num_get<wchar_t, istreambuf_iterator<wchar_t> >;
template class num_put<wchar_t, ostreambuf_iterator<wchar_t> >;
diff --git a/libstdc++-v3/src/locale.cc b/libstdc++-v3/src/locale.cc
index db08de0feca..7788a58419d 100644
--- a/libstdc++-v3/src/locale.cc
+++ b/libstdc++-v3/src/locale.cc
@@ -449,30 +449,37 @@ namespace std
locale::facet::
~facet() { }
- locale::facet::
- facet(size_t __refs) throw() : _M_references(__refs ? 1 : 0)
- { }
-
- void
- locale::facet::
- _M_add_reference() const throw()
- { __atomic_add(&_M_references, 1); }
+ template<>
+ const __numpunct_cache<char>&
+ __use_cache(const locale& __loc)
+ {
+ size_t __i = numpunct<char>::id._M_id();
+ const locale::facet** __caches = __loc._M_impl->_M_caches;
+ if (!__caches[__i])
+ {
+ __numpunct_cache<char>* __tmp = new __numpunct_cache<char>;
+ __tmp->_M_cache(__loc);
+ __loc._M_impl->_M_install_cache(__tmp, __i);
+ }
+ return static_cast<const __numpunct_cache<char>&>(*__caches[__i]);
+ }
- void
- locale::facet::
- _M_remove_reference() const throw()
- {
- if (__exchange_and_add(&_M_references, -1) == 1)
- {
- try
- { delete this; }
- catch (...)
- { }
- }
- }
-
- locale::id::id()
- { }
+#ifdef _GLIBCPP_USE_WCHAR_T
+ template<>
+ const __numpunct_cache<wchar_t>&
+ __use_cache(const locale& __loc)
+ {
+ size_t __i = numpunct<wchar_t>::id._M_id();
+ const locale::facet** __caches = __loc._M_impl->_M_caches;
+ if (!__caches[__i])
+ {
+ __numpunct_cache<wchar_t>* __tmp = new __numpunct_cache<wchar_t>;
+ __tmp->_M_cache(__loc);
+ __loc._M_impl->_M_install_cache(__tmp, __i);
+ }
+ return static_cast<const __numpunct_cache<wchar_t>&>(*__caches[__i]);
+ }
+#endif
// Definitions for static const data members of time_base
template<>
diff --git a/libstdc++-v3/src/localename.cc b/libstdc++-v3/src/localename.cc
index c09900b628f..424bc64fec7 100644
--- a/libstdc++-v3/src/localename.cc
+++ b/libstdc++-v3/src/localename.cc
@@ -69,6 +69,12 @@ namespace __gnu_cxx
extern time_put<wchar_t> time_put_w;
extern std::messages<wchar_t> messages_w;
#endif
+
+ extern locale::facet* cache_vec[_GLIBCPP_NUM_FACETS];
+ extern std::__numpunct_cache<char> numpunct_cache_c;
+#ifdef _GLIBCPP_USE_WCHAR_T
+ extern std::__numpunct_cache<wchar_t> numpunct_cache_w;
+#endif
} // namespace __gnu_cxx
namespace std
@@ -83,6 +89,11 @@ namespace std
_M_facets[__i]->_M_remove_reference();
delete [] _M_facets;
+ for (size_t __i = 0; __i < _M_facets_size; ++__i)
+ if (_M_caches[__i])
+ _M_caches[__i]->_M_remove_reference();
+ delete [] _M_caches;
+
for (size_t __i = 0; __i < _S_categories_size; ++__i)
delete [] _M_names[__i];
delete [] _M_names;
@@ -91,7 +102,7 @@ namespace std
// Clone existing _Impl object.
locale::_Impl::
_Impl(const _Impl& __imp, size_t __refs)
- : _M_references(__refs), _M_facets_size(__imp._M_facets_size) // XXX
+ : _M_references(__refs), _M_facets_size(__imp._M_facets_size)
{
try
{
@@ -113,6 +124,22 @@ namespace std
try
{
+ _M_caches = new const facet*[_M_facets_size];
+ }
+ catch(...)
+ {
+ delete [] _M_caches;
+ __throw_exception_again;
+ }
+ for (size_t __i = 0; __i < _M_facets_size; ++__i)
+ {
+ _M_caches[__i] = __imp._M_caches[__i];
+ if (_M_caches[__i])
+ _M_caches[__i]->_M_add_reference();
+ }
+
+ try
+ {
_M_names = new char*[_S_categories_size];
}
catch(...)
@@ -131,10 +158,10 @@ namespace std
// Construct named _Impl.
locale::_Impl::
_Impl(const char* __s, size_t __refs)
- : _M_references(__refs), _M_facets_size(_GLIBCPP_NUM_FACETS)
+ : _M_references(__refs), _M_facets_size(_GLIBCPP_NUM_FACETS)
{
- // Initialize the underlying locale model, which also checks
- // to see if the given name is valid.
+ // Initialize the underlying locale model, which also checks to
+ // see if the given name is valid.
__c_locale __cloc;
locale::facet::_S_create_c_locale(__cloc, __s);
@@ -150,6 +177,18 @@ namespace std
__throw_exception_again;
}
+ try
+ {
+ _M_caches = new const facet*[_M_facets_size];
+ for (size_t __i = 0; __i < _M_facets_size; ++__i)
+ _M_caches[__i] = 0;
+ }
+ catch(...)
+ {
+ delete [] _M_caches;
+ __throw_exception_again;
+ }
+
// Name all the categories.
try
{
@@ -235,6 +274,10 @@ namespace std
for (size_t __i = 0; __i < _M_facets_size; ++__i)
_M_facets[__i] = 0;
+ _M_caches = new (&cache_vec) const facet*[_M_facets_size];
+ for (size_t __i = 0; __i < _M_facets_size; ++__i)
+ _M_caches[__i] = 0;
+
// Name all the categories.
_M_names = new (&name_vec) char*[_S_categories_size];
for (size_t __i = 0; __i < _S_categories_size; ++__i)
@@ -252,7 +295,12 @@ namespace std
// destroyed.
_M_init_facet(new (&ctype_c) std::ctype<char>(0, false, 1));
_M_init_facet(new (&codecvt_c) codecvt<char, char, mbstate_t>(1));
- _M_init_facet(new (&numpunct_c) numpunct<char>(1));
+
+ // Safe to cache this.
+ typedef __numpunct_cache<char> num_cache_c;
+ num_cache_c* __npc = new (&numpunct_cache_c) num_cache_c(2);
+ _M_init_facet(new (&numpunct_c) numpunct<char>(__npc, 1));
+
_M_init_facet(new (&num_get_c) num_get<char>(1));
_M_init_facet(new (&num_put_c) num_put<char>(1));
_M_init_facet(new (&collate_c) std::collate<char>(1));
@@ -264,10 +312,15 @@ namespace std
_M_init_facet(new (&time_get_c) time_get<char>(1));
_M_init_facet(new (&time_put_c) time_put<char>(1));
_M_init_facet(new (&messages_c) std::messages<char>(1));
+
#ifdef _GLIBCPP_USE_WCHAR_T
_M_init_facet(new (&ctype_w) std::ctype<wchar_t>(1));
_M_init_facet(new (&codecvt_w) codecvt<wchar_t, char, mbstate_t>(1));
- _M_init_facet(new (&numpunct_w) numpunct<wchar_t>(1));
+
+ typedef __numpunct_cache<wchar_t> num_cache_w;
+ num_cache_w* __npw = new (&numpunct_cache_w) num_cache_w(2);
+ _M_init_facet(new (&numpunct_w) numpunct<wchar_t>(__npw, 1));
+
_M_init_facet(new (&num_get_w) num_get<wchar_t>(1));
_M_init_facet(new (&num_put_w) num_put<wchar_t>(1));
_M_init_facet(new (&collate_w) std::collate<wchar_t>(1));
@@ -280,6 +333,13 @@ namespace std
_M_init_facet(new (&time_put_w) time_put<wchar_t>(1));
_M_init_facet(new (&messages_w) std::messages<wchar_t>(1));
#endif
+
+ // This locale is safe to pre-cache, after all the facets have
+ // been installed.
+ _M_caches[numpunct<char>::id._M_id()] = __npc;
+#ifdef _GLIBCPP_USE_WCHAR_T
+ _M_caches[numpunct<wchar_t>::id._M_id()] = __npw;
+#endif
}
void
@@ -336,18 +396,31 @@ namespace std
// Check size of facet vector to ensure adequate room.
if (__index > _M_facets_size - 1)
{
- const facet** __old = _M_facets;
- const facet** __new;
const size_t __new_size = __index + 4;
- __new = new const facet*[__new_size];
+
+ // New facet array.
+ const facet** __oldf = _M_facets;
+ const facet** __newf;
+ __newf = new const facet*[__new_size];
+ for (size_t __i = 0; __i < _M_facets_size; ++__i)
+ __newf[__i] = _M_facets[__i];
+ for (size_t __i2 = _M_facets_size; __i2 < __new_size; ++__i2)
+ __newf[__i2] = 0;
+
+ // New cache array.
+ const facet** __oldc = _M_caches;
+ const facet** __newc;
+ __newc = new const facet*[__new_size];
for (size_t __i = 0; __i < _M_facets_size; ++__i)
- __new[__i] = _M_facets[__i];
+ __newc[__i] = _M_caches[__i];
for (size_t __i2 = _M_facets_size; __i2 < __new_size; ++__i2)
- __new[__i2] = 0;
+ __newc[__i2] = 0;
_M_facets_size = __new_size;
- _M_facets = __new;
- delete [] __old;
+ _M_facets = __newf;
+ _M_caches = __newc;
+ delete [] __oldf;
+ delete [] __oldc;
}
__fp->_M_add_reference();
@@ -365,6 +438,21 @@ namespace std
// swanky-fresh _Impl.
_M_facets[__index] = __fp;
}
+
+ // Ideally, it would be nice to only remove the caches that
+ // are now incorrect. However, some of the caches depend on
+ // multiple facets, and we only know about one facet
+ // here. It's no great loss: the first use of the new facet
+ // will create a new, correctly cached facet anyway.
+ for (size_t __i = 0; __i < _M_facets_size; ++__i)
+ {
+ const facet* __cpr = _M_caches[__i];
+ if (__cpr)
+ {
+ __cpr->_M_remove_reference();
+ _M_caches[__i] = 0;
+ }
+ }
}
}
} // namespace std
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr.cc b/libstdc++-v3/testsuite/20_util/auto_ptr.cc
index a6dd1c69991..d70b63f3e9e 100644
--- a/libstdc++-v3/testsuite/20_util/auto_ptr.cc
+++ b/libstdc++-v3/testsuite/20_util/auto_ptr.cc
@@ -197,8 +197,8 @@ test06()
std::auto_ptr<A> A_from_A_ptr(A_from_A.release());
VERIFY( A_from_A.get() == 0 );
VERIFY( A_from_A_ptr.get() != 0 );
- VERIFY( A_from_A->ctor_count == 1 );
- VERIFY( (*A_from_A).dtor_count == 0 );
+ VERIFY( A_from_A_ptr->ctor_count == 1 );
+ VERIFY( (*A_from_A_ptr).dtor_count == 0 );
A* A_ptr = A_from_A_ptr.get();
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/assign/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/assign/char/1.cc
index 735c61c86e0..879d3c139c7 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/assign/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/assign/char/1.cc
@@ -44,6 +44,9 @@ test01()
aux.assign(aux, i + 1, string::npos);
VERIFY(aux.c_str()[9] == 'B');
VERIFY(aux == "/Hanalei Bay/Kauai/Hawaii");
+
+ aux.assign(10, 0);
+ VERIFY(aux.length() == 10);
}
int main()
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/4.cc b/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/4.cc
index 47cf335daa0..fcb924a8222 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/4.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/4.cc
@@ -55,7 +55,7 @@ test04()
str02 = "boards";
char* ptr1 = &*str01.begin();
- char* ptr2 = &*str01.end();
+ char* ptr2 = ptr1 + str01.length();
str02.replace(str02.begin(), str02.end(), ptr1, ptr2);
VERIFY(str02 == "geogaddi");
}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/4.cc b/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/4.cc
index bc827d03282..94baa82250d 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/4.cc
@@ -55,7 +55,7 @@ test04()
str02 = L"boards";
wchar_t* ptr1 = &*str01.begin();
- wchar_t* ptr2 = &*str01.end();
+ wchar_t* ptr2 = ptr1 + str01.length();
str02.replace(str02.begin(), str02.end(), ptr1, ptr2);
VERIFY(str02 == L"geogaddi");
}
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/1.cc b/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/1.cc
index b349a38aedd..bbe0c2eadf0 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/1.cc
@@ -56,7 +56,7 @@ void test01()
}
// narrow(const charT* low, const charT* high, char dfault, char* dest) const
- ctype_c.narrow(&wide[0], &wide[wide.length()], dfault, &narrow_chars[0]);
+ ctype_c.narrow(&wide[0], &wide[0] + wide.length(), dfault, &narrow_chars[0]);
VERIFY( narrow_chars[0] != dfault );
for (int i = 0; i < wide.length(); ++i)
VERIFY( narrow_chars[i] == narrow[i] );
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/2.cc b/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/2.cc
index 31805ae1ecc..aa3ff4c70bc 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/2.cc
@@ -60,7 +60,7 @@ void test02()
}
// narrow(const charT* low, const charT* high, char dfault, char* dest) const
- ctype_c.narrow(&wide[0], &wide[wide.length()], dfault, &narrow_chars[0]);
+ ctype_c.narrow(&wide[0], &wide[0] + wide.length(), dfault, &narrow_chars[0]);
VERIFY( narrow_chars[0] != dfault );
for (int i = 0; i < wide.length(); ++i)
VERIFY( narrow_chars[i] == narrow[i] );
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/1.cc
index 820fe6c99bc..459dcf7db57 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/1.cc
@@ -56,7 +56,7 @@ void test01()
}
// narrow(const charT* low, const charT* high, char dfault, char* dest) const
- ctype_c.narrow(&wide[0], &wide[wide.length()], dfault, &narrow_chars[0]);
+ ctype_c.narrow(&wide[0], &wide[0] + wide.length(), dfault, &narrow_chars[0]);
VERIFY( narrow_chars[0] != dfault );
for (int i = 0; i < wide.length(); ++i)
VERIFY( narrow_chars[i] == narrow[i] );
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/2.cc
index 2d7750629b1..8f8fecc6ea9 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/2.cc
@@ -60,7 +60,7 @@ void test02()
}
// narrow(const charT* low, const charT* high, char dfault, char* dest) const
- ctype_c.narrow(&wide[0], &wide[wide.length()], dfault, &narrow_chars[0]);
+ ctype_c.narrow(&wide[0], &wide[0] + wide.length(), dfault, &narrow_chars[0]);
VERIFY( narrow_chars[0] != dfault );
for (int i = 0; i < wide.length(); ++i)
VERIFY( narrow_chars[i] == narrow[i] );
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/widen/char/1.cc b/libstdc++-v3/testsuite/22_locale/ctype/widen/char/1.cc
index ea206059bfb..f7a2c15ad86 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/widen/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/widen/char/1.cc
@@ -55,7 +55,7 @@ void test01()
}
// widen(const char* low, const char* high, charT* dest) const
- ctype_c.widen(&narrow[0], &narrow[narrow.length()], &wide_chars[0]);
+ ctype_c.widen(&narrow[0], &narrow[0] + narrow.length(), &wide_chars[0]);
for (int i = 0; i < narrow.length(); ++i)
VERIFY( wide_chars[i] == wide[i] );
}
diff --git a/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/1.cc
index e0b33155bb9..042a0b5f705 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/1.cc
@@ -55,7 +55,7 @@ void test01()
}
// widen(const char* low, const char* high, charT* dest) const
- ctype_c.widen(&narrow[0], &narrow[narrow.length()], &wide_chars[0]);
+ ctype_c.widen(&narrow[0], &narrow[0] + narrow.length(), &wide_chars[0]);
for (int i = 0; i < narrow.length(); ++i)
VERIFY( wide_chars[i] == wide[i] );
}
diff --git a/libstdc++-v3/testsuite/23_containers/list_modifiers.cc b/libstdc++-v3/testsuite/23_containers/list_modifiers.cc
index 213fc41f17d..8cdc9f0e254 100644
--- a/libstdc++-v3/testsuite/23_containers/list_modifiers.cc
+++ b/libstdc++-v3/testsuite/23_containers/list_modifiers.cc
@@ -107,14 +107,12 @@ test01()
VERIFY(list0101.size() == 2);
VERIFY(T::dtorCount() == 1);
VERIFY(i->id() == 1);
- VERIFY(j->id() == 1);
VERIFY(k->id() == 1);
list0101.pop_front(); // list should be [1]
VERIFY(list0101.size() == 1);
VERIFY(T::dtorCount() == 2);
VERIFY(i->id() == 1);
- VERIFY(j->id() == 1);
VERIFY(k->id() == 1);
}
diff --git a/libstdc++-v3/testsuite/23_containers/vector_bool.cc b/libstdc++-v3/testsuite/23_containers/vector_bool.cc
index 17836499cf9..3deec4985d2 100644
--- a/libstdc++-v3/testsuite/23_containers/vector_bool.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector_bool.cc
@@ -26,7 +26,8 @@
void test01()
{
std::vector<bool>::iterator i;
- ++i;
+ if (false)
+ ++i;
}
// libstdc++/6886
diff --git a/libstdc++-v3/testsuite/24_iterators/rel_ops.cc b/libstdc++-v3/testsuite/24_iterators/rel_ops.cc
index 2c853967720..65034b2519f 100644
--- a/libstdc++-v3/testsuite/24_iterators/rel_ops.cc
+++ b/libstdc++-v3/testsuite/24_iterators/rel_ops.cc
@@ -30,7 +30,8 @@ void test01()
{
std::vector<int> v;
std::vector<int>::iterator vi;
-
+ v.push_back(1);
+ vi = v.end();
vi != v.begin();
vi > v.begin();
vi <= v.begin();
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc
index 9098a2083e7..451518c1f23 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc
@@ -46,11 +46,11 @@ void test05()
{
constraint_filebuf fb_03;
fb_03.open(name_03, ios_base::out | ios_base::in | ios_base::trunc);
- VERIFY( fb_03.write_position() );
+ VERIFY( !fb_03.write_position() );
VERIFY( !fb_03.read_position() );
int_type c5 = fb_03.sbumpc();
VERIFY( c5 == traits_type::eof() );
- VERIFY( fb_03.write_position() );
+ VERIFY( !fb_03.write_position() );
VERIFY( !fb_03.read_position() );
}
@@ -58,9 +58,9 @@ void test05()
{
constraint_filebuf fb_01;
fb_01.open(name_01, ios_base::in | ios_base::out);
- VERIFY( fb_01.write_position() );
+ VERIFY( !fb_01.write_position() );
- int_type c1 = fb_01.sbumpc();
+ int_type c1 = fb_01.sbumpc();
VERIFY( c1 == '/' );
int_type c3 = fb_01.sbumpc();
VERIFY( c3 == '/' );
@@ -80,7 +80,7 @@ void test05()
VERIFY( c2 == '9' );
VERIFY( c3 == '0' );
- VERIFY( fb_01.write_position() );
+ VERIFY( !fb_01.write_position() );
VERIFY( fb_01.read_position() );
}
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc
index ff0cb97dd5d..69559a9a69c 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc
@@ -45,13 +45,13 @@ void test05()
{
constraint_filebuf fb_02;
fb_02.open(name_02, ios_base::out | ios_base::trunc);
- VERIFY( fb_02.write_position() );
+ VERIFY( !fb_02.write_position() );
VERIFY( !fb_02.read_position() );
int_type c2 = fb_02.sbumpc();
VERIFY( c2 == traits_type::eof() );
int_type c4 = fb_02.sbumpc();
VERIFY( c4 == traits_type::eof() );
- VERIFY( fb_02.write_position() );
+ VERIFY( !fb_02.write_position() );
VERIFY( !fb_02.read_position() );
}
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/3-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/3-io.cc
index 7552d889eb6..d310d513871 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/3-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/3-io.cc
@@ -59,7 +59,7 @@ void test05()
{
constraint_filebuf fb_03;
fb_03.open(name_01, ios_base::out | ios_base::in);
- VERIFY( fb_03.write_position() );
+ VERIFY( !fb_03.write_position() );
VERIFY( !fb_03.read_position() );
// 27filebuf-3.txt = bd23456789:;<=>?...
//beg
@@ -111,7 +111,7 @@ void test05()
fb_03.pubsync();
c3 = fb_03.sgetc();
VERIFY( c1 == c3 );
- VERIFY( fb_03.write_position() );
+ VERIFY( !fb_03.write_position() );
VERIFY( fb_03.read_position() );
}
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/3-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/3-io.cc
index 097edb76b2a..6efbb9512ae 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/3-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/3-io.cc
@@ -60,7 +60,7 @@ void test05()
{
constraint_filebuf fb_03;
fb_03.open(name_01, ios_base::out | ios_base::in);
- VERIFY( fb_03.write_position() );
+ VERIFY( !fb_03.write_position() );
VERIFY( !fb_03.read_position() );
pt_1 = fb_03.pubseekoff(78, ios_base::beg);
off_1 = pt_1;
@@ -84,7 +84,7 @@ void test05()
VERIFY( off_1 > off_2 );
fb_03.sputn("\nof the wonderful things he does!!\nok", 37);
fb_03.pubsync();
- VERIFY( fb_03.write_position() );
+ VERIFY( !fb_03.write_position() );
VERIFY( !fb_03.read_position() );
fb_03.close();
VERIFY( !fb_03.is_open() );
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/1.cc
index d4f9e4c15dc..25511d93ea6 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/1.cc
@@ -79,7 +79,7 @@ void test05()
// setbuf
// pubsetbuf(char_type* s, streamsize n)
f_tmp.pubsetbuf(0, 0);
- VERIFY( !f_tmp.check_pointers() );
+ VERIFY( f_tmp.check_pointers() );
}
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc
index 6882234f1d5..7a754768002 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc
@@ -48,13 +48,13 @@ void test05()
{
constraint_filebuf fb_03; // in | out
fb_03.open(name_03, ios::out | ios::in | ios::trunc);
- VERIFY( fb_03.write_position() );
+ VERIFY( !fb_03.write_position() );
VERIFY( !fb_03.read_position() );
c1 = fb_03.sgetc();
c2 = fb_03.sbumpc();
VERIFY( c1 == traits_type::eof() );
VERIFY( c1 == c2 );
- VERIFY( fb_03.write_position() );
+ VERIFY( !fb_03.write_position() );
VERIFY( !fb_03.read_position() );
}
@@ -62,7 +62,7 @@ void test05()
{
constraint_filebuf fb_01; // in
fb_01.open(name_01, ios::in | ios::out);
- VERIFY( fb_01.write_position() );
+ VERIFY( !fb_01.write_position() );
c1 = fb_01.sgetc();
VERIFY( c1 == '/' );
c2 = fb_01.sgetc();
@@ -74,7 +74,7 @@ void test05()
VERIFY( c1 == '/' );
VERIFY( c2 == ' ' );
VERIFY( c3 == ' ' );
- VERIFY( fb_01.write_position() );
+ VERIFY( !fb_01.write_position() );
VERIFY( fb_01.read_position() );
}
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc
index 30d4d1b5e40..41e18e435e4 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc
@@ -47,7 +47,7 @@ void test05()
{
constraint_filebuf fb_02; // out
fb_02.open(name_02, ios::out | ios::trunc);
- VERIFY( fb_02.write_position() );
+ VERIFY( !fb_02.write_position() );
VERIFY( !fb_02.read_position() );
c1 = fb_02.sgetc();
VERIFY( c1 == traits_type::eof() );
@@ -57,7 +57,7 @@ void test05()
c1 = fb_02.sbumpc();
c2 = fb_02.sgetc();
VERIFY( c1 == c2 );
- VERIFY( fb_02.write_position() );
+ VERIFY( !fb_02.write_position() );
VERIFY( !fb_02.read_position() );
}
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc
index 021a1c89d68..0f17624c58c 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc
@@ -37,12 +37,12 @@ void test05()
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
- bool test = true;
+ bool test = true;
streamsize strmsz_1, strmsz_2, strmsz_3;
- int i = 0, j = 0, k = 0;
char carray1[13] = "";
char carray2[8192] = "";
+ char buffer[8192] = "";
int_type c1, c2, c3, c4;
// streamsize sgetn(char_type *s, streamsize n)
@@ -52,7 +52,10 @@ void test05()
// in
{
- constraint_filebuf fb_01;
+ constraint_filebuf fb_01;
+ // Need this since BUFSIZ is only guaranteed >= 255 and we want
+ // to trigger the same underflow situation everywhere.
+ fb_01.pubsetbuf(buffer, 8192);
fb_01.open(name_01, ios_base::in);
VERIFY( !fb_01.write_position() );
strmsz_1 = fb_01.in_avail(); // 8261
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc
index 432ed6cdab5..e1d9a38f75e 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc
@@ -38,12 +38,12 @@ void test05()
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
- bool test = true;
+ bool test = true;
streamsize strmsz_1, strmsz_2, strmsz_3;
- int i = 0, j = 0, k = 0;
char carray1[13] = "";
char carray2[8192] = "";
+ char buffer[8192] = "";
int_type c1, c2, c3, c4;
// streamsize sgetn(char_type *s, streamsize n)
@@ -55,19 +55,22 @@ void test05()
{
constraint_filebuf fb_03;
fb_03.open(name_03, ios_base::out | ios_base::in | ios_base::trunc);
- VERIFY( fb_03.write_position() );
+ VERIFY( !fb_03.write_position() );
VERIFY( !fb_03.read_position() );
strmsz_1 = fb_03.sgetn(carray1, 10);
VERIFY( strmsz_1 == 0 );
- VERIFY( fb_03.write_position() );
+ VERIFY( !fb_03.write_position() );
VERIFY( !fb_03.read_position() );
}
// in | out 2
{
- constraint_filebuf fb_01;
+ constraint_filebuf fb_01;
+ // Need this since BUFSIZ is only guaranteed >= 255 and we want
+ // to trigger the same underflow situation everywhere.
+ fb_01.pubsetbuf(buffer, 8192);
fb_01.open(name_01, ios_base::in | ios_base::out);
- VERIFY( fb_01.write_position() );
+ VERIFY( !fb_01.write_position() );
strmsz_1 = fb_01.in_avail();
strmsz_2 = fb_01.sgetn(carray1, 10);
VERIFY( strmsz_2 == 10 );
@@ -84,7 +87,7 @@ void test05()
VERIFY( strmsz_1 > 0 );
strmsz_2 = fb_01.sgetn(carray2, strmsz_1 + 5);
VERIFY( strmsz_1 == strmsz_2 ); //at the end of the actual file
- VERIFY( fb_01.write_position() );
+ VERIFY( !fb_01.write_position() );
VERIFY( !fb_01.read_position() );
}
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc
index dcefe01c6a1..eb710f2d056 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc
@@ -37,10 +37,9 @@ void test05()
typedef filebuf::int_type int_type;
typedef filebuf::traits_type traits_type;
- bool test = true;
+ bool test = true;
streamsize strmsz_1, strmsz_2, strmsz_3;
- int i = 0, j = 0, k = 0;
char carray1[13] = "";
char carray2[8192] = "";
int_type c1, c2, c3, c4;
@@ -52,9 +51,9 @@ void test05()
// out
{
- constraint_filebuf fb_02;
+ constraint_filebuf fb_02;
fb_02.open(name_02, ios_base::out | ios_base::trunc);
- VERIFY( fb_02.write_position() );
+ VERIFY( !fb_02.write_position() );
VERIFY( !fb_02.read_position() );
strmsz_2 = fb_02.in_avail();
strmsz_2 = fb_02.sgetn(carray2, 10);
@@ -67,7 +66,7 @@ void test05()
VERIFY( strmsz_2 == 0 );
c4 = fb_02.sgetc();
VERIFY( c4 == traits_type::eof() );
- VERIFY( fb_02.write_position() );
+ VERIFY( !fb_02.write_position() );
VERIFY( !fb_02.read_position() );
}
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-io.cc
index 0627648cc7b..aa5000d987a 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-io.cc
@@ -48,11 +48,11 @@ void test05()
{
constraint_filebuf fb_03;
fb_03.open(name_03, ios_base::out | ios_base::in | ios_base::trunc);
- VERIFY( fb_03.write_position() );
+ VERIFY( !fb_03.write_position() );
VERIFY( !fb_03.read_position() );
c3 = fb_03.snextc();
VERIFY( c3 == traits_type::eof() );
- VERIFY( fb_03.write_position() );
+ VERIFY( !fb_03.write_position() );
VERIFY( !fb_03.read_position() );
}
@@ -60,7 +60,7 @@ void test05()
{
constraint_filebuf fb_01;
fb_01.open(name_01, ios_base::in | ios_base::out);
- VERIFY( fb_01.write_position() );
+ VERIFY( !fb_01.write_position() );
int_type c4 = fb_01.sbumpc();
VERIFY( c4 == '/' );
c4 = fb_01.sbumpc();
@@ -71,7 +71,7 @@ void test05()
VERIFY( c1 == '9' );
c4 = fb_01.sgetc();
VERIFY( c4 == '9' );
- VERIFY( fb_01.write_position() );
+ VERIFY( !fb_01.write_position() );
VERIFY( fb_01.read_position() );
}
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-out.cc
index d226ac29699..118383a978e 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-out.cc
@@ -48,13 +48,13 @@ void test05()
{
constraint_filebuf fb_02;
fb_02.open(name_02, ios_base::out | ios_base::trunc);
- VERIFY( fb_02.write_position() );
+ VERIFY( !fb_02.write_position() );
VERIFY( !fb_02.read_position() );
c2 = fb_02.snextc();
VERIFY( c2 == traits_type::eof() );
c2 = fb_02.snextc();
VERIFY( c2 == traits_type::eof() );
- VERIFY( fb_02.write_position() );
+ VERIFY( !fb_02.write_position() );
VERIFY( !fb_02.read_position() );
}
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc
index ca300cedbd1..f43191cc730 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc
@@ -50,7 +50,7 @@ void test01()
{
constraint_filebuf fb_01;
fb_01.open(name_01, ios_base::out | ios_base::in | ios_base::trunc);
- VERIFY( fb_01.write_position() );
+ VERIFY( !fb_01.write_position() );
VERIFY( !fb_01.read_position() );
strmsz_1 = fb_01.sputn("racadabras", 10);//"abracadabras or what?"
strmsz_2 = fb_01.sputn(", i wanna reach out and", 10);
@@ -90,7 +90,7 @@ void test01()
c3 = fb_01.sgetc();
VERIFY( c3 == c2 );
VERIFY( strmsz_1 + 1 == strmsz_2 );
- VERIFY( fb_01.write_position() );
+ VERIFY( !fb_01.write_position() );
VERIFY( fb_01.read_position() );
}
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc
index 78d3b790df6..83d57e2fc61 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc
@@ -48,7 +48,7 @@ void test01()
{
constraint_filebuf fb_01; // out
fb_01.open(name_01, ios::out | ios::trunc);
- VERIFY( fb_01.write_position() );
+ VERIFY( !fb_01.write_position() );
VERIFY( !fb_01.read_position() );
c1 = fb_01.sgetc();
VERIFY( c1 == traits_type::eof() );
@@ -58,7 +58,7 @@ void test01()
c1 = fb_01.sbumpc();
c2 = fb_01.sputbackc('a');
VERIFY( c1 == c2 );
- VERIFY( fb_01.write_position() );
+ VERIFY( !fb_01.write_position() );
VERIFY( !fb_01.read_position() );
}
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc
index c1717612b6c..72350c0a8b8 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc
@@ -52,7 +52,7 @@ void test05()
{
constraint_filebuf fb_03;
fb_03.open(name_03, ios_base::out | ios_base::in | ios_base::trunc);
- VERIFY( fb_03.write_position() );
+ VERIFY( !fb_03.write_position() );
VERIFY( !fb_03.read_position() );
c1 = fb_03.sputc('b');
VERIFY( c1 == 'b' );
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc
index 987b4e26217..f4b5b73f0e7 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc
@@ -51,7 +51,7 @@ void test05()
{
constraint_filebuf fb_02;
fb_02.open(name_02, ios_base::out | ios_base::trunc);
- VERIFY( fb_02.write_position() );
+ VERIFY( !fb_02.write_position() );
VERIFY( !fb_02.read_position() );
c1 = fb_02.sputc('a');
VERIFY( c1 == 'a' );
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/9701-2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/9701-2.cc
index e0358ef5252..1d100dd3ede 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/9701-2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/9701-2.cc
@@ -55,7 +55,7 @@ void test11()
dfbuf_01.open(name_05, std::ios_base::out);
over_called = false;
dfbuf_01.sputc('i');
- VERIFY( !over_called );
+ VERIFY( over_called );
over_expected = dfbuf_01.pub_epptr() == dfbuf_01.pub_pptr();
over_called = false;
dfbuf_01.sputc('v');
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-io.cc
index 37509601427..9ec3d259ca8 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-io.cc
@@ -50,7 +50,7 @@ void test05()
{
constraint_filebuf fb_03;
fb_03.open(name_03, ios_base::out | ios_base::in | ios_base::trunc);
- VERIFY( fb_03.write_position() );
+ VERIFY( !fb_03.write_position() );
VERIFY( !fb_03.read_position() );
strmsz_1 = fb_03.sputn("racadabras", 10);//"abracadabras or what?"
VERIFY( strmsz_1 == 10 );
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc
index 647f310d87f..f98bcd745b1 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc
@@ -49,7 +49,7 @@ void test05()
{
constraint_filebuf fb_02;
fb_02.open(name_02, ios_base::out | ios_base::trunc);
- VERIFY( fb_02.write_position() );
+ VERIFY( !fb_02.write_position() );
VERIFY( !fb_02.read_position() );
strmsz_1 = fb_02.sputn("racadabras", 10);
VERIFY( strmsz_1 == 10 );
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/9701-1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/9701-1.cc
index 3c350a4d360..b675d79d0bb 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/9701-1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/9701-1.cc
@@ -59,7 +59,7 @@ void test11()
dfbuf_02.open(name_05, std::ios_base::out);
over_called = false;
dfbuf_02.sputn("sonne's", 7);
- VERIFY( !over_called );
+ VERIFY( over_called );
over_expected = dfbuf_02.pub_epptr() == dfbuf_02.pub_pptr();
over_called = false;
dfbuf_02.sputn(" peak", 5);
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1.cc
deleted file mode 100644
index 201217ea00a..00000000000
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1.cc
+++ /dev/null
@@ -1,178 +0,0 @@
-// 2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
-
-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library 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 this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 27.8.1.4 Overridden virtual functions
-
-#include <fstream>
-#include <testsuite_hooks.h>
-
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
-// NB: This test assumes that _M_buf_size == 40, and not the usual
-// buffer_size length of BUFSIZ (8192), so that overflow/underflow can be
-// simulated a bit more readily.
-// NRB (Nota Really Bene): setting it to 40 breaks the test, as intended.
-const int buffer_size = 8192;
-//const int buffer_size = 40;
-
-const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
-const char name_02[] = "filebuf_virtuals-2.txt"; // empty file, need to create
-const char name_03[] = "filebuf_virtuals-3.txt"; // empty file, need to create
-
-class derived_filebuf: public std::filebuf
-{
- public:
- void
- set_size(int_type __size) { _M_buf_size = __size; }
-};
-
-derived_filebuf fb_01; // in
-derived_filebuf fb_02; // out
-derived_filebuf fb_03; // in | out
-
-// Initialize filebufs to be the same size regardless of platform.
-void test03()
-{
- fb_01.set_size(buffer_size);
- fb_02.set_size(buffer_size);
- fb_03.set_size(buffer_size);
-}
-
-// Test overloaded virtual functions.
-void test05()
-{
- typedef std::filebuf::int_type int_type;
- typedef std::filebuf::traits_type traits_type;
- typedef std::filebuf::pos_type pos_type;
- typedef std::filebuf::off_type off_type;
- typedef size_t size_type;
-
- bool test = true;
- std::filebuf f_tmp;
- std::streamsize strmsz_1, strmsz_2;
- std::streamoff strmof_1, strmof_2;
- int i = 0, j = 0, k = 0;
-
- fb_01.open(name_01, std::ios_base::in);
- fb_02.open(name_02, std::ios_base::out | std::ios_base::trunc);
- fb_03.open(name_03, std::ios_base::out | std::ios_base::in | std::ios_base::trunc);
-
- int_type c1 = fb_01.sbumpc();
- int_type c2 = fb_02.sbumpc();
- int_type c3 = fb_01.sbumpc();
- int_type c4 = fb_02.sbumpc();
- int_type c5 = fb_03.sbumpc();
- int_type c6 = fb_01.sgetc();
- int_type c7 = fb_02.sgetc();
- int_type c8 = fb_01.sgetc();
- int_type c9 = fb_02.sgetc();
-
- // PUT
- strmsz_1 = fb_03.sputn("racadabras", 10);//"abracadabras or what?"
- strmsz_2 = fb_03.sputn(", i wanna reach out and", 10);
- strmsz_1 = fb_02.sputn("racadabras", 10);
- strmsz_1 = fb_01.sputn("racadabra", 10);
-
- // PUTBACK
- // int_type pbfail(int_type c)
- // called when gptr() null, gptr() == eback(), or traits::eq(*gptr, c) false
- // "pending sequence" is:
- // 1) everything as defined in underflow
- // 2) + if (traits::eq_int_type(c, traits::eof()), then input
- // sequence is backed up one char before the pending sequence is
- // determined.
- // 3) + if (not 2) then c is prepended. Left unspecified is
- // whether the input sequence is backedup or modified in any way
- // returns traits::eof() for failure, unspecified other value for success
-
- // int_type sputbackc(char_type c)
- // if in_cur not avail || ! traits::eq(c, gptr() [-1]), return pbfail
- // otherwise decrements in_cur and returns *gptr()
- c1 = fb_03.sgetc(); // -1
- c2 = fb_03.sputbackc('z');
- strmsz_2 = fb_03.in_avail();
- c3 = fb_03.sgetc();
- //test for _in_cur == _in_beg
- // fb_03._M_out_beg = "bd23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZracada" etc
- fb_03.pubseekoff(10, std::ios_base::beg,
- std::ios_base::in | std::ios_base::out);
- fb_03.sputc('m');
- strmsz_1 = fb_03.in_avail();
- c1 = fb_03.sgetc();
- fb_03.snextc();
- c2 = fb_03.sputbackc('z');
- strmsz_2 = fb_03.in_avail();
- c3 = fb_03.sgetc();
- fb_03.snextc();
- fb_03.sputc('u');
- fb_03.sputc('v');
- fb_03.sputc('a');
- strmsz_1 = fb_03.in_avail();
- c2 = fb_03.sputbackc('a');
- strmsz_2 = fb_03.in_avail();
- c3 = fb_03.sgetc();
- //test for ios_base::out
- c1 = fb_02.sgetc(); // undefined
- c2 = fb_02.sputbackc('a');
-
- // int_type sungetc()
- // if in_cur not avail, return pbackfail(), else decrement and
- // return to_int_type(*gptr())
- // fb_03._M_out_beg = "uvaacadabras, i wannaZ[\\]^_`abcdefghijkl"
- // fb_03._M_out_cur = "aacadabras, i wannaZ[\\]^_`abcdefghijkl"
- strmsz_1 = fb_03.in_avail();
- c2 = fb_03.sungetc(); // delete the 'a'
- strmsz_2 = fb_03.in_avail();
- VERIFY( c2 == 'v' ); // VERIFY( c2 != traits_type::eof() );
- VERIFY( strmsz_1 + 1 == strmsz_2 );
- //test for _in_cur == _in_beg
- for (int i = 50; i < 32 + 29; ++i)
- fb_02.sputc(char(i));
- fb_02.pubseekoff(0, std::ios_base::beg, std::ios_base::out);
- c1 = fb_02.sgetc();
- strmsz_1 = fb_02.in_avail();
- c2 = fb_02.sungetc();
- c3 = fb_02.sgetc();
- strmsz_2 = fb_02.in_avail();
- VERIFY( c1 == c2 );
- VERIFY( c2 == c3 );
- VERIFY( c1 == traits_type::eof() );
- VERIFY( strmsz_1 == strmsz_2 );
- //test for _in_cur == _in_end
- fb_03.pubseekoff(0, std::ios_base::end);
- strmsz_1 = fb_03.in_avail(); // -1 cuz at the end
- c1 = fb_03.sgetc();
- c2 = fb_03.sungetc();
- strmsz_2 = fb_03.in_avail(); // 1
- c3 = fb_03.sgetc();
- VERIFY( c1 != c2 );
- // VERIFY( c2 == c3 || c2 == traits_type::not_eof(int(c3)) );
- VERIFY( strmsz_2 != strmsz_1 );
- VERIFY( strmsz_2 == 1 );
- //test for ios_base::out
-}
-
-main()
-{
- test03();
- test05();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc b/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc
index 7e138313b6f..e6f9921b368 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc
@@ -41,5 +41,5 @@ void test01()
io1 = io2;
}
// { dg-error "within this context" "" { target *-*-* } 41 }
-// { dg-error "is private" "" { target *-*-* } 666 }
+// { dg-error "is private" "" { target *-*-* } 696 }
// { dg-error "operator=" "" { target *-*-* } 0 }
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc b/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc
index 56531485c8b..5d77444b342 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc
@@ -41,5 +41,5 @@ void test02()
test_base io2 = io1;
}
// { dg-error "within this context" "" { target *-*-* } 41 }
-// { dg-error "is private" "" { target *-*-* } 663 }
+// { dg-error "is private" "" { target *-*-* } 693 }
// { dg-error "copy constructor" "" { target *-*-* } 0 }
diff --git a/libstdc++-v3/testsuite/Makefile.am b/libstdc++-v3/testsuite/Makefile.am
index 9ea34275f94..06705b57120 100644
--- a/libstdc++-v3/testsuite/Makefile.am
+++ b/libstdc++-v3/testsuite/Makefile.am
@@ -23,6 +23,8 @@
AUTOMAKE_OPTIONS = cygnus dejagnu
+mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
+
DEJATOOL = libstdc++-v3
EXPECT = `if [ -f @glibcpp_builddir@/../../expect/expect ] ; then \
@@ -37,14 +39,19 @@ AM_RUNTESTFLAGS =
RUNTESTFLAGS =
## CXX is actually a "C" compiler. These are real C++ programs.
-## Do the same thing as `testsuite_flags --build-cxx`
-CXX_build = @glibcpp_CXX@
-CXX=`echo "$(CXX_build)" | sed 's,gcc/xgcc ,gcc/g++ ,'`
+glibcpp_srcdir=@glibcpp_srcdir@
+glibcpp_builddir=@glibcpp_builddir@
+testsuite_flags_script=${glibcpp_builddir}/scripts/testsuite_flags
+CXX=`${testsuite_flags_script} --build-cxx`
+
CXXLINK = \
LD_RUN_PATH=$${LD_RUN_PATH:+$$LD_RUN_PATH:}${glibcpp_builddir}/src/.libs\
$(LIBTOOL) --tag=CXX --mode=link $(CXX) \
$(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
+GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
+LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
+TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
INCLUDES = \
-nostdinc++ \
@GLIBCPP_INCLUDES@ @LIBSUPCXX_INCLUDES@ @TOPLEVEL_INCLUDES@
@@ -54,24 +61,95 @@ noinst_LIBRARIES = libv3test.a
libv3test_a_SOURCES = testsuite_hooks.cc testsuite_allocator.cc
## Build support utilities.
-## Only build this as native, as need to find startup files and libc to link.
-if GLIBCPP_BUILD_ABI_CHECK
+if GLIBCPP_TEST_ABI
noinst_PROGRAMS = abi_check
else
noinst_PROGRAMS =
endif
abi_check_SOURCES = abi_check.cc
+all-local: stamp_wchar
+
# Enable wchar_t tests if capable.
if GLIBCPP_TEST_WCHAR_T
-all-local: stamp_wchar
+stamp_wchar:
+ touch testsuite_wchar_t
else
-all-local:
+stamp_wchar:
endif
-stamp_wchar:
- touch testsuite_wchar_t
+# Override this so local rules are possible.
+check-am:
+ $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU; \
+ $(MAKE) $(AM_MAKEFLAGS) check-local
+
+check-local: check-abi
+
+baseline_dir = @baseline_dir@
+baseline_file = ${baseline_dir}/baseline_symbols.txt
+extract_symvers = @glibcpp_srcdir@/scripts/extract_symvers
+
+current_symbols.txt: ${extract_symvers} ../src/.libs/libstdc++.so
+ -@(${extract_symvers} ../src/.libs/libstdc++.so current_symbols.txt)
+
+baseline_symbols:
+ -@(output=${baseline_file}; \
+ if test ! -f $${output}; then \
+ echo "Baseline file doesn't exist."; \
+ echo "Try 'make new-abi-baseline' to create it."; \
+ exit 1; \
+ fi; \
+ touch baseline_symbols)
+
+new-abi-baseline:
+ -@$(mkinstalldirs) ${baseline_dir}
+ -@(output=${baseline_file}; \
+ if test -f $${output}; then \
+ output=$${output}.new; \
+ t=`echo $${output} | sed 's=.*config/abi/=='`; \
+ echo "Baseline file already exists, writing to $${t} instead."; \
+ fi; \
+ ${extract_symvers} ../src/.libs/libstdc++.so $${output})
+
+if GLIBCPP_TEST_ABI
+# Use 'new-abi-baseline' to create an initial symbol file. Then run
+# 'check-abi' to test for changes against that file.
+check-abi: abi_check baseline_symbols current_symbols.txt
+ -@(./abi_check --check ./current_symbols.txt ${baseline_file})
+
+check-abi-verbose: abi_check baseline_symbols current_symbols.txt
+ -@(./abi_check --check-verbose ./current_symbols.txt ${baseline_file})
+else
+check-abi:
+check-abi-verbose:
+endif
+
+
+# These two special 'check-script' rules use the bash script
+# 'check_survey' to do testing. This script is not as portable as the
+# dejagnu test harness, and is thus off by default. It does produce
+# interesting output however, including various performance analysis
+# items like compile time, execution time, and binary size.
+survey_script = ${glibcpp_builddir}/scripts/check_survey
+check-script: ${survey_script}
+ -@(chmod + ${survey_script}; \
+ ${survey_script} 0)
+
+check-script-install: ${survey_script}
+ -@(chmod + ${survey_script}; \
+ ${survey_script} 0)
+
+
+# Runs the testsuite/performance tests.
+# Some of these tests create large (~75MB) files, allocate huge
+# ammounts of memory, or otherwise tie up machine resources. Thus,
+# running this is off by default.
+performance_script=${glibcpp_srcdir}/scripts/check_performance
+check-performance: ${performance_script}
+ -@(chmod + ${performance_script}; \
+ ${performance_script} ${glibcpp_srcdir} ${glibcpp_builddir})
+
# By adding these files here, automake will remove them for 'make clean'
CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
- testsuite_* site.exp abi_check
+ testsuite_* site.exp abi_check baseline_symbols *.performance
diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in
index 3c6cd842bbd..2850829326d 100644
--- a/libstdc++-v3/testsuite/Makefile.in
+++ b/libstdc++-v3/testsuite/Makefile.in
@@ -93,11 +93,9 @@ EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
-GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
GLIBCPP_IS_CROSS_COMPILING = @GLIBCPP_IS_CROSS_COMPILING@
LIBMATHOBJS = @LIBMATHOBJS@
LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
@@ -115,12 +113,10 @@ SECTION_FLAGS = @SECTION_FLAGS@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
STRIP = @STRIP@
SYMVER_MAP = @SYMVER_MAP@
-TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
-baseline_file = @baseline_file@
check_msgfmt = @check_msgfmt@
enable_shared = @enable_shared@
enable_static = @enable_static@
@@ -129,10 +125,8 @@ glibcpp_MOFILES = @glibcpp_MOFILES@
glibcpp_PCHFLAGS = @glibcpp_PCHFLAGS@
glibcpp_POFILES = @glibcpp_POFILES@
glibcpp_basedir = @glibcpp_basedir@
-glibcpp_builddir = @glibcpp_builddir@
glibcpp_localedir = @glibcpp_localedir@
glibcpp_prefixdir = @glibcpp_prefixdir@
-glibcpp_srcdir = @glibcpp_srcdir@
glibcpp_thread_h = @glibcpp_thread_h@
glibcpp_toolexecdir = @glibcpp_toolexecdir@
glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
@@ -143,6 +137,8 @@ toplevel_srcdir = @toplevel_srcdir@
AUTOMAKE_OPTIONS = cygnus dejagnu
+mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
+
DEJATOOL = libstdc++-v3
EXPECT = `if [ -f @glibcpp_builddir@/../../expect/expect ] ; then \
@@ -158,14 +154,20 @@ RUNTEST = `if [ -f @glibcpp_srcdir@/../dejagnu/runtest ] ; then \
AM_RUNTESTFLAGS =
RUNTESTFLAGS =
-CXX_build = @glibcpp_CXX@
-CXX = `echo "$(CXX_build)" | sed 's,gcc/xgcc ,gcc/g++ ,'`
+glibcpp_srcdir = @glibcpp_srcdir@
+glibcpp_builddir = @glibcpp_builddir@
+testsuite_flags_script = ${glibcpp_builddir}/scripts/testsuite_flags
+CXX = `${testsuite_flags_script} --build-cxx`
+
CXXLINK = \
LD_RUN_PATH=$${LD_RUN_PATH:+$$LD_RUN_PATH:}${glibcpp_builddir}/src/.libs\
$(LIBTOOL) --tag=CXX --mode=link $(CXX) \
$(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
+GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
+LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
+TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
INCLUDES = \
-nostdinc++ \
@GLIBCPP_INCLUDES@ @LIBSUPCXX_INCLUDES@ @TOPLEVEL_INCLUDES@
@@ -173,15 +175,31 @@ INCLUDES = \
noinst_LIBRARIES = libv3test.a
libv3test_a_SOURCES = testsuite_hooks.cc testsuite_allocator.cc
-@GLIBCPP_BUILD_ABI_CHECK_TRUE@noinst_PROGRAMS = @GLIBCPP_BUILD_ABI_CHECK_TRUE@abi_check
-@GLIBCPP_BUILD_ABI_CHECK_FALSE@noinst_PROGRAMS =
+@GLIBCPP_TEST_ABI_TRUE@noinst_PROGRAMS = @GLIBCPP_TEST_ABI_TRUE@abi_check
+@GLIBCPP_TEST_ABI_FALSE@noinst_PROGRAMS =
abi_check_SOURCES = abi_check.cc
+baseline_dir = @baseline_dir@
+baseline_file = ${baseline_dir}/baseline_symbols.txt
+extract_symvers = @glibcpp_srcdir@/scripts/extract_symvers
+
+# These two special 'check-script' rules use the bash script
+# 'check_survey' to do testing. This script is not as portable as the
+# dejagnu test harness, and is thus off by default. It does produce
+# interesting output however, including various performance analysis
+# items like compile time, execution time, and binary size.
+survey_script = ${glibcpp_builddir}/scripts/check_survey
+
+# Runs the testsuite/performance tests.
+# Some of these tests create large (~75MB) files, allocate huge
+# ammounts of memory, or otherwise tie up machine resources. Thus,
+# running this is off by default.
+performance_script = ${glibcpp_srcdir}/scripts/check_performance
+
# By adding these files here, automake will remove them for 'make clean'
CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
- testsuite_* site.exp abi_check
+ testsuite_* site.exp abi_check baseline_symbols *.performance
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
@@ -194,7 +212,7 @@ LIBS = @LIBS@
libv3test_a_LIBADD =
libv3test_a_OBJECTS = testsuite_hooks.$(OBJEXT) \
testsuite_allocator.$(OBJEXT)
-@GLIBCPP_BUILD_ABI_CHECK_FALSE@noinst_PROGRAMS =
+@GLIBCPP_TEST_ABI_FALSE@noinst_PROGRAMS =
PROGRAMS = $(noinst_PROGRAMS)
abi_check_OBJECTS = abi_check.$(OBJEXT)
@@ -386,7 +404,7 @@ info: info-am
dvi-am:
dvi: dvi-am
check-am:
- $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
+ $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU check-local
check: check-am
installcheck-am:
installcheck: installcheck-am
@@ -456,19 +474,69 @@ clean-libtool maintainer-clean-libtool mostlyclean-noinstPROGRAMS \
distclean-noinstPROGRAMS clean-noinstPROGRAMS \
maintainer-clean-noinstPROGRAMS tags mostlyclean-tags distclean-tags \
clean-tags maintainer-clean-tags distdir check-DEJAGNU info-am info \
-dvi-am dvi check check-am installcheck-am installcheck install-info-am \
-install-info install-exec-am install-exec install-data-am install-data \
-install-am install uninstall-am uninstall all-local all-redirect all-am \
-all installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+dvi-am dvi check-local check check-am installcheck-am installcheck \
+install-info-am install-info install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-local all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
-# Enable wchar_t tests if capable.
-@GLIBCPP_TEST_WCHAR_T_TRUE@all-local: stamp_wchar
-@GLIBCPP_TEST_WCHAR_T_FALSE@all-local:
+all-local: stamp_wchar
-stamp_wchar:
- touch testsuite_wchar_t
+# Enable wchar_t tests if capable.
+@GLIBCPP_TEST_WCHAR_T_TRUE@stamp_wchar:
+@GLIBCPP_TEST_WCHAR_T_TRUE@ touch testsuite_wchar_t
+@GLIBCPP_TEST_WCHAR_T_FALSE@stamp_wchar:
+
+# Override this so local rules are possible.
+check-am:
+ $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU; \
+ $(MAKE) $(AM_MAKEFLAGS) check-local
+
+check-local: check-abi
+
+current_symbols.txt: ${extract_symvers} ../src/.libs/libstdc++.so
+ -@(${extract_symvers} ../src/.libs/libstdc++.so current_symbols.txt)
+
+baseline_symbols:
+ -@(output=${baseline_file}; \
+ if test ! -f $${output}; then \
+ echo "Baseline file doesn't exist."; \
+ echo "Try 'make new-abi-baseline' to create it."; \
+ exit 1; \
+ fi; \
+ touch baseline_symbols)
+
+new-abi-baseline:
+ -@$(mkinstalldirs) ${baseline_dir}
+ -@(output=${baseline_file}; \
+ if test -f $${output}; then \
+ output=$${output}.new; \
+ t=`echo $${output} | sed 's=.*config/abi/=='`; \
+ echo "Baseline file already exists, writing to $${t} instead."; \
+ fi; \
+ ${extract_symvers} ../src/.libs/libstdc++.so $${output})
+
+# Use 'new-abi-baseline' to create an initial symbol file. Then run
+# 'check-abi' to test for changes against that file.
+@GLIBCPP_TEST_ABI_TRUE@check-abi: abi_check baseline_symbols current_symbols.txt
+@GLIBCPP_TEST_ABI_TRUE@ -@(./abi_check --check ./current_symbols.txt ${baseline_file})
+
+@GLIBCPP_TEST_ABI_TRUE@check-abi-verbose: abi_check baseline_symbols current_symbols.txt
+@GLIBCPP_TEST_ABI_TRUE@ -@(./abi_check --check-verbose ./current_symbols.txt ${baseline_file})
+@GLIBCPP_TEST_ABI_FALSE@check-abi:
+@GLIBCPP_TEST_ABI_FALSE@check-abi-verbose:
+check-script: ${survey_script}
+ -@(chmod + ${survey_script}; \
+ ${survey_script} 0)
+
+check-script-install: ${survey_script}
+ -@(chmod + ${survey_script}; \
+ ${survey_script} 0)
+check-performance: ${performance_script}
+ -@(chmod + ${performance_script}; \
+ ${performance_script} ${glibcpp_srcdir} ${glibcpp_builddir})
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/libstdc++-v3/testsuite/abi_check.cc b/libstdc++-v3/testsuite/abi_check.cc
index 51c384f9d55..c4d7805e086 100644
--- a/libstdc++-v3/testsuite/abi_check.cc
+++ b/libstdc++-v3/testsuite/abi_check.cc
@@ -313,17 +313,20 @@ main(int argc, char** argv)
using namespace std;
// Get arguments. (Heading towards getopt_long, I can feel it.)
- string argv1;
- if (argc < 4 || (string("--help") == (argv1 = argv[1])))
+ bool verbose = false;
+ string argv1 = argc > 1 ? argv[1] : "";
+ if (argv1 == "--help" || argc < 4)
{
- cerr << "Usage: abi_check --check cur baseline\n"
- " --help\n\n"
- "Where CUR is a file containing the current results from\n"
+ cerr << "usage: abi_check --check current baseline\n"
+ " --check-verbose current baseline\n"
+ " --help\n\n"
+ "Where CURRENT is a file containing the current results from\n"
"extract_symvers, and BASELINE is one from config/abi.\n"
<< endl;
exit(1);
}
-
+ else if (argv1 == "--check-verbose")
+ verbose = true;
// Quick sanity/setup check for arguments.
const char* test_file = argv[2];
@@ -412,25 +415,42 @@ main(int argc, char** argv)
}
// Report results.
- cout << added_names.size() << " added symbols " << endl;
- for (size_t j = 0; j < added_names.size() ; ++j)
- report_symbol_info(test_symbols[added_names[j]], j + 1);
-
- cout << missing_names.size() << " missing symbols " << endl;
- for (size_t j = 0; j < missing_names.size() ; ++j)
- report_symbol_info(baseline_symbols[missing_names[j]], j + 1);
-
- cout << incompatible.size() << " incompatible symbols " << endl;
- for (size_t j = 0; j < incompatible.size() ; ++j)
+ if (verbose && added_names.size())
{
- // First, report name.
- const symbol_info& base = incompatible[j].first;
- const symbol_info& test = incompatible[j].second;
- report_symbol_info(test, j + 1, false);
-
- // Second, report reason or reasons incompatible.
- check_compatible(base, test, true);
+ cout << added_names.size() << " added symbols " << endl;
+ for (size_t j = 0; j < added_names.size() ; ++j)
+ report_symbol_info(test_symbols[added_names[j]], j + 1);
+ }
+
+ if (verbose && missing_names.size())
+ {
+ cout << missing_names.size() << " missing symbols " << endl;
+ for (size_t j = 0; j < missing_names.size() ; ++j)
+ report_symbol_info(baseline_symbols[missing_names[j]], j + 1);
}
+
+ if (verbose && incompatible.size())
+ {
+ cout << incompatible.size() << " incompatible symbols " << endl;
+ for (size_t j = 0; j < incompatible.size() ; ++j)
+ {
+ // First, report name.
+ const symbol_info& base = incompatible[j].first;
+ const symbol_info& test = incompatible[j].second;
+ report_symbol_info(test, j + 1, false);
+
+ // Second, report reason or reasons incompatible.
+ check_compatible(base, test, true);
+ }
+ }
+
+ cout << "\n\t\t=== libstdc++-v3 check-abi Summary ===" << endl;
+ cout << endl;
+ cout << "# of added symbols:\t\t " << added_names.size() << endl;
+ cout << "# of missing symbols:\t\t " << missing_names.size() << endl;
+ cout << "# of incompatible symbols:\t " << incompatible.size() << endl;
+ cout << endl;
+ cout << "using: " << baseline_file << endl;
return 0;
}
diff --git a/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp b/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp
index 6a4351c21e5..e9722ac660e 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp
@@ -110,7 +110,7 @@ proc libstdc++-v3-init { args } {
set includes "-I./"
} else {
# If we find a testsuite_flags file, we're testing in the build dir.
- set flags_file "${blddir}/testsuite_flags"
+ set flags_file "${blddir}/scripts/testsuite_flags"
if { [file exists $flags_file] } {
set cxx [exec sh $flags_file --build-cxx]
set cxxflags [exec sh $flags_file --cxxflags]
diff --git a/libstdc++-v3/testsuite/performance/allocator.cc b/libstdc++-v3/testsuite/performance/allocator.cc
index a70eda5bd25..42997e952ca 100644
--- a/libstdc++-v3/testsuite/performance/allocator.cc
+++ b/libstdc++-v3/testsuite/performance/allocator.cc
@@ -25,15 +25,193 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
-#include <list>
+/*
+ *
+ *
+ * The goal with this application is to compare the performance
+ * between different STL allocators relative to the default
+ * __pool_alloc.
+ *
+ * The container used for the tests is vector, which as stated by
+ * SGI "Vector is the simplest of the STL container classes, and in
+ * many cases the most efficient.".
+ *
+ * NOTE! The vector<> container does some "caching" of it's own and
+ * therefore we redeclare the variable in each iteration (forcing the
+ * const/destr to be called and thus free memory).
+ *
+ * NOTE! The usage of gettimeofday is unwanted since it's not POSIX,
+ * however I have not found a more generic system call to use -
+ * ideas are greatly appriciated!
+ *
+ * NOTE! This version only does operations on vector<int>. More/other
+ * data types should maybe also be tested - ideas are always welcome!
+ *
+ * I assume that glibc/underlying malloc() implementation has been
+ * compiled with -O2 thus should this application also be compiled
+ * with -O2 in order to get relevant results.
+ */
+
+// 2003-02-05 Stefan Olsson <stefan@snon.net>
+
+#include <vector>
+#include <sys/time.h>
+#include <ext/mt_allocator.h>
+#include <ext/malloc_allocator.h>
+#include <testsuite_performance.h>
+
+using namespace std;
+using __gnu_cxx::__malloc_alloc;
+using __gnu_cxx::__mt_alloc;
+
+/*
+ * In order to avoid that the time it takes for the application to
+ * startup/shutdown affect the end result, we define a target
+ * duration (in seconds) for which all tests should run.
+ * Each test is responsible for "calibrating" their # of iterations
+ * to come as close as possible to this target based on the time
+ * it takes to complete the test using the default __pool_alloc.
+ */
+int target_run_time = 10;
+
+/*
+ * The number of iterations to be performed in order to figure out
+ * the "speed" of this computer and adjust the number of iterations
+ * needed to come close to target_run_time.
+ */
+int calibrate_iterations = 100000;
+
+/*
+ * The number of values to insert in the vector, 32 will cause
+ * 5 (re)allocations to be performed (sizes 4, 8, 16, 32 and 64)
+ * This means that all allocations are within _MAX_BYTES = 128
+ * as defined in stl_alloc.h for __pool_alloc.
+ * Whether or not this value is relevant in "the real world"
+ * or not I don't know and should probably be investigated in
+ * more detail.
+ */
+int insert_values = 32;
+
+static struct timeval _tstart, _tend;
+static struct timezone tz;
+
+void
+tstart(void)
+{
+ gettimeofday(&_tstart, &tz);
+}
+
+void
+tend(void)
+{
+ gettimeofday(&_tend, &tz);
+}
+
+double
+tval()
+{
+ double t1, t2;
+
+ t1 =(double)_tstart.tv_sec +(double)_tstart.tv_usec/(1000*1000);
+ t2 =(double)_tend.tv_sec +(double)_tend.tv_usec/(1000*1000);
+ return t2 - t1;
+}
+
+int
+calibrate_test_ints(void)
+{
+ tstart();
+ for (int i = 0; i < calibrate_iterations; i++)
+ {
+ vector<int> v1;
+
+ for(int j = 0; j < insert_values; j++)
+ v1.push_back(1);
+ }
+ tend();
+
+ return(int)((double)target_run_time / tval()) * calibrate_iterations;
+}
+
+double
+test_ints_pool_alloc(int iterations)
+{
+ tstart();
+ for(int i = 0; i < iterations; i++)
+ {
+ vector<int> v1;
+
+ for(int j = 0; j < insert_values; j++)
+ v1.push_back(1);
+ }
+ tend();
+
+ return tval();
+}
+
+double
+test_ints_malloc_alloc(int iterations)
+{
+ tstart();
+ for(int i = 0; i < iterations; i++)
+ {
+ vector<int, __malloc_alloc<0> > v1;
+
+ for(int j = 0; j < insert_values; j++)
+ {
+ v1.push_back(1);
+ }
+ }
+ tend();
+
+ return tval();
+}
+
+double
+test_ints_mt_alloc(int iterations)
+{
+ tstart();
+ for(int i = 0; i < iterations; i++)
+ {
+ vector<int, __mt_alloc<0> > v1;
+
+ for(int j = 0; j < insert_values; j++)
+ {
+ v1.push_back(1);
+ }
+ }
+ tend();
+
+ return tval();
+}
-// Primarily a test of the default allocator.
// http://gcc.gnu.org/ml/libstdc++/2001-05/msg00105.html
-int main ()
+// http://gcc.gnu.org/ml/libstdc++/2003-05/msg00231.html
+int main(void)
{
- std::list<int> List;
- for (int i = 0; i < 10000000; ++i )
- List.push_back( int() );
+ using namespace __gnu_cxx_test;
+
+ time_counter time;
+ resource_counter resource;
+
+ int iterations = calibrate_test_ints();
+
+ start_counters(time, resource);
+ test_ints_pool_alloc(iterations);
+ stop_counters(time, resource);
+ report_performance(__FILE__, "default", time, resource);
+ clear_counters(time, resource);
+
+ start_counters(time, resource);
+ test_ints_malloc_alloc(iterations);
+ stop_counters(time, resource);
+ report_performance(__FILE__, "malloc", time, resource);
+ clear_counters(time, resource);
+
+ start_counters(time, resource);
+ test_ints_mt_alloc(iterations);
+ stop_counters(time, resource);
+ report_performance(__FILE__, "mt", time, resource);
+
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/performance/complex_norm.cc b/libstdc++-v3/testsuite/performance/complex_norm.cc
index 4a4277634cd..952e727ba56 100644
--- a/libstdc++-v3/testsuite/performance/complex_norm.cc
+++ b/libstdc++-v3/testsuite/performance/complex_norm.cc
@@ -26,34 +26,58 @@
// the GNU General Public License.
#include <complex>
+#include <testsuite_performance.h>
// based on libstdc++/5730, use --fast-math
int main()
{
- typedef std::complex<double> complex_type;
+ using namespace std;
+ using namespace __gnu_cxx_test;
+
+ time_counter time;
+ resource_counter resource;
+ const int iterations = 2000;
+
+ typedef complex<double> complex_type;
complex_type u[2048];
for (int i = 0; i < 2048; ++i)
u[i] = 1.0;
- for (int i = 0; i < 2000; ++i)
+ start_counters(time, resource);
+ for (int i = 0; i < iterations; ++i)
{
complex_type * p = u;
for (int j = 0; j < 2048; ++j)
{
-#if 1
double u2 = norm(*p);
-#else
+ double t = u2 * 0.1;
+ *p *= complex_type(cos(t), sin(t));
+ ++p;
+ }
+ }
+ stop_counters(time, resource);
+ report_performance(__FILE__, "norm", time, resource);
+ clear_counters(time, resource);
+
+ start_counters(time, resource);
+ for (int i = 0; i < iterations; ++i)
+ {
+ complex_type * p = u;
+ for (int j = 0; j < 2048; ++j)
+ {
// Shouldn't be slower than the above.
double ur = real(*p);
double ui = imag(*p);
double u2 = ur * ur + ui * ui;
-#endif
double t = u2 * 0.1;
*p *= complex_type(cos(t), sin(t));
++p;
}
}
+ stop_counters(time, resource);
+ report_performance(__FILE__, "", time, resource);
+
return 0;
}
diff --git a/libstdc++-v3/testsuite/performance/cout_insert_int.cc b/libstdc++-v3/testsuite/performance/cout_insert_int.cc
index 42e44efdd86..66f15df032b 100644
--- a/libstdc++-v3/testsuite/performance/cout_insert_int.cc
+++ b/libstdc++-v3/testsuite/performance/cout_insert_int.cc
@@ -26,11 +26,23 @@
// the GNU General Public License.
#include <iostream>
+#include <testsuite_performance.h>
// libstdc++/7076
int main()
{
- for (int i = 0; i < 150000; i++)
+ using namespace std;
+ using namespace __gnu_cxx_test;
+
+ time_counter time;
+ resource_counter resource;
+ const int iterations = 150000;
+
+ start_counters(time, resource);
+ for (int i = 0; i < iterations; i++)
std::cout << i << '\n';
+ stop_counters(time, resource);
+ report_performance(__FILE__, "", time, resource);
+
return 0;
}
diff --git a/libstdc++-v3/testsuite/performance/fstream_seek_write.cc b/libstdc++-v3/testsuite/performance/fstream_seek_write.cc
index 0ea0cfda310..d14fd610f0e 100644
--- a/libstdc++-v3/testsuite/performance/fstream_seek_write.cc
+++ b/libstdc++-v3/testsuite/performance/fstream_seek_write.cc
@@ -26,21 +26,32 @@
// the GNU General Public License.
#include <fstream>
+#include <testsuite_performance.h>
// libstdc++/10672
int main()
{
using namespace std;
+ using namespace __gnu_cxx_test;
+
+ time_counter time;
+ resource_counter resource;
+ const int iterations = 300000;
+
fstream s("tmp_perf_seek", ios::binary | ios::in | ios::out | ios::trunc);
if (s.good())
{
- for (int i = 0; i < 300000; i++)
+ start_counters(time, resource);
+ for (int i = 0; i < iterations; i++)
{
s.seekp(0);
s.write((char *) & i, sizeof(int));
s.seekp(sizeof(int));
s.write((char *) & i, sizeof(int));
}
+ stop_counters(time, resource);
+ report_performance(__FILE__, "", time, resource);
}
+
return 0;
}
diff --git a/libstdc++-v3/testsuite/performance/ifstream_getline.cc b/libstdc++-v3/testsuite/performance/ifstream_getline.cc
index f0a9131983e..b7ca9976078 100644
--- a/libstdc++-v3/testsuite/performance/ifstream_getline.cc
+++ b/libstdc++-v3/testsuite/performance/ifstream_getline.cc
@@ -26,17 +26,36 @@
// the GNU General Public License.
#include <fstream>
+#include <testsuite_performance.h>
// libstdc++/5001 (100,000 line input file)
int main ()
{
using namespace std;
- const char* name = "/usr/share/dict/linux.words";
+ using namespace __gnu_cxx_test;
+
+ time_counter time;
+ resource_counter resource;
+
+ const char* name1 = "/usr/share/dict/words";
+ const char* name2 = "/usr/share/dict/linux.words";
+ ifstream in;
+ in.open(name1);
+ if (!in.is_open())
+ {
+ in.clear();
+ in.open(name2);
+ }
- ifstream in(name);
char buffer[BUFSIZ];
- while(!in.eof())
+ start_counters(time, resource);
+ if (in.is_open())
{
- in.getline(buffer, BUFSIZ);
+ while (in.good())
+ in.getline(buffer, BUFSIZ);
}
+ stop_counters(time, resource);
+ report_performance(__FILE__, "", time, resource);
+
+ return 0;
}
diff --git a/libstdc++-v3/testsuite/performance/map_create_fill.cc b/libstdc++-v3/testsuite/performance/map_create_fill.cc
index f0fc51458cc..5c3698ba383 100644
--- a/libstdc++-v3/testsuite/performance/map_create_fill.cc
+++ b/libstdc++-v3/testsuite/performance/map_create_fill.cc
@@ -20,30 +20,34 @@
#include <map>
#include <testsuite_hooks.h>
-
-static bool test = true;
+#include <testsuite_performance.h>
static void create_and_fill(const unsigned int n)
{
typedef std::map<int, int> Map;
Map m;
+ bool test = true;
for (unsigned int i = 0; i < n; ++i)
m[i] = i;
- VERIFY ( m.size() == n );
+ VERIFY( m.size() == n );
}
-void test01()
+// http://gcc.gnu.org/ml/libstdc++/2003-03/msg00000.html
+int main()
{
- const unsigned n = 10000000;
+ using namespace std;
+ using namespace __gnu_cxx_test;
+
+ time_counter time;
+ resource_counter resource;
+ const int iterations = 100000000;
- for (unsigned int i = 0; i < n; ++i)
+ start_counters(time, resource);
+ for (int i = 0; i < iterations; ++i)
create_and_fill( 0 );
-}
+ stop_counters(time, resource);
+ report_performance(__FILE__, "", time, resource);
-// http://gcc.gnu.org/ml/libstdc++/2003-03/msg00000.html
-int main()
-{
- test01();
return 0;
}
diff --git a/libstdc++-v3/testsuite/performance/ofstream_insert_float.cc b/libstdc++-v3/testsuite/performance/ofstream_insert_float.cc
index 0fefdd43877..549e2030ddd 100644
--- a/libstdc++-v3/testsuite/performance/ofstream_insert_float.cc
+++ b/libstdc++-v3/testsuite/performance/ofstream_insert_float.cc
@@ -26,15 +26,27 @@
// the GNU General Public License.
#include <fstream>
+#include <testsuite_performance.h>
// based on libstdc++/8761 poor fstream performance (converted to float)
int main()
{
- std::ofstream out("tmp_perf_float.txt");
- for (int i = 0; i < 10000000; ++i)
+ using namespace std;
+ using namespace __gnu_cxx_test;
+
+ time_counter time;
+ resource_counter resource;
+ const int iterations = 10000000;
+
+ ofstream out("tmp_perf_float.txt");
+ start_counters(time, resource);
+ for (int i = 0; i < iterations; ++i)
{
float f = static_cast<float>(i);
out << f << "\n";
}
+ stop_counters(time, resource);
+ report_performance(__FILE__, "", time, resource);
+
return 0;
};
diff --git a/libstdc++-v3/testsuite/performance/ofstream_insert_int.cc b/libstdc++-v3/testsuite/performance/ofstream_insert_int.cc
index 69357f39084..f068767a178 100644
--- a/libstdc++-v3/testsuite/performance/ofstream_insert_int.cc
+++ b/libstdc++-v3/testsuite/performance/ofstream_insert_int.cc
@@ -26,12 +26,24 @@
// the GNU General Public License.
#include <fstream>
+#include <testsuite_performance.h>
// libstdc++/8761 poor fstream performance
int main()
{
- std::ofstream out("tmp_perf_int.txt");
- for (int i = 0; i < 10000000; ++i)
+ using namespace std;
+ using namespace __gnu_cxx_test;
+
+ time_counter time;
+ resource_counter resource;
+ const int iterations = 10000000;
+
+ ofstream out("tmp_perf_int.txt");
+ start_counters(time, resource);
+ for (int i = 0; i < iterations; ++i)
out << i << "\n";
+ stop_counters(time, resource);
+ report_performance(__FILE__, "", time, resource);
+
return 0;
};
diff --git a/libstdc++-v3/testsuite/performance/string_append.cc b/libstdc++-v3/testsuite/performance/string_append.cc
index e385eb752b2..c07c3af0699 100644
--- a/libstdc++-v3/testsuite/performance/string_append.cc
+++ b/libstdc++-v3/testsuite/performance/string_append.cc
@@ -28,6 +28,7 @@
#include <ctime>
#include <iostream>
#include <string>
+#include <testsuite_performance.h>
using namespace std;
@@ -36,7 +37,7 @@ test_append_char(int how_much)
{
string buf; // no preallocation
for (int i = 0; i < how_much; ++i)
- buf.append(static_cast<string::size_type>(1) , 'x');
+ buf.append(static_cast<string::size_type>(1) , 'x');
}
void
@@ -45,29 +46,31 @@ test_append_string(int how_much)
string s(static_cast<string::size_type>(1) , 'x');
string buf; // no preallocation
for (int i = 0; i < how_much; ++i)
- buf.append(s);
+ buf.append(s);
}
void
run_benchmark1(int how_much)
{
- clock_t t0 = clock();
+ using namespace __gnu_cxx_test;
+ time_counter time;
+ resource_counter resource;
+ start_counters(time, resource);
test_append_char(how_much);
- clock_t t1 = clock();
- cout << "Execution time of " << how_much
- << " string::append(char) calls: "
- << (static_cast<float>(t1 - t0)/CLOCKS_PER_SEC) << " sec."<< endl;
+ stop_counters(time, resource);
+ report_performance(__FILE__, "char", time, resource);
}
void
run_benchmark2(int how_much)
{
- clock_t t0 = clock();
+ using namespace __gnu_cxx_test;
+ time_counter time;
+ resource_counter resource;
+ start_counters(time, resource);
test_append_string(how_much);
- clock_t t1 = clock();
- cout << "Execution time of " << how_much
- << " string::append(const string&) calls: "
- << (static_cast<float>(t1 - t0)/CLOCKS_PER_SEC) << " sec." << endl;
+ stop_counters(time, resource);
+ report_performance(__FILE__, "string", time, resource);
}
// libstdc++/5380
diff --git a/libstdc++-v3/testsuite/testsuite_performance.h b/libstdc++-v3/testsuite/testsuite_performance.h
index b55ed9121df..1ad02518fd0 100644
--- a/libstdc++-v3/testsuite/testsuite_performance.h
+++ b/libstdc++-v3/testsuite/testsuite_performance.h
@@ -170,7 +170,7 @@ namespace __gnu_cxx_test
{
const char space = ' ';
const char tab = '\t';
- const char* name = "libstdc++-v3-performance.sum";
+ const char* name = "libstdc++-v3.performance";
std::string::const_iterator i = file.begin() + file.find_last_of('/') + 1;
std::string testname(i, file.end());
diff --git a/libstdc++-v3/testsuite_flags.in b/libstdc++-v3/testsuite_flags.in
deleted file mode 100755
index 4858c2e6606..00000000000
--- a/libstdc++-v3/testsuite_flags.in
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-
-#
-# This script computes the various flags needed to run GNU C++ testsuites
-# (compiler specific as well as library specific).
-#
-# Written by Benjamin Kosnik <bkoz@redhat.com>
-# Gabriel Dos Reis <gdr@codesourcery.com>
-#
-
-# Print a message saying how this script is intended to be invoked
-print_usage() {
- cat <<EOF
-Usage:
- testsuite_flags --install-includes
- --build-includes
- --build-cxx
- --install-cxx
- --cxxflags
-EOF
-}
-
-# Establish configure-generated directory structure.
-BUILD_DIR=@glibcpp_builddir@
-SRC_DIR=@glibcpp_srcdir@
-PREFIX_DIR=@glibcpp_prefixdir@
-query=$1
-
-case ${query} in
- --install-includes)
- INCLUDES="-I${SRC_DIR}/testsuite"
- echo ${INCLUDES}
- ;;
- --build-includes)
- INCLUDES="-nostdinc++ @GLIBCPP_INCLUDES@
- -I${SRC_DIR}/libsupc++ -I${SRC_DIR}/libio
- -I${SRC_DIR}/include/backward
- -I${SRC_DIR}/testsuite"
- echo ${INCLUDES}
- ;;
- --install-cxx)
- CXX=${PREFIX_DIR}/bin/g++
- echo ${CXX}
- ;;
- --build-cxx)
- PCHFLAGS="@glibcpp_PCHFLAGS@"
- CXX_build="@glibcpp_CXX@ ${PCHFLAGS}"
- CXX=`echo "$CXX_build" | sed 's,gcc/xgcc ,gcc/g++ ,'`
- echo ${CXX}
- ;;
- --cxxflags)
- CXXFLAGS_save="-g -O2"
- CXXFLAGS_config='@SECTION_FLAGS@ @SECTION_LDFLAGS@ -fmessage-length=0
- @EXTRA_CXX_FLAGS@ -DLOCALEDIR="@glibcpp_localedir@" '
- echo ${CXXFLAGS_save} ${CXXFLAGS_config}
- ;;
- *)
- print_usage
- ;;
-esac
-
-exit 0
diff --git a/maintainer-scripts/ChangeLog b/maintainer-scripts/ChangeLog
index b48bbda195a..f897e22db2d 100644
--- a/maintainer-scripts/ChangeLog
+++ b/maintainer-scripts/ChangeLog
@@ -1,3 +1,36 @@
+2003-06-25 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * gcc_release: Factor the updating of links and READMEs on the
+ FTP server and sending mail for snapshots into a...
+ (announce_snapshot): ...new function.
+ Add informative output for both.
+
+2003-06-18 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * gcc_release: Do not update gcc_latest_snapshot tag any longer.
+
+2003-06-18 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * snapshot-index.html: Use F77 instead of G77 front end.
+ Remove link to CodeSourcery snapshots which was not up-to-date.
+ Do not refer to gcc-bugs@gcc.gnu.org any longer.
+
+ * snapshot-README: Use F77 front end instead of G77 language.
+
+2003-06-17 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * gcc_release (build_tarfile): Build .bz2 files instead of .gz files.
+ (build_bz2): Rename to build_gzip and create .gz files from .bz2
+ files instead of the other way around.
+ (build_gzip): New function.
+ (build_diffs): Build .bz2 files instead of .gz files.
+ (build_diff): Use .bz2 files instead of .gz files.
+ Make an error message independent of the compression format.
+ (MODE_BZIP2): Rename to MODE_GZIP. Related changes to the
+ invocation of this script.
+ (MODE_GZIP): New variable.
+ (OLD_TARS): Use .bz2 archive of the previous snapshot.
+
2003-06-14 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* snapshot-README: Use GCC instead of gcc, C++ front end instead of
diff --git a/maintainer-scripts/gcc_release b/maintainer-scripts/gcc_release
index c5fa0d4ae01..41fb7fe7c08 100755
--- a/maintainer-scripts/gcc_release
+++ b/maintainer-scripts/gcc_release
@@ -245,11 +245,11 @@ EOF
build_tarfile() {
# Get the name of the destination tar file.
- TARFILE="$1.tar.gz"
+ TARFILE="$1.tar.bz2"
shift
# Build the tar file itself.
- (${TAR} cf - "$@" | ${GZIP} > ${TARFILE}) || \
+ (${TAR} cf - "$@" | ${BZIP2} > ${TARFILE}) || \
error "Could not build tarfile"
FILE_LIST="${FILE_LIST} ${TARFILE}"
}
@@ -288,11 +288,11 @@ build_tarfiles() {
`basename ${SOURCE_DIRECTORY}`
}
-# Build .bz2 files.
-build_bzip2() {
+# Build .gz files.
+build_gzip() {
for f in ${FILE_LIST}; do
- bzfile=${f%.gz}.bz2
- (zcat $f | ${BZIP2} > ${bzfile}) || error "Could not create ${bzfile}"
+ target=${f%.bz2}.gz
+ (${BZIP2} -d -c $f | ${GZIP} > ${target}) || error "Could not create ${target}"
done
}
@@ -300,19 +300,19 @@ build_bzip2() {
build_diffs() {
old_dir=${1%/*}
old_file=${1##*/}
- old_vers=${old_file%.tar.gz}
+ old_vers=${old_file%.tar.bz2}
old_vers=${old_vers#gcc-}
inform "Building diffs against version $old_vers"
for f in gcc gcc-ada gcc-g++ gcc-g77 gcc-java gcc-objc gcc-testsuite gcc-core; do
- old_tar=${old_dir}/${f}-${old_vers}.tar.gz
- new_tar=${WORKING_DIRECTORY}/${f}-${RELEASE}.tar.gz
+ old_tar=${old_dir}/${f}-${old_vers}.tar.bz2
+ new_tar=${WORKING_DIRECTORY}/${f}-${RELEASE}.tar.bz2
if [ ! -e $old_tar ]; then
inform "$old_tar not found; not generating diff file"
elif [ ! -e $new_tar ]; then
inform "$new_tar not found; not generating diff file"
else
build_diff $old_tar gcc-${old_vers} $new_tar gcc-${RELEASE} \
- ${f}-${old_vers}-${RELEASE}.diff.gz
+ ${f}-${old_vers}-${RELEASE}.diff.bz2
fi
done
}
@@ -323,20 +323,19 @@ build_diff() {
tmpdir=gccdiff.$$
mkdir $tmpdir || error "Could not create directory $tmpdir"
changedir $tmpdir
- ${TAR} xfz $1 || error "Could not unpack $1 for diffs"
- ${TAR} xfz $3 || error "Could not unpack $3 for diffs"
- ${DIFF} $2 $4 > ../${5%.gz}
+ (${BZIP2} -d -c $1 | ${TAR} xf - ) || error "Could not unpack $1 for diffs"
+ (${BZIP2} -d -c $3 | ${TAR} xf - ) || error "Could not unpack $3 for diffs"
+ ${DIFF} $2 $4 > ../${5%.bz2}
if [ $? -eq 2 ]; then
error "Trouble making diffs from $1 to $3"
fi
- ${GZIP} ../${5%.gz} || error "Could not gzip ../${5%.gz}"
+ ${BZIP2} ../${5%.bz2} || error "Could not generate ../$5"
changedir ..
rm -rf $tmpdir
FILE_LIST="${FILE_LIST} $5"
}
# Upload the files to the FTP server.
-
upload_files() {
inform "Uploading files"
@@ -372,6 +371,30 @@ upload_files() {
done
}
+# Announce a snapshot, both on the web and via mail.
+announce_snapshot() {
+ inform "Updating links and READMEs on the FTP server"
+
+ TEXT_DATE=`date --date=$DATE +%B\ %d,\ %Y`
+ cd ~ftp/pub/gcc/snapshots
+ sed -e "s%@DATE@%$DATE%g" -e "s%@LAST_DATE@%$LAST_DATE%g" \
+ -e "s%@LONG_DATE@%$LONG_DATE%g" \
+ -e "s%@TEXT_DATE@%$TEXT_DATE%g" < ~/scripts/snapshot-README > $$
+ mv $$ README
+ sed -e "s%@DATE@%$DATE%g" -e "s%@LAST_DATE@%$LAST_DATE%g" \
+ -e "s%@LONG_DATE@%$LONG_DATE%g" \
+ -e "s%@TEXT_DATE@%$TEXT_DATE%g" < ~/scripts/snapshot-index.html > $$
+ mv $$ index.html
+
+ touch LATEST-IS-$LONG_DATE
+ rm -f LATEST-IS-$LAST_LONG_DATE
+
+ inform "Sending mail"
+
+ export QMAILHOST=gcc.gnu.org
+ mail -s "gcc-ss-$DATE is now available" gcc@gcc.gnu.org < ~ftp/pub/gcc/snapshots/README
+}
+
########################################################################
# Initialization
########################################################################
@@ -446,13 +469,13 @@ SNAPSHOT=0
LOCAL=0
# Major operation modes.
-MODE_BZIP2=0
+MODE_GZIP=0
MODE_DIFFS=0
MODE_SOURCES=0
MODE_TARFILES=0
MODE_UPLOAD=0
-# .gz files generated to create .bz2 files from.
+# List of archive files generated; used to create .gz files from .bz2.
FILE_LIST=""
# Programs we use.
@@ -546,7 +569,7 @@ else
LAST_DATE=`cat ~/.snapshot_date`
LAST_LONG_DATE=`date --date=$LAST_DATE +%Y-%m-%d`
LAST_DIR=~ftp/pub/gcc/snapshots/${LAST_LONG_DATE}
- OLD_TARS=${LAST_DIR}/gcc-${LAST_DATE}.tar.gz
+ OLD_TARS=${LAST_DIR}/gcc-${LAST_DATE}.tar.bz2
fi
fi
@@ -583,12 +606,12 @@ export TZ
# Handle the major modes.
while [ $# -ne 0 ]; do
case $1 in
- bzip2) MODE_BZIP2=1;;
diffs) MODE_DIFFS=1;;
+ gzip) MODE_GZIP=1;;
sources) MODE_SOURCES=1;;
tarfiles) MODE_TARFILES=1;;
upload) MODE_UPLOAD=1;;
- all) MODE_SOURCES=1; MODE_TARFILES=1; MODE_DIFFS=1; MODE_BZIP2=1; MODE_UPLOAD=1;;
+ all) MODE_SOURCES=1; MODE_TARFILES=1; MODE_DIFFS=1; MODE_GZIP=1; MODE_UPLOAD=1;;
*) error "Unknown mode $1";;
esac
shift
@@ -617,9 +640,9 @@ if [ $MODE_DIFFS -ne 0 ]; then
fi
fi
-# Build bzip2 files
-if [ $MODE_BZIP2 -ne 0 ]; then
- build_bzip2
+# Build gzip files
+if [ $MODE_GZIP -ne 0 ]; then
+ build_gzip
fi
# Upload them to the FTP server.
@@ -629,33 +652,12 @@ if [ $MODE_UPLOAD -ne 0 ]; then
# For snapshots, make some further updates.
if [ $SNAPSHOT -ne 0 ] && [ $LOCAL -ne 0 ]; then
- # Update links on the FTP server.
- TEXT_DATE=`date --date=$DATE +%B\ %d,\ %Y`
- cd ~ftp/pub/gcc/snapshots
- sed -e "s%@DATE@%$DATE%g" -e "s%@LAST_DATE@%$LAST_DATE%g" \
- -e "s%@LONG_DATE@%$LONG_DATE%g" \
- -e "s%@TEXT_DATE@%$TEXT_DATE%g" < ~/scripts/snapshot-README > $$
- mv $$ README
- sed -e "s%@DATE@%$DATE%g" -e "s%@LAST_DATE@%$LAST_DATE%g" \
- -e "s%@LONG_DATE@%$LONG_DATE%g" \
- -e "s%@TEXT_DATE@%$TEXT_DATE%g" < ~/scripts/snapshot-index.html > $$
- mv $$ index.html
-
- touch LATEST-IS-$LONG_DATE
- rm -f LATEST-IS-$LAST_LONG_DATE
+ announce_snapshot
# Update snapshot date file.
changedir ~
echo $DATE >.snapshot_date
- # Update gcc_latest_snapshot tag.
- ${CVS} rtag -d gcc_latest_snapshot gcc
- ${CVS} rtag -rgcc_ss_${DATE} gcc_latest_snapshot gcc
-
- # Announce the snapshot.
- export QMAILHOST=gcc.gnu.org
- mail -s "gcc-ss-$DATE is now available" gcc@gcc.gnu.org < ~ftp/pub/gcc/snapshots/README
-
# Remove working directory
rm -rf ${WORKING_DIRECTORY}
fi
diff --git a/maintainer-scripts/snapshot-README b/maintainer-scripts/snapshot-README
index 9322635e464..0f4f89458dc 100644
--- a/maintainer-scripts/snapshot-README
+++ b/maintainer-scripts/snapshot-README
@@ -7,7 +7,7 @@ This snapshot has been generated from the GCC CVS 3.3 branch.
You'll find:
gcc-@DATE@.tar.bz2 The full GCC snapshot, including all
- languages and runtime libraries.
+ languages and runtime libraries.
gcc-core-@DATE@.tar.bz2 Just the C front end and core compiler.
@@ -17,7 +17,7 @@ You'll find:
gcc-g++-@DATE@.tar.bz2 The C++ front end and runtime.
- gcc-g77-@DATE@.tar.bz2 The g77 language and runtime.
+ gcc-g77-@DATE@.tar.bz2 The F77 front end and runtime.
gcc-objc-@DATE@.tar.bz2 The Objective-C front end and runtime.
diff --git a/maintainer-scripts/snapshot-index.html b/maintainer-scripts/snapshot-index.html
index aaf6b2ae82b..15e204152e7 100644
--- a/maintainer-scripts/snapshot-index.html
+++ b/maintainer-scripts/snapshot-index.html
@@ -43,7 +43,7 @@ how to sign up can be found on the GCC project home page.</p>
up to gcc-g++-@DATE@.
<p> <a href="@LONG_DATE@/gcc-g77-@DATE@.tar.bz2">
- gcc-g77</a> @TEXT_DATE@ snapshot, includes just the G77 front
+ gcc-g77</a> @TEXT_DATE@ snapshot, includes just the F77 front
end and runtime.
<p> <a href="@LONG_DATE@/diffs/gcc-g77-@LAST_DATE@-@DATE@.diff.bz2">
@@ -76,12 +76,6 @@ how to sign up can be found on the GCC project home page.</p>
</blockquote>
-<p>If you are using an x86 GNU/Linux system that uses RPMs to handle
-installation, you may find the daily RPM snapshots at:
-<a href="http://www.codesourcery.com/gcc-snapshots.html">
-http://www.codesourcery.com/gcc-snapshots.html </a>
-easier to install.</p>
-
</p>When a particular snapshot is ready for public consumption the LATEST-IS-
file is updated and a message is sent to the gcc list. Please do not use
a snapshot before it has been announced that way.</p>
@@ -93,9 +87,8 @@ href="ftp://gcc.gnu.org/pub/gcc/snapshots/">ftp://gcc.gnu.org:/pub/gcc/snapshots
<address>
<a href="mailto:gcc@gcc.gnu.org">gcc@gcc.gnu.org</a>
-<a href="mailto:gcc-bugs@gcc.gnu.org">gcc-bugs@gcc.gnu.org</a>
-
-<p>Last modified @TEXT_DATE@</p>
+<br />
+Last modified @TEXT_DATE@
</address>
</body>